/* Some or all contents Copyright (c) 2010 Meraki, Inc., all rights reserved */







/* tm.js */
var meraki_tm=(function(){var L=new Date().getTime(),N=null,M=null,J=null;function B(Q,P,S){var O="",R;if(S){R=new Date();R.setTime(R.getTime()+(S*86400000));O="; expires="+R.toGMTString()}document.cookie=Q+"="+P+O+"; domain="+M+"; path=/"}function H(Q){var P=document.cookie.split(";"),R=Q+"=",O,S;for(O=0;O<P.length;O++){S=P[O];while(S.charAt(0)==" "){S=S.substring(1,S.length)}if(S.indexOf(R)==0){return S.substring(R.length,S.length)}}return null}function C(O){B(O,"",-1)}function E(){var P=H("ut"),O=unescape(H("uu"));if(P&&O&&document.referrer==O){return P}return null}function D(){C("ut");C("uu")}function A(O,P){if(!J){return }if(O>2.5){document.getElementById(J).style.background="darkred";document.getElementById(J).style.color="white"}else{if(O>1.5){document.getElementById(J).style.background="orange"}else{document.getElementById(J).style.background="#00a651";document.getElementById(J).style.color="white"}}document.getElementById(J).innerHTML=P}function G(){var R=(new Date()).getTime(),T=E(),P=(R-L)/1000,S=P,O,Q="&rt="+encodeURIComponent(P);if(T){O=(L-parseInt(T))/1000;Q+="&lst="+encodeURIComponent(O);S=O+P;A(S,Math.round(S*1000)/1000+"s")}else{}(new Image()).src=N+Q;D()}function I(){var O=(new Date()).getTime();B("ut",O);B("uu",escape(window.location.href))}function F(O,P,Q){var S,R;N=O;M=P;J=Q;S=window.onload;if(typeof window.onload!="function"){window.onload=G}else{window.onload=function(){if(S){S()}G()}}R=window.onbeforeunload;if(typeof window.onbeforeunload!="function"){window.onbeforeunload=I}else{window.onbeforeunload=function(){I();if(R){return R()}}}}function K(){}K.two=F;return K})();






/* jquery-1.4.2.js */
/*
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(window,undefined){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context)
},_jQuery=window.jQuery,_$=window.$,document=window.document,rootjQuery,quickExpr=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/,rnotwhite=/\S/,rtrim=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,userAgent=navigator.userAgent,browserMatch,readyBound=false,readyList=[],DOMContentLoaded,toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,indexOf=Array.prototype.indexOf;jQuery.fn=jQuery.prototype={init:function(selector,context){var match,elem,ret,doc;if(!selector){return this}if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this}if(selector==="body"&&!context){this.context=document;this[0]=document.body;this.selector="body";this.length=1;return this}if(typeof selector==="string"){match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true)}else{selector=[doc.createElement(ret[1])]}}else{ret=buildFragment([match[1]],[doc]);selector=(ret.cacheable?ret.fragment.cloneNode(true):ret.fragment).childNodes}return jQuery.merge(this,selector)}else{elem=document.getElementById(match[2]);if(elem){if(elem.id!==match[2]){return rootjQuery.find(selector)}this.length=1;this[0]=elem}this.context=document;this.selector=selector;return this}}else{if(!context&&/^\w+$/.test(selector)){this.selector=selector;this.context=document;selector=document.getElementsByTagName(selector);return jQuery.merge(this,selector)}else{if(!context||context.jquery){return(context||rootjQuery).find(selector)}else{return jQuery(context).find(selector)}}}}else{if(jQuery.isFunction(selector)){return rootjQuery.ready(selector)}}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context}return jQuery.makeArray(selector,this)
},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return slice.call(this,0)},get:function(num){return num==null?this.toArray():(num<0?this.slice(num)[0]:this[num])},pushStack:function(elems,name,selector){var ret=jQuery();if(jQuery.isArray(elems)){push.apply(ret,elems)}else{jQuery.merge(ret,elems)}ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector}else{if(name){ret.selector=this.selector+"."+name+"("+selector+")"}}return ret},each:function(callback,args){return jQuery.each(this,callback,args)},ready:function(fn){jQuery.bindReady();if(jQuery.isReady){fn.call(document,jQuery)}else{if(readyList){readyList.push(fn)}}return this},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},end:function(){return this.prevObject||jQuery(null)},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options,name,src,copy;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={}}if(length===i){target=this;--i}for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue}if(deep&&copy&&(jQuery.isPlainObject(copy)||jQuery.isArray(copy))){var clone=src&&(jQuery.isPlainObject(src)||jQuery.isArray(src))?src:jQuery.isArray(copy)?[]:{};target[name]=jQuery.extend(deep,clone,copy)}else{if(copy!==undefined){target[name]=copy}}}}}return target};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery
}return jQuery},isReady:false,ready:function(){if(!jQuery.isReady){if(!document.body){return setTimeout(jQuery.ready,13)}jQuery.isReady=true;if(readyList){var fn,i=0;while((fn=readyList[i++])){fn.call(document,jQuery)}readyList=null}if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready")}}},bindReady:function(){if(readyBound){return }readyBound=true;if(document.readyState==="complete"){return jQuery.ready()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",jQuery.ready,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",jQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null}catch(e){}if(document.documentElement.doScroll&&toplevel){doScrollCheck()}}}},isFunction:function(obj){return toString.call(obj)==="[object Function]"},isArray:function(obj){return toString.call(obj)==="[object Array]"},isPlainObject:function(obj){if(!obj||toString.call(obj)!=="[object Object]"||obj.nodeType||obj.setInterval){return false}if(obj.constructor&&!hasOwnProperty.call(obj,"constructor")&&!hasOwnProperty.call(obj.constructor.prototype,"isPrototypeOf")){return false}var key;for(key in obj){}return key===undefined||hasOwnProperty.call(obj,key)},isEmptyObject:function(obj){for(var name in obj){return false}return true},error:function(msg){throw msg},parseJSON:function(data){if(typeof data!=="string"||!data){return null}data=jQuery.trim(data);if(/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return window.JSON&&window.JSON.parse?window.JSON.parse(data):(new Function("return "+data))()}else{jQuery.error("Invalid JSON: "+data)}},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");
script.type="text/javascript";if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data))}else{script.text=data}head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase()},each:function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||jQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===false){break}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break}}}}else{if(isObj){for(name in object){if(callback.call(object[name],name,object[name])===false){break}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object},trim:function(text){return(text||"").replace(rtrim,"")},makeArray:function(array,results){var ret=results||[];if(array!=null){if(array.length==null||typeof array==="string"||jQuery.isFunction(array)||(typeof array!=="function"&&array.setInterval)){push.call(ret,array)}else{jQuery.merge(ret,array)}}return ret},inArray:function(elem,array){if(array.indexOf){return array.indexOf(elem)}for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}return -1},merge:function(first,second){var i=first.length,j=0;if(typeof second.length==="number"){for(var l=second.length;j<l;j++){first[i++]=second[j]}}else{while(second[j]!==undefined){first[i++]=second[j++]}}first.length=i;return first},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!==!callback(elems[i],i)){ret.push(elems[i])}}return ret},map:function(elems,callback,arg){var ret=[],value;for(var i=0,length=elems.length;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value}}return ret.concat.apply([],ret)},guid:1,proxy:function(fn,proxy,thisObject){if(arguments.length===2){if(typeof proxy==="string"){thisObject=fn;fn=thisObject[proxy];proxy=undefined
}else{if(proxy&&!jQuery.isFunction(proxy)){thisObject=proxy;proxy=undefined}}}if(!proxy&&fn){proxy=function(){return fn.apply(thisObject||this,arguments)}}if(fn){proxy.guid=fn.guid=fn.guid||proxy.guid||jQuery.guid++}return proxy},uaMatch:function(ua){ua=ua.toLowerCase();var match=/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||!/compatible/.test(ua)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}},browser:{}});browserMatch=jQuery.uaMatch(userAgent);if(browserMatch.browser){jQuery.browser[browserMatch.browser]=true;jQuery.browser.version=browserMatch.version}if(jQuery.browser.webkit){jQuery.browser.safari=true}if(indexOf){jQuery.inArray=function(elem,array){return indexOf.call(array,elem)}}rootjQuery=jQuery(document);if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);jQuery.ready()}}else{if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);jQuery.ready()}}}}function doScrollCheck(){if(jQuery.isReady){return }try{document.documentElement.doScroll("left")}catch(error){setTimeout(doScrollCheck,1);return }jQuery.ready()}function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}if(elem.parentNode){elem.parentNode.removeChild(elem)}}function access(elems,key,value,exec,fn,pass){var length=elems.length;if(typeof key==="object"){for(var k in key){access(elems,k,key[k],exec,fn,value)}return elems}if(value!==undefined){exec=!pass&&exec&&jQuery.isFunction(value);for(var i=0;i<length;i++){fn(elems[i],key,exec?value.call(elems[i],i,fn(elems[i],key)):value,pass)}return elems}return length?fn(elems[0],key):undefined}function now(){return(new Date).getTime()}(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+now();
div.style.display="none";div.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return }jQuery.support={leadingWhitespace:div.firstChild.nodeType===3,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:/^0.55$/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:div.getElementsByTagName("input")[0].value==="on",optSelected:document.createElement("select").appendChild(document.createElement("option")).selected,parentNode:div.removeChild(div.appendChild(document.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"))}catch(e){}root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id]}try{delete script.test}catch(e){jQuery.support.deleteExpando=false}root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function click(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",click)});div.cloneNode(true).fireEvent("onclick")}div=document.createElement("div");div.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var fragment=document.createDocumentFragment();fragment.appendChild(div.firstChild);jQuery.support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display="none";div=null});var eventSupported=function(eventName){var el=document.createElement("div");
eventName="on"+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,"return;");isSupported=typeof el[eventName]==="function"}el=null;return isSupported};jQuery.support.submitBubbles=eventSupported("submit");jQuery.support.changeBubbles=eventSupported("change");root=script=div=all=a=null})();jQuery.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},expando:expando,noData:{embed:true,object:true,applet:true},data:function(elem,name,data){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return }elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache;if(!id&&typeof name==="string"&&data===undefined){return null}if(!id){id=++uuid}if(typeof name==="object"){elem[expando]=id;thisCache=cache[id]=jQuery.extend(true,{},name)}else{if(!cache[id]){elem[expando]=id;cache[id]={}}}thisCache=cache[id];if(data!==undefined){thisCache[name]=data}return typeof name==="string"?thisCache[name]:thisCache},removeData:function(elem,name){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return }elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache=cache[id];if(name){if(thisCache){delete thisCache[name];if(jQuery.isEmptyObject(thisCache)){jQuery.removeData(elem)}}}else{if(jQuery.support.deleteExpando){delete elem[jQuery.expando]}else{if(elem.removeAttribute){elem.removeAttribute(jQuery.expando)}}delete cache[id]}}});jQuery.fn.extend({data:function(key,value){if(typeof key==="undefined"&&this.length){return jQuery.data(this[0])}else{if(typeof key==="object"){return this.each(function(){jQuery.data(this,key)})}}var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);
if(data===undefined&&this.length){data=jQuery.data(this[0],key)}return data===undefined&&parts[1]?this.data(parts[0]):data}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)})}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})}});jQuery.extend({queue:function(elem,type,data){if(!elem){return }type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!data){return q||[]}if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data))}else{q.push(data)}return q},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),fn=queue.shift();if(fn==="inprogress"){fn=queue.shift()}if(fn){if(type==="fx"){queue.unshift("inprogress")}fn.call(elem,function(){jQuery.dequeue(elem,type)})}}});jQuery.fn.extend({queue:function(type,data){if(typeof type!=="string"){data=type;type="fx"}if(data===undefined){return jQuery.queue(this[0],type)}return this.each(function(i,elem){var queue=jQuery.queue(this,type,data);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type)}})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(){var elem=this;setTimeout(function(){jQuery.dequeue(elem,type)},time)})},clearQueue:function(type){return this.queue(type||"fx",[])}});var rclass=/[\n\t]/g,rspace=/\s+/,rreturn=/\r/g,rspecialurl=/href|src|style/,rtype=/(button|input)/i,rfocusable=/(button|input|object|select|textarea)/i,rclickable=/^(a|area)$/i,rradiocheck=/radio|checkbox/;jQuery.fn.extend({attr:function(name,value){return access(this,name,value,true,jQuery.attr)},removeAttr:function(name,fn){return this.each(function(){jQuery.attr(this,name,"");if(this.nodeType===1){this.removeAttribute(name)}})},addClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.addClass(value.call(this,i,self.attr("class")))
})}if(value&&typeof value==="string"){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1){if(!elem.className){elem.className=value}else{var className=" "+elem.className+" ",setClass=elem.className;for(var c=0,cl=classNames.length;c<cl;c++){if(className.indexOf(" "+classNames[c]+" ")<0){setClass+=" "+classNames[c]}}elem.className=jQuery.trim(setClass)}}}}return this},removeClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.removeClass(value.call(this,i,self.attr("class")))})}if((value&&typeof value==="string")||value===undefined){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1&&elem.className){if(value){var className=(" "+elem.className+" ").replace(rclass," ");for(var c=0,cl=classNames.length;c<cl;c++){className=className.replace(" "+classNames[c]+" "," ")}elem.className=jQuery.trim(className)}else{elem.className=""}}}}return this},toggleClass:function(value,stateVal){var type=typeof value,isBool=typeof stateVal==="boolean";if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.toggleClass(value.call(this,i,self.attr("class"),stateVal),stateVal)})}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),state=stateVal,classNames=value.split(rspace);while((className=classNames[i++])){state=isBool?state:!self.hasClass(className);self[state?"addClass":"removeClass"](className)}}else{if(type==="undefined"||type==="boolean"){if(this.className){jQuery.data(this,"__className__",this.className)}this.className=this.className||value===false?"":jQuery.data(this,"__className__")||""}}})},hasClass:function(selector){var className=" "+selector+" ";for(var i=0,l=this.length;i<l;i++){if((" "+this[i].className+" ").replace(rclass," ").indexOf(className)>-1){return true}}return false},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text
}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one){return value}values.push(value)}}return values}if(rradiocheck.test(elem.type)&&!jQuery.support.checkOn){return elem.getAttribute("value")===null?"on":elem.value}return(elem.value||"").replace(rreturn,"")}return undefined}var isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val=value;if(this.nodeType!==1){return }if(isFunction){val=value.call(this,i,self.val())}if(typeof val==="number"){val+=""}if(jQuery.isArray(val)&&rradiocheck.test(this.type)){this.checked=jQuery.inArray(self.val(),val)>=0}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(val);jQuery("option",this).each(function(){this.selected=jQuery.inArray(jQuery(this).val(),values)>=0});if(!values.length){this.selectedIndex=-1}}else{this.value=val}}})}});jQuery.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(elem,name,value,pass){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value)}var notxml=elem.nodeType!==1||!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.nodeType===1){var special=rspecialurl.test(name);if(name==="selected"&&!jQuery.support.optSelected){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex}}}if(name in elem&&notxml&&!special){if(set){if(name==="type"&&rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("type property can't be changed")}elem[name]=value}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue}if(name==="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");
return attributeNode&&attributeNode.specified?attributeNode.value:rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined}return elem[name]}if(!jQuery.support.style&&notxml&&name==="style"){if(set){elem.style.cssText=""+value}return elem.style.cssText}if(set){elem.setAttribute(name,""+value)}var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}return jQuery.style(elem,name,value)}});var rnamespaces=/\.(.*)$/,fcleanup=function(nm){return nm.replace(/[^\w\s\.\|`]/g,function(ch){return"\\"+ch})};jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return }if(elem.setInterval&&(elem!==window&&!elem.frameElement)){elem=window}var handleObjIn,handleObj;if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler}if(!handler.guid){handler.guid=jQuery.guid++}var elemData=jQuery.data(elem);if(!elemData){return }var events=elemData.events=elemData.events||{},eventHandle=elemData.handle,eventHandle;if(!eventHandle){elemData.handle=eventHandle=function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(eventHandle.elem,arguments):undefined}}eventHandle.elem=elem;types=types.split(" ");var type,i=0,namespaces;while((type=types[i++])){handleObj=handleObjIn?jQuery.extend({},handleObjIn):{handler:handler,data:data};if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();handleObj.namespace=namespaces.slice(0).sort().join(".")}else{namespaces=[];handleObj.namespace=""}handleObj.type=type;handleObj.guid=handler.guid;var handlers=events[type],special=jQuery.event.special[type]||{};if(!handlers){handlers=events[type]=[];if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false)}else{if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle)}}}}if(special.add){special.add.call(elem,handleObj);
if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid}}handlers.push(handleObj);jQuery.event.global[type]=true}elem=null},global:{},remove:function(elem,types,handler,pos){if(elem.nodeType===3||elem.nodeType===8){return }var ret,type,fn,i=0,all,namespaces,namespace,special,eventType,handleObj,origType,elemData=jQuery.data(elem),events=elemData&&elemData.events;if(!elemData||!events){return }if(types&&types.type){handler=types.handler;types=types.type}if(!types||typeof types==="string"&&types.charAt(0)==="."){types=types||"";for(type in events){jQuery.event.remove(elem,type+types)}return }types=types.split(" ");while((type=types[i++])){origType=type;handleObj=null;all=type.indexOf(".")<0;namespaces=[];if(!all){namespaces=type.split(".");type=namespaces.shift();namespace=new RegExp("(^|\\.)"+jQuery.map(namespaces.slice(0).sort(),fcleanup).join("\\.(?:.*\\.)?")+"(\\.|$)")}eventType=events[type];if(!eventType){continue}if(!handler){for(var j=0;j<eventType.length;j++){handleObj=eventType[j];if(all||namespace.test(handleObj.namespace)){jQuery.event.remove(elem,origType,handleObj.handler,j);eventType.splice(j--,1)}}continue}special=jQuery.event.special[type]||{};for(var j=pos||0;j<eventType.length;j++){handleObj=eventType[j];if(handler.guid===handleObj.guid){if(all||namespace.test(handleObj.namespace)){if(pos==null){eventType.splice(j--,1)}if(special.remove){special.remove.call(elem,handleObj)}}if(pos!=null){break}}}if(eventType.length===0||pos!=null&&eventType.length===1){if(!special.teardown||special.teardown.call(elem,namespaces)===false){removeEvent(elem,type,elemData.handle)}ret=null;delete events[type]}}if(jQuery.isEmptyObject(events)){var handle=elemData.handle;if(handle){handle.elem=null}delete elemData.events;delete elemData.handle;if(jQuery.isEmptyObject(elemData)){jQuery.removeData(elem)}}},trigger:function(event,data,elem){var type=event.type||event,bubbling=arguments[3];if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);
if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true}if(!elem){event.stopPropagation();if(jQuery.event.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem)}})}}if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event)}event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle){handle.apply(elem,data)}var parent=elem.parentNode||elem.ownerDocument;try{if(!(elem&&elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()])){if(elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false}}}catch(e){}if(!event.isPropagationStopped()&&parent){jQuery.event.trigger(event,data,parent,true)}else{if(!event.isDefaultPrevented()){var target=event.target,old,isClick=jQuery.nodeName(target,"a")&&type==="click",special=jQuery.event.special[type]||{};if((!special._default||special._default.call(elem,event)===false)&&!isClick&&!(target&&target.nodeName&&jQuery.noData[target.nodeName.toLowerCase()])){try{if(target[type]){old=target["on"+type];if(old){target["on"+type]=null}jQuery.event.triggered=true;target[type]()}}catch(e){}if(old){target["on"+type]=old}jQuery.event.triggered=false}}}},handle:function(event){var all,handlers,namespaces,namespace,events;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;all=event.type.indexOf(".")<0&&!event.exclusive;if(!all){namespaces=event.type.split(".");event.type=namespaces.shift();namespace=new RegExp("(^|\\.)"+namespaces.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}var events=jQuery.data(this,"events"),handlers=events[event.type];if(events&&handlers){handlers=handlers.slice(0);for(var j=0,l=handlers.length;j<l;j++){var handleObj=handlers[j];if(all||namespace.test(handleObj.namespace)){event.handler=handleObj.handler;event.data=handleObj.data;event.handleObj=handleObj;var ret=handleObj.handler.apply(this,arguments);
if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation()}}if(event.isImmediatePropagationStopped()){break}}}}return event.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando]){return event}var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop]}if(!event.target){event.target=event.srcElement||document}if(event.target.nodeType===3){event.target=event.target.parentNode}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}if(!event.which&&event.button!==undefined){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}return event},guid:100000000,proxy:jQuery.proxy,special:{ready:{setup:jQuery.bindReady,teardown:jQuery.noop},live:{add:function(handleObj){jQuery.event.add(this,handleObj.origType,jQuery.extend({},handleObj,{handler:liveHandler}))},remove:function(handleObj){var remove=true,type=handleObj.origType.replace(rnamespaces,"");jQuery.each(jQuery.data(this,"events").live||[],function(){if(type===this.origType.replace(rnamespaces,"")){remove=false;
return false}});if(remove){jQuery.event.remove(this,handleObj.origType,liveHandler)}}},beforeunload:{setup:function(data,namespaces,eventHandle){if(this.setInterval){this.onbeforeunload=eventHandle}return false},teardown:function(namespaces,eventHandle){if(this.onbeforeunload===eventHandle){this.onbeforeunload=null}}}}};var removeEvent=document.removeEventListener?function(elem,type,handle){elem.removeEventListener(type,handle,false)}:function(elem,type,handle){elem.detachEvent("on"+type,handle)};jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src)}if(src&&src.type){this.originalEvent=src;this.type=src.type}else{this.type=src}this.timeStamp=now();this[expando]=true};function returnFalse(){return false}function returnTrue(){return true}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return }if(e.preventDefault){e.preventDefault()}e.returnValue=false},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return }if(e.stopPropagation){e.stopPropagation()}e.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation()},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;try{while(parent&&parent!==this){parent=parent.parentNode}if(parent!==this){event.type=event.data;jQuery.event.handle.apply(this,arguments)}}catch(e){}},delegate=function(event){event.type=event.data;jQuery.event.handle.apply(this,arguments)};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={setup:function(data){jQuery.event.add(this,fix,data&&data.selector?delegate:withinElement,orig)},teardown:function(data){jQuery.event.remove(this,fix,data&&data.selector?delegate:withinElement)}}});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(data,namespaces){if(this.nodeName.toLowerCase()!=="form"){jQuery.event.add(this,"click.specialSubmit",function(e){var elem=e.target,type=elem.type;
if((type==="submit"||type==="image")&&jQuery(elem).closest("form").length){return trigger("submit",this,arguments)}});jQuery.event.add(this,"keypress.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="text"||type==="password")&&jQuery(elem).closest("form").length&&e.keyCode===13){return trigger("submit",this,arguments)}})}else{return false}},teardown:function(namespaces){jQuery.event.remove(this,".specialSubmit")}}}if(!jQuery.support.changeBubbles){var formElems=/textarea|input|select/i,changeFilters,getVal=function(elem){var type=elem.type,val=elem.value;if(type==="radio"||type==="checkbox"){val=elem.checked}else{if(type==="select-multiple"){val=elem.selectedIndex>-1?jQuery.map(elem.options,function(elem){return elem.selected}).join("-"):""}else{if(elem.nodeName.toLowerCase()==="select"){val=elem.selectedIndex}}}return val},testChange=function testChange(e){var elem=e.target,data,val;if(!formElems.test(elem.nodeName)||elem.readOnly){return }data=jQuery.data(elem,"_change_data");val=getVal(elem);if(e.type!=="focusout"||elem.type!=="radio"){jQuery.data(elem,"_change_data",val)}if(data===undefined||val===data){return }if(data!=null||val){e.type="change";return jQuery.event.trigger(e,arguments[1],elem)}};jQuery.event.special.change={filters:{focusout:testChange,click:function(e){var elem=e.target,type=elem.type;if(type==="radio"||type==="checkbox"||elem.nodeName.toLowerCase()==="select"){return testChange.call(this,e)}},keydown:function(e){var elem=e.target,type=elem.type;if((e.keyCode===13&&elem.nodeName.toLowerCase()!=="textarea")||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){return testChange.call(this,e)}},beforeactivate:function(e){var elem=e.target;jQuery.data(elem,"_change_data",getVal(elem))}},setup:function(data,namespaces){if(this.type==="file"){return false}for(var type in changeFilters){jQuery.event.add(this,type+".specialChange",changeFilters[type])}return formElems.test(this.nodeName)},teardown:function(namespaces){jQuery.event.remove(this,".specialChange");
return formElems.test(this.nodeName)}};changeFilters=jQuery.event.special.change.filters}function trigger(type,elem,args){args[0].type=type;return jQuery.event.handle.apply(elem,args)}if(document.addEventListener){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){jQuery.event.special[fix]={setup:function(){this.addEventListener(orig,handler,true)},teardown:function(){this.removeEventListener(orig,handler,true)}};function handler(e){e=jQuery.event.fix(e);e.type=fix;return jQuery.event.handle.call(this,e)}})}jQuery.each(["bind","one"],function(i,name){jQuery.fn[name]=function(type,data,fn){if(typeof type==="object"){for(var key in type){this[name](key,data,type[key],fn)}return this}if(jQuery.isFunction(data)){fn=data;data=undefined}var handler=name==="one"?jQuery.proxy(fn,function(event){jQuery(this).unbind(event,handler);return fn.apply(this,arguments)}):fn;if(type==="unload"&&name!=="one"){this.one(type,data,fn)}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.add(this[i],type,handler,data)}}return this}});jQuery.fn.extend({unbind:function(type,fn){if(typeof type==="object"&&!type.preventDefault){for(var key in type){this.unbind(key,type[key])}}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.remove(this[i],type,fn)}}return this},delegate:function(selector,types,data,fn){return this.live(types,data,fn,selector)},undelegate:function(selector,types,fn){if(arguments.length===0){return this.unbind("live")}else{return this.die(types,null,fn,selector)}},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result}},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.proxy(fn,args[i++])}return this.click(jQuery.proxy(fn,function(event){var lastToggle=(jQuery.data(this,"lastToggle"+fn.guid)||0)%i;jQuery.data(this,"lastToggle"+fn.guid,lastToggle+1);
event.preventDefault();return args[lastToggle].apply(this,arguments)||false}))},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)}});var liveMap={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};jQuery.each(["live","die"],function(i,name){jQuery.fn[name]=function(types,data,fn,origSelector){var type,i=0,match,namespaces,preType,selector=origSelector||this.selector,context=origSelector?this:jQuery(this.context);if(jQuery.isFunction(data)){fn=data;data=undefined}types=(types||"").split(" ");while((type=types[i++])!=null){match=rnamespaces.exec(type);namespaces="";if(match){namespaces=match[0];type=type.replace(rnamespaces,"")}if(type==="hover"){types.push("mouseenter"+namespaces,"mouseleave"+namespaces);continue}preType=type;if(type==="focus"||type==="blur"){types.push(liveMap[type]+namespaces);type=type+namespaces}else{type=(liveMap[type]||type)+namespaces}if(name==="live"){context.each(function(){jQuery.event.add(this,liveConvert(type,selector),{data:data,selector:selector,handler:fn,origType:type,origHandler:fn,preType:preType})})}else{context.unbind(liveConvert(type,selector),fn)}}return this}});function liveHandler(event){var stop,elems=[],selectors=[],args=arguments,related,match,handleObj,elem,j,i,l,data,events=jQuery.data(this,"events");if(event.liveFired===this||!events||!events.live||event.button&&event.type==="click"){return }event.liveFired=this;var live=events.live.slice(0);for(j=0;j<live.length;j++){handleObj=live[j];if(handleObj.origType.replace(rnamespaces,"")===event.type){selectors.push(handleObj.selector)}else{live.splice(j--,1)}}match=jQuery(event.target).closest(selectors,event.currentTarget);for(i=0,l=match.length;i<l;i++){for(j=0;j<live.length;j++){handleObj=live[j];if(match[i].selector===handleObj.selector){elem=match[i].elem;related=null;if(handleObj.preType==="mouseenter"||handleObj.preType==="mouseleave"){related=jQuery(event.relatedTarget).closest(handleObj.selector)[0]}if(!related||related!==elem){elems.push({elem:elem,handleObj:handleObj})
}}}}for(i=0,l=elems.length;i<l;i++){match=elems[i];event.currentTarget=match.elem;event.data=match.handleObj.data;event.handleObj=match.handleObj;if(match.handleObj.origHandler.apply(match.elem,args)===false){stop=false;break}}return stop}function liveConvert(type,selector){return"live."+(type&&type!=="*"?type+".":"")+selector.replace(/\./g,"`").replace(/ /g,"&")}jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error").split(" "),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)};if(jQuery.attrFn){jQuery.attrFn[name]=true}});if(window.attachEvent&&!window.addEventListener){window.attachEvent("onunload",function(){for(var id in jQuery.cache){if(jQuery.cache[id].handle){try{jQuery.event.remove(jQuery.cache[id].handle.elem)}catch(e){}}}});
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
}(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0});var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[]}if(!selector||typeof selector!=="string"){return results}var parts=[],m,set,checkSet,extra,prune=true,contextXML=isXML(context),soFar=selector;while((chunker.exec(""),m=chunker.exec(soFar))!==null){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);
while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift()}set=posProcess(selector,set)}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0]}if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set)}else{prune=false}while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur=""}else{pop=parts.pop()}if(pop==null){pop=context}Expr.relative[cur](checkSet,pop,contextXML)}}else{checkSet=parts=[]}}if(!checkSet){checkSet=set}if(!checkSet){Sizzle.error(cur||selector)}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)}else{if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i])}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])}}}}}else{makeArray(checkSet,results)}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results)}return results};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}return results};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[]}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");
set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break}}}}if(!set){set=context.getElementsByTagName("*")}return{set:set,expr:expr}};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){var filter=Expr.filter[type],found,item,left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue}if(curLoop===result){result=[]}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true}else{if(match===true){continue}}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true}else{curLoop[i]=false}}else{if(pass){result.push(item);anyFound=true}}}}}if(found!==undefined){if(!inplace){curLoop=result}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[]}break}}}if(expr===old){if(anyFound==null){Sizzle.error(expr)}else{break}}old=expr}return curLoop};Sizzle.error=function(msg){throw"Syntax error, unrecognized expression: "+msg};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href")}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;
if(isTag){part=part.toLowerCase()}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)}},">":function(checkSet,part){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part}}if(isPartStr){Sizzle.filter(part,checkSet,true)}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[]}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])}}return ret.length===0?null:ret}},TAG:function(match,context){return context.getElementsByTagName(match[1])}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem)
}}else{if(inplace){curLoop[i]=false}}}}return false},ID:function(match){return match[1].replace(/\\/g,"")},TAG:function(match,curLoop){return match[1].toLowerCase()},CHILD:function(match){if(match[1]==="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0}match[0]=done++;return match},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name]}if(match[2]==="~="){match[4]=" "+match[4]+" "}return match},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop)}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret)}return false}}else{if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true}}return match},POS:function(match){match.unshift(true);return match}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"},disabled:function(elem){return elem.disabled===true},checked:function(elem){return elem.checked===true},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true},parent:function(elem){return !!elem.firstChild},empty:function(elem){return !elem.firstChild},has:function(elem,i,match){return !!Sizzle(match[3],elem).length},header:function(elem){return/h\d/i.test(elem.nodeName)},text:function(elem){return"text"===elem.type},radio:function(elem){return"radio"===elem.type},checkbox:function(elem){return"checkbox"===elem.type},file:function(elem){return"file"===elem.type},password:function(elem){return"password"===elem.type},submit:function(elem){return"submit"===elem.type},image:function(elem){return"image"===elem.type},reset:function(elem){return"reset"===elem.type},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button"
},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName)}},setFilters:{first:function(elem,i){return i===0},last:function(elem,i,match,array){return i===array.length-1},even:function(elem,i){return i%2===0},odd:function(elem,i){return i%2===1},lt:function(elem,i,match){return i<match[3]-0},gt:function(elem,i,match){return i>match[3]-0},nth:function(elem,i,match){return match[3]-0===i},eq:function(elem,i,match){return match[3]-0===i}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array)}else{if(name==="contains"){return(elem.textContent||elem.innerText||getText([elem])||"").indexOf(match[3])>=0}else{if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false}}return true}else{Sizzle.error("Syntax error, unrecognized expression: "+name)}}}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case"only":case"first":while((node=node.previousSibling)){if(node.nodeType===1){return false}}if(type==="first"){return true}node=elem;case"last":while((node=node.nextSibling)){if(node.nodeType===1){return false}}return true;case"nth":var first=match[2],last=match[3];if(first===1&&last===0){return true}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count}}parent.sizcache=doneName}var diff=elem.nodeIndex-last;if(first===0){return diff===0}else{return(diff%first===0&&diff/first>=0)}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];
return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array)}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,function(all,num){return"\\"+(num-0+1)}))}var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results}return array};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i])}}else{for(var i=0;array[i];i++){ret.push(array[i])}}}return ret}}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true}return a.compareDocumentPosition?-1:1}var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true}return ret}}else{if("sourceIndex" in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true}return a.sourceIndex?-1:1}var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true}return ret}}else{if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true}return a.ownerDocument?-1:1
}var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true}return ret}}}}function getText(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue}else{if(elem.nodeType!==8){ret+=getText(elem.childNodes)}}}return ret}(function(){var form=document.createElement("div"),id="script"+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match}}root.removeChild(form);root=form=null})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i])}}results=tmp}return results}}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)}}div=null})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return }Sizzle=function(query,context,extra,seed){context=context||document;
if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra)}catch(e){}}return oldSizzle(query,context,extra,seed)};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop]}div=null})()}(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return }div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return }Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])}};div=null})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i}if(elem.nodeName.toLowerCase()===cur){match=elem;break}elem=elem[dir]}checkSet[i]=match}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i}if(typeof cur!=="string"){if(elem===cur){match=true;break}}else{if(Sizzle.filter(cur,[elem]).length>0){match=elem;break}}}elem=elem[dir]}checkSet[i]=match}}}var contains=document.compareDocumentPosition?function(a,b){return !!(a.compareDocumentPosition(b)&16)}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};var isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;
while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"")}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet)}return Sizzle.filter(later,tmpSet)};jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;jQuery.unique=Sizzle.uniqueSort;jQuery.text=getText;jQuery.isXMLDoc=isXML;jQuery.contains=contains;return ;window.Sizzle=Sizzle})();var runtil=/Until$/,rparentsprev=/^(?:parents|prevUntil|prevAll)/,rmultiselector=/,/,slice=Array.prototype.slice;var winnow=function(elements,qualifier,keep){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return !!qualifier.call(elem,i,elem)===keep})}else{if(qualifier.nodeType){return jQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep})}else{if(typeof qualifier==="string"){var filtered=jQuery.grep(elements,function(elem){return elem.nodeType===1});if(isSimple.test(qualifier)){return jQuery.filter(qualifier,filtered,!keep)}else{qualifier=jQuery.filter(qualifier,filtered)}}}}return jQuery.grep(elements,function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep})};jQuery.fn.extend({find:function(selector){var ret=this.pushStack("","find",selector),length=0;for(var i=0,l=this.length;i<l;i++){length=ret.length;jQuery.find(selector,this[i],ret);if(i>0){for(var n=length;n<ret.length;n++){for(var r=0;r<length;r++){if(ret[r]===ret[n]){ret.splice(n--,1);break}}}}}return ret},has:function(target){var targets=jQuery(target);return this.filter(function(){for(var i=0,l=targets.length;i<l;i++){if(jQuery.contains(this,targets[i])){return true}}})},not:function(selector){return this.pushStack(winnow(this,selector,false),"not",selector)},filter:function(selector){return this.pushStack(winnow(this,selector,true),"filter",selector)},is:function(selector){return !!selector&&jQuery.filter(selector,this).length>0},closest:function(selectors,context){if(jQuery.isArray(selectors)){var ret=[],cur=this[0],match,matches={},selector;
if(cur&&selectors.length){for(var i=0,l=selectors.length;i<l;i++){selector=selectors[i];if(!matches[selector]){matches[selector]=jQuery.expr.match.POS.test(selector)?jQuery(selector,context||this.context):selector}}while(cur&&cur.ownerDocument&&cur!==context){for(selector in matches){match=matches[selector];if(match.jquery?match.index(cur)>-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur});delete matches[selector]}}cur=cur.parentNode}}return ret}var pos=jQuery.expr.match.POS.test(selectors)?jQuery(selectors,context||this.context):null;return this.map(function(i,cur){while(cur&&cur.ownerDocument&&cur!==context){if(pos?pos.index(cur)>-1:jQuery(cur).is(selectors)){return cur}cur=cur.parentNode}return null})},index:function(elem){if(!elem||typeof elem==="string"){return jQuery.inArray(this[0],elem?jQuery(elem):this.parent().children())}return jQuery.inArray(elem.jquery?elem[0]:elem,this)},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context||this.context):jQuery.makeArray(selector),all=jQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all))},andSelf:function(){return this.add(this.prevObject)}});function isDisconnected(node){return !node||!node.parentNode||node.parentNode.nodeType===11}jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null},parents:function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function(elem){return jQuery.nth(elem,2,"nextSibling")},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)
},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(!runtil.test(name)){selector=until}if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret)}ret=this.length>1?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse()}return this.pushStack(ret,name,slice.call(arguments).join(","))}});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")"}return jQuery.find.matches(expr,elems)},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur)}cur=cur[dir]}return matched},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break}}return cur},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n)}}return r}});var rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/(<([\w:]+)[^>]*?)\/>/g,rselfClosing=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnocache=/<script|<object|<embed|<option|<style/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,fcloseTag=function(all,front,tag){return rselfClosing.test(tag)?all:front+"></"+tag+">"},wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;
wrapMap.th=wrapMap.td;if(!jQuery.support.htmlSerialize){wrapMap._default=[1,"div<div>","</div>"]}jQuery.fn.extend({text:function(text){if(jQuery.isFunction(text)){return this.each(function(i){var self=jQuery(this);self.text(text.call(this,i,self.text()))})}if(typeof text!=="object"&&text!==undefined){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}return jQuery.text(this)},wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))})}if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0])}wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i))})}return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html)}else{self.append(html)}})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.insertBefore(elem,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this)})}else{if(arguments.length){var set=jQuery(arguments[0]);set.push.apply(set,this.toArray());return this.pushStack(set,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})}else{if(arguments.length){var set=this.pushStack(this,"after",arguments);
set.push.apply(set,jQuery(arguments[0]).toArray());return set}}},remove:function(selector,keepData){for(var i=0,elem;(elem=this[i])!=null;i++){if(!selector||jQuery.filter(selector,[elem]).length){if(!keepData&&elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));jQuery.cleanData([elem])}if(elem.parentNode){elem.parentNode.removeChild(elem)}}}return this},empty:function(){for(var i=0,elem;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"))}while(elem.firstChild){elem.removeChild(elem.firstChild)}}return this},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML,ownerDocument=this.ownerDocument;if(!html){var div=ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML}return jQuery.clean([html.replace(rinlinejQuery,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(rleadingWhitespace,"")],ownerDocument)[0]}else{return this.cloneNode(true)}});if(events===true){cloneCopyEvent(this,ret);cloneCopyEvent(this.find("*"),ret.find("*"))}return ret},html:function(value){if(value===undefined){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(rinlinejQuery,""):null}else{if(typeof value==="string"&&!rnocache.test(value)&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,fcloseTag);try{for(var i=0,l=this.length;i<l;i++){if(this[i].nodeType===1){jQuery.cleanData(this[i].getElementsByTagName("*"));this[i].innerHTML=value}}}catch(e){this.empty().append(value)}}else{if(jQuery.isFunction(value)){this.each(function(i){var self=jQuery(this),old=self.html();self.empty().append(function(){return value.call(this,i,old)})})}else{this.empty().append(value)}}}return this},replaceWith:function(value){if(this[0]&&this[0].parentNode){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this),old=self.html();
self.replaceWith(value.call(this,i,old))})}if(typeof value!=="string"){value=jQuery(value).detach()}return this.each(function(){var next=this.nextSibling,parent=this.parentNode;jQuery(this).remove();if(next){jQuery(next).before(value)}else{jQuery(parent).append(value)}})}else{return this.pushStack(jQuery(jQuery.isFunction(value)?value():value),"replaceWith",value)}},detach:function(selector){return this.remove(selector,true)},domManip:function(args,table,callback){var results,first,value=args[0],scripts=[],fragment,parent;if(!jQuery.support.checkClone&&arguments.length===3&&typeof value==="string"&&rchecked.test(value)){return this.each(function(){jQuery(this).domManip(args,table,callback,true)})}if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);args[0]=value.call(this,i,table?self.html():undefined);self.domManip(args,table,callback)})}if(this[0]){parent=value&&value.parentNode;if(jQuery.support.parentNode&&parent&&parent.nodeType===11&&parent.childNodes.length===this.length){results={fragment:parent}}else{results=buildFragment(args,this,scripts)}fragment=results.fragment;if(fragment.childNodes.length===1){first=fragment=fragment.firstChild}else{first=fragment.firstChild}if(first){table=table&&jQuery.nodeName(first,"tr");for(var i=0,l=this.length;i<l;i++){callback.call(table?root(this[i],first):this[i],i>0||results.cacheable||this.length>1?fragment.cloneNode(true):fragment)}}if(scripts.length){jQuery.each(scripts,evalScript)}}return this;function root(elem,cur){return jQuery.nodeName(elem,"table")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem}}});function cloneCopyEvent(orig,ret){var i=0;ret.each(function(){if(this.nodeName!==(orig[i]&&orig[i].nodeName)){return }var oldData=jQuery.data(orig[i++]),curData=jQuery.data(this,oldData),events=oldData&&oldData.events;if(events){delete curData.handle;curData.events={};for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data)
}}}})}function buildFragment(args,nodes,scripts){var fragment,cacheable,cacheresults,doc=(nodes&&nodes[0]?nodes[0].ownerDocument||nodes[0]:document);if(args.length===1&&typeof args[0]==="string"&&args[0].length<512&&doc===document&&!rnocache.test(args[0])&&(jQuery.support.checkClone||!rchecked.test(args[0]))){cacheable=true;cacheresults=jQuery.fragments[args[0]];if(cacheresults){if(cacheresults!==1){fragment=cacheresults}}}if(!fragment){fragment=doc.createDocumentFragment();jQuery.clean(args,doc,fragment,scripts)}if(cacheable){jQuery.fragments[args[0]]=cacheresults?fragment:1}return{fragment:fragment,cacheable:cacheable}}jQuery.fragments={};jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),parent=this.length===1&&this[0].parentNode;if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);return this}else{for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems)}return this.pushStack(ret,name,insert.selector)}}});jQuery.extend({clean:function(elems,context,fragment,scripts){context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}var ret=[];for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+=""}if(!elem){continue}if(typeof elem==="string"&&!rhtml.test(elem)){elem=context.createTextNode(elem)}else{if(typeof elem==="string"){elem=elem.replace(rxhtmlTag,fcloseTag);var tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div");div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild}if(!jQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]==="<table>"&&!hasBody?div.childNodes:[];
for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}}if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild)}elem=div.childNodes}}if(elem.nodeType){ret.push(elem)}else{ret=jQuery.merge(ret,elem)}}if(fragment){for(var i=0;ret[i];i++){if(scripts&&jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i])}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))))}fragment.appendChild(ret[i])}}}return ret},cleanData:function(elems){var data,id,cache=jQuery.cache,special=jQuery.event.special,deleteExpando=jQuery.support.deleteExpando;for(var i=0,elem;(elem=elems[i])!=null;i++){id=elem[jQuery.expando];if(id){data=cache[id];if(data.events){for(var type in data.events){if(special[type]){jQuery.event.remove(elem,type)}else{removeEvent(elem,type,data.handle)}}}if(deleteExpando){delete elem[jQuery.expando]}else{if(elem.removeAttribute){elem.removeAttribute(jQuery.expando)}}delete cache[id]}}}});var rexclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,ralpha=/alpha\([^)]*\)/,ropacity=/opacity=([^)]*)/,rfloat=/float/i,rdashAlpha=/-([a-z])/ig,rupper=/([A-Z])/g,rnumpx=/^-?\d+(?:px)?$/i,rnum=/^-?\d/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssWidth=["Left","Right"],cssHeight=["Top","Bottom"],getComputedStyle=document.defaultView&&document.defaultView.getComputedStyle,styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat",fcamelCase=function(all,letter){return letter.toUpperCase()};jQuery.fn.css=function(name,value){return access(this,name,value,true,function(elem,name,value){if(value===undefined){return jQuery.curCSS(elem,name)}if(typeof value==="number"&&!rexclude.test(name)){value+="px"
}jQuery.style(elem,name,value)})};jQuery.extend({style:function(elem,name,value){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}if((name==="width"||name==="height")&&parseFloat(value)<0){value=undefined}var style=elem.style||elem,set=value!==undefined;if(!jQuery.support.opacity&&name==="opacity"){if(set){style.zoom=1;var opacity=parseInt(value,10)+""==="NaN"?"":"alpha(opacity="+value*100+")";var filter=style.filter||jQuery.curCSS(elem,"filter")||"";style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):opacity}return style.filter&&style.filter.indexOf("opacity=")>=0?(parseFloat(ropacity.exec(style.filter)[1])/100)+"":""}if(rfloat.test(name)){name=styleFloat}name=name.replace(rdashAlpha,fcamelCase);if(set){style[name]=value}return style[name]},css:function(elem,name,force,extra){if(name==="width"||name==="height"){var val,props=cssShow,which=name==="width"?cssWidth:cssHeight;function getWH(){val=name==="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border"){return }jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0}if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0}else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0}})}if(elem.offsetWidth!==0){getWH()}else{jQuery.swap(elem,props,getWH)}return Math.max(0,Math.round(val))}return jQuery.curCSS(elem,name,force)},curCSS:function(elem,name,force){var ret,style=elem.style,filter;if(!jQuery.support.opacity&&name==="opacity"&&elem.currentStyle){ret=ropacity.test(elem.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return ret===""?"1":ret}if(rfloat.test(name)){name=styleFloat}if(!force&&style&&style[name]){ret=style[name]}else{if(getComputedStyle){if(rfloat.test(name)){name="float"}name=name.replace(rupper,"-$1").toLowerCase();var defaultView=elem.ownerDocument.defaultView;if(!defaultView){return null}var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle){ret=computedStyle.getPropertyValue(name)
}if(name==="opacity"&&ret===""){ret="1"}}else{if(elem.currentStyle){var camelCase=name.replace(rdashAlpha,fcamelCase);ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!rnumpx.test(ret)&&rnum.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=camelCase==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft}}}}return ret},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(var name in options){elem.style[name]=old[name]}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight,skip=elem.nodeName.toLowerCase()==="tr";return width===0&&height===0&&!skip?true:width>0&&height>0&&!skip?false:jQuery.curCSS(elem,"display")==="none"};jQuery.expr.filters.visible=function(elem){return !jQuery.expr.filters.hidden(elem)}}var jsc=now(),rscript=/<script(.|\s)*?\/script>/gi,rselectTextarea=/select|textarea/i,rinput=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,jsre=/=\?(&|$)/,rquery=/\?/,rts=/(\?|&)_=.*?(&|$)/,rurl=/^(\w+:)?\/\/([^\/?#]+)/,r20=/%20/g,_load=jQuery.fn.load;jQuery.fn.extend({load:function(url,params,callback){if(typeof url!=="string"){return _load.call(this,url)}else{if(!this.length){return this}}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else{if(typeof params==="object"){params=jQuery.param(params,jQuery.ajaxSettings.traditional);type="POST"}}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status==="success"||status==="notmodified"){self.html(selector?jQuery("<div />").append(res.responseText.replace(rscript,"")).find(selector):res.responseText)
}if(callback){self.each(callback,[res.responseText,status,res])}}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||rselectTextarea.test(this.nodeName)||rinput.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:window.XMLHttpRequest&&(window.location.protocol!=="file:"||!window.ActiveXObject)?function(){return new window.XMLHttpRequest()}:function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(origSettings){var s=jQuery.extend(true,{},jQuery.ajaxSettings,origSettings);
var jsonp,status,data,callbackContext=origSettings&&origSettings.context||s,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional)}if(s.dataType==="jsonp"){if(type==="GET"){if(!jsre.test(s.url)){s.url+=(rquery.test(s.url)?"&":"?")+(s.jsonp||"callback")+"=?"}}else{if(!s.data||!jsre.test(s.data)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}}s.dataType="json"}if(s.dataType==="json"&&(s.data&&jsre.test(s.data)||jsre.test(s.url))){jsonp=s.jsonpCallback||("jsonp"+jsc++);if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=window[jsonp]||function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}if(head){head.removeChild(script)}}}if(s.dataType==="script"&&s.cache===null){s.cache=false}if(s.cache===false&&type==="GET"){var ts=now();var ret=s.url.replace(rts,"$1_="+ts+"$2");s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"")}if(s.data&&type==="GET"){s.url+=(rquery.test(s.url)?"&":"?")+s.data}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var parts=rurl.exec(s.url),remote=parts&&(parts[1]&&parts[1]!==location.protocol||parts[2]!==location.host);if(s.dataType==="script"&&type==="GET"&&remote){var head=document.getElementsByTagName("head")[0]||document.documentElement;var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;if(head&&script.parentNode){head.removeChild(script)}}}}head.insertBefore(script,head.firstChild);return undefined}var requestDone=false;var xhr=s.xhr();if(!xhr){return }if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)}else{xhr.open(type,s.url,s.async)
}try{if(s.data||origSettings&&origSettings.contentType){xhr.setRequestHeader("Content-Type",s.contentType)}if(s.ifModified){if(jQuery.lastModified[s.url]){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url])}if(jQuery.etag[s.url]){xhr.setRequestHeader("If-None-Match",jQuery.etag[s.url])}}if(!remote){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest")}xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend&&s.beforeSend.call(callbackContext,xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}xhr.abort();return false}if(s.global){trigger("ajaxSend",[xhr,s])}var onreadystatechange=xhr.onreadystatechange=function(isTimeout){if(!xhr||xhr.readyState===0||isTimeout==="abort"){if(!requestDone){complete()}requestDone=true;if(xhr){xhr.onreadystatechange=jQuery.noop}}else{if(!requestDone&&xhr&&(xhr.readyState===4||isTimeout==="timeout")){requestDone=true;xhr.onreadystatechange=jQuery.noop;status=isTimeout==="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";var errMsg;if(status==="success"){try{data=jQuery.httpData(xhr,s.dataType,s)}catch(err){status="parsererror";errMsg=err}}if(status==="success"||status==="notmodified"){if(!jsonp){success()}}else{jQuery.handleError(s,xhr,status,errMsg)}complete();if(isTimeout==="timeout"){xhr.abort()}if(s.async){xhr=null}}}};try{var oldAbort=xhr.abort;xhr.abort=function(){if(xhr){oldAbort.call(xhr)}onreadystatechange("abort")}}catch(e){}if(s.async&&s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout")}},s.timeout)}try{xhr.send(type==="POST"||type==="PUT"||type==="DELETE"?s.data:null)}catch(e){jQuery.handleError(s,xhr,null,e);complete()}if(!s.async){onreadystatechange()}function success(){if(s.success){s.success.call(callbackContext,data,status,xhr)}if(s.global){trigger("ajaxSuccess",[xhr,s])}}function complete(){if(s.complete){s.complete.call(callbackContext,xhr,status)
}if(s.global){trigger("ajaxComplete",[xhr,s])}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}function trigger(type,args){(s.context?jQuery(s.context):jQuery.event).trigger(type,args)}return xhr},handleError:function(s,xhr,status,e){if(s.error){s.error.call(s.context||s,xhr,status,e)}if(s.global){(s.context?jQuery(s.context):jQuery.event).trigger("ajaxError",[xhr,s,e])}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol==="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status===304||xhr.status===1223||xhr.status===0}catch(e){}return false},httpNotModified:function(xhr,url){var lastModified=xhr.getResponseHeader("Last-Modified"),etag=xhr.getResponseHeader("Etag");if(lastModified){jQuery.lastModified[url]=lastModified}if(etag){jQuery.etag[url]=etag}return xhr.status===304||xhr.status===0},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){jQuery.error("parsererror")}if(s&&s.dataFilter){data=s.dataFilter(data,type)}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=jQuery.parseJSON(data)}else{if(type==="script"||!type&&ct.indexOf("javascript")>=0){jQuery.globalEval(data)}}}return data},param:function(a,traditional){var s=[];if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional}if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value)})}else{for(var prefix in a){buildParams(prefix,a[prefix])}}return s.join("&").replace(r20,"+");function buildParams(prefix,obj){if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||/\[\]$/.test(prefix)){add(prefix,v)}else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v)}})}else{if(!traditional&&obj!=null&&typeof obj==="object"){jQuery.each(obj,function(k,v){buildParams(prefix+"["+k+"]",v)})}else{add(prefix,obj)}}}function add(key,value){value=jQuery.isFunction(value)?value():value;
s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)}}});var elemdisplay={},rfxtypes=/toggle|show|hide/,rfxnum=/^([+-]=)?([\d+-.]+)(.*)$/,timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];jQuery.fn.extend({show:function(speed,callback){if(speed||speed===0){return this.animate(genFx("show",3),speed,callback)}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var nodeName=this[i].nodeName,display;if(elemdisplay[nodeName]){display=elemdisplay[nodeName]}else{var elem=jQuery("<"+nodeName+" />").appendTo("body");display=elem.css("display");if(display==="none"){display="block"}elem.remove();elemdisplay[nodeName]=display}jQuery.data(this[i],"olddisplay",display)}}for(var j=0,k=this.length;j<k;j++){this[j].style.display=jQuery.data(this[j],"olddisplay")||""}return this}},hide:function(speed,callback){if(speed||speed===0){return this.animate(genFx("hide",3),speed,callback)}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"))}}for(var j=0,k=this.length;j<k;j++){this[j].style.display="none"}return this}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";if(jQuery.isFunction(fn)&&jQuery.isFunction(fn2)){this._toggle.apply(this,arguments)}else{if(fn==null||bool){this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]()})}else{this.animate(genFx("toggle",3),fn,fn2)}}return this},fadeTo:function(speed,to,callback){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);if(jQuery.isEmptyObject(prop)){return this.each(optall.complete)}return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType===1&&jQuery(this).is(":hidden"),self=this;
for(p in prop){var name=p.replace(rdashAlpha,fcamelCase);if(p!==name){prop[name]=prop[p];delete prop[p];p=name}if(prop[p]==="hide"&&hidden||prop[p]==="show"&&!hidden){return opt.complete.call(this)}if((p==="height"||p==="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}if(jQuery.isArray(prop[p])){(opt.specialEasing=opt.specialEasing||{})[p]=prop[p][1];prop[p]=prop[p][0]}}if(opt.overflow!=null){this.style.overflow="hidden"}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(rfxtypes.test(val)){e[val==="toggle"?hidden?"show":"hide":val](prop)}else{var parts=rfxnum.exec(val),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!=="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit}if(parts[1]){end=((parts[1]==="-="?-1:1)*end)+start}e.custom(start,end,unit)}else{e.custom(start,val,"")}}});return true})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem===this){if(gotoEnd){timers[i](true)}timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}return this}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback)}});jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()}if(jQuery.isFunction(opt.old)){opt.old.call(this)
}};return opt},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(jQuery.fx.tick,13)}},show:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());jQuery(this.elem).show()},hide:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(gotoEnd){var t=now(),done=true;if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var old=jQuery.data(this.elem,"olddisplay");this.elem.style.display=old?old:this.options.display;if(jQuery.css(this.elem,"display")==="none"){this.elem.style.display="block"}}if(this.options.hide){jQuery(this.elem).hide()
}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.style(this.elem,p,this.options.orig[p])}}this.options.complete.call(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;var specialEasing=this.options.specialEasing&&this.options.specialEasing[this.prop];var defaultEasing=this.options.easing||(jQuery.easing.swing?"swing":"linear");this.pos=jQuery.easing[specialEasing||defaultEasing](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.extend(jQuery.fx,{tick:function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}if(!timers.length){jQuery.fx.stop()}},stop:function(){clearInterval(timerId);timerId=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.style(fx.elem,"opacity",fx.now)},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=(fx.prop==="width"||fx.prop==="height"?Math.max(0,fx.now):fx.now)+fx.unit}else{fx.elem[fx.prop]=fx.now}}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length}}function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type});return obj}if("getBoundingClientRect" in document.documentElement){jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i)})}if(!elem||!elem.ownerDocument){return null}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem)}var box=elem.getBoundingClientRect(),doc=elem.ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;
return{top:top,left:left}}}else{jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i)})}if(!elem||!elem.ownerDocument){return null}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem)}jQuery.offset.initialize();var offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle,top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){break}computedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle;top-=elem.scrollTop;left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop;left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0}prevOffsetParent=offsetParent,offsetParent=elem.offsetParent}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0}prevComputedStyle=computedStyle}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop;left+=body.offsetLeft}if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft)}return{top:top,left:left}}}jQuery.offset={initialize:function(){var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,bodyMarginTop=parseFloat(jQuery.curCSS(body,"marginTop",true))||0,html="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
jQuery.extend(container.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild;checkDiv=innerDiv.firstChild;td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);checkDiv.style.position="fixed",checkDiv.style.top="20px";this.supportsFixedPosition=(checkDiv.offsetTop===20||checkDiv.offsetTop===15);checkDiv.style.position=checkDiv.style.top="";innerDiv.style.overflow="hidden",innerDiv.style.position="relative";this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==bodyMarginTop);body.removeChild(container);body=container=innerDiv=checkDiv=table=td=null;jQuery.offset.initialize=jQuery.noop},bodyOffset:function(body){var top=body.offsetTop,left=body.offsetLeft;jQuery.offset.initialize();if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseFloat(jQuery.curCSS(body,"marginTop",true))||0;left+=parseFloat(jQuery.curCSS(body,"marginLeft",true))||0}return{top:top,left:left}},setOffset:function(elem,options,i){if(/static/.test(jQuery.curCSS(elem,"position"))){elem.style.position="relative"}var curElem=jQuery(elem),curOffset=curElem.offset(),curTop=parseInt(jQuery.curCSS(elem,"top",true),10)||0,curLeft=parseInt(jQuery.curCSS(elem,"left",true),10)||0;if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset)}var props={top:(options.top-curOffset.top)+curTop,left:(options.left-curOffset.left)+curLeft};if("using" in options){options.using.call(elem,props)}else{curElem.css(props)}}};jQuery.fn.extend({position:function(){if(!this[0]){return null}var elem=this[0],offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.curCSS(elem,"marginTop",true))||0;
offset.left-=parseFloat(jQuery.curCSS(elem,"marginLeft",true))||0;parentOffset.top+=parseFloat(jQuery.curCSS(offsetParent[0],"borderTopWidth",true))||0;parentOffset.left+=parseFloat(jQuery.curCSS(offsetParent[0],"borderLeftWidth",true))||0;return{top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.nodeName)&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent}return offsetParent})}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){var elem=this[0],win;if(!elem){return null}if(val!==undefined){return this.each(function(){win=getWindow(this);if(win){win.scrollTo(!i?val:jQuery(win).scrollLeft(),i?val:jQuery(win).scrollTop())}else{this[method]=val}})}else{win=getWindow(elem);return win?("pageXOffset" in win)?win[i?"pageYOffset":"pageXOffset"]:jQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method]}}});function getWindow(elem){return("scrollTo" in elem&&elem.document)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false}jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],type,false,"padding"):null};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],type,false,margin?"margin":"border"):null};jQuery.fn[type]=function(size){var elem=this[0];if(!elem){return size==null?null:this}if(jQuery.isFunction(size)){return this.each(function(i){var self=jQuery(this);self[type](size.call(this,i,self[type]()))})}return("scrollTo" in elem&&elem.document)?elem.document.compatMode==="CSS1Compat"&&elem.document.documentElement["client"+name]||elem.document.body["client"+name]:(elem.nodeType===9)?Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]):size===undefined?jQuery.css(elem,type):this.css(type,typeof size==="string"?size:size+"px")
}});window.jQuery=window.$=jQuery})(window);$j=jQuery.noConflict();






/* jquery.colorhelpers.js */
(function(C){C.color={};function B(D){D.add=function(G,F){for(var E=0;E<G.length;++E){D[G.charAt(E)]+=F}return D.normalize()};D.scale=function(G,F){for(var E=0;E<G.length;++E){D[G.charAt(E)]*=F}return D.normalize()};D.toString=function(){if(D.a>=1){return"rgb("+[D.r,D.g,D.b].join(",")+")"}else{return"rgba("+[D.r,D.g,D.b,D.a].join(",")+")"}};D.normalize=function(){function E(G,H,F){return H<G?G:(H>F?F:H)}D.r=E(0,parseInt(D.r),255);D.g=E(0,parseInt(D.g),255);D.b=E(0,parseInt(D.b),255);D.a=E(0,D.a,1);return D};D.clone=function(){return C.color.make(D.r,D.b,D.g,D.a)}}C.color.make=function(G,F,D,E){var H={};if(C.isArray(G)){H.r=G[0]||0;H.g=G[1]||0;H.b=G[2]||0;H.a=G[3]!=null?G[3]:1}else{H.r=G||0;H.g=F||0;H.b=D||0;H.a=E!=null?E:1}B(H);return H.normalize()};C.color.extract=function(E,D){var F;do{F=E.css(D).toLowerCase();if(F!=""&&F!="transparent"){break}E=E.parent()}while(!C.nodeName(E.get(0),"body"));if(F=="rgba(0, 0, 0, 0)"){F="transparent"}return C.color.parse(F)};C.color.parse=function(G){var F,D=C.color.make;if(C.isArray(G)){return D(G)}if(F=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(G)){return D(parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10))}if(F=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(G)){return D(parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10),parseFloat(F[4]))}if(F=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(G)){return D(parseFloat(F[1])*2.55,parseFloat(F[2])*2.55,parseFloat(F[3])*2.55)}if(F=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(G)){return D(parseFloat(F[1])*2.55,parseFloat(F[2])*2.55,parseFloat(F[3])*2.55,parseFloat(F[4]))}if(F=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(G)){return D(parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16))
}if(F=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(G)){return D(parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16))}var E=C.trim(G).toLowerCase();if(E=="transparent"){return D(255,255,255,0)}else{F=A[E];return D(F[0],F[1],F[2])}};C.color.interpolate=function(H,F){var J=0,D=0,G,I,E,L=[0,0,0,0],K;if(arguments.length>2){for(I=[],G=[],E=0;E+1<arguments.length;E+=2){I.push(arguments[E]),G.push(arguments[E+1])}I.push(arguments[E]);H=I,F=G}for(E=0;E<F.length;++E){J+=F[E]||0}if(J<1&&F.length==H.length-1){J=1}for(E=0;E<H.length;++E){G=(E<F.length?F[E]:J-D)||0;I=H[E];I=I.charAt?C.color.parse(I):I;D+=G;if(G>0){for(K=4;-1<--K;){L[K]+=I["rgba".charAt(K)]*(G/J)}}}for(K=3;-1<--K;){L[K]=Math.round(L[K])}return C.color.make(L[0],L[1],L[2],L[3])};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);






/* jquery.cookie.js */
jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";
var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}};






/* jquery.dimensions.js */
(function(B){B.dimensions={version:"1.2"};B.each(["Height","Width"],function(D,C){B.fn["inner"+C]=function(){if(!this[0]){return }var F=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+C]:A(this,C.toLowerCase())+A(this,"padding"+F)+A(this,"padding"+E)};B.fn["outer"+C]=function(F){if(!this[0]){return }var H=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";F=B.extend({margin:false},F||{});var G=this.is(":visible")?this[0]["offset"+C]:A(this,C.toLowerCase())+A(this,"border"+H+"Width")+A(this,"border"+E+"Width")+A(this,"padding"+H)+A(this,"padding"+E);return G+(F.margin?(A(this,"margin"+H)+A(this,"margin"+E)):0)}});B.each(["Left","Top"],function(D,C){B.fn["scroll"+C]=function(E){if(!this[0]){return }return E!=undefined?this.each(function(){this==window||this==document?window.scrollTo(C=="Left"?E:B(window)["scrollLeft"](),C=="Top"?E:B(window)["scrollTop"]()):this["scroll"+C]=E}):this[0]==window||this[0]==document?self[(C=="Left"?"pageXOffset":"pageYOffset")]||B.boxModel&&document.documentElement["scroll"+C]||document.body["scroll"+C]:this[0]["scroll"+C]}});B.fn.extend({position:function(){var H=0,G=0,F=this[0],I,C,E,D;if(F){E=this.offsetParent();I=this.offset();C=E.offset();I.top-=A(F,"marginTop");I.left-=A(F,"marginLeft");C.top+=A(E,"borderTopWidth");C.left+=A(E,"borderLeftWidth");D={top:I.top-C.top,left:I.left-C.left}}return D},offsetParent:function(){var C=this[0].offsetParent;while(C&&(!/^body|html$/i.test(C.tagName)&&B.css(C,"position")=="static")){C=C.offsetParent}return B(C)}});function A(C,D){return parseInt(B.curCSS(C.jquery?C[0]:C,D,true))||0
}})(jQuery);






/* jquery.jeditable.js */
(function($){$.fn.editable=function(target,options){var settings={target:target,name:"value",id:"id",type:"text",width:"auto",height:"auto",event:"click",onblur:"cancel",loadtype:"GET",loadtext:"Loading...",placeholder:"Click to edit",loaddata:{},submitdata:{}};if(options){$.extend(settings,options)}var plugin=$.editable.types[settings.type].plugin||function(){};var submit=$.editable.types[settings.type].submit||function(){};var buttons=$.editable.types[settings.type].buttons||$.editable.types.defaults.buttons;var content=$.editable.types[settings.type].content||$.editable.types.defaults.content;var element=$.editable.types[settings.type].element||$.editable.types.defaults.element;var reset=$.editable.types[settings.type].reset||$.editable.types.defaults.reset;var cb_success=settings.callback||function(){};var cb_error=settings.error||function(){};if(!$.isFunction($(this)[settings.event])){$.fn[settings.event]=function(fn){return fn?this.bind(settings.event,fn):this.trigger(settings.event)}}$(this).attr("title",settings.tooltip);settings.autowidth="auto"==settings.width;settings.autoheight="auto"==settings.height;return this.each(function(){var self=this;var savedwidth=$(self).width();var savedheight=$(self).height();if(!$.trim($(this).html())){$(this).html(settings.placeholder)}$(this)[settings.event](function(e){if(self.editing){return }if(0==$(self).width()){settings.width=savedwidth;settings.height=savedheight}else{if(settings.width!="none"){settings.width=settings.autowidth?$(self).width():settings.width}if(settings.height!="none"){settings.height=settings.autoheight?$(self).height():settings.height}}if($(this).html().toLowerCase().replace(/;/,"")==settings.placeholder.toLowerCase().replace(/;/,"")){$(this).html("")}$(this).html($(this).html().replace(/<br *\/?>/ig,"\n"));self.editing=true;self.revert=self.orig_revert?self.orig_revert:$(self).html();var form=$("<form/>");if(settings.cssclass){if("inherit"==settings.cssclass){form.attr("class",$(self).attr("class"))
}else{form.attr("class",settings.cssclass)}}if(settings.style){if("inherit"==settings.style){form.attr("style",$(self).attr("style"));form.css("display",$(self).css("display"))}else{form.attr("style",settings.style)}}var input=element.apply(form,[settings,self]);var input_content;if(settings.loadurl){var t=setTimeout(function(){input.disabled=true;content.apply(form,[settings.loadtext,settings,self])},100);var loaddata={};loaddata[settings.id]=self.id;if($.isFunction(settings.loaddata)){$.extend(loaddata,settings.loaddata.apply(self,[self.revert,settings]))}else{$.extend(loaddata,settings.loaddata)}$.ajax({type:settings.loadtype,url:settings.loadurl,data:loaddata,async:false,success:function(result){window.clearTimeout(t);input_content=result;input.disabled=false}})}else{if(settings.data){input_content=settings.data;if($.isFunction(settings.data)){input_content=settings.data.apply(self,[self.revert,settings])}}else{input_content=$(self).html()}}content.apply(form,[input_content,settings,self]);input.attr("name",settings.name);buttons.apply(form,[settings,self]);$(self).html("");$(self).append(form);plugin.apply(form,[settings,self]);$(":input:visible:enabled:first",form).focus();if(settings.select){input.select()}input.keydown(function(e){if(e.keyCode==27){e.preventDefault();reset.apply(form,[settings,self])}});var t;if("cancel"==settings.onblur){input.blur(function(e){t=setTimeout(function(){reset.apply(form,[settings,self])},500)})}else{if("submit"==settings.onblur){input.blur(function(e){form.submit()})}else{if($.isFunction(settings.onblur)){input.blur(function(e){settings.onblur.apply(self,[input.val(),settings])})}else{input.blur(function(e){})}}}form.submit(function(e){if(t){clearTimeout(t)}e.preventDefault();if(false!==submit.apply(form,[settings,self])){$(self).find("button").attr("disabled","disabled");if($.isFunction(settings.target)){var str=settings.target.apply(self,[input.val(),settings]);$(self).html(str);self.editing=false;cb_success.apply(self,[self.innerHTML,settings]);
if(!$.trim($(self).html())){$(self).html(settings.placeholder)}}else{var submitdata={};submitdata[settings.name]=input.val().replace(/<br *\/?>/ig,"\n");submitdata[settings.id]=self.id;if($.isFunction(settings.submitdata)){$.extend(submitdata,settings.submitdata.apply(self,[self.revert,settings]))}else{$.extend(submitdata,settings.submitdata)}var common_callback=function(){$(self).find("button").removeAttr("disabled");self.editing=false;if(!$.trim($(self).html())){$(self).html(settings.placeholder)}};$(self).html(settings.indicator);$.ajax({url:settings.target,data:submitdata,type:"POST",success:function(data,status){var j=data.replace(/\n/g,"<br/>");if(self.orig_revert){self.orig_revert=j}$(self).html(j);common_callback.apply(self);cb_success.apply(self,[self.innerHTML,settings])},error:function(xhr,status,error){if(!self.orig_revert){self.orig_revert=self.revert}common_callback.apply(self);cb_error.apply(self,[self.innerHTML,xhr.responseText]);$(self).html(submitdata[settings.name]);$(self).trigger(settings.event)}})}}return false})});this.reset=function(){$(self).html(self.revert.replace(/\n/ig,"<br/>"));self.editing=false;if(!$.trim($(self).html())){$(self).html(settings.placeholder)}}})};$.editable={types:{defaults:{element:function(settings,original){var input=$('<input type="hidden">');$(this).append(input);return(input)},content:function(string,settings,original){$(":input:first",this).val(string)},reset:function(settings,original){original.reset()},buttons:function(settings,original){var form=this;if(settings.submit){if(settings.submit.match(/>$/)){var submit=$(settings.submit).click(function(){form.submit()})}else{var submit=$('<button type="submit">');submit.html(settings.submit)}$(this).append(submit)}if(settings.cancel){if(settings.cancel.match(/>$/)){var cancel=$(settings.cancel)}else{var cancel=$('<button type="cancel">');cancel.html(settings.cancel)}$(this).append(cancel);$(cancel).click(function(event){if($.isFunction($.editable.types[settings.type].reset)){var reset=$.editable.types[settings.type].reset
}else{var reset=$.editable.types.defaults.reset}reset.apply(form,[settings,original]);return false})}}},text:{element:function(settings,original){var input=$("<input>");if(settings.width!="none"){input.width(settings.width)}if(settings.height!="none"){input.height(settings.height)}input.attr("autocomplete","off");$(this).append(input);return(input)}},textarea:{element:function(settings,original){var textarea=$("<textarea>");if(settings.rows){textarea.attr("rows",settings.rows)}else{textarea.height(settings.height)}if(settings.cols){textarea.attr("cols",settings.cols)}else{textarea.width(settings.width)}$(this).append(textarea);return(textarea)}},select:{element:function(settings,original){var select=$("<select>");$(this).append(select);return(select)},content:function(string,settings,original){if(String==string.constructor){eval("var json = "+string);for(var key in json){if(!json.hasOwnProperty(key)){continue}if("selected"==key){continue}var option=$("<option>").val(key).append(json[key]);$("select",this).append(option)}}$("select",this).children().each(function(){if($(this).val()==json.selected||$(this).text()==original.revert){$(this).attr("selected","selected")}})}}},addInputType:function(name,input){$.editable.types[name]=input}}})(jQuery);






/* jquery.history.js */
(function(E){var G={put:function(L,I,K){var H=(K||window).location,J;L=this.encoder(L);if(!I){H.hash=L}else{J=H.href.replace(/#.*/,"");H.replace(J+(L==""||L.charAt(0)=="#"?"":"#")+L)}},get:function(I){var H=((I||window).location.hash).replace(/^#/,"");return E.browser.mozilla?H:decodeURIComponent(H)},encoder:encodeURIComponent};var D={id:"__jQuery_history",init:function(){var H='<iframe id="'+this.id+'" style="display:none" src="javascript:false;" />';E("body").prepend(H);return this},_document:function(){return E("#"+this.id)[0].contentWindow.document},put:function(J,H){var I=this._document();I.open();I.close();G.put(J,H,I)},get:function(){return G.get(this._document())}};function F(J){J=E.extend({unescape:false},J||{});
G.encoder=K(J.unescape);G.get=H(J.unescape);function K(L){if(L===true){return function(M){return M}}if(typeof L=="string"&&(L=I(L.split("")))||typeof L=="function"){return function(M){return L(encodeURIComponent(M))}}return encodeURIComponent}function I(M){var L=new RegExp(E.map(M,encodeURIComponent).join("|"),"ig");return function(N){return N.replace(L,decodeURIComponent)}}function H(L){if(L===true){return function(M){return((M||window).location.href).replace(/^[^#]*#?/,"")}}return G.get}}var B={appState:undefined,callback:undefined,init:function(I,H){},check:function(){},load:function(I,H){}};E.history=B;var A={init:function(J,H){F(H);B.callback=J;var I=G.get();B.appState=I;B.callback(I);setInterval(B.check,100)},check:function(){var H=G.get();if(H!=B.appState){B.appState=H;B.callback(H)}},load:function(I,H){if(I!=B.appState){G.put(I,H);B.appState=I;B.callback(I)}}};var C={init:function(J,H){F(H);B.callback=J;var I=G.get();B.appState=I;D.init().put(I);B.callback(I);setInterval(B.check,100)},check:function(){var I=D.get(),H=G.get();if(H!=I){if(H==B.appState){B.appState=I;G.put(I);B.callback(I)}else{B.appState=H;D.put(H);B.callback(H)}}},load:function(I,H){if(I!=B.appState){G.put(I,H);D.put(I,H);B.appState=I;B.callback(I)}}};if(E.browser.msie&&(E.browser.version<8||document.documentMode<8)){E.extend(B,C)}else{E.extend(B,A)}})(jQuery);






/* jquery.ui.dialog.js */
(function(B){B.ui=B.ui||{};B.fn.extend({dialog:function(D,E){var C=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof D=="string"){var F=B.data(this,"ui-dialog")||B.data(B(this).parents(".ui-dialog:first").find(".ui-dialog-content")[0],"ui-dialog");F[D].apply(F,C)}else{if(!B(this).is(".ui-dialog-content")){new B.ui.dialog(this,D)}}})}});B.ui.dialog=function(D,L){this.options=L=B.extend({},B.ui.dialog.defaults,L&&L.modal?{resizable:false}:{},L);this.element=D;var K=this;B.data(this.element,"ui-dialog",this);B(D).bind("setData.dialog",function(N,M,O){L[M]=O}).bind("getData.dialog",function(N,M){return L[M]
});var E=B(D).addClass("ui-dialog-content");if(!E.parent().length){E.appendTo("body")}E.wrap(document.createElement("div")).wrap(document.createElement("div"));var H=E.parent();var J=this.uiDialog=H.parent();H.hide();J.hide().addClass("ui-dialog").css({position:"absolute",width:L.width,height:L.height,overflow:"hidden"});H.addClass("ui-dialog-container").css({position:"relative"}).show();var C=E.attr("className").split(" ");B.each(C,function(M,N){if(N!="ui-dialog-content"){J.addClass(N)}});if(L.resizable&&B.fn.resizable){if(L.resizable!="height-only"){J.append('<div class="ui-resizable-e ui-resizable-handle"></div>').append('<div class="ui-resizable-w ui-resizable-handle"></div>')}if(L.resizable!="width-only"){J.append('<div class="ui-resizable-n ui-resizable-handle"></div>').append('<div class="ui-resizable-s ui-resizable-handle"></div>')}if(L.resizable!="width-only"&&L.resizable!="height-only"){J.append('<div class="ui-resizable-ne ui-resizable-handle"></div>').append('<div class="ui-resizable-se ui-resizable-handle"></div>').append('<div class="ui-resizable-sw ui-resizable-handle"></div>').append('<div class="ui-resizable-nw ui-resizable-handle"></div>')}J.resizable({maxWidth:L.maxWidth,maxHeight:L.maxHeight,minWidth:L.minWidth,minHeight:L.minHeight})}var I=(L.title)?L.title:(E.attr("title"))?E.attr("title"):"";H.prepend('<div class="ui-dialog-titlebar"></div>');this.uiDialogTitlebar=B(".ui-dialog-titlebar",H).append('<span class="ui-dialog-title">'+I+"</span>").append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>');this.uiDialogTitlebarClose=B(".ui-dialog-titlebar-close",this.uiDialogTitlebar).hover(function(){B(this).addClass("ui-dialog-titlebar-close-hover")},function(){B(this).removeClass("ui-dialog-titlebar-close-hover")}).mousedown(function(M){M.stopPropagation()}).click(function(){K.close();return false}).keydown(function(M){var N=27;M.keyCode&&M.keyCode==N&&K.close()});var F=0;B.each(L.buttons,function(){F=1;return false});if(F==1){J.append('<div class="ui-dialog-buttonpane"></div>');
var G=B(".ui-dialog-buttonpane",J);B.each(L.buttons,function(M,O){var N=B(document.createElement("button")).text(M).click(O);G.append(N)})}if(L.draggable&&B.fn.draggable){J.draggable({handle:".ui-dialog-titlebar",start:function(){K.activate()}})}J.mousedown(function(){K.activate()});this.uiDialogTitlebar.click(function(){K.activate()});L.bgiframe&&B.fn.bgiframe&&J.bgiframe();this.open=function(){L.modal&&A.show(K,L.overlay);J.appendTo("body");var O=B(window),R=B(document),Q=R.scrollTop(),P=R.scrollLeft();if(L.position.constructor==Array){Q+=L.position[1];P+=L.position[0]}else{if(L.position.top&&L.position.left){Q=L.position.top;P=L.position.left}else{switch(L.position){case"center":Q+=(O.height()/2)-(J.height()/2);P+=(O.width()/2)-(J.width()/2);break;case"top":Q+=0;P+=(O.width()/2)-(J.width()/2);break;case"right":Q+=(O.height()/2)-(J.height()/2);P+=(O.width())-(J.width());break;case"bottom":Q+=(O.height())-(J.height());P+=(O.width()/2)-(J.width()/2);break;case"left":Q+=(O.height()/2)-(J.height()/2);P+=0;break;default:Q+=(O.height()/2)-(J.height()/2);P+=(O.width()/2)-(J.width()/2)}}}Q=Q<R.scrollTop()?R.scrollTop():Q;J.css({top:Q,left:P});if(jQuery.browser.msie){this.uiDialogTitlebar.width(J.width())}J.show();K.activate();var M=null;var N={options:L};this.uiDialogTitlebarClose.focus();B(this.element).triggerHandler("dialogopen",[M,N],L.open)};this.activate=function(){var M=0;B(".ui-dialog:visible").each(function(){var N=parseInt(B(this).css("z-index"),10);if(!isNaN(N)){M=Math.max(M,N)}});A.$el&&A.$el.css("z-index",++M);J.css("z-index",++M)};this.close=function(){L.modal&&A.hide();J.hide();var N=null;var M={options:L};B(this.element).triggerHandler("dialogclose",[N,M],L.close)};if(L.autoOpen){this.open()}};B.extend(B.ui.dialog,{defaults:{autoOpen:true,bgiframe:false,buttons:[],draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:"center",resizable:true,width:300}});var A={$el:null,events:B.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(C){return C+".ui-dialog-overlay"
}).join(" "),show:function(D,C){if(this.$el){return }this.dialog=D;this.selects=this.ie6&&B("select:visible").css("visibility","hidden");this.$el=B("<div/>").appendTo(document.body).addClass("ui-dialog-overlay").css(B.extend({borderWidth:0,margin:0,padding:0,position:"fixed",top:0,left:0,width:"100%",height:"100%",_position:"absolute",_top:"expression(eval(document.body.scrollTop))"},C));B("a, :input").bind(this.events,function(){if(B(this).parents(".ui-dialog").length==0){D.uiDialogTitlebarClose.focus();return false}});B(document).bind("keydown.ui-dialog-overlay",function(E){var F=27;E.keyCode&&E.keyCode==F&&D.close()})},hide:function(){B("a, :input").add([document,window]).unbind(".ui-dialog-overlay");this.ie6&&this.selects.css("visibility","visible");this.$el=null;B(".ui-dialog-overlay").remove()},ie6:B.browser.msie&&B.browser.version<7,selects:null}})(jQuery);






/* jquery.ui.resizable.js */
(function(A){A.fn.resizable=function(B){return this.each(function(){var D=Array.prototype.slice.call(arguments,1);if(typeof B=="string"){var C=A.data(this,"ui-resizable");C[B].apply(C,D)}else{if(!A(this).is(".ui-resizable")){new A.ui.resizable(this,B)}}})};A.ui.resizable=function(K,R){var Q=this;this.element=A(K);A.data(K,"ui-resizable",this);this.element.addClass("ui-resizable");this.options=A.extend({preventDefault:true,transparent:false,minWidth:10,minHeight:10,aspectRatio:false,disableSelection:true,preserveCursor:true,autohide:false},R);this.options._aspectRatio=!!(this.options.aspectRatio);A(K).bind("setData.resizable",function(T,S,U){Q.options[S]=U}).bind("getData.resizable",function(T,S){return Q.options[S]});var C=this.options;var E="1px solid #DEDEDE";C.defaultTheme={"ui-resizable":{display:"block"},"ui-resizable-handle":{position:"absolute",background:"#F5F5F5"},"ui-resizable-n":{cursor:"n-resize",height:"4px",left:"0px",right:"0px",borderTop:E},"ui-resizable-s":{cursor:"s-resize",height:"4px",left:"0px",right:"0px",borderBottom:E},"ui-resizable-e":{cursor:"e-resize",width:"4px",top:"0px",bottom:"0px",borderRight:E},"ui-resizable-w":{cursor:"w-resize",width:"4px",top:"0px",bottom:"0px",borderLeft:E},"ui-resizable-se":{cursor:"se-resize",width:"4px",height:"4px",borderRight:E,borderBottom:E},"ui-resizable-sw":{cursor:"sw-resize",width:"4px",height:"4px",borderBottom:E,borderLeft:E},"ui-resizable-ne":{cursor:"ne-resize",width:"4px",height:"4px",borderRight:E,borderTop:E},"ui-resizable-nw":{cursor:"nw-resize",width:"4px",height:"4px",borderLeft:E,borderTop:E}};
if(!C.proxy&&(this.element.css("position")=="static"||this.element.css("position")=="")){this.element.css("position","relative")}var O=K.nodeName;if(O.match(/textarea|input|select|button|img/i)){this.element.wrap('<div class="ui-wrapper"  style="overflow: hidden; position: relative; width: '+this.element.outerWidth()+"px; height: "+this.element.outerHeight()+';"></div>');var I=this.element;K=K.parentNode;this.element=A(K);this.element.css({marginLeft:I.css("marginLeft"),marginTop:I.css("marginTop"),marginRight:I.css("marginRight"),marginBottom:I.css("marginBottom")});I.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if(A.browser.safari&&C.preventDefault){I.css("resize","none")}C.proportionallyResize=I.css("position","static");this._proportionallyResize()}if(!C.handles){C.handles=!A(".ui-resizable-handle",K).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}}if(C.handles.constructor==String){if(C.handles=="all"){C.handles="n,e,s,w,se,sw,ne,nw"}var D=C.handles.split(",");C.handles={};C.zIndex=C.zIndex||1000;var H={handle:"overflow:hidden; position:absolute;",n:"top: 0pt; width:100%;",e:"right: 0pt; height:100%;",s:"bottom: 0pt; width:100%;",w:"left: 0pt; height:100%;",se:"bottom: 0pt; right: 0px;",sw:"bottom: 0pt; left: 0px;",ne:"top: 0pt; right: 0px;",nw:"top: 0pt; left: 0px;"};for(var J=0;J<D.length;J++){var M=jQuery.trim(D[J]),P=C.defaultTheme,B="ui-resizable-"+M;var N=A.extend(P[B],P["ui-resizable-handle"]),G=A(['<div class="',B,' ui-resizable-handle" style="',H[M],H.handle,'"></div>'].join("")).css(/sw|se|ne|nw/.test(M)?{zIndex:++C.zIndex}:{});C.handles[M]=".ui-resizable-"+M;this.element.append(G.css(!A.ui.css(B)?N:{}))}}this._renderAxis=function(W){W=W||this.element;for(var T in C.handles){if(C.handles[T].constructor==String){C.handles[T]=A(C.handles[T],K).show()}if(C.transparent){C.handles[T].css({opacity:0})}if(this.element.is(".ui-wrapper")&&O.match(/textarea|input|select|button/i)){var U=A(C.handles[T],K),V=0;
V=/sw|ne|nw|se|n|s/.test(T)?U.outerHeight():U.outerWidth();var S=["padding",/ne|nw|n/.test(T)?"Top":/se|sw|s/.test(T)?"Bottom":/^e$/.test(T)?"Right":"Left"].join("");if(!C.transparent){W.css(S,V)}}if(!A(C.handles[T]).length){continue}}};this._renderAxis(this.element);var F=A(".ui-resizable-handle",Q.element);if(C.disableSelection){F.each(function(S,T){A.ui.disableSelection(T)})}F.mouseover(function(){if(!C.resizing){if(this.className){var S=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}C.axis=S&&S[1]?S[1]:"se"}});if(C.autohide){var L=A.ui.css("ui-resizable-s")||A.ui.css("ui-resizable-e");if(!L){F.hide()}A(Q.element).addClass("ui-resizable-autohide").hover(function(){if(!L){F.show()}A(this).removeClass("ui-resizable-autohide")},function(){if(!C.resizing){if(!L){F.hide()}A(this).addClass("ui-resizable-autohide")}})}this.element.mouseInteraction({executor:this,delay:0,distance:0,dragPrevention:["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(T){if(this.disabled){return false}for(var S in this.options.handles){if(A(this.options.handles[S])[0]==T.target){return true}}return false}})};A.extend(A.ui.resizable.prototype,{plugins:{},ui:function(){return{instance:this,axis:this.options.axis,options:this.options}},_proportionallyResize:function(){var E=this.options;if(!E.proportionallyResize){return }var C=E.proportionallyResize;var B=[C.css("borderTopWidth"),C.css("borderRightWidth"),C.css("borderBottomWidth"),C.css("borderLeftWidth")];var D=[C.css("paddingTop"),C.css("paddingRight"),C.css("paddingBottom"),C.css("paddingLeft")];E.borderDif=E.borderDif||A.map(B,function(F,H){var G=parseInt(F,10)||0,I=parseInt(D[H],10)||0;return G+I});C.css({display:"block",height:(this.element.height()-E.borderDif[0]-E.borderDif[2])+"px",width:(this.element.width()-E.borderDif[1]-E.borderDif[3])+"px"})},_renderProxy:function(){var B=this.element,D=this.options;this.offset=B.offset();if(D.proxy){this.helper=this.helper||A('<div style="overflow:hidden;"></div>');
var C=(A.browser.msie&&A.browser.version<7?3:0);this.helper.addClass(D.proxy).css({width:B.outerWidth(),height:B.outerHeight(),position:"absolute",left:this.offset.left-C+"px",top:this.offset.top-C+"px",zIndex:++D.zIndex});this.helper.appendTo("body");if(D.disableSelection){A.ui.disableSelection(this.helper.get(0))}}else{this.helper=B}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);this.element.triggerHandler(C=="resize"?C:"resize"+C,[B,this.ui()],this.options[C])},destroy:function(){this.element.removeClass("ui-resizable ui-resizable-disabled").removeMouseInteraction().removeData("ui-resizable").unbind(".resizable")},enable:function(){this.element.removeClass("ui-resizable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-resizable-disabled");this.disabled=true},start:function(L){var G=this.options,C=this.element.position(),H=this.element;G.resizing=true;G.documentScroll={top:A(document).scrollTop(),left:A(document).scrollLeft()};if(H.is(".ui-draggable")||(/absolute/).test(H.css("position"))){var O=A.browser.msie&&!G.containment&&(/absolute/).test(H.css("position"))&&!(/relative/).test(H.parent().css("position"));var P=O?G.documentScroll.top:0,J=O?G.documentScroll.left:0;H.css({position:"absolute",top:(C.top+P),left:(C.left+J)})}if(/relative/.test(H.css("position"))&&A.browser.opera){H.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var Q=parseInt(this.helper.css("left"),10)||0,I=parseInt(this.helper.css("top"),10)||0;A.extend(G,{currentSize:{width:H.outerWidth(),height:H.outerHeight()},currentSizeDiff:{width:H.outerWidth()-H.width(),height:H.outerHeight()-H.height()},startMousePosition:{left:L.pageX,top:L.pageY},startPosition:{left:Q,top:I},currentPosition:{left:Q,top:I}});var E=G.currentSize.width<G.currentSize.height;G.aspectRatio=(typeof G.aspectRatio=="number")?G.aspectRatio:Math.pow(G.currentSize.width/G.currentSize.height,E?1:-1);G.aspectRatioTarget=E?"width":"height";if(G.preserveCursor){A("body").css("cursor",G.axis+"-resize")
}if(G.containment){var D=G.containment,F=(D instanceof jQuery)?D.get(0):(/parent/.test(D))?H.parent().get(0):null;if(F){var N=function(U,S){var R=/top/.test(S||"top")?"scrollTop":"scrollLeft",T=false;if(U[R]>0){return true}U[R]=1;T=U[R]>0?true:false;U[R]=0;return T};var M=A(F).offset(),B=A(F).innerHeight(),K=A(F).innerWidth();G.cdata={e:F,l:M.left,t:M.top,w:(N(F,"left")?F.scrollWidth:K),h:(N(F)?F.scrollHeight:B)}}if(/document/.test(D)||D==document){G.cdata={e:document,l:0,t:0,w:A(document).width(),h:A(document).height()}}}this.propagate("start",L);return false},stop:function(C){this.options.resizing=false;var D=this.options;if(D.proxy){var B={width:(this.helper.width()-D.currentSizeDiff.width)+"px",height:(this.helper.height()-D.currentSizeDiff.height)+"px",top:((parseInt(this.element.css("top"),10)||0)+((parseInt(this.helper.css("top"),10)-this.offset.top)||0)),left:((parseInt(this.element.css("left"),10)||0)+((parseInt(this.helper.css("left"),10)-this.offset.left)||0))};this.element.css(B);if(D.proxy){this._proportionallyResize()}this.helper.remove()}if(D.preserveCursor){A("body").css("cursor","auto")}this.propagate("stop",C);return false},drag:function(E){var C=this.helper,B=this.options,G={},O=this,K=B._aspectRatio||E.shiftKey;var H=function(V,U){var T=(V=="top"||V=="height"),Q=(V=="width"||V=="height"),X=(B.axis=="se"||B.axis=="s"||B.axis=="e");var S=(E[T?"pageY":"pageX"]-B.startMousePosition[T?"top":"left"])*(U?-1:1);var P=B[Q?"currentSize":"startPosition"][V]-S-(!B.proxy&&X?B.currentSizeDiff.width:0);if(K){var W=P*Math.pow(B.aspectRatio,(T?-1:1)*(B.aspectRatioTarget=="height"?1:-1)),R=false;if(T&&W>=B.maxWidth||!T&&W>=B.maxHeight){R=true}if(T&&W<=B.minWidth||!T&&W<=B.minHeight){R=true}if(Q&&!R){C.css(T?"width":"height",W)}if(V=="top"&&(B.axis=="ne"||B.axis=="nw")){return }}C.css(V,P)};var J=B.axis,I=0,M;if(J=="n"||J=="ne"||J=="nw"){H("height")}if(J=="s"||J=="se"||J=="sw"){H("height",1)}var F=parseInt(C.css("height"),10)||0;if(B.minHeight&&F<=B.minHeight){C.css("height",B.minHeight)
}if(B.maxHeight&&F>=B.maxHeight){C.css("height",B.maxHeight)}if(J=="n"||J=="ne"||J=="nw"){H("top",1)}var D=parseInt(C.css("top"),10)||0;I=(B.startPosition.top+(B.currentSize.height-B.minHeight));M=(B.startPosition.top+(B.currentSize.height-B.maxHeight));if(B.minHeight&&D>=I){C.css("top",I)}if(B.maxHeight&&D<=M){C.css("top",M)}if(J=="e"||J=="se"||J=="ne"){H("width",1)}if(J=="sw"||J=="w"||J=="nw"){H("width")}var L=parseInt(C.css("width"),10)||0;if(B.minWidth&&L<=B.minWidth){C.css("width",B.minWidth)}if(B.maxWidth&&L>=B.maxWidth){C.css("width",B.maxWidth)}if(J=="sw"||J=="w"||J=="nw"){H("left",1)}var N=parseInt(C.css("left"),10)||0;I=(B.startPosition.left+(B.currentSize.width-B.minWidth));M=(B.startPosition.left+(B.currentSize.width-B.maxWidth));if(B.minWidth&&N>=I){C.css("left",I)}if(B.maxWidth&&N<=M){C.css("left",M)}if(B.containment&&B.cdata.e){if(N<0){C.css("left",0);C.css("width",L+N)}if(D<0){C.css("top",0);C.css("height",F+D)}if(L+B.currentSizeDiff.width+N>=B.cdata.w){C.css("width",B.cdata.w-B.currentSizeDiff.width-(N<0?0:N))}if(F+B.currentSizeDiff.height+D>=B.cdata.h){C.css("height",B.cdata.h-B.currentSizeDiff.height-(D<0?0:D))}}B.currentPosition={left:N,top:D};if(!B.proxy){this._proportionallyResize()}this.propagate("resize",E);return false}})})(jQuery);






/* jquery.ui.mouse.js */
(function(A){A.ui=A.ui||{};A.extend(A.ui,{plugin:{add:function(C,D,F){var E=A.ui[C].prototype;for(var B in F){E.plugins[B]=E.plugins[B]||[];E.plugins[B].push([D,F[B]])}},call:function(B,C,E){var F=B.plugins[C];if(!F){return }for(var D=0;D<F.length;D++){if(B.options[F[D][0]]){F[D][1].apply(B.element,E)}}}},cssCache:{},css:function(B){if(A.ui.cssCache[B]){return A.ui.cssCache[B]}var C=A('<div class="ui-resizable-gen">').addClass(B).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");A.ui.cssCache[B]=!!(((/^[1-9]/).test(C.css("height"))||(/^[1-9]/).test(C.css("width"))||!(/none/).test(C.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(C.css("backgroundColor"))));
try{A("body").get(0).removeChild(C.get(0))}catch(D){}return A.ui.cssCache[B]},disableSelection:function(B){if(!B){return }B.unselectable="on";B.onselectstart=function(){return false};if(B.style){B.style.MozUserSelect="none"}},enableSelection:function(B){if(!B){return }B.unselectable="off";B.onselectstart=function(){return true};if(B.style){B.style.MozUserSelect=""}}});A.fn.extend({mouseInteraction:function(B){return this.each(function(){new A.ui.mouseInteraction(this,B)})},removeMouseInteraction:function(B){return this.each(function(){if(A.data(this,"ui-mouse")){A.data(this,"ui-mouse").destroy()}})}});A.ui.mouseInteraction=function(D,C){var B=this;this.element=D;A.data(this.element,"ui-mouse",this);this.options=A.extend({},C);A(D).bind("mousedown.draggable",function(){return B.click.apply(B,arguments)});if(A.browser.msie){A(D).attr("unselectable","on")}};A.extend(A.ui.mouseInteraction.prototype,{destroy:function(){A(this.element).unbind("mousedown.draggable")},trigger:function(){return this.click.apply(this,arguments)},click:function(D){if(D.which!=1||A.inArray(D.target.nodeName.toLowerCase(),this.options.dragPrevention)!=-1||(this.options.condition&&!this.options.condition.apply(this.options.executor||this,[D,this.element]))){return true}var C=this;var B=function(){C._MP={left:D.pageX,top:D.pageY};A(document).bind("mouseup.draggable",function(){return C.stop.apply(C,arguments)});A(document).bind("mousemove.draggable",function(){return C.drag.apply(C,arguments)})};if(this.options.delay){if(this.timer){clearInterval(this.timer)}this.timer=setTimeout(B,this.options.delay)}else{B()}return false},stop:function(B){var C=this.options;if(!this.initialized){return A(document).unbind("mouseup.draggable").unbind("mousemove.draggable")}if(this.options.stop){this.options.stop.call(this.options.executor||this,B,this.element)}A(document).unbind("mouseup.draggable").unbind("mousemove.draggable");this.initialized=false;return false},drag:function(B){var C=this.options;if(A.browser.msie&&!B.button){return this.stop.apply(this,[B])
}if(!this.initialized&&(Math.abs(this._MP.left-B.pageX)>=C.distance||Math.abs(this._MP.top-B.pageY)>=C.distance)){if(this.options.start){this.options.start.call(this.options.executor||this,B,this.element)}this.initialized=true}else{if(!this.initialized){return false}}if(C.drag){C.drag.call(this.options.executor||this,B,this.element)}return false}})})(jQuery);






/* jquery.ui.draggable.js */
(function(A){A.fn.extend({draggable:function(C){var B=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof C=="string"){var D=A.data(this,"ui-draggable");D[C].apply(D,B)}else{if(!A.data(this,"ui-draggable")){new A.ui.draggable(this,C)}}})}});A.ui.draggable=function(D,C){var B=this;this.element=A(D);A.data(D,"ui-draggable",this);this.element.addClass("ui-draggable");this.options=A.extend({},C);var E=this.options;A.extend(E,{helper:E.ghosting==true?"clone":(E.helper||"original"),handle:E.handle?(A(E.handle,D)[0]?A(E.handle,D):this.element):this.element,appendTo:E.appendTo||"parent"});A(D).bind("setData.draggable",function(G,F,H){B.options[F]=H}).bind("getData.draggable",function(G,F){return B.options[F]});A(E.handle).mouseInteraction({executor:this,delay:E.delay,distance:E.distance||0,dragPrevention:E.prevention?E.prevention.toLowerCase().split(","):["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(F){return !(F.target.className.indexOf("ui-resizable-handle")!=-1||this.disabled)}});if(E.helper=="original"&&(this.element.css("position")=="static"||this.element.css("position")=="")){this.element.css("position","relative")}};A.extend(A.ui.draggable.prototype,{plugins:{},ui:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,instance:this,options:this.options}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this.ui()],this.options[C])},destroy:function(){this.handle.removeMouseInteraction();
this.element.removeClass("ui-draggable ui-draggable-disabled").removeData("ui-draggable").unbind(".draggable")},enable:function(){this.element.removeClass("ui-draggable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-draggable-disabled");this.disabled=true},recallOffset:function(D){var C={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};var B=this.helper.css("position")=="relative";this.originalPosition={left:(B?parseInt(this.helper.css("left"),10)||0:C.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(B?parseInt(this.helper.css("top"),10)||0:C.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};this.offset={left:this._pageX-this.originalPosition.left,top:this._pageY-this.originalPosition.top}},start:function(D){var E=this.options;if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=typeof E.helper=="function"?A(E.helper.apply(this.element[0],[D])):(E.helper=="clone"?this.element.clone().appendTo((E.appendTo=="parent"?this.element[0].parentNode:E.appendTo)):this.element);if(this.helper[0]!=this.element[0]){this.helper.css("position","absolute")}if(!this.helper.parents("body").length){this.helper.appendTo((E.appendTo=="parent"?this.element[0].parentNode:E.appendTo))}this.offsetParent=(function(F){while(F){if(F.style&&(/(absolute|relative|fixed)/).test(A.css(F,"position"))){return A(F)}F=F.parentNode?F.parentNode:null}return A("body")})(this.helper[0].parentNode);this.elementOffset=this.element.offset();this.offsetParentOffset=this.offsetParent.offset();var C={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};this._pageX=D.pageX;this._pageY=D.pageY;this.clickOffset={left:D.pageX-this.elementOffset.left,top:D.pageY-this.elementOffset.top};var B=this.helper.css("position")=="relative";this.originalPosition={left:(B?parseInt(this.helper.css("left"),10)||0:C.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(B?parseInt(this.helper.css("top"),10)||0:C.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};
if(this.element.css("position")=="fixed"){this.originalPosition.top-=this.offsetParent[0]==document.body?A(document).scrollTop():this.offsetParent[0].scrollTop;this.originalPosition.left-=this.offsetParent[0]==document.body?A(document).scrollLeft():this.offsetParent[0].scrollLeft}this.offset={left:D.pageX-this.originalPosition.left,top:D.pageY-this.originalPosition.top};this.propagate("start",D);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!E.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,D)}if(E.cursorAt){if(E.cursorAt.top!=undefined||E.cursorAt.bottom!=undefined){this.offset.top-=this.clickOffset.top-(E.cursorAt.top!=undefined?E.cursorAt.top:(this.helperProportions.height-E.cursorAt.bottom));this.clickOffset.top=(E.cursorAt.top!=undefined?E.cursorAt.top:(this.helperProportions.height-E.cursorAt.bottom))}if(E.cursorAt.left!=undefined||E.cursorAt.right!=undefined){this.offset.left-=this.clickOffset.left-(E.cursorAt.left!=undefined?E.cursorAt.left:(this.helperProportions.width-E.cursorAt.right));this.clickOffset.left=(E.cursorAt.left!=undefined?E.cursorAt.left:(this.helperProportions.width-E.cursorAt.right))}}return false},clear:function(){if(A.ui.ddmanager){A.ui.ddmanager.current=null}this.helper=null},stop:function(B){if(A.ui.ddmanager&&!this.options.dropBehaviour){A.ui.ddmanager.drop(this,B)}this.propagate("stop",B);if(this.cancelHelperRemoval){return false}if(this.options.helper!="original"){this.helper.remove()}this.clear();return false},drag:function(B){this.position={top:B.pageY-this.offset.top,left:B.pageX-this.offset.left};this.positionAbs={left:B.pageX-this.clickOffset.left,top:B.pageY-this.clickOffset.top};this.position=this.propagate("drag",B)||this.position;this.helper.css({left:this.position.left+"px",top:this.position.top+"px"});if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false}})})(jQuery);






/* jquery.flot.v06.js */
(function(C){function B(m,W,X,E){var O=[],g={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:0.85},xaxis:{mode:null,transform:null,inverseTransform:null,min:null,max:null,minmax:null,autoscaleMargin:null,ticks:null,tickFormatter:null,partialGrid:null,labelWidth:null,labelHeight:null,labelSpacing:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:false},yaxis:{autoscaleMargin:0.02},x2axis:{autoscaleMargin:null},y2axis:{autoscaleMargin:0.02},series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false},shadowSize:3},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,tickColor:"rgba(0,0,0,0.15)",labelMargin:4,borderWidth:2,borderColor:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},hooks:{}},P=null,AJ=null,AK=null,Y=null,AR=null,w={xaxis:{},yaxis:{},x2axis:{},y2axis:{}},e={left:0,right:0,top:0,bottom:0},AE=0,Q=0,I=0,x=0,L={processOptions:[],processRawData:[],processDatapoints:[],draw:[],bindEvents:[],drawOverlay:[]},G=this;
G.setData=f;G.setupGrid=l;G.draw=AO;G.getPlaceholder=function(){return m};G.getCanvas=function(){return P};G.getPlotOffset=function(){return e};G.width=function(){return I};G.height=function(){return x};G.offset=function(){var AS=AK.offset();AS.left+=e.left;AS.top+=e.top;return AS};G.getData=function(){return O};G.getAxes=function(){return w};G.getOptions=function(){return g};G.highlight=AL;G.unhighlight=AD;G.triggerRedrawOverlay=t;G.pointOffset=function(AS){return{left:parseInt(T(AS,"xaxis").p2c(+AS.x)+e.left),top:parseInt(T(AS,"yaxis").p2c(+AS.y)+e.top)}};G.offsetPoint=function(AV){var AT=AV.left,AS=AV.top,AU,AW={};if(AT==null&&AV.pageX!=null){AU=G.offset();AT=AV.pageX-AU.left}if(AT!=null){AW.x=w.xaxis.c2p(AT);if(w.x2axis.used){AW.x2=w.x2axis.c2p(AT)}}if(AS==null&&AV.pageY!=null){AU=AU||G.offset();AS=AV.pageY-AU.top}if(AS!=null){AW.y=w.yaxis.c2p(AS);if(w.y2axis.used){AW.y2=w.y2axis.c2p(AS)}}return AW};G.getXPosition=function(AS){return parseInt(w.xaxis.p2c(+AS)+e.left)};G.stopDrag=function(){var AS=m.data("flot.dragstate");if(AS&&AS[0]==2){m.data("flot.dragstate",[3]);return true}else{m.data("flot.dragstate",null);return false}};G.hooks=L;b(G);v(X);c();f(W);l();AO();AN();function Z(AU,AS){AS=[G].concat(AS);for(var AT=0;AT<AU.length;++AT){AU[AT].apply(this,AS)}}function b(){for(var AS=0;AS<E.length;++AS){var AT=E[AS];AT.init(G);if(AT.options){C.extend(true,g,AT.options)}}}function v(AS){C.extend(true,g,AS);if(g.grid.borderColor==null){g.grid.borderColor=g.grid.color}if(g.xaxis.noTicks&&g.xaxis.ticks==null){g.xaxis.ticks=g.xaxis.noTicks}if(g.yaxis.noTicks&&g.yaxis.ticks==null){g.yaxis.ticks=g.yaxis.noTicks}if(g.grid.coloredAreas){g.grid.markings=g.grid.coloredAreas}if(g.grid.coloredAreasColor){g.grid.markingsColor=g.grid.coloredAreasColor}if(g.lines){C.extend(true,g.series.lines,g.lines)}if(g.points){C.extend(true,g.series.points,g.points)}if(g.bars){C.extend(true,g.series.bars,g.bars)}if(g.shadowSize!=null){g.series.shadowSize=g.shadowSize}for(var AT in L){if(g.hooks[AT]&&g.hooks[AT].length){L[AT]=L[AT].concat(g.hooks[AT])
}}Z(L.processOptions,[g])}function f(AS){O=M(AS);U();n()}function M(AV){var AT=[];for(var AS=0;AS<AV.length;++AS){var AU=C.extend(true,{},g.series);if(AV[AS].data){AU.data=AV[AS].data;delete AV[AS].data;C.extend(true,AU,AV[AS]);AV[AS].data=AU.data}else{AU.data=AV[AS]}AT.push(AU)}return AT}function T(AU,AS){var AT=AU[AS];if(!AT||AT==1){return w[AS]}if(typeof AT=="number"){return w[AS.charAt(0)+AT+AS.slice(1)]}return AT}function U(){var AX;var Ad=O.length,AS=[],AV=[];for(AX=0;AX<O.length;++AX){var Aa=O[AX].color;if(Aa!=null){--Ad;if(typeof Aa=="number"){AV.push(Aa)}else{AS.push(C.color.parse(O[AX].color))}}}for(AX=0;AX<AV.length;++AX){Ad=Math.max(Ad,AV[AX]+1)}var AT=[],AW=0;AX=0;while(AT.length<Ad){var AZ;if(g.colors.length==AX){AZ=C.color.make(100,100,100)}else{AZ=C.color.parse(g.colors[AX])}var AU=AW%2==1?-1:1;AZ.scale("rgb",1+AU*Math.ceil(AW/2)*0.2);AT.push(AZ);++AX;if(AX>=g.colors.length){AX=0;++AW}}var AY=0,Ae;for(AX=0;AX<O.length;++AX){Ae=O[AX];if(Ae.color==null){Ae.color=AT[AY].toString();++AY}else{if(typeof Ae.color=="number"){Ae.color=AT[Ae.color].toString()}}if(Ae.lines.show==null){var Ac,Ab=true;for(Ac in Ae){if(Ae[Ac].show){Ab=false;break}}if(Ab){Ae.lines.show=true}}Ae.xaxis=T(Ae,"xaxis");Ae.yaxis=T(Ae,"yaxis")}}function n(){var Ae=Number.POSITIVE_INFINITY,AY=Number.NEGATIVE_INFINITY,Ak,Ai,Ah,Ad,AT,AZ,Aj,Af,AX,AW,AS,Aq,An,Ab;for(AS in w){w[AS].datamin=Ae;w[AS].datamax=AY;w[AS].used=false}function AV(At,As,Ar){if(As<At.datamin){At.datamin=As}if(Ar>At.datamax){At.datamax=Ar}}for(Ak=0;Ak<O.length;++Ak){AZ=O[Ak];AZ.datapoints={points:[]};Z(L.processRawData,[AZ,AZ.data,AZ.datapoints])}for(Ak=0;Ak<O.length;++Ak){AZ=O[Ak];var Ap=AZ.data,Am=AZ.datapoints.format;if(!Am){Am=[];Am.push({x:true,number:true,required:true});Am.push({y:true,number:true,required:true});if(AZ.bars.show){Am.push({y:true,number:true,required:false,defaultValue:0})}AZ.datapoints.format=Am}if(AZ.datapoints.pointsize!=null){continue}if(AZ.datapoints.pointsize==null){AZ.datapoints.pointsize=Am.length
}Af=AZ.datapoints.pointsize;Aj=AZ.datapoints.points;insertSteps=AZ.lines.show&&AZ.lines.steps;AZ.xaxis.used=AZ.yaxis.used=true;for(Ai=Ah=0;Ai<Ap.length;++Ai,Ah+=Af){Ab=Ap[Ai];var AU=Ab==null;if(!AU){for(Ad=0;Ad<Af;++Ad){Aq=Ab[Ad];An=Am[Ad];if(An){if(An.number&&Aq!=null){Aq=+Aq;if(isNaN(Aq)){Aq=null}}if(Aq==null){if(An.required){AU=true}if(An.defaultValue!=null){Aq=An.defaultValue}}}Aj[Ah+Ad]=Aq}}if(AU){for(Ad=0;Ad<Af;++Ad){Aq=Aj[Ah+Ad];if(Aq!=null){An=Am[Ad];if(An.x){AV(AZ.xaxis,Aq,Aq)}if(An.y){AV(AZ.yaxis,Aq,Aq)}}Aj[Ah+Ad]=null}}else{if(insertSteps&&Ah>0&&Aj[Ah-Af]!=null&&Aj[Ah-Af]!=Aj[Ah]&&Aj[Ah-Af+1]!=Aj[Ah+1]){for(Ad=0;Ad<Af;++Ad){Aj[Ah+Af+Ad]=Aj[Ah+Ad]}Aj[Ah+1]=Aj[Ah-Af+1];Ah+=Af}}}}for(Ak=0;Ak<O.length;++Ak){AZ=O[Ak];Z(L.processDatapoints,[AZ,AZ.datapoints])}for(Ak=0;Ak<O.length;++Ak){AZ=O[Ak];Aj=AZ.datapoints.points,Af=AZ.datapoints.pointsize;var Aa=Ae,Ag=Ae,Ac=AY,Al=AY;for(Ai=0;Ai<Aj.length;Ai+=Af){if(Aj[Ai]==null){continue}for(Ad=0;Ad<Af;++Ad){Aq=Aj[Ai+Ad];An=Am[Ad];if(!An){continue}if(An.x){if(Aq<Aa){Aa=Aq}if(Aq>Ac){Ac=Aq}}if(An.y){if(Aq<Ag){Ag=Aq}if(Aq>Al){Al=Aq}}}}if(AZ.bars.show){var Ao=AZ.bars.align=="left"?0:-AZ.bars.barWidth/2;if(AZ.bars.horizontal){Ag+=Ao;Al+=Ao+AZ.bars.barWidth}else{Aa+=Ao;Ac+=Ao+AZ.bars.barWidth}}AV(AZ.xaxis,Aa,Ac);AV(AZ.yaxis,Ag,Al)}for(AS in w){if(w[AS].datamin==Ae){w[AS].datamin=null}if(w[AS].datamax==AY){w[AS].datamax=null}}}function c(){function AS(AU,AT){var AV=document.createElement("canvas");AV.width=AU;AV.height=AT;if(C.browser.msie){AV=window.G_vmlCanvasManager.initElement(AV)}return AV}AE=g.targetWidth||m.width();Q=g.targetHeight||m.height();m.html("");if(AE<=0||Q<=0){throw"Invalid dimensions for plot, width = "+AE+", height = "+Q}if(C.browser.msie){window.G_vmlCanvasManager.init_(document)}P=C(AS(AE,Q)).appendTo(m).get(0);Y=P.getContext("2d");if(!g.noOverlay){AJ=C(AS(AE,Q)).css({position:"absolute",left:0,top:0,zIndex:2}).appendTo(m).get(0);AR=AJ.getContext("2d");AR.stroke()}}function AN(){AK=C([AJ,P]);if(g.grid.hoverable||g.grid.draggable){AK.mousemove(D)
}if(g.grid.clickable){AK.click(d)}if(g.grid.draggable){AK.mousedown(AI).mouseup(AQ)}Z(L.bindEvents,[AK])}function l(){function AT(Ab,Ac){function AX(Ad){return Ad}var Aa,AW,AY=Ac.transform||AX,AZ=Ac.inverseTransform;if(Ab==w.xaxis||Ab==w.x2axis){Aa=Ab.scale=I/(AY(Ab.max)-AY(Ab.min));AW=AY(Ab.min);if(AY==AX){Ab.p2c=function(Ad){return(Ad-AW)*Aa}}else{Ab.p2c=function(Ad){return(AY(Ad)-AW)*Aa}}if(!AZ){Ab.c2p=function(Ad){return AW+Ad/Aa}}else{Ab.c2p=function(Ad){return AZ(AW+Ad/Aa)}}}else{Aa=Ab.scale=x/(AY(Ab.max)-AY(Ab.min));AW=AY(Ab.max);if(AY==AX){Ab.p2c=function(Ad){return(AW-Ad)*Aa}}else{Ab.p2c=function(Ad){return(AW-AY(Ad))*Aa}}if(!AZ){Ab.c2p=function(Ad){return AW-Ad/Aa}}else{Ab.c2p=function(Ad){return AZ(AW-Ad/Aa)}}}}function AV(AZ,Ab){var AY,Aa=[],AX;AZ.labelWidth=Ab.labelWidth;AZ.labelHeight=Ab.labelHeight;if(AZ==w.xaxis||AZ==w.x2axis){if(AZ.labelWidth==null){AZ.labelWidth=AE/(AZ.ticks.length>0?AZ.ticks.length:1)}if(AZ.labelHeight==null){Aa=[];for(AY=0;AY<AZ.ticks.length;++AY){AX=AZ.ticks[AY].label;if(AX){Aa.push('<div class="tickLabel" style="float:left;width:'+AZ.labelWidth+'px">'+AX+"</div>")}}if(Aa.length>0){var AW=C('<div style="position:absolute;top:-10000px;width:10000px;font-size:smaller">'+Aa.join("")+'<div style="clear:left"></div></div>').appendTo(m);AZ.labelHeight=AW.height();AW.remove()}}}else{if(AZ.labelWidth==null||AZ.labelHeight==null){for(AY=0;AY<AZ.ticks.length;++AY){AX=AZ.ticks[AY].label;if(AX){Aa.push('<div class="tickLabel">'+AX+"</div>")}}if(Aa.length>0){var AW=C('<div style="position:absolute;top:-10000px;font-size:smaller">'+Aa.join("")+"</div>").appendTo(m);if(AZ.labelWidth==null){AZ.labelWidth=AW.width()}if(AZ.labelHeight==null){AZ.labelHeight=AW.find("div").height()}AW.remove()}}}if(AZ.labelWidth==null){AZ.labelWidth=0}if(AZ.labelHeight==null){AZ.labelHeight=0}}function AU(){var AW,AY=g.grid.borderWidth;for(AW=0;AW<O.length;++AW){AY=Math.max(AY,2*(O[AW].points.radius+O[AW].points.lineWidth/2))}e.left=e.right=e.top=e.bottom=AY;var AX=g.grid.labelMargin+g.grid.borderWidth;
AW=(g.xaxis.labelSpacing==null?w.xaxis.labelHeight:g.xaxis.labelSpacing);if(AW>0){e.bottom=Math.max(AY,AW+AX)}AW=(g.yaxis.labelSpacing==null?w.yaxis.labelWidth:g.yaxis.labelSpacing);if(AW>0){e.left=Math.max(AY,AW+AX)}AW=(g.x2axis.labelSpacing==null?w.x2axis.labelHeight:g.x2axis.labelSpacing);if(AW>0){e.top=Math.max(AY,AW+AX)}AW=(g.y2axis.labelSpacing==null?w.y2axis.labelWidth:g.y2axis.labelSpacing);if(AW>0){e.right=Math.max(AY,AW+AX)}I=AE-e.left-e.right;x=Q-e.bottom-e.top}var AS;for(AS in w){K(w[AS],g[AS])}if(g.grid.show){for(AS in w){F(w[AS],g[AS]);s(w[AS],g[AS]);AV(w[AS],g[AS])}AU()}else{e.left=e.right=e.top=e.bottom=0;I=AE;x=Q}for(AS in w){AT(w[AS],g[AS])}if(g.grid.show){h()}AP()}function K(AV,AY){var AU=+(AY.min!=null?AY.min:AV.datamin),AS=+(AY.max!=null?AY.max:AV.datamax),AX=AS-AU;if(AX==0){var AT=AS==0?1:0.01;if(AY.min==null){AU-=AT}if(AY.max==null||AY.min!=null){AS+=AT}}else{var AW=AY.autoscaleMargin;if(AW!=null){if(AY.min==null){AU-=AX*AW;if(AU<0&&AV.datamin!=null&&AV.datamin>=0){AU=0}}if(AY.max==null){AS+=AX*AW;if(AS>0&&AV.datamax!=null&&AV.datamax<=0){AS=0}}}}if(AY.minmax!=null&&AS<AY.minmax){AS=AY.minmax}AV.min=AU;AV.max=AS}function p(AV){var AT,AS,AW,AU;if(typeof Mkiconf!=="undefined"&&(AS=Mkiconf.tz)){AU=AV.getTime()/1000;for(AT=AS.length-1;AT>=0;--AT){AW=AS[AT];if(AW[0]==null||AW[0]<=AU||AT==0){return -AW[2]/60}}}return AV.getTimezoneOffset()}function F(AX,Aa){var AW;if(typeof Aa.ticks=="number"&&Aa.ticks>0){AW=Aa.ticks}else{if(AX==w.xaxis||AX==w.x2axis){AW=0.3*Math.sqrt(AE)}else{AW=0.3*Math.sqrt(Q)}}var Af=(AX.max-AX.min)/AW,Ah,Ab,Ad,Ae,AZ,AU,AT;if(Aa.mode=="time"){var Ac={second:1000,minute:60*1000,hour:60*60*1000,day:24*60*60*1000,month:30*24*60*60*1000,year:365.2425*24*60*60*1000};var Ag=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[0.25,"month"],[0.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];
var AV=0;if(Aa.minTickSize!=null){if(typeof Aa.tickSize=="number"){AV=Aa.tickSize}else{AV=Aa.minTickSize[0]*Ac[Aa.minTickSize[1]]}}for(AZ=0;AZ<Ag.length-1;++AZ){if(Af<(Ag[AZ][0]*Ac[Ag[AZ][1]]+Ag[AZ+1][0]*Ac[Ag[AZ+1][1]])/2&&Ag[AZ][0]*Ac[Ag[AZ][1]]>=AV){break}}Ah=Ag[AZ][0];Ad=Ag[AZ][1];if(Ad=="year"){AU=Math.pow(10,Math.floor(Math.log(Af/Ac.year)/Math.LN10));AT=(Af/Ac.year)/AU;if(AT<1.5){Ah=1}else{if(AT<3){Ah=2}else{if(AT<7.5){Ah=5}else{Ah=10}}}Ah*=AU}if(Aa.tickSize){Ah=Aa.tickSize[0];Ad=Aa.tickSize[1]}Ab=function(Am){var At=[],Aq=Am.tickSize[0],Au=Am.tickSize[1],Ar=new Date(Am.min);var Al=Aq*Ac[Au];if(Au=="second"){Ar.setUTCSeconds(A(Ar.getUTCSeconds(),Aq))}if(Au=="minute"){Ar.setUTCMinutes(A(Ar.getUTCMinutes(),Aq))}if(Au=="hour"){Ar.setUTCHours(A(Ar.getUTCHours(),Aq))}if(Au=="month"){Ar.setUTCMonth(A(Ar.getUTCMonth(),Aq))}if(Au=="year"){Ar.setUTCFullYear(A(Ar.getUTCFullYear(),Aq))}Ar.setUTCMilliseconds(0);if(Al>=Ac.minute){Ar.setUTCSeconds(0)}if(Al>=Ac.hour){Ar.setUTCMinutes(0)}if(Al>=Ac.day){Ar.setUTCHours(0)}if(Al>=Ac.day*4){Ar.setUTCDate(1)}if(Al>=Ac.year){Ar.setUTCMonth(0)}if(Aa.timezoneOffset===true&&p(Ar)>0){if(Al<=4*Ac.hour){Ar.setTime(Ar.getTime()-Al*Math.ceil(12*Ac.hour/Al))}else{if(Al<=3*Ac.day){Ar.setTime(Ar.getTime()-3*Al)}}}var Aw=0,Av=Number.NaN,An;var Aj,Ap,As=0,Ak=0;while(1){Av=Aj=Ar.getTime();if(Aa.timezoneOffset===true){Ap=p(new Date(Av+Ak))*60000;if(Ap!==As){Ak+=Ap-As}As=Ap;Aj+=Ak}else{if(Aa.timezoneOffset){Aj+=Aa.timezoneOffset*60000}}if(Aj>Am.max||Aj===An){break}if(Aj>=Am.min){At.push({v:Aj,label:Am.tickFormatter(Av,Am)})}An=Aj;if(Au=="month"){if(Aq<1){Ar.setUTCDate(1);var Ai=Ar.getTime();Ar.setUTCMonth(Ar.getUTCMonth()+1);var Ao=Ar.getTime();Ar.setTime(Av+Aw*Ac.hour+(Ao-Ai)*Aq);Aw=Ar.getUTCHours();Ar.setUTCHours(0)}else{Ar.setUTCMonth(Ar.getUTCMonth()+Aq)}}else{if(Au=="year"){Ar.setUTCFullYear(Ar.getUTCFullYear()+Aq)}else{Ar.setTime(Av+Al)}}}return At};Ae=function(Ai,Al){var An=new Date(Ai);if(Aa.timeformat!=null){return C.plot.formatDate(An,Aa.timeformat,Aa.monthNames)
}var Aj=Al.tickSize[0]*Ac[Al.tickSize[1]];var Ak=Al.max-Al.min;var Am=(Aa.twelveHourClock)?" %p":"";if(Aj<Ac.minute){fmt="%h:%M:%S"+Am}else{if(Aj<Ac.day){if(Ak>=2*Ac.day){fmt="%b %d %h:%M"+Am}else{if(Ak>4*Ac.hour&&An.getUTCHours()==0&&An.getUTCMinutes()==0){fmt="%b %d"}else{fmt="%h:%M"+Am}}}else{if(Aj<Ac.month){fmt="%b %d"}else{if(Aj<Ac.year){if(Ak<Ac.year){fmt="%b"}else{fmt="%b %y"}}else{fmt="%y"}}}}return C.plot.formatDate(An,fmt,Aa.monthNames)}}else{var AS=Aa.tickDecimals;var AY=-Math.floor(Math.log(Af)/Math.LN10);if(AS!=null&&AY>AS){AY=AS}AU=Math.pow(10,-AY);AT=Af/AU;if(AT<1.5){Ah=1}else{if(AT<3){Ah=2;if(AT>2.25&&(AS==null||AY+1<=AS)){Ah=2.5;++AY}}else{if(AT<7.5){Ah=5}else{Ah=10}}}Ah*=AU;if(Aa.minTickSize!=null&&Ah<Aa.minTickSize){Ah=Aa.minTickSize}if(Aa.tickSize!=null){Ah=Aa.tickSize}AX.tickDecimals=Math.max(0,(AS!=null)?AS:AY);Ab=function(Ak){var Am=[];var An=A(Ak.min,Ak.tickSize),Aj=0,Ai=Number.NaN,Al;do{Al=Ai;Ai=An+Aj*Ak.tickSize;Am.push({v:Ai,label:Ak.tickFormatter(Ai,Ak)});++Aj}while(Ai<Ak.max&&Ai!=Al);return Am};Ae=function(Ai,Aj){return Ai.toFixed(Aj.tickDecimals)}}AX.tickSize=Ad?[Ah,Ad]:Ah;AX.tickGenerator=Ab;if(C.isFunction(Aa.tickFormatter)){AX.tickFormatter=function(Ai,Aj){return""+Aa.tickFormatter(Ai,Aj)}}else{AX.tickFormatter=Ae}}function s(AW,AY){AW.ticks=[];if(!AW.used&&!AY.used){return }if(AY.ticks==null){AW.ticks=AW.tickGenerator(AW)}else{if(typeof AY.ticks=="number"){if(AY.ticks>0){AW.ticks=AW.tickGenerator(AW)}}else{if(AY.ticks){var AX=AY.ticks;if(C.isFunction(AX)){AX=AX({min:AW.min,max:AW.max})}var AV,AS;for(AV=0;AV<AX.length;++AV){var AT=null;var AU=AX[AV];if(typeof AU=="object"){AS=AU[0];if(AU.length>1){AT=AU[1]}}else{AS=AU}if(AT==null){AT=AW.tickFormatter(AS,AW)}AW.ticks[AV]={v:AS,label:AT}}}}}if(AY.autoscaleMargin!=null&&AW.ticks.length>0){if(AY.min==null){AW.min=Math.min(AW.min,AW.ticks[0].v)}if(AY.max==null&&AW.ticks.length>1){AW.max=Math.max(AW.max,AW.ticks[AW.ticks.length-1].v)}}}function AO(){Y.clearRect(0,0,AE,Q);Y.save();Y.translate(e.left,e.top);
var AU=g.grid,AS;if(AU.show){u()}if(AU.show&&!AU.aboveData){AS=S()}for(var AT=0;AT<O.length;++AT){AG(O[AT])}if(AU.show&&AU.aboveData){S()}else{if(AS){z(AS,"top")}}if(AU.show){o()}Y.restore();Z(L.draw,[Y])}function N(AT,AZ){var AW=AZ+"axis",AS=AZ+"2axis",AV,AY,AX,AU;if(AT[AW]){AV=w[AW];AY=AT[AW].from;AX=AT[AW].to}else{if(AT[AS]){AV=w[AS];AY=AT[AS].from;AX=AT[AS].to}else{AV=w[AW];AY=AT[AZ+"1"];AX=AT[AZ+"2"]}}if(AY!=null&&AX!=null&&AY>AX){return{from:AX,to:AY,axis:AV}}return{from:AY,to:AX,axis:AV}}function z(AT,AY){var AW,AU=[];if(C.isFunction(AT)){AT=AT({xmin:w.xaxis.min,xmax:w.xaxis.max,ymin:w.yaxis.min,ymax:w.yaxis.max,xaxis:w.xaxis,yaxis:w.yaxis,x2axis:w.x2axis,y2axis:w.y2axis})||[]}for(AW=0;AW<AT.length;++AW){var AS=AT[AW],AX=N(AS,"x"),AV=N(AS,"y");if(AX.from==null){AX.from=AX.axis.min}if(AX.to==null){AX.to=AX.axis.max}if(AV.from==null){AV.from=AV.axis.min}if(AV.to==null){AV.to=AV.axis.max}if(AX.to<AX.axis.min||AX.from>AX.axis.max||AV.to<AV.axis.min||AV.from>AV.axis.max){continue}if(AS.mode&&AY&&AS.mode!=AY){AU.push(AS);continue}AX.from=Math.max(AX.from,AX.axis.min);AX.to=Math.min(AX.to,AX.axis.max);AV.from=Math.max(AV.from,AV.axis.min);AV.to=Math.min(AV.to,AV.axis.max);if(AX.from==AX.to&&AV.from==AV.to){continue}AX.from=AX.axis.p2c(AX.from);AX.to=AX.axis.p2c(AX.to);AV.from=AV.axis.p2c(AV.from);AV.to=AV.axis.p2c(AV.to);if(AX.from==AX.to||AV.from==AV.to){Y.beginPath();Y.strokeStyle=AS.color||g.grid.markingsColor;Y.lineWidth=AS.lineWidth||g.grid.markingsLineWidth;Y.moveTo(AX.from,AV.from);Y.lineTo(AX.to,AV.to);Y.stroke()}else{Y.fillStyle=AS.color||g.grid.markingsColor;Y.fillRect(AX.from,AV.to,AX.to-AX.from,AV.from-AV.to)}}return AU.length?AU:null}function u(){if(g.grid.backgroundColor){Y.fillStyle=R(g.grid.backgroundColor,x,0,"rgba(255, 255, 255, 0)");Y.fillRect(0,0,I,x)}}function S(){var AU;var AS=g.grid.markings;if(AS){AS=z(AS,g.grid.aboveData?null:"bottom")}Y.lineWidth=1;Y.strokeStyle=g.grid.tickColor;Y.beginPath();var AT,AV=w.xaxis;for(AU=0;AU<AV.ticks.length;++AU){AT=AV.ticks[AU].v;
if(AT<=AV.min||AT>=w.xaxis.max){continue}AT=Math.floor(AV.p2c(AT))+Y.lineWidth/2;Y.moveTo(AT,0);if(g.xaxis.partialGrid&&x>10){Y.lineTo(AT,5);Y.moveTo(AT,x-5)}Y.lineTo(AT,x)}AV=w.yaxis;for(AU=0;AU<AV.ticks.length;++AU){AT=AV.ticks[AU].v;if(AT<=AV.min||AT>=AV.max){continue}AT=Math.floor(AV.p2c(AT))+Y.lineWidth/2;Y.moveTo(0,AT);if(g.yaxis.partialGrid&&I>10){Y.lineTo(5,AT);Y.moveTo(I-5,AT)}Y.lineTo(I,AT)}AV=w.x2axis;for(AU=0;AU<AV.ticks.length;++AU){AT=AV.ticks[AU].v;if(AT<=AV.min||AT>=AV.max){continue}Y.moveTo(Math.floor(AV.p2c(AT))+Y.lineWidth/2,-5);Y.moveTo(Math.floor(AV.p2c(AT))+Y.lineWidth/2,-5);Y.lineTo(Math.floor(AV.p2c(AT))+Y.lineWidth/2,5)}AV=w.y2axis;for(AU=0;AU<AV.ticks.length;++AU){AT=AV.ticks[AU].v;if(AT<=AV.min||AT>=AV.max){continue}Y.moveTo(I-5,Math.floor(AV.p2c(AT))+Y.lineWidth/2);Y.lineTo(I+5,Math.floor(AV.p2c(AT))+Y.lineWidth/2)}Y.stroke();return AS}function o(){if(g.grid.borderWidth){var AS=g.grid.borderWidth;Y.lineWidth=AS;Y.lineJoin="round";Y.strokeStyle=g.grid.borderColor;Y.strokeRect(-AS/2,-AS/2,I+AS,x+AS)}}function h(){m.find(".tickLabels").remove();var AS=[];function AU(AX,AY){for(var AW=0;AW<AX.ticks.length;++AW){var AV=AX.ticks[AW];if(!AV.label||AV.v<AX.min||AV.v>AX.max){continue}AS.push(AY(AV,AX))}}var AT=g.grid.labelMargin+g.grid.borderWidth;AU(w.xaxis,function(AV,AW){return'<div style="position:absolute;top:'+(e.top+x+AT)+"px;left:"+Math.round(e.left+AW.p2c(AV.v)-AW.labelWidth/2)+"px;width:"+AW.labelWidth+'px;text-align:center" class="tickLabel">'+AV.label+"</div>"});AU(w.yaxis,function(AV,AW){return'<div style="position:absolute;top:'+Math.round(e.top+AW.p2c(AV.v)-AW.labelHeight/2)+"px;right:"+(e.right+I+AT)+"px;width:"+AW.labelWidth+'px;text-align:right" class="tickLabel">'+AV.label+"</div>"});AU(w.x2axis,function(AV,AW){return'<div style="position:absolute;bottom:'+(e.bottom+x+AT)+"px;left:"+Math.round(e.left+AW.p2c(AV.v)-AW.labelWidth/2)+"px;width:"+AW.labelWidth+'px;text-align:center" class="tickLabel">'+AV.label+"</div>"});AU(w.y2axis,function(AV,AW){return'<div style="position:absolute;top:'+Math.round(e.top+AW.p2c(AV.v)-AW.labelHeight/2)+"px;left:"+(e.left+I+AT)+"px;width:"+AW.labelWidth+'px;text-align:left" class="tickLabel">'+AV.label+"</div>"
});AS=AS.join("");if(AS!==""){AS='<div class="tickLabels" style="font-size:smaller;color:'+g.grid.color+'">'+AS+"</div>";m.append(AS)}}function AG(AS){if(AS.lines.show){a(AS)}if(AS.bars.show){q(AS)}if(AS.points.show){r(AS)}}function a(AV){function AU(Ag,Ah,AZ,Al,Ak){var Am=Ag.points,Aa=Ag.pointsize,Ae=null,Ad=null;Y.beginPath();for(var Af=Aa;Af<Am.length;Af+=Aa){var Ac=Am[Af-Aa],Aj=Am[Af-Aa+1],Ab=Am[Af],Ai=Am[Af+1];if(Ac==null||Ab==null){continue}if(Aj<=Ai&&Aj<Ak.min){if(Ai<Ak.min){continue}Ac=(Ak.min-Aj)/(Ai-Aj)*(Ab-Ac)+Ac;Aj=Ak.min}else{if(Ai<=Aj&&Ai<Ak.min){if(Aj<Ak.min){continue}Ab=(Ak.min-Aj)/(Ai-Aj)*(Ab-Ac)+Ac;Ai=Ak.min}}if(Aj>=Ai&&Aj>Ak.max){if(Ai>Ak.max){continue}Ac=(Ak.max-Aj)/(Ai-Aj)*(Ab-Ac)+Ac;Aj=Ak.max}else{if(Ai>=Aj&&Ai>Ak.max){if(Aj>Ak.max){continue}Ab=(Ak.max-Aj)/(Ai-Aj)*(Ab-Ac)+Ac;Ai=Ak.max}}if(Ac<=Ab&&Ac<Al.min){if(Ab<Al.min){continue}Aj=(Al.min-Ac)/(Ab-Ac)*(Ai-Aj)+Aj;Ac=Al.min}else{if(Ab<=Ac&&Ab<Al.min){if(Ac<Al.min){continue}Ai=(Al.min-Ac)/(Ab-Ac)*(Ai-Aj)+Aj;Ab=Al.min}}if(Ac>=Ab&&Ac>Al.max){if(Ab>Al.max){continue}Aj=(Al.max-Ac)/(Ab-Ac)*(Ai-Aj)+Aj;Ac=Al.max}else{if(Ab>=Ac&&Ab>Al.max){if(Ac>Al.max){continue}Ai=(Al.max-Ac)/(Ab-Ac)*(Ai-Aj)+Aj;Ab=Al.max}}if(Ac!=Ae||Aj!=Ad){Y.moveTo(Al.p2c(Ac)+Ah,Ak.p2c(Aj)+AZ)}Ae=Ab;Ad=Ai;Y.lineTo(Al.p2c(Ab)+Ah,Ak.p2c(Ai)+AZ)}Y.stroke()}function AW(Af,Am,Ak){var An=Af.points,AZ=Af.pointsize,Aa=Math.min(Math.max(0,Ak.min),Ak.max),Ai,Ad=0,Al=false;for(var Ae=AZ;Ae<An.length;Ae+=AZ){var Ac=An[Ae-AZ],Aj=An[Ae-AZ+1],Ab=An[Ae],Ah=An[Ae+1];if(Al&&Ac!=null&&Ab==null){Y.lineTo(Am.p2c(Ad),Ak.p2c(Aa));Y.fill();Al=false;continue}if(Ac==null||Ab==null){continue}if(Ac<=Ab&&Ac<Am.min){if(Ab<Am.min){continue}Aj=(Am.min-Ac)/(Ab-Ac)*(Ah-Aj)+Aj;Ac=Am.min}else{if(Ab<=Ac&&Ab<Am.min){if(Ac<Am.min){continue}Ah=(Am.min-Ac)/(Ab-Ac)*(Ah-Aj)+Aj;Ab=Am.min}}if(Ac>=Ab&&Ac>Am.max){if(Ab>Am.max){continue}Aj=(Am.max-Ac)/(Ab-Ac)*(Ah-Aj)+Aj;Ac=Am.max}else{if(Ab>=Ac&&Ab>Am.max){if(Ac>Am.max){continue}Ah=(Am.max-Ac)/(Ab-Ac)*(Ah-Aj)+Aj;Ab=Am.max}}if(!Al){Y.beginPath();
Y.moveTo(Am.p2c(Ac),Ak.p2c(Aa));Al=true}if(Aj>=Ak.max&&Ah>=Ak.max){Y.lineTo(Am.p2c(Ac),Ak.p2c(Ak.max));Y.lineTo(Am.p2c(Ab),Ak.p2c(Ak.max));Ad=Ab;continue}else{if(Aj<=Ak.min&&Ah<=Ak.min){Y.lineTo(Am.p2c(Ac),Ak.p2c(Ak.min));Y.lineTo(Am.p2c(Ab),Ak.p2c(Ak.min));Ad=Ab;continue}}var Ao=Ac,Ag=Ab;if(Aj<=Ah&&Aj<Ak.min&&Ah>=Ak.min){Ac=(Ak.min-Aj)/(Ah-Aj)*(Ab-Ac)+Ac;Aj=Ak.min}else{if(Ah<=Aj&&Ah<Ak.min&&Aj>=Ak.min){Ab=(Ak.min-Aj)/(Ah-Aj)*(Ab-Ac)+Ac;Ah=Ak.min}}if(Aj>=Ah&&Aj>Ak.max&&Ah<=Ak.max){Ac=(Ak.max-Aj)/(Ah-Aj)*(Ab-Ac)+Ac;Aj=Ak.max}else{if(Ah>=Aj&&Ah>Ak.max&&Aj<=Ak.max){Ab=(Ak.max-Aj)/(Ah-Aj)*(Ab-Ac)+Ac;Ah=Ak.max}}if(Ac!=Ao){if(Aj<=Ak.min){Ai=Ak.min}else{Ai=Ak.max}Y.lineTo(Am.p2c(Ao),Ak.p2c(Ai));Y.lineTo(Am.p2c(Ac),Ak.p2c(Ai))}Y.lineTo(Am.p2c(Ac),Ak.p2c(Aj));Y.lineTo(Am.p2c(Ab),Ak.p2c(Ah));if(Ab!=Ag){if(Ah<=Ak.min){Ai=Ak.min}else{Ai=Ak.max}Y.lineTo(Am.p2c(Ab),Ak.p2c(Ai));Y.lineTo(Am.p2c(Ag),Ak.p2c(Ai))}Ad=Math.max(Ab,Ag)}if(Al){Y.lineTo(Am.p2c(Ad),Ak.p2c(Aa));Y.fill()}}Y.lineJoin="round";var AX=AV.lines.lineWidth,AS=AV.shadowSize;if(AX>0&&AS>0){Y.lineWidth=AS;Y.strokeStyle="rgba(0,0,0,0.1)";var AY=Math.PI/18;AU(AV.datapoints,Math.sin(AY)*(AX/2+AS/2),Math.cos(AY)*(AX/2+AS/2),AV.xaxis,AV.yaxis);Y.lineWidth=AS/2;AU(AV.datapoints,Math.sin(AY)*(AX/2+AS/4),Math.cos(AY)*(AX/2+AS/4),AV.xaxis,AV.yaxis)}Y.lineWidth=AX;Y.strokeStyle=AV.color;var AT=V(AV.lines,AV.color,0,x);if(AT){Y.fillStyle=AT;AW(AV.datapoints,AV.xaxis,AV.yaxis)}if(AX>0){AU(AV.datapoints,0,0,AV.xaxis,AV.yaxis)}}function r(AV){function AX(Ac,Ab,Aj,AZ,Ad,Ah,Ag){var Ai=Ac.points,AY=Ac.pointsize;for(var Aa=0;Aa<Ai.length;Aa+=AY){var Af=Ai[Aa],Ae=Ai[Aa+1];if(Af==null||Af<Ah.min||Af>Ah.max||Ae<Ag.min||Ae>Ag.max){continue}Y.beginPath();Y.arc(Ah.p2c(Af),Ag.p2c(Ae)+AZ,Ab,0,Ad,false);if(Aj){Y.fillStyle=Aj;Y.fill()}Y.stroke()}}var AW=AV.lines.lineWidth,AT=AV.shadowSize,AS=AV.points.radius;if(AW>0&&AT>0){var AU=AT/2;Y.lineWidth=AU;Y.strokeStyle="rgba(0,0,0,0.1)";AX(AV.datapoints,AS,null,AU+AU/2,Math.PI,AV.xaxis,AV.yaxis);Y.strokeStyle="rgba(0,0,0,0.2)";
AX(AV.datapoints,AS,null,AU/2,Math.PI,AV.xaxis,AV.yaxis)}Y.lineWidth=AW;Y.strokeStyle=AV.color;AX(AV.datapoints,AS,V(AV.points,AV.color),0,2*Math.PI,AV.xaxis,AV.yaxis)}function AH(Ad,Ac,Al,AY,Ag,AV,AT,Ab,Aa,Ak,Ah){var AU,Aj,AZ,Af,AW,AS,Ae,AX,Ai;if(Ah){AX=AS=Ae=true;AW=false;AU=Al;Aj=Ad;Af=Ac+AY;AZ=Ac+Ag;if(Aj<AU){Ai=Aj;Aj=AU;AU=Ai;AW=true;AS=false}}else{AW=AS=Ae=true;AX=false;AU=Ad+AY;Aj=Ad+Ag;AZ=Al;Af=Ac;if(Af<AZ){Ai=Af;Af=AZ;AZ=Ai;AX=true;Ae=false}}if(Aj<Ab.min||AU>Ab.max||Af<Aa.min||AZ>Aa.max){return }if(AU<Ab.min){AU=Ab.min;AW=false}if(Aj>Ab.max){Aj=Ab.max;AS=false}if(AZ<Aa.min){AZ=Aa.min;AX=false}if(Af>Aa.max){Af=Aa.max;Ae=false}AU=Ab.p2c(AU);AZ=Aa.p2c(AZ);Aj=Ab.p2c(Aj);Af=Aa.p2c(Af);if(AT){Ak.beginPath();Ak.moveTo(AU,AZ);Ak.lineTo(AU,Af);Ak.lineTo(Aj,Af);Ak.lineTo(Aj,AZ);Ak.fillStyle=AT(AZ,Af);Ak.fill()}if(AW||AS||Ae||AX){Ak.beginPath();Ak.moveTo(AU,AZ+AV);if(AW){Ak.lineTo(AU,Af+AV)}else{Ak.moveTo(AU,Af+AV)}if(Ae){Ak.lineTo(Aj,Af+AV)}else{Ak.moveTo(Aj,Af+AV)}if(AS){Ak.lineTo(Aj,AZ+AV)}else{Ak.moveTo(Aj,AZ+AV)}if(AX){Ak.lineTo(AU,AZ+AV)}else{Ak.moveTo(AU,AZ+AV)}Ak.stroke()}}function q(AU){function AT(Aa,AZ,Ac,AX,Ab,Ae,Ad){var Af=Aa.points,AW=Aa.pointsize;for(var AY=0;AY<Af.length;AY+=AW){if(Af[AY]==null){continue}AH(Af[AY],Af[AY+1],Af[AY+2],AZ,Ac,AX,Ab,Ae,Ad,Y,AU.bars.horizontal)}}Y.lineWidth=AU.bars.lineWidth;Y.strokeStyle=AU.color;var AS=AU.bars.align=="left"?0:-AU.bars.barWidth/2;var AV=AU.bars.fill?function(AW,AX){return V(AU.bars,AU.color,AW,AX)}:null;AT(AU.datapoints,AS,AS+AU.bars.barWidth,0,AV,AU.xaxis,AU.yaxis)}function V(AU,AS,AT,AW){var AV=AU.fill;if(!AV){return null}if(AU.fillColor){return R(AU.fillColor,AT,AW,AS)}var AX=C.color.parse(AS);AX.a=typeof AV=="number"?AV:0.4;AX.normalize();return AX.toString()}function AP(){m.find(".legend").remove();if(!g.legend.show){return }var AX=[],AV=false,Ad=g.legend.labelFormatter,Ac,AZ;for(i=0;i<O.length;++i){Ac=O[i];AZ=Ac.label;if(!AZ){continue}if(i%g.legend.noColumns==0){if(AV){AX.push("</tr>")}AX.push("<tr>");AV=true
}if(Ad){AZ=Ad(AZ,Ac)}AX.push('<td class="legendColorBox"><div style="border:1px solid '+g.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+Ac.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+AZ+"</td>")}if(AV){AX.push("</tr>")}if(AX.length==0){return }var Ab='<table style="font-size:smaller;color:'+g.grid.color+'">'+AX.join("")+"</table>";if(g.legend.container!=null){C(g.legend.container).html(Ab)}else{var AY="",AT=g.legend.position,AU=g.legend.margin;if(AU[0]==null){AU=[AU,AU]}if(AT.charAt(0)=="n"){AY+="top:"+(AU[1]+e.top)+"px;"}else{if(AT.charAt(0)=="s"){AY+="bottom:"+(AU[1]+e.bottom)+"px;"}}if(AT.charAt(1)=="e"){AY+="right:"+(AU[0]+e.right)+"px;"}else{if(AT.charAt(1)=="w"){AY+="left:"+(AU[0]+e.left)+"px;"}}var Aa=C('<div class="legend">'+Ab.replace('style="','style="position:absolute;'+AY+";")+"</div>").appendTo(m);if(g.legend.backgroundOpacity!=0){var AW=g.legend.backgroundColor;if(AW==null){AW=g.grid.backgroundColor;if(AW&&typeof AW=="string"){AW=C.color.parse(AW)}else{AW=C.color.extract(Aa,"background-color")}AW.a=1;AW=AW.toString()}var AS=Aa.children();C('<div style="position:absolute;width:'+AS.width()+"px;height:"+AS.height()+"px;"+AY+"background-color:"+AW+';"> </div>').prependTo(Aa).css("opacity",g.legend.backgroundOpacity)}}}var AC=[],J=null;function AM(AZ,AX,AU){var Af=g.grid.mouseActiveRadius,Ar=Af*Af+1,Ap=null,Ai=false,An,Al;for(An=0;An<O.length;++An){if(!AU(O[An])){continue}var Ag=O[An],AY=Ag.xaxis,AW=Ag.yaxis,Am=Ag.datapoints.points,Ak=Ag.datapoints.pointsize,Ah=AY.c2p(AZ),Ae=AW.c2p(AX),AT=Af/AY.scale,AS=Af/AW.scale;if(Ag.lines.show||Ag.points.show){for(Al=0;Al<Am.length;Al+=Ak){var Ab=Am[Al],Aa=Am[Al+1];if(Ab==null){continue}if(Ab-Ah>AT||Ab-Ah<-AT||Aa-Ae>AS||Aa-Ae<-AS){continue}var Ad=Math.abs(AY.p2c(Ab)-AZ),Ac=Math.abs(AW.p2c(Aa)-AX),Aj=Ad*Ad+Ac*Ac;if(Aj<=Ar){Ar=Aj;Ap=[An,Al/Ak]}}}if(Ag.bars.show&&!Ap){var AV=Ag.bars.align=="left"?0:-Ag.bars.barWidth/2,Ao=AV+Ag.bars.barWidth;for(Al=0;Al<Am.length;
Al+=Ak){var Ab=Am[Al],Aa=Am[Al+1],Aq=Am[Al+2];if(Ab==null){continue}if(O[An].bars.horizontal?(Ah<=Math.max(Aq,Ab)&&Ah>=Math.min(Aq,Ab)&&Ae>=Aa+AV&&Ae<=Aa+Ao):(Ah>=Ab+AV&&Ah<=Ab+Ao&&Ae>=Math.min(Aq,Aa)&&Ae<=Math.max(Aq,Aa))){Ap=[An,Al/Ak]}}}}if(Ap){An=Ap[0];Al=Ap[1];Ak=O[An].datapoints.pointsize;return{datapoint:O[An].datapoints.points.slice(Al*Ak,(Al+1)*Ak),dataIndex:Al,series:O[An],seriesIndex:An}}return null}function D(AW){var AV,AT,AU,AS,AX;if(g.grid.draggable){AU=m.data("flot.dragstate");if(AU&&AU[0]==2){AV="plotdrag",AT="draggable"}else{if(AU&&AU[0]==1){AS=AW.pageX-AU[1];AX=AW.pageY-AU[2];if(AS*AS+AX*AX>=36){m.data("flot.dragstate",[2]);AV="plotdragstart",AT="draggable"}}}}if(!AV&&g.grid.hoverable){AV="plothover",AT="hoverable"}if(AV){H(AV,AW,AT)}}function d(AT){var AS=m.data("flot.dragstate");if(!AS||AS[0]==1){H("plotclick",AT,"clickable")}}function AI(AS){if(!AS.shiftKey&&!AS.altKey&&!AS.ctrlKey&&!AS.metaKey){m.data("flot.dragstate",[1,AS.pageX,AS.pageY]);AS.stopPropagation();AS.preventDefault()}}function AQ(AS){if(G.stopDrag()){H("plotdragend",AS,"draggable")}}function H(AT,AS,AU){var AV=AK.offset(),Aa={pageX:AS.pageX,pageY:AS.pageY},AY=AS.pageX-AV.left-e.left,AW=AS.pageY-AV.top-e.top;Aa.x=w.xaxis.c2p(AY);Aa.y=w.yaxis.c2p(AW);if(w.x2axis.used){Aa.x2=w.x2axis.c2p(AY)}if(w.y2axis.used){Aa.y2=w.y2axis.c2p(AW)}var Ab=AM(AY,AW,function(Ac){return Ac[AU]!=false});if(Ab){Ab.pageX=parseInt(Ab.series.xaxis.p2c(Ab.datapoint[0])+AV.left+e.left);Ab.pageY=parseInt(Ab.series.yaxis.p2c(Ab.datapoint[1])+AV.top+e.top)}if(g.grid.autoHighlight){for(var AX=0;AX<AC.length;++AX){var AZ=AC[AX];if(AZ.auto==AT&&!(Ab&&AZ.series==Ab.series&&AZ.point==Ab.datapoint)){AD(AZ.series,AZ.point)}}if(Ab){AL(Ab.series,Ab.datapoint,AT)}}m.trigger(AT,[Aa,Ab,G])}function t(){if(!J){J=setTimeout(AB,30)}}function AB(){J=null;AR.save();AR.clearRect(0,0,AE,Q);AR.translate(e.left,e.top);var AT,AS;for(AT=0;AT<AC.length;++AT){AS=AC[AT];if(AS.series.bars.show){AF(AS.series,AS.point)}else{AA(AS.series,AS.point)
}}AR.restore();Z(L.drawOverlay,[AR])}function AL(AU,AS,AV){if(typeof AU=="number"){AU=O[AU]}if(typeof AS=="number"){AS=AU.data[AS]}var AT=k(AU,AS);if(AT==-1){AC.push({series:AU,point:AS,auto:AV});t()}else{if(!AV){AC[AT].auto=false}}}function AD(AU,AS){if(AU==null&&AS==null){AC=[];t()}if(typeof AU=="number"){AU=O[AU]}if(typeof AS=="number"){AS=AU.data[AS]}var AT=k(AU,AS);if(AT!=-1){AC.splice(AT,1);t()}}function k(AU,AV){for(var AS=0;AS<AC.length;++AS){var AT=AC[AS];if(AT.series==AU&&AT.point[0]==AV[0]&&AT.point[1]==AV[1]){return AS}}return -1}function AA(AV,AU){var AT=AU[0],AZ=AU[1],AY=AV.xaxis,AX=AV.yaxis;if(AT<AY.min||AT>AY.max||AZ<AX.min||AZ>AX.max){return }var AW=AV.points.radius+AV.points.lineWidth/2;AR.lineWidth=AW;AR.strokeStyle=C.color.parse(AV.color).scale("a",0.5).toString();var AS=1.5*AW;AR.beginPath();AR.arc(AY.p2c(AT),AX.p2c(AZ),AS,0,2*Math.PI,false);AR.stroke()}function AF(AV,AS){AR.lineWidth=AV.bars.lineWidth;AR.strokeStyle=C.color.parse(AV.color).scale("a",0.5).toString();var AU=C.color.parse(AV.color).scale("a",0.5).toString();var AT=AV.bars.align=="left"?0:-AV.bars.barWidth/2;AH(AS[0],AS[1],AS[2]||0,AT,AT+AV.bars.barWidth,0,function(){return AU},AV.xaxis,AV.yaxis,AR,AV.bars.horizontal)}function R(AU,AT,AY,AW){if(typeof AU=="string"){return AU}else{var AX=Y.createLinearGradient(0,AY,0,AT);for(var AV=0,AS=AU.colors.length;AV<AS;++AV){var AZ=AU.colors[AV];if(typeof AZ!="string"){AZ=C.color.parse(AW).scale("rgb",AZ.brightness);AZ.a*=AZ.opacity;AZ=AZ.toString()}AX.addColorStop(AV/(AS-1),AZ)}return AX}}}C.plot=function(G,E,D){var F=new B(C(G),E,D,C.plot.plugins);return F};C.plot.plugins=[];C.plot.formatDate=function(H,E,G){var L=function(N){N=""+N;return N.length==1?"0"+N:N};var D=[];var M=false;var K=H.getUTCHours();var I=K<12;if(G==null){G=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}if(E.search(/%p|%P/)!=-1){if(K>12){K=K-12}else{if(K==0){K=12}}}for(var F=0;F<E.length;++F){var J=E.charAt(F);if(M){switch(J){case"h":J=""+K;break;
case"H":J=L(K);break;case"M":J=L(H.getUTCMinutes());break;case"S":J=L(H.getUTCSeconds());break;case"d":J=""+H.getUTCDate();break;case"m":J=""+(H.getUTCMonth()+1);break;case"y":J=""+H.getUTCFullYear();break;case"b":J=""+G[H.getUTCMonth()];break;case"p":J=(I)?("am"):("pm");break;case"P":J=(I)?("AM"):("PM");break}D.push(J);M=false}else{if(J=="%"){M=true}else{D.push(J)}}}return D.join("")};function A(E,D){return D*Math.floor(E/D)}})(jQuery);






/* jquery.hotkeys.js */
(function(A){this.version="(beta)(0.0.3)";this.all={};this.special_keys={27:"esc",9:"tab",32:"space",13:"return",8:"backspace",145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"};this.shift_nums={"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"};this.add=function(C,B,H){if(A.isFunction(B)){H=B;B={}}var D={},F={type:"keydown",propagate:false,disableInInput:false,target:A("html")[0],checkParent:true},E=this;D=A.extend(D,F,B||{});C=C.toLowerCase();var G=function(J){J=A.event.fix(J);var O=J.target;O=(O.nodeType==3)?O.parentNode:O;if(D.disableInInput){var S=A(O);if(S.is("input")||S.is("textarea")){return }}var L=J.which,U=J.type,R=String.fromCharCode(L).toLowerCase(),T=E.special_keys[L],M=J.shiftKey,I=J.ctrlKey,P=J.altKey,Q=true,K=null;if(A.browser.opera||A.browser.safari||D.checkParent){while(!E.all[O]&&O.parentNode){O=O.parentNode}}var V=E.all[O].events[U].callbackMap;if(!M&&!I&&!P){K=V[T]||V[R]}else{var N="";if(P){N+="alt+"}if(I){N+="ctrl+"}if(M){N+="shift+"}K=V[N+T]||V[N+R]||V[N+E.shift_nums[R]]}if(K){K.cb(J);if(!K.propagate){J.stopPropagation();J.preventDefault();return false}}};if(!this.all[D.target]){this.all[D.target]={events:{}}}if(!this.all[D.target].events[D.type]){this.all[D.target].events[D.type]={callbackMap:{}};
A.event.add(D.target,D.type,G)}this.all[D.target].events[D.type].callbackMap[C]={cb:H,propagate:D.propagate};return A};this.remove=function(C,B){B=B||{};target=B.target||A("html")[0];type=B.type||"keydown";C=C.toLowerCase();delete this.all[target].events[type].callbackMap[C];return A};A.hotkeys=this;return A})(jQuery);






/* json2.js */
if(!this.JSON){JSON=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}if(typeof value.toJSON==="function"){return stringify(value.toJSON())}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||"null")}return"["+a.join(",")+"]"}if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}else{for(k in value){if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}return"{"+a.join(",")+"}"}}return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n}else{delete v[i]}}}}return filter(k,v)}if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");
return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")}}}()}






/* google_maps.js */
function verifyAddress(I,G,B,H){var C,F,E=B;function D(L){var J,K;if((J=L.match(/^\s*([-+]?(?:\d+\.?\d*|\.\d+))\s$/))){return +J[1]}else{if((J=L.match(/^\s*([-+]?\d+)\s*d\s*(?:(\d+\.?\d*|\.\d+)\s*m)?\s*$/))&&(J[2]||0)<=65){K=J[1]<0?-1:1;return +J[1]+K*(J[2]||0)/60}else{if((J=L.match(/^\s*([-+]?\d+)\s*d\s*(\d+)\s*m\s*(?:(\d+\.?\d*|\.\d+)\s*s?)?\s*$/))&&J[2]<=65&&(J[3]||0)<=65){K=J[1]<0?-1:1;return +J[1]+K*((J[2]||0)/60+(J[3]||0)/3600)}else{return null}}}}function A(J,K){K[2]=K[2].toUpperCase();K[4]=K[4].toUpperCase();if(K[2]=="E"||K[2]=="W"){K=[K[3],K[4],K[1],K[2]]}if(K[2]=="S"){K[1]=-K[1]}if(K[4]=="W"){K[3]=-K[3]}if((K[2]!="N"&&K[2]!="S")||(K[4]!="E"&&K[4]!="W")||K[1]<-90||K[1]>90||K[3]<-180||K[3]>180){return null}else{return{address:J,Point:{coordinates:[K[3],K[1],0]}}}}if(!verifyAddress.geocoder){if(typeof GClientGeocoder==="undefined"){googleMapsLoad(function(){verifyAddress(I,G,B,H)});return }verifyAddress.geocoder=new GClientGeocoder(null,google_maps_key,google_maps_client_id)}if(!H){B=function(K){var J=new GLatLng(K.Point.coordinates[1],K.Point.coordinates[0]);E(J.lat(),J.lng())}}if((C=I.match(/^\s*([-+]?(?:\d+\.?\d*|\.\d+))\s+([-+]?(?:\d+\.?\d*|\.\d+))\s*$/))&&(F=A(I,[null,+C[1],"N",+C[2],"E"]))){return B(F)}if((C=I.match(/^([-+\d\.\sdms]+)\s*([NSEW])\s*([-+\d\.\sdms]+)\s*([NSEW])\s*$/))&&(C[1]=D(C[1]))!=null&&(C[3]=D(C[3]))!=null&&(F=A(I,C))){return B(F)}verifyAddress.geocoder.getLocations(I,function(J){if(!J){G(0)}else{if(J.Status.code!=200){G(J.Status.code)}else{B(J.Placemark[0])}}})}function verifyAddressExtended(B,C,A){return verifyAddress(B,C,A,true)}function addressBadDefaultHandler(A){if(A==603){alert("Unfortunately the map interface we use does not support the country or location that you entered.\n           You will probably need to enter an address in a different country for your nodes, or enter raw latitude and longitude.\n           We apologize for the inconvenience.")
}else{alert('Could not translate address, please try again.\n           Valid formats are:\n           - Address, City, State\n           - Street, Zip\n           - City, Country\n           - Latitude and longitude, such as "37.76N 122.4W"')}}






/* application.js */
Mkiconf=window.Mkiconf||{};Mkihelp=window.Mkihelp||{};var js_error_log_url;function log_error(G,C,B,F,A){var D=new Image();var E={date:new Date(),line:B,msg:G,url:C};if(typeof (js_error_log_url)!=="undefined"){D.src=js_error_log_url+"cx="+escape(JSON.stringify(E));if(F&&(typeof (console)!=="undefined")&&console.log){console.log(G,A)}}return false}function latlng_for(D,J,H,E){var M=Math.PI/180,I=6378137,A,C,B,G,F,K,L;A=D*M;C=J*M;B=-Math.atan2(H,E)+Math.PI/2;F=Math.sqrt(E*E+H*H);G=(F/(2*Math.PI*I))*2*Math.PI;K=Math.asin(Math.sin(A)*Math.cos(G)+Math.cos(A)*Math.sin(G)*Math.cos(B))/M;L=(Math.atan2(Math.sin(G)*Math.sin(B),Math.cos(A)*Math.cos(G)-Math.sin(A)*Math.sin(G)*Math.cos(B))+C)/M;return[K,L]}function distance_between_lat_lng_in_meters(F,D,C,B){var A=Math.PI/180;F=F*A;D=D*A;C=C*A;B=B*A;var E=Math.sqrt(Math.cos(F)*Math.cos(C)*((D-B)*(D-B))+(F-C)*(F-C))*6378137*(1-0.0033493*Math.sin(F+C/2)*Math.sin(F+C/2));return E}function getWindowHeight(){if(window.self&&self.innerHeight){return self.innerHeight}if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}return 0}function getWindowWidth(){if(window.self&&self.innerWidth){return self.innerWidth}if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth}return 0}function normalize_id(A){return"#"+A.replace(/[\[\]\.\:]/g,"\\$&")}function jQueryId(A){return jQuery(normalize_id(A))}function hQueryId(A){return hQuery(normalize_id(A))}function getOffset(A){return jQueryId(A).offset().top}function position_horizontally_in_viewport(B,A,I){var J=B.width(),E=A.offset().left,H=A.width(),F=jQuery(window),G=F.width(),C=F.scrollLeft(),D=G+C;if(I==null){I=8
}if(J&&G){if(E>=C&&E<D&&E+J+I>D){E=Math.max(C+I,E+H-J,D-I-J)}else{if(E<C&&E+H>=C){E=Math.min(C+I,E+H)}}}B.css({left:E})}function stretch_height(B,C){if(C==null){C=10}var D=getOffset(B),E=getWindowHeight(),A=E-D-C;if(A>=0){jQueryId(B).css("height",A+"px")}}function make_query_url(C){var B="",A;if(arguments.length>1){for(A=1;A<arguments.length;++A){if(arguments[A]!=null&&arguments[A]!=""){B+=(B==""?"":"&")+arguments[A]}}if(B==""){return C}}return C+(C.indexOf("?")==-1?"?":"&")+B}function xhr_extract_error_json(C){var B={},A;if(C.responseText){try{B=JSON.parse(C.responseText);if(typeof B!=="object"){B={}}}catch(A){}}B.errf=B.errf||true;B.error=B.error||"Unable to save changes. Please try again.";return B}function stretch_gmap_height(){var C=jQuery("#gmap"),E=jQuery("#trailer"),B,D,A;if(E.length==0){E=jQuery("#footer")}if(E.length==0||C.length==0){return }B=getWindowHeight()-(E.offset().top+E.outerHeight(true))+C.height();if(C[0].style.minHeight&&(A=parseInt(C[0].style.minHeight))>0){B=Math.max(A,B)}else{B=Math.max(300,B)}if(C[0].style.height=="100%"||C.height()!=B){C.height(B);if(typeof map3!=="undefined"&&map3&&map3.get_gmap&&(D=map3.get_gmap())){A=D.getCenter();D.checkResize();D.setCenter(A)}}}function html_entity_decode(B){var A=document.createElement("textarea");A.innerHTML=B.replace(/</g,"&lt;").replace(/>/g,"&gt;");return A.value.replace(/^\s*|\s*$/g,"")}function html_entity_encode(C,B){var A=document.createElement("div").appendChild(document.createTextNode(C)).parentNode.innerHTML;if(B){A=A.replace(/\n/g,"<br />\n")}return A}function br2nl(A){return A.replace(/<br\s*\/?>(?:<\/br>)?\n?/g,"\n")}var nativeSplit=nativeSplit||String.prototype.split;String.prototype.split=function(I,D){if(!(I instanceof RegExp)){return nativeSplit.apply(this,arguments)}if(D===undefined||+D<0){D=false}else{D=Math.floor(+D);if(!D){return[]}}var C=(I.global?"g":"")+(I.ignoreCase?"i":"")+(I.multiline?"m":""),G=new RegExp("^"+I.source+"$",C),B=[],A=0,E=0,F,H;if(!I.global){I=new RegExp(I.source,"g"+C)
}while((!D||E++<=D)&&(F=I.exec(this))){H=!F[0].length;if(H&&I.lastIndex>F.index){I.lastIndex=F.index}if(I.lastIndex>A){if(F.length>1){F[0].replace(G,function(){for(var J=1;J<arguments.length-2;J++){if(arguments[J]===undefined){F[J]=undefined}}})}B=B.concat(this.slice(A,F.index),(F.index===this.length?[]:F.slice(1)));A=I.lastIndex}if(H){I.lastIndex++}}return(A===this.length)?(I.test("")?B:B.concat("")):(D?B:B.concat(this.slice(A)))};function strcmp(B,A){var C=B||"",D=A||"";return C<D?-1:(D<C?1:0)}function strcasecmp(B,A){var C=B?B.toLowerCase():"",D=A?A.toLowerCase():"";return C<D?-1:(D<C?1:(B==A?0:strcmp(B,A)))}function numcmp(B,A){var C=+(B||0),D=+(A||0);return C<D?-1:(D<C?1:0)}function human_sortable_string(A){return(" "+A).replace(/\s+/g," ").replace(/(\A|[^:.])(\d+)/g,function(C,D,B){if(B.length>=7){return C}else{return D+"000000".slice(0,7-B.length)+B}}).toLowerCase()}function pluralize(F,E,C){var A,D,B;C=C||{};if(C.nocount||C.nc){A=E}else{if(C.wordcount&&F>=0&&F<=10&&F==Math.ceil(F)){A=["zero","one","two","three","four","five","six","seven","eight","nine","ten"][F]+" "+E}else{A=F+" "+E}}D=(F===1)===(!!C.verb)?1:0;if(D&&E.length>2&&((B=E.substr(E.length-2))==="ch"||B==="sh")){A+="es"}else{if(D){A+="s"}}if(C.these){A=["this ","these "][D]+A}if(C.their){A=["its ","their "][D]+A}return A}function commajoin(A){if(A.length<=1){return A[0]}else{if(A.length==2){return A[0]+" and "+A[1]}else{return A.slice(0,A.length-1).join(", ")+", and "+A[A.length-1]}}}function parse_size(D,A){var F,B,C,E=parse_size.sipfx;if(!(B=D.match(parse_size.regexp))){return false}D=B[1];B[2]=B[2].toUpperCase();for(C=0;B[2]!==""&&C<E.length;C+=3){if(B[2]===E[C]){F=E[C+1];D*=F;if(A&&A.indexOf("<")>-1){D=Math.max(Math.ceil(D+F*0.05),0)}else{if(A&&A.indexOf(">")>-1){D=Math.floor(D-F*0.05)}}}}return D}parse_size.sipfx=["T",1024*1024*1024*1024,2,"G",1024*1024*1024,2,"M",1024*1024,1,"K",1024,true];parse_size.regexp=/^\s*([-+]?(?:\d+\.?\d*|\.\d+))\s*([KMGT]?)/i;function unparse_size(A,E,F,B){var D="",C,G=Math.abs(A),H=parse_size.sipfx;
for(C=0;C<H.length;C+=3){if(G>=H[C+1]){A/=H[C+1];D="\xA0"+parse_size.sipfx[C];if(E===true){E=H[C+2]}break}}if(E===true){if(A==0){return"none"}E=1;B=true}if(E==null){A=A.toString()}else{A=A.toFixed(E);if(B&&E>0){A=A.replace(/\.?0+$/,"")}}if(F=="Bytes"){if(D){F="B"}else{if(A=="1"){F="Byte"}}}if(F){D=(D||"\xA0")+F}return A+D}function unparse_bytes(A,B){return unparse_size(A,true,"Bytes",B)}function unparse_kb(A,B){return unparse_size(A*1024,true,"Bytes",B)}function unparse_kb_pair(E,D,C,G){var F,B,H,A;A=(C=="s"?"SSID u":"U")+"sage"+(G||"");if(E+D){F=unparse_kb(E+D,true);B=unparse_kb(E,true),H=unparse_kb(D,true);if(C=="h"){return F+" (<span title='Received/downloaded'>&darr;<span class='thinsp'></span>"+B+"</span>, <span title='Sent/uploaded'>&uarr;<span class='thinsp'></span>"+H+"</span>)"}else{return A+": "+F+" ("+B+"\xA0received, "+H+"\xA0sent)"}}else{return"No "+A.replace(/^U/,"u")}}function parse_time(B,C){var A,D,E=false;while((A=B.match(/^(\d+\.?\d*|\.\d+)\s*([a-z]*)\s*(.*)$/i))){A[2]=A[2].toLowerCase();if(parse_time.tsyn.hasOwnProperty(A[2])){A[2]=parse_time.tsyn[A[2]]}if(A[2]===""&&C&&A[3]===""){A[2]=C}for(D=0;D<parse_time.tsfx.length;D+=2){if(A[2]===parse_time.tsfx[D]){break}}if(D>=parse_time.tsfx.length){return false}if(E===false){E=0}E+=A[1]*parse_time.tsfx[D+1];B=A[3]}return(B===""?E:false)}parse_time.tsfx=["y",31536000,"mo",2628000,"d",86400,"h",3600,"m",60,"s",1,"ms",0.0001];parse_time.tsyn={years:"y",year:"y",yr:"y",months:"mo",month:"mo",mos:"mo",days:"d",day:"d",hrs:"h",hr:"h",hours:"h",hour:"h",min:"m",mins:"m",minutes:"m",minute:"m",seconds:"s",second:"s",sec:"s",secs:"s",msec:"ms",milliseconds:"ms"};function unparse_interval(B){var A,C;for(A=0;B>=unparse_interval.tsfx[A];A+=3){}if(unparse_interval.tsfx[A+1]){B=Math.round(B/(unparse_interval.tsfx[A+2]/10))/10}else{B=Math.round(B/unparse_interval.tsfx[A+2])}C=unparse_interval.tmap[unparse_interval.tsfx[A+2]];return B+"\xA0"+C+(B==1?"":"s")}unparse_interval.tsfx=[90,0,1,3600,0,60,28800,1,3600,172800,0,3600,604800,1,86400,5184000,0,86400,7257600,1,604800,31556928,1,2629744,Infinity,0,2629744];
unparse_interval.tmap={"1":"second","60":"minute","3600":"hour","86400":"day","604800":"week","2629744":"month"};(function(F){var E=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],J=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],B=new RegExp("^(.*)\\b("+E.join("|")+"|"+J.join("|")+")\\b(.*)$","i"),C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],A=["January","February","March","April","May","June","July","August","September","October","November","December"],I={Y:"getFullYear",d:"getDate",m:"getMonth",a:"getDay",H:"getHours",M:"getMinutes",S:"getSeconds"},K={Y:"getUTCFullYear",d:"getUTCDate",m:"getUTCMonth",a:"getUTCDay",H:"getUTCHours",M:"getUTCMinutes",S:"getUTCSeconds"},H=(function(){var M,L={};for(M=0;M<12;++M){L[C[M].toLowerCase()]=L[A[M].toLowerCase()]=M}return L})();function G(L){return L.getDate?L.getTime()/1000:L}function D(N){var M,O,L=Mkiconf.tz||[];N=G(N);for(M=L.length-1;M>=0;--M){O=L[M];if(O[0]==null||O[0]<=N||M==0){return O}}return null}window.local_utc_date=function(L){var M;L=G(L);if((M=D(L))){L+=M[2]}return new Date(L*1000)};window.unparse_date=function(R,U,X){var P,W="",S,O,T,N,Q,L,M=I,V="";if(X==1&&(S=D(R))){R=G(R)+S[2];V=S[3];M=K}else{if(X==2){M=K;V="UTC"}}if(!R.getDate){R=new Date(R*1000)}for(P=0;P<U.length;++P){S=U.charAt(P);if(S=="%"){N="0";Q=0;for(++P;P<U.length;++P){O=U.charAt(P);if(O=="-"){N=""}else{if(O=="#"){++Q}else{if(O==" "){N=" "}else{break}}}}if(P==U.length){break}if(O=="a"){W+=E[R[M.a]()]}else{if(O=="A"){W+=J[R[M.a]()]}else{if(O=="b"){W+=C[R[M.m]()]}else{if(O=="B"){W+=A[R[M.m]()]}else{if(O.match(/^[dHmMS]/)){T=R[M[O]]();W+=(T<10?N:"")+T}else{if(O=="I"){T=R[M.H]()%12||12;W+=(T<10?N:"")+T}else{if(O=="p"){W+=R[M.H]()<12?"AM":"PM"}else{if(O=="P"){W+=R[M.H]()<12?"am":"pm"}else{if(O=="y"){T=R[M.Y]()%100;W+=(T<10?N:"")+T}else{if(O=="Y"){if(Q){L=new Date();if(Math.abs(L.getTime()-R.getTime())>=15552000000){Q=0}}if(!Q){W+=(N!="0"?N:"")+R[M.Y]()}}else{if(O=="Z"){if(V!=""){W+=(N=="0"?"":N)+V}}else{if(O=="%"){W+=O
}}}}}}}}}}}}}else{W+=S}}return W};window.parse_date=function(Y,T){var Q,b,L,X,O,P,W,U,Z,S=0,R=0,N=0,M,a;function V(c){return H[c.toLowerCase()]}if((Q=Y.match(B))){Y=Q[1]+" "+Q[3]}if(F.trim(Y)==""){return false}if((Q=Y.match(/^(.*)\b(\d{1,2}):(\d\d)(?::(\d\d(?:\.\d+)?))?(?:\s*([ap])m?)?(.*)$/i))&&+Q[2]>=0&&+Q[2]<24&&+Q[3]>=0&&+Q[3]<60){S=+Q[2];if(Q[5]&&Q[5].toLowerCase()=="p"){S+=(S==12?0:12)}else{if(Q[5]&&Q[5].toLowerCase()=="a"&&S==12){S=0}}R=+Q[3];N=Q[4]?+Q[4]:0;Y=Q[1]+" "+Q[6]}if((Q=Y.match(/^(.*)\b(\d{4})[-\/](\d+)[-\/](\d+)\b(.*)$/))){W=+Q[2],U=+Q[3]-1,Z=+Q[4];Y=Q[1]+" "+Q[5]}else{if((Q=Y.match(/^(.*)\b(\d+)(?:[-\/]|\s+)(\w+)(?:[-\/]|\s+)(\d+)\b(.*)$/))&&(U=V(Q[3]))!=null){if(Q[2].length==4){W=+Q[2],Z=+Q[4]}else{W=+Q[4],Z=+Q[2]}Y=Q[1]+" "+Q[5]}else{if((Q=Y.match(/^(.*)\b(\d{1,2})\/(\d{1,2})\b(.*)$/))){U=+Q[2]-1,Z=+Q[3];Y=Q[1]+" "+Q[4]}else{if((Q=Y.match(/^(.*)\b(\d{1,2})\s+(\w+)\b(.*)$/))&&(U=V(Q[3]))!=null){Z=+Q[2];Y=Q[1]+" "+Q[4]}else{if((Q=Y.match(/^(.*)\b(\w+)\s+(\d{1,2})(?:\s*(\d{4}))?\b(.*)$/))&&(U=V(Q[2]))!=null){Z=+Q[3],W=(Q[4]?+Q[4]:null);Y=Q[1]+" "+Q[5]}}}}}Y=F.trim(Y);if(/^(?:GMT|UTC)$/i.test(Y)){a=true}else{if(!/^(?:\w+(?:[-+]\d+)?)$/.test(Y)){}else{if(Y!=""){return false}}}T=G(T||new Date());if((X=D(T))){T+=X[2];P=K}else{P=I}T=new Date(T*1000);if(Z==null){Z=T[P.d]()}if(U==null){U=T[P.m]()}if(W==null&&U>T[P.m]()){W=T[P.Y]()-1}else{if(W==null){W=T[P.Y]()}}if(W<2000||W>T[P.Y]()+10||U<0||U>11||Z<1||Z>31||S<0||S>23||R<0||R>59||N<0||N>62){return false}M=Math.round(N*1000)-Math.round(N)*1000;N=Math.round(N);b=Date.UTC(W,U,Z,S,R,N,M);if(a){return new Date(b)}else{if((X=D(b/1000))){L=new Date(b-X[2]*1000);if((X[0]&&X[0]>L.getTime()/1000&&(O=D(X[0]-1))&&O!=X)||(X[1]&&X[1]<L.getTime()/1000&&(O=D(X[1]+1))&&O!=X)){L=new Date(b-O[2]*1000)}return L}else{return new Date(W,U,Z,S,R,N,M)}}}})(window.jQuery);function add_time_zone_info(C){var A,E,B,D;if(!C||!C.length){return }Mkiconf.tz=E=Mkiconf.tz||[];for(B=0,A=C[0];A[0]&&E[B]&&A[0]>E[B][0];++B){}for(D=E.length,A=C[C.length-1];
A[1]&&D>0&&(!E[D-1][1]||A[1]<E[D-1][1]);--D){}A=[B,D-B];A.push.apply(A,C);meraki_array_splice_apply(E,A)}if(navigator&&navigator.appVersion&&navigator.appVersion.match(/MSIE 8/)){meraki_array_splice_apply=function(A,C){var E=C[0],D=C[1],B;if(A.length!=E+D){B=A.slice(E+D,A.length)}A.splice(E,D);A.push.apply(A,C.slice(2,C.length));if(B){A.push.apply(A,B)}}}else{meraki_array_splice_apply=function(A,B){A.splice.apply(A,B)}}function unparse_fraction_as_percent(A,C){var B;if((C||0)<=0){return"N/A"}else{B=(100*(A||0)/C).toFixed(1)+"%";if(B=="0.0%"&&(A||0)!=0){B="&lt;<span class='thinsp'></span>0.1%"}return B}}function unparse_truncated_fixed(C,B){var A=C.toFixed(B);return(B>0?A.replace(/\.?0+$/,""):A)}function is_ipaddress(D){var B=D.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/),C,A;if(!B){return false}for(C=1;C<5;C++){A=parseInt(B[C]);if(isNaN(A)||A<0||A>255){return false}}return true}function build_func(text,context){var i,f,ctx="";for(i in context){if(context.hasOwnProperty(i)){ctx+="var "+i+" = context."+i+";"}}eval(ctx+"f = "+text);return f}function benchmark(A,B,G){var H=0,C=[],F=true,D,I,E;for(D=0;D<A;++D){I=new Date().getTime();F=B.apply(G)&&F;E=new Date().getTime();H+=(E-I)}C.push("ran "+D+" iterations of "+B);C.push("ret && ret && ...: "+F);C.push("total time: "+H);C.push("mean time: "+H/A);alert(C.join("\n"))}mkisubtabber=(function(){var H={},G={};function F(I){return jQuery("a.tabnav",I).text()}function E(I){return function(){var M=F(I),J=jQuery(".tabnavh_subs",I),L,K;if(H[M]!=1&&H[M]!=3){return }L=J.stop().height();J.css({height:"",margin:"",padding:"",overflow:""});if(H[M]==1){J.slideDown("fast")}else{K=J.height();J.height(L).animate({height:K})}H[M]=2}}function A(){var I=F(this);if(H[I]==2||H[I]==-1){H[I]=3;jQuery(".tabnavh_subs",this).stop().slideUp("fast",function(){H[I]=0})}else{if(H[I]!=3){H[I]=0}}}function B(I){var J=jQuery(I).closest(".tabnav_tab").find("a.tabnav").text();if(J&&J in H){H[J]=-1}}function C(J){var I,K;J=J||window.event;if(J&&(J.shiftKey||J.ctrlKey||J.altKey)){J.stopPropagation();
return true}for(I=J?J.target||J.srcElement:null;I&&I!=this;I=I.parentNode){K=jQuery(I);if(I.tagName.toUpperCase()=="A"){J.stopPropagation();B(I);return true}else{if(K.hasClass("noclick")){J.stopPropagation();return true}else{if(K.hasClass("tabnavh_sub")){J.stopPropagation();if((K=K.find("a")).length&&K[0].href){B(I);window.location.replace(K[0].href)}return true}}}}}function D(J){var I=jQuery(this).find("a.tabnav").attr("href");if(I){B(this);window.location.replace(I)}}return{show:function(){var I=F(this);if(!H[I]){H[I]=1;G[I]=this;setTimeout(E(this),300)}else{if(H[I]==3){E(this)()}}},hide:A,cancelshow:function(){var I=F(this);if(H[I]==1){H[I]=0}},pinshow:function(){var I=F(this);E(this)();H[I]=-1},hideall:function(){var I;for(I in H){if(H[I]>0){A.apply(G[I])}}},click:C,tabclick:D}})();function updateBodyContainer(A){jQuery(window).resize(function(){var C=jQuery("#body_container.full_width"),B=jQuery(window).width()-parseInt(C.css("margin-left"))-parseInt(C.css("margin-right"));C.width(Math.max(A,B))})}function add_toggled_helplink_listeners(A){jQuery("#"+A+".config_explanation a.link_text").click(function(){jQuery(this).blur().parents(".config_explanation").toggleClass("expanded");return false})}function baseline_spinner_html(){return"<span style='display:inline-block;width:16px;position:relative'>&nbsp;<img src='"+Mkiconf.images+"spinner.gif' style='position:absolute;left:0;bottom:-1px' /></span>"}function colored_bullet(A){return"<span class='colbult_l1'>&nbsp;<span class='colbult_l2' style='color:"+A+"'>&#x25CF;</span></span>"}function show_spinner_at_mouse_click(E){var C,B,D,A;if(E){C=E.pageX,B=E.pageY}if(C==null&&E&&E.clientX!=null){D=document.documentElement;A=document.body;C=event.clientX+(D&&D.scrollLeft||A&&A.scrollLeft||0)-(D.clientLeft||0);B=event.clientY+(D&&D.scrollTop||A&&A.scrollTop||0)-(D.clientTop||0)}jQuery("div#spinner").css({position:"absolute",top:B,left:C,zIndex:200}).show()}function hide_spinner_at_mouse_click(){jQuery("div#spinner").hide()}function block_enter_key(B){var A=(window.event)?window.event.keyCode:B.which;
return(A!=13)}function preload_image(B){var A=new Image();A.src=B;return A}jQuery.fn.dim=function(A,D,B){var C={alert_on_click:false,click_callback:false},E;if(B){jQuery.extend(C,B)}if(A==undefined||A){E=jQuery("<div class='controls_dimmer active'></div>");if(typeof (A)=="string"){D=A}if(D){E.attr("title",D);if(C.alert_on_click){E.click(function(){alert(D)})}}if(C.click_callback){E.click(C.click_callback)}jQuery(this).children(".controls_dimmer.active").remove().end().prepend(E)}else{jQuery(this).undim()}return this};jQuery.fn.undim=function(){jQuery(this).children(".controls_dimmer").remove();return this};jQuery.fn.mval=function(){switch(jQuery(this).attr("type")){case"checkbox":if(jQuery(this).attr("checked")){return jQuery(this).val()}else{return null}break;case"radio":if(jQuery(this).attr("checked")){return jQuery(this).val()}else{return undefined}case"select":if(this.selectedIndex<0){return null}if(this.multiple){return jQuery(this).val().join("\u21F0")}default:return jQuery(this).val()}};jQuery.fn.hint=function(A){jQuery(this).blur(function(){if(jQuery(this).val()==""){jQuery(this).addClass("hint_text");jQuery(this).val(A)}}).blur();jQuery(this).click(function(){jQuery(this).removeClass("hint_text");if(jQuery(this).val()==A){jQuery(this).val("")}})};function hide_notice(A,B){var C;if(A===true||!A){B=A;A="#notice_explanation"}C=jQuery(A);if(C.parent().hasClass("notice_explanation_container")){C=C.parent()}B?C.hide():C.fadeOut("slow")}function hide_hidenotice(A){if(A){jQuery("#hidenotice_explanation").parent().hide()}else{jQuery("#hidenotice_explanation").parent().fadeOut("slow")}}function nodecmp(C,B){var A;if((A=B.is_gateway-C.is_gateway)){return A}if(C.model!=B.model&&(A=strcmp(node_product_info(C,"type"),node_product_info(B,"type")))){return A}return strcmp(C["name$"],B["name$"])||strcmp(C.mac,B.mac)}function node_name(A){return A.name||A.mac||(A.id?"(AP\xA0#"+A.id+")":"(unknown)")}function mac_to_node_id(D){var B,A=0,C;if(!D){return 0}B=D.split(":");if(B.length!=6){return 0
}return parseInt(B[3],16)*65536+parseInt(B[4],16)*256+parseInt(B[5],16)}node_product_info=(function(){var B={icon:"product_icon",type:"device_type",description:"product_description",short_description:"product_short_description",interface_names:"interface_names",max_ssid:"max_ssid"},A={interface_names:[]};return function(E,G,D){var F=Mkiconf.products,C;if(D===undefined){D=A[G]}if(!E){return D}else{if(F&&E.model&&(C=F[E.model])){return C[G]||D}else{if((C=B[G])){return E[C]||D}else{return D}}}}})();var form_helper=(function(){var A=1;return{make_target:function(D){var E=D.form,C="form_iframe_"+ ++A,B;if((B=E.attr("target"))){jQuery("#"+B).remove()}E.attr("target",C);E.after("<iframe src='about:blank' id='"+C+"' name='"+C+"' onload='form_helper.target_loaded(\""+C+"\")' style='display:none'></iframe>");jQuery("#"+C)[0].form_iframe_complete=D.complete},target_loaded:function(B){var C=jQuery("#"+B),D=C.contents();if(D[0].location.href!=="about:blank"){C[0].form_iframe_complete(D);C.attr("src","about:blank")}}}})();function auto_grow(A){A=jQuery(A);A.bind("keyup",B);A.bind("input",B);function B(){jQuery(this).css("height",this.scrollHeight)}}jQuery.build_async_uploader=function(B){var C={name:new Date().getTime(),id:new Date().getTime(),label:"Locate your file: ",action:"",buttontext:"Upload",help_text:undefined,waiting_text:"Uploading. Please wait...",waiting_img:null,before:(function(){}),waiting:(function(){}),complete:(function(D){})},A="";if(B){jQuery.extend(C,B)}if(C.waiting_img=="image"){preload_image(C.waiting_img)}if(C.help_text){A='<div class="async_uploader hide_during_upload help_text small_print">'+C.help_text+"</div>"}return jQuery('<label for="'+C.id+'" class="async_uploader hide_during_upload">'+C.label+'</label><input type="file" name="'+C.name+'" name="'+C.id+'" class="async_uploader hide_during_upload" />'+A).filter("input").change(function(){var D,G,F,E;if(jQuery(this).parents("form").length){D=jQuery(this).parents("form");G=D.attr("target")||"";F=D.attr("action")||""
}else{D=jQuery(this).wrap("<form></form>").parent("form").attr("data_delete_during_cleanup","true")}C.before();D.append(jQuery('<iframe src="about:blank" style="display:none;" class="async_uploader" name="'+C.name+'_target"></iframe>').load(function(){if(jQuery(this).contents().get(0).location.href!=="about:blank"){C.complete(jQuery(this).contents().get(0).body.innerHTML);jQuery(this).attr("src","about:blank");if(jQuery(this).parents("form").attr("data_delete_during_cleanup")=="true"){jQuery(this).parents("form").remove()}else{jQuery(this).parents("form").find(".async_uploader").remove().end().attr("target",G).attr("action",F)}}return true})).attr("target",C.name+"_target").attr("action",C.action).submit();C.waiting();if(C.waiting_img){E=jQuery('<img class="waiting_message async_uploader" src="'+C.waiting_img+'" />')}else{E=jQuery('<span class="waiting_message async_uploader">'+C.waiting_text+"</span>")}jQuery(this).siblings(".async_uploader.hide_during_upload").andSelf().hide().end().end().after(E);return true}).end()};jQuery.fn.mSelectSlider=function(){var B,C,A;B=jQuery('<div class="mSelectSlider selected_indicator"></div>').hide();C=jQuery('<div class="mSelectSlider selected_subtitle""></div>');jQuery(this).addClass("mSelectSlider").before(B).after(C);jQuery(this).find("li").click(function(){var D=jQuery(this).addClass("selected").siblings(".selected").removeClass("selected").end().find("a").blur().end();C.animate({opacity:0},{duration:200,complete:function(){C.html(D.attr("data_name"));A=0;D.prevAll().each(function(){A+=jQuery(this).width()+2});C.css("marginLeft",((D.width()/2)-(C.width()/2)+A+2)+"px").css("top",D.height()+"px");B.animate({marginLeft:A+"px",opacity:1,width:D.width(),height:D.height()},{duration:200,easing:"swing",complete:function(){C.animate({opacity:1},{})}})}});return false});return this};jQuery.fn.m_disable_form=function(C){if(!C){C={}}var B,A;if(this.get(0).tagName.toLowerCase()=="form"){if(C.hard){this.bind("submit.m_disable_form",function(){return false
})}this.addClass("disabled");B=this.find("input:submit");B.attr("disabled","disabled");if(C.button_text){B.each(function(D){jQuery(this).attr("data_orig_val",jQuery(this).val())});B.val(C.button_text)}if(C.waiting_msg){A=function(){B.after("<br class='waiting_msg'/><div class='waiting_msg'>"+C.waiting_msg+"</div>")};if(C.waiting_msg_delay){setTimeout(A,C.waiting_msg_delay)}else{A()}}}return this};jQuery.fn.m_reenable_form=function(){var A,B;if(this.get(0).tagName.toLowerCase()=="form"){this.removeClass("disabled");this.unbind(".m_disable_form");A=jQuery(this).find("input:submit");A.attr("disabled","");A.each(function(C){B=jQuery(this);if(B.attr("data_orig_val")){B.val(B.attr("data_orig_val"))}});this.find(".waiting_msg").remove()}return this};function set_uri_param(C,A,D){var B=new RegExp("(?:^\\?|&)"+A.replace(/\W/g,"\\$&")+"(?:=[^&]*)?(?=&|$)","g");return C.replace(/^([^\?#]*)(\?[^\#]*)?(\#.*)?$/,function(F,E,G,H){G=(G||"").replace(B,"");if(D!=null){if(G!=""&&G!="?"){G+="&"}G+=A+"="+encodeURIComponent(D)}if(G.length>0&&G.charAt(0)!="?"){G="?"+G}if(G.length>1&&G.substr(0,2)=="?&"){G="?"+G.substr(2)}if(G=="?"){G=""}H=H||"";return E+G+H})}function stable_json_stringify(A){var C,B,D=[];if(A==null){return""}else{if(typeof A!=="object"){return JSON.stringify(A)}else{if(jQuery.isArray(A)){for(C=0;C<A.length;++C){D.push(stable_json_stringify(A[C]))}return"["+D.join(",")+"]"}else{for(C in A){if(A.hasOwnProperty(C)&&A[C]!=null&&A[C]!==""){B=stable_json_stringify(A[C]);if(B!==""&&B!=="{}"){D.push(JSON.stringify(C)+":"+B)}}}D.sort(strcmp);return"{"+D.join(",")+"}"}}}}function json_eq(B,A){var D,E,C;if(B==null||A==null){return B==A}else{if(typeof B!=="object"||typeof A!=="object"){return B===A}}D=jQuery.isArray(B);E=jQuery.isArray(A);if(D||E){if(!D||!E||B.length!==A.length){return false}for(C=B.length-1;C>=0;--C){if(!json_eq(B[C],A[C])){return false}}return true}else{for(C in B){if(!json_eq(B[C],A[C])){return false}}for(C in A){if(A[C]!=null&&B[C]==null){return false}}return true
}}function json_namespace_separate(A){var C,B;for(C=0;A.charAt(C)=="/";++C){}B=A.indexOf("/",C);if(B<0){B=A.length}return{a:A.substring(C,B),b:A.substring(B+1,A.length)}}function json_ensure(A,B){var C=json_namespace_separate(B);if(!A||typeof A!=="object"||jQuery.isArray(A)){A={}}if(C.a!==""){A[C.a]=json_ensure(A[C.a],C.b)}return A}function json_select(C,B,F){var D=json_namespace_separate(B),A,E;if(!C||typeof C!=="object"||jQuery.isArray(C)){C={}}if(D.b!==""){A=json_select(C[D.a],D.b,F)}else{if(D.a!==""){A=C[D.a]}else{return C}}if(F){E={};E[D.a]=A;return E}else{return A}}function json_delete(A,B){var C=json_namespace_separate(B);if(!A||typeof A!=="object"||jQuery.isArray(A)){A={}}if(C.b!==""){json_delete(A[C.a],C.b)}else{if(C.a!==""){delete A[C.a]}else{return{}}}return A}function json_assign(A,B,C){var D=json_namespace_separate(B);if(!A||typeof A!=="object"||jQuery.isArray(A)){A={}}if(D.b!==""){A[D.a]=json_assign(A[D.a],D.b,C)}else{if(D.a!==""){A[D.a]=json_assign({},"",C)}else{if(jQuery.isArray(C)){return[].concat(C)}else{if(C&&typeof C==="object"){return jQuery.extend(true,{},C)}else{return C}}}}return A}function save_user_dashboard_prefs(A){var C=Mkiconf.user_dashboard_prefs,D="user_dashboard_prefs_saved",B=Mkiconf[D];if(typeof A!=="string"){A=""}if(A){C=json_select(C,A,true);B=json_select(B,A,true)}if(!json_eq(C,B)&&Mkiconf.quiet_update_url){jQuery.post(Mkiconf.quiet_update_url,{user_prefs:JSON.stringify(C)});Mkiconf[D]=json_delete(Mkiconf[D],A||"");jQuery.extend(true,Mkiconf[D],C)}}function change_ssid(){var A=jQuery(this).val(),B=set_uri_param(window.location.href,"ssid",A>=0?A:null);window.location.href=change_ssid_url+"?ssid="+A+"&f="+encodeURIComponent(B)}jQuery(document).ready(function(){jQuery("select#select_network").change(function(){var A=jQuery(this).val();if(A){window.location.href=A}});jQuery("#select_ssid.sync").change(change_ssid)});var add_access_points_interface=function(){var A={};function B(){}B.init=function(C){jQuery.extend(A,C);hQuery(".add_nodes_form").m_reenable_form().find("#lat, #lng").val("");
hQuery(".add_nodes_form").submit(function(){var D=jQuery(this);D.m_disable_form();if(D.find("#user_supplied_address").val()!=""&&D.find("#lat").val()==""&&D.find("#lng").val()==""){verifyAddress(jQuery("#user_supplied_address").val(),function(){D.find("#lat").val("0.00");D.find("#lng").val("0.00");D.m_reenable_form().submit()},function(F,E){jQuery("#lat").val(F);jQuery("#lng").val(E);D.m_reenable_form().submit()});return false}return true})};return B}();function hQuery(A){var B;if(arguments.length!=1){log_error("invalid call to hQuery with "+arguments.length+" args",window.location,"unknown",true,arguments)}B=jQuery(A);if(typeof (B.length)==="undefined"||B.length<1){log_error("no dom element matches selector "+A,window.location,"unknown",true)}return B}function match_current_proto(B){var A,C;A=window.location.protocol;C=B.match(/^(.+:)/);if(C.length){C=C[1]}else{C=null}return B.replace(C,A)}function gaLoad(G,B){var E=(("https:"==document.location.protocol)?"https://ssl.":"http://www."),D,A=false,C;C=document.createElement("script");C.src=E+"google-analytics.com/ga.js";C.type="text/javascript";function F(){if(!A){A=true;D=_gat._getTracker(G);if(B){D._setVar("meraki_i")}D._trackPageview()}}C.onload=F;C.onreadystatechange=function(){if("loaded"===C.readyState||"complete"===C.readyState){F()}};document.getElementsByTagName("head")[0].appendChild(C)}var googleMapsLoad=(function(){var D=null,B=null,C=null;function A(){var E;if(C){clearTimeout(C);C=null}if(typeof GMap2==="undefined"){C=setTimeout(A,25);return }B=true;if(D){for(E=0;E<D.length;++E){D[E]()}D=null}}return function(E){var F;if(typeof GMap2==="function"&&B===null){A()}if(typeof E==="function"){if(B){E()}else{D=D||[];D.push(E)}}else{if(E===true){A()}else{if(B===null){B=false;F=document.createElement("script");F.src=google_maps_script_url;F.type="text/javascript";F.onload=A;F.onreadystatechange=function(){if("loaded"===F.readyState||"complete"===F.readyState){A()}};document.getElementsByTagName("head")[0].appendChild(F)
}}}}})();if(typeof google_maps_script_url!=="undefined"){googleMapsLoad()}window.mki_odometer=(function(D){function B(){D(this).remove()}function A(I){var G=[],H;for(I=I.toString(),H=I.length-1;H>=0;--H){G.push(+I.charAt(H))}return G}function C(I,M,L){var H=M.length,G,K,J;for(G=0;G<H;++G){K=D(I[H-G-1]);K.children("div.current").removeClass("current").fadeOut(L,B);J=D("<div class='current' style='position:absolute;left:0;top:0;display:none'>"+M[G]+"</div>").appendTo(K);K.width(function(O,N){return Math.max(N,J.width())});J.fadeIn(L)}}function F(H,V,J,O,T,K){var G=J.length,L,M,Q,N,I,S,P,R=T-O,U=D(H[0]).height();for(L=0;L<G;++L,R/=10){N=V[L];I=J[L];if(N==I&&R<1){break}Q=[];N=(N+1)%10;for(M=1;M<20&&M<R;++M,N=(N+1)%10){Q.push(N)}for(;N!=I;N=(N+1)%10){Q.push(N)}S=D(H[G-L-1]);S.children("div.current").removeClass("current").animate({top:-(Q.length+1)*U},{duration:K,complete:B});if(Q.length){D("<div style='position:absolute;left:0;top:"+U+"px'>"+Q.join("<br />")+"</div>").appendTo(S).animate({top:-Q.length*U},{duration:K,complete:B})}P=D("<div class='current' style='position:absolute;left:0;top:"+(Q.length+1)*U+"px'>"+J[L]+"</div>").appendTo(S);S.width(function(X,W){return Math.max(W,P.width())});P.animate({top:0},{duration:K})}}function E(H,O,P){var M,G,I,N,Q,K,J,L=(P&&P.duration)||500;if(typeof H==="string"||H.nodeType){H=D(H)}if(H.length>1){for(M=0;M<H.length;++M){E(D(H[M]),O)}return H}else{if(!H.length&&window.console&&console.log){console.log("bad mki_odometer")}}if(O==null){H.empty();H.data("mki_odometer",null);return H}N=H.data("mki_odometer");if(N===+O){return H}Q=N==null?[]:A(N);K=A(+O);if(Q.length==0){H.empty()}J=Q.length==0||O<N;I=H.children().toArray();G=Math.max(Q.length,K.length,I.length);while(Q.length<G){Q.push(0)}while(K.length<G){K.push(0)}while(I.length<G){I.unshift(D("<span style='display:inline-block;position:relative;overflow:hidden'>&nbsp;</span>").prependTo(H))}if(J){C(I,K,L)}else{F(I,Q,K,N,O,L)}H.data("mki_odometer",+O);return H}return E})(window.jQuery);
hohelp=(function(H,N){var S=null,B=null,U=null,I="",Z=false,Y=0,K=0,E=null,D=0,R=[6,7,7,7],T=8,A=13,P=14,C=27,W=15,L=[8,4,4,4];function G(){if(S){S.stop(true,true).hide()}I="";U=null;Z=false}function V(){E=null;if(Y==0&&K==0&&!Z){G()}}function O(b,c,a,M){return function(){if(M==D&&Y>0){X(b,c,a,true)}}}function Q(){if(S){return }S=H('<table id="hover_help_container" style="display:none;position:absolute;z-index:212" class="lean"><tbody><tr><td><div style="position:relative"><div id="hover_help_pointer" class="hhptr_up" style="position:absolute;font-size:x-small">&nbsp;</div><table class="hover_body lean"><tbody><tr><td class="hhsh_tl" style="width:'+R[3]+"px;height:"+R[0]+'px"></td><td class="hhsh_t" style="height:'+R[0]+'px"></td><td class="hhsh_tr" style="width:'+R[1]+"px;height:"+R[0]+'px"></td></tr><tr><td class="hhsh_l" style="width:'+R[3]+'px"></td><td id="hover_help_contents"></td><td class="hhsh_r" style="width:'+R[1]+'px"></td></tr><tr><td class="hhsh_bl" style="width:'+R[3]+"px;height:"+R[2]+'px"></td><td class="hhsh_b" style="height:'+R[2]+'px"></td><td class="hhsh_br" style="width:'+R[1]+"px;height:"+R[2]+'px"></td></tr></tbody></table></div></td></tr></tbody></table>');H("body").append(S);S.find("#hover_help_pointer, .hover_body").mouseover(function(){++K}).mouseout(function(){if(K>0&&--K==0){if(E){clearTimeout(E)}E=setTimeout(V,180)}});B=S.find("#hover_help_contents")}function F(d,b,M,e,c){var g=d[M],f=0,a=g;if(e!=null){f=(e>0?e:g+e)}if(c!=null){a=(c>0?c:g+c)}d[b]+=N.max(f,0);d[M]=N.max(a-f,0)}function J(c,M){var d=H(c),b=d.offset(),a;b.w=d.outerWidth();b.h=d.outerHeight();b.l=b.left-(b.w-d.width())/2;b.t=b.top-(b.h-d.height())/2;F(b,"l","w",M.left,M.right);F(b,"t","h",M.top,M.bottom);a=[{l:b.l+b.w/2,t:b.t+N.min(L[0],b.h)},{l:b.l+b.w-N.min(L[1],b.w),t:b.t+b.h/2},{l:b.l+b.w/2,t:b.t+b.h-N.min(L[2],b.h+1)},{l:b.l+N.min(L[3],b.w),t:b.t+b.h/2}];if(M.aboveoffset&&typeof M.aboveoffset=="number"){a[0].t-=M.aboveoffset}else{if(M.aboveoffset&&(y=H(M.aboveoffset)).length){a[0].t-=H(c).offset().top-y.offset().top
}}return a}function X(d,a,q,b){var e,n,m,k,g,l,p,f,M,o,h,c;q=q||{};if(typeof d=="string"){d=H(d)}if(d.jquery){d=d[0]}if(d&&!a&&U&&U!=d){return false}if(d&&d==U&&q.sticky&&Z==q.sticky){a=null;Z=false}else{if(Z&&!q.sticky){return false}}if(d&&!a&&!q.nostack&&!q.sticky&&Y>0){--Y;if(Y>0){return false}}if(d&&a&&d==U&&a==I&&!b){if(Y==0||(!q.nostack&&!q.sticky)){++Y}return false}if(E){clearTimeout(E);E=null}if(!d||!a){Y=0;if(q.sticky){G()}else{E=setTimeout(V,q.delay||180)}return false}++D;U=d;I=(typeof a==="string"?a:true);Z=q.sticky;Y=1;K=0;if(!q.sticky&&!b&&(!S||!S.is(":visible"))){setTimeout(O(d,a,q,D),q.delay||300);return false}if(S&&d!=U){S.stop(true,true).hide().fadeIn("fast")}else{Q();S.fadeIn("fast")}o=H(window);h={l:o.scrollLeft(),t:o.scrollTop(),w:o.width(),h:o.height()};h.lp=h.l+T;h.rp=h.l+h.w-T;h.tp=h.t+T;h.bp=h.t+h.h-T;if((n=q.offsets||q.offset)){e=H.isArray(n)?n:[n];for(i=0;i<4;++i){e[i]=H.extend({},e[i]||e[i^2]||e[i^3]||e[i^1]);e[i].l=e[i].l||e[i].left;e[i].t=e[i].t||e[i].top}}else{e=J(d,q)}if(typeof a==="string"){B.html("<div><div class='hover_help_contents'>"+X.prepare_html(a)+"</div></div>")}else{B.html("<div><div class='hover_help_contents'></div></div>");B.find(".hover_help_contents").append(a)}k=B.children();n=R[1]+R[3];l=N.max(N.min(k.width()+n+1,300,h.w-2*T),100);k.width(l-n);p=k.height()+R[0]+R[2];n=N.max(h.lp,N.min(h.rp-l,e[0].l+C-l));f=[{l:n,t:e[0].t-p-(P-R[2])+1}];m=N.max(h.tp,N.min(h.bp-p,e[1].t-p/2));f[1]={l:e[1].l+(P-R[1]),t:m};n=N.max(h.lp,N.min(h.rp-l,e[2].l+C-l));f[2]={l:n,t:e[2].t+(P-R[0])};m=N.max(h.tp,N.min(h.bp-p,e[3].t-p/2));f[3]={l:e[3].l-l-(P-R[3])+1,t:m};f[0].o=h.t-f[0].t;f[1].o=(f[1].l+l)-(h.l+h.w);f[2].o=(f[2].t+p)-(h.t+h.h);f[3].o=h.l-f[3].l;M=(q.above?[0,2]:[2,0]);q.atleft&&M.unshift(3);q.atright&&M.unshift(1);for(i=0;i<M.length&&f[M[i]].o>0;++i){}if(i>=M.length){M.sort(function(s,r){return f[s].o-f[r].o});i=0}M=M[i];f=f[M];g=S.find("#hover_help_pointer");n=(M&1?p:l);m=e[M][M&1?"t":"l"]-f[M&1?"t":"l"];c=N.max(W,N.min(n-W,m))-A/2-0.5;
if(M==0){g.css({left:N.floor(c),top:p-R[2]-1})}else{if(M==1){g.css({left:R[3]-P+1,top:N.floor(c)})}else{if(M==2){g.css({left:N.floor(c),top:R[0]-P+1})}else{g.css({left:l-R[1]-1,top:N.floor(c)})}}}g[0].className="hhptr_"+["down","left","up","right"][M];S.css({left:N.round(f.l),top:N.round(f.t)});return false}X.prepare_html=function(M){return M.replace(/(?:\s*<br\s*\/?>|\s*\n){2,}/g,"<br/><br/>\n")};return X})(jQuery,Math);dashhelp=(function(){var F=0,J={};function A(L){if(!Mkiconf.update_help_message_url){return"asx_md"}else{if(Mkihelp[L]&&Mkihelp.drafts[L]){return"asx_gn"}else{if(Mkihelp.drafts[L]){return"asx_lt"}else{if(Mkihelp[L]){return"asx_md"}else{return"asx_ou"}}}}}function G(N,L,M){return[function(){hohelp(N,Mkihelp[L],M)},function(){hohelp(N)}]}function K(P,O,M,N){var L;P.unbind("mouseover.dashhelp").unbind("mouseout.dashhelp");if(Mkihelp[M]){L=G("#"+O,M,N);P.bind("mouseover.dashhelp",L[0]).bind("mouseout.dashhelp",L[1])}}function E(N,M,L){return function(Q,R,P){var O=jQuery(N).closest("form");O.find(".notice_explanation").html(xhr_extract_error_json(Q).error).show();O.css("opacity",1)}}function C(O,N,L,M){Mkihelp[L]=O.text;Mkihelp.drafts[L]=O.draft_text;K(jQuery(M._t),N,L,M);jQuery("#"+N)[0].className=A(L)}function I(O,N,L,M){return function(P,R,Q){C(P,N,L,M);hohelp("#"+N,null,{sticky:"dashedithelp"})}}function H(P,L,N,M){function Q(R){if(!J[L]){J[L]=true;C(R,P,L,N);M()}}function O(){if(!J[L]){J[L]=true;M()}}jQuery.getJSON(Mkiconf.update_help_message_url,{name:L,page_name:Mkihelp.page_name||Mkihelp.page_names[L]},Q);setTimeout(O,5000)}function D(P,M,N){function U(Z,X){var V=jQuery(Z).closest("form"),W=Mkihelp.page_name||Mkihelp.page_names[M],Y=V.serialize()+"&"+X+"=1&page_name="+encodeURIComponent(W);jQuery.ajax({type:"POST",url:Mkiconf.update_help_message_url,data:Y,dataType:"json",error:E(Z,P,M),success:I(Z,P,M,N)});V.css("opacity",0.5);return false}function R(){return hohelp("#"+P,null,{sticky:"dashedithelp"})}function L(){return U(this,"abandon")}function T(){return U(this,"approve")
}function O(){return U(this,"save")}function S(){var V=jQuery(this).closest("form"),W;Mkihelp.drafts[M]=V.find("textarea").val();W=jQuery("<div><div style='text-align:right;font-size:11px;padding-bottom:3px'><a class='previewer' href='#'>Edit draft</a> &nbsp; <a class='q closer' href='#'>X</a></div><div class='helppreview'></div></div>");W.find("a.previewer").click(Q);W.find("a.closer").click(R);W.find(".helppreview").html(hohelp.prepare_html(Mkihelp.drafts[M]));return hohelp("#"+P,W,{sticky:"dashedithelp"})}function Q(X){var W=[],V;if(X){X.stopPropagation()}if(Mkiconf.sync_help_messages&&!J[M]){hohelp("#"+P,"Loading...");H(P,M,N,Q);return false}W.push('<form id="dashaction="'+Mkiconf.update_help_message_url+"\" method='post' enctype='multipart/form-data' style='font-size:11px'>");W.push("<div style='text-align:right'><a class='previewer' href='#'>Preview draft</a> &nbsp; <a class='q closer' href='#'>X</a></div>");W.push("<div class='notice_explanation bad' style='display:none'></div><div>");W.push("<strong>HTML help text for &ldquo;"+M+"&rdquo;</strong>");if(Mkihelp.drafts[M]&&Mkihelp[M]){W.push("<br />This <em>draft</em> help differs from the user-visible help.")}else{if(Mkihelp.drafts[M]){W.push("<br />This <em>draft</em> help is not shown to normal users.")}}W.push("<textarea name='text' rows='8' style='width:240px;font-size:100%'></textarea><div style='text-align:right'>");W.push("<input type='hidden' name='name' />");if(Mkihelp.drafts[M]){W.push("<input type='submit' name='abandon' value='Delete draft' style='font-size:100%' />&nbsp; ")}W.push("<input type='submit' name='save' value='Save draft' style='font-size:100%' />&nbsp; ");W.push("<input type='submit' name='approve' value='Publish' style='font-size:100%;font-weight:bold' />");W.push("</div></div></form>");V=jQuery(W.join(""));V.find("input[name=name]").val(M);V.find("textarea").text(Mkihelp.drafts[M]||Mkihelp[M]||"");V.find("a.previewer").click(S);V.find("a.closer").click(R);V.find("input[name=abandon]").click(L);
V.find("input[name=approve]").click(T);V.find("input[name=save]").click(O);hohelp("#"+P,V,{sticky:"editdashhelp"});V.find("textarea")[0].focus();return false}return Q}function B(L,U,T){var P,S,Q,O,N,R,M;if(U&&(typeof U=="string"||U.jquery||U.nodeType)){U={trigger_selector:U}}if(U&&T){U=jQuery.extend({},U,T)}if(jQuery.isArray(L)){for(R=0;R<L.length;++R){B(L[R],U)}return }else{if(typeof L=="object"){U=jQuery.extend({},L,U||{});L=U.name}}M={_t:(U&&U.trigger_selector)||"#"+L+"_header"};if(U&&U.above){jQuery.extend(M,{above:true,aboveoffset:M._t})}P=jQuery(M._t);S=jQuery((U?U.marker_selector:null)||M._t);Q=!!Mkiconf.update_help_message_url;if(P.length==0||S.length==0||(!Q&&!Mkihelp[L])){return }do{N="dashhelpa_"+(++F)}while(document.getElementById(N));if(!U||!U.nospace){S.append(" ")}O=jQuery("<img id='"+N+"' class='"+A(L)+"' src='"+Mkiconf.images+"1x1.gif' alt='[Help]' />");O.appendTo(S);K(P,N,L,M);if(Q){O.click(D(N,L,M))}}return B})();mkistartdrag=(function(A){return function(E,D){var G;if(E.jquery){E=E[0]}function C(H,J){var I=(this.tagName.toUpperCase()=="BODY"?0:1),K=G[H];G[I]=J;return K}function B(H){H=A.event.fix(H||window.event);H.type="mkidrag";A(E).trigger(H);H.stopPropagation()}function F(H){if(document.addEventListener){document.removeEventListener("mousemove",B,true);document.removeEventListener("mouseup",F,true)}else{E.detachEvent("onmousemove",B);E.detachEvent("onmouseup",F);E.detachEvent("onlosecapture",F);E.releaseCapture()}if(G){A(E).css("cursor",C);A("body").css("cursor",C)}H=A.event.fix(H||window.event);H.type="mkidragend";A(E).trigger(H);H.stopPropagation()}if(document.addEventListener){document.addEventListener("mousemove",B,true);document.addEventListener("mouseup",F,true)}else{if(document.attachEvent){E.setCapture();E.attachEvent("onmousemove",B);E.attachEvent("onmouseup",F);E.attachEvent("onlosecapture",F)}else{return false}}if(D&&D.cursor){G=[D.cursor,D.cursor];A(E).css("cursor",C);A("body").css("cursor",C)}else{G=null}}})(jQuery);jQuery.fn.ruler=function(J){var A=jQuery(this);
var E=20;var H=A.outerWidth()-E;var C=A.outerHeight()-E;var B=A.offset();jQuery("body").append('<canvas id="ruler_canvas"style="position:absolute;top:'+B.top+"px;left:"+B.left+'px;cursor:crosshair;z-index:1000004"width="'+H+'" height="'+C+'"></canvas>');var L=hQuery("#ruler_canvas")[0].getContext("2d");function K(){L.clearRect(0,0,H,C)}var D=hQuery("#ruler_canvas").offset();var F=false;var I,G;hQuery("#ruler_canvas").mousedown(function(M){F=true;I=M.pageX-D.left;G=M.pageY-D.top;return false}).mousemove(function(P){if(!F){return }K();var W=P.pageX-D.left;var V=P.pageY-D.top;var N=Math.sqrt((W-I)*(W-I)+(V-G)*(V-G));var U=(W-I)/N;var S=(V-G)/N;L.lineWidth=1;L.beginPath();L.moveTo(I,G);var O=2;var T=2;var R,Q,M;for(R=I,Q=G,M=0;M<N;){if(M+O>N){L.lineTo(W,V);break}else{R+=U*O;Q+=S*O;L.lineTo(R,Q);M+=O}R+=U*T;Q+=S*T;L.moveTo(R,Q);M+=T}L.stroke();J(N,false);return false}).mouseup(function(O){K();var M=O.pageX-D.left;var P=O.pageY-D.top;var N=Math.sqrt((M-I)*(M-I)+(P-G)*(P-G));F=false;J(N,true);return false}).mouseout(function(){K();F=false;return false});return this};function normalize_mac_address(D){var B,A=[],C;if(!D){return""}B=D.split(":");for(C=0;C<B.length;++C){if(B[C]==""||B[C].length>2){A.push("00")}else{if(B[C].length==1){A.push("0"+B[C])}else{A.push(B[C])}}}return A.join(":").toLowerCase()}function build_traffic_analysis_teaser_ui(A){function B(E,D){var C=D.replace("XYZ",window.location.href)+"&enable="+(E?"true":"false");hQuery("#traffic_analysis_teaser_enable_button, #traffic_analysis_teaser_nothanks_button").attr("disabled","disabled");window.location.href=C;return }hQuery("#traffic_analysis_teaser_enable_button").click(function(){B(true,A)});hQuery("#traffic_analysis_teaser_nothanks_button").click(function(){B(false,A)});return true}






/* jstemplates.js */
var JSTemplate=(function(){function addslashes(t){return t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/\"/g,'\\"')}function TemplateType(source){var buffer=[],p=0,l=source.length,p2,c;while(p!==l){if((p2=source.indexOf("[%",p))<0){p2=l
}if(p!==p2){buffer.push('__buffer__.push("'+addslashes(source.substring(p,p2))+'")')}if(p2+2>=l){break}if((p=source.indexOf("%]",p2+2))<0){p=l}if((c=source.charAt(p2+2))=="%"){buffer.push('__buffer__.push("[%")');p=p2+1}else{if(c=="="){buffer.push("__buffer__.push("+source.substring(p2+3,p)+")")}else{if(c!="#"){buffer.push(source.substring(p2+2,p))}}}p+=2}eval("function render(__buffer__){"+buffer.join(";")+"}");this.renderFunc=render}TemplateType.prototype.render=function(context){var buffer=[];this.renderFunc.call(context,buffer);return buffer.join("")};function each(seq,callback){for(var i=0,n=seq.length;i!=n;i++){callback(seq[i],i)}}function escape(s){if(s===null){return""}var el=document.createElement("div");el.appendChild(document.createTextNode(s));return el.innerHTML}function escape_attr(s){if(s===null){return""}return s.replace(/[<>&\"\']/g,function(x){return{"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&apos;"}[x]})}TemplateType.escape=escape;TemplateType.escape_attr=escape_attr;return TemplateType})();






/* flex_table2.js */
function make_flex_column_selector(C){var K=C.fields,L=C.selected,E=C.callback,O,J,B=0,I=C.selectable||{},N={},R="",D="",G,M,S,A={};if(!K||!L||!E){if(typeof console!=="undefined"&&typeof console.log==="function"){throw new Error("bad make_flex_column_selector invocation")}return null}function H(T){if(I[T]===false){return false}else{if(typeof K[T]==="string"){return K[T]}else{if(I[T]==null&&K[T].selectable===false){return false}else{return K[T].l}}}}for(O=0;O<L.length;++O){if((J=H(L[O]))){R+="<option value='"+L[O]+"'>"+J+"</option>";N[L[O]]=true;++B}}for(O in K){if(!N[O]&&(J=H(O))){D+="<option value='"+O+"'>"+J+"</option>";++B}}G=jQuery("<div class='flora' title='Display options'><table><tr>\n  <td>Available columns</td><td></td><td>Displayed columns</td><td></td>\n</tr><tr>\n  <td class='custcol_avail'><select class='field_select' multiple='multiple' size='"+B+"'>"+D+"</select></td>\n  <td><img src='"+Mkiconf.images+"1x1.gif' class='custcol_add' alt='Add column' title='Add column' /><br /><img src='"+Mkiconf.images+"1x1.gif' class='custcol_rm' alt='Remove column' title='Remove column' /></td>\n  <td class='custcol_selected'><select class='field_select' multiple='multiple' size='"+B+"'>"+R+"</select></td>\n  <td><img src='"+Mkiconf.images+"1x1.gif' class='custcol_up' alt='Move up' title='Move up' /><br /><img src='"+Mkiconf.images+"1x1.gif' class='custcol_down' alt='Move down' title='Move down' /></td>\n</tr></table><br /><br /><br /></div>");
M=jQuery(".custcol_avail > select",G);S=jQuery(".custcol_selected > select",G);function Q(){var T=this.className.replace(/\s*custcol_active\s*/,"");if(T=="custcol_up"){jQuery("option:selected:first",S).prev().remove().insertAfter(jQuery("option:selected:last",S))}else{if(T=="custcol_down"){jQuery("option:selected:last",S).next().remove().insertBefore(jQuery("option:selected:first",S))}else{if(T=="custcol_add"){jQuery("option:selected",M).remove().appendTo(S)}else{if(T=="custcol_rm"){jQuery("option:selected",S).remove().appendTo(M)}}}}P()}function F(T,U){var V;if(A[T]!==U){V=jQuery(T,G);if(U){V.addClass("custcol_active");V.bind("click",Q)}else{V.removeClass("custcol_active");V.unbind("click",Q)}A[T]=U}}function P(){var Y,V,U,X,T,W,Z;Y=jQuery("option:selected",M).length>0;V=jQuery("option:selected",S).length>0;if(S[0].selectedIndex==-1){U=X=false}else{Z=S[0].options;U=!Z[0].selected;X=!Z[Z.length-1].selected;for(W=0;W<Z.length&&(U||X);++W){if(Z[W].selected&&T!==undefined&&T!==W-1){U=X=false}else{if(Z[W].selected){T=W}}}}F(".custcol_up",U);F(".custcol_down",X);F(".custcol_add",Y);F(".custcol_rm",V)}M.bind("change",P);S.bind("change",P);P();G.bind("dialogclose",function(){G.parents(".ui-dialog").remove()});G.dialog({autoOpen:true,modal:true,width:"",height:"",buttons:{OK:function(X,W,V){var U=S[0].options,T,Y=[];for(T=0;T<U.length;++T){Y.push(U[T].value)}E(Y);G.dialog("close")}},overlay:{"background-color":"#000000",opacity:0.5}})}function make_flex_dashboard_prefs_loader(B,C){var A="user_dashboard_prefs";return{update:function(D){if(C){D=jQuery.extend({},D,C)}Mkiconf[A]=json_assign(Mkiconf[A],B,D);setTimeout(save_user_dashboard_prefs,2000,B)},value:function(E){var D=json_select(Mkiconf[A],B);if(D&&(!C||!(E in C))){return D[E]}else{return null}}}}function flex_sort(F,E,J,M){var C,K,I,H,B,G,L,D,A;if(!jQuery.isArray(F)){K=[];for(C in F){K.push(F[C])}F=K}if((H=E[J])&&H.sorter!==false&&H.sort_by!==false){B=H.revsort;if(M==null){M=B}G=H.sort_by===undefined?H.sortprepare:H.sort_by;
L=H.sorter;if(typeof G!=="function"&&typeof G!=="string"&&typeof L!=="function"){G=J}if(typeof G==="function"){for(K in F){I=F[K];I["$$"]=G(I)}}else{if(typeof G==="string"){for(K in F){I=F[K];I["$$"]=I[G]}if(!L&&G.substr(G.length-1)==="#"){L="#"}}else{G=false}}if(L==="#"){L=function(O,N){return numcmp(O["$$"],N["$$"])}}else{if(typeof L!=="function"){L=function(O,N){return strcmp(O["$$"],N["$$"])}}else{if(G){D=L;L=function(O,N){return D(O["$$"],N["$$"])}}}}}else{L=function(){return 0}}if(E.__fallback_sorter__){A=E.__fallback_sorter__.sorter}A=A||function(){return 0};K=M?-1:1;I=B?-K:K;F.sort(function(O,N){return K*L(O,N)||I*A(O,N)});if(G){for(K in F){delete F[K]["$$"]}}return F}make_flex_table=(function(A){return function(H){if(!H.container||A(H.container).length!=1){if(typeof console!=="undefined"&&typeof console.log==="function"){throw new Error("bad make_flex_table invocation")}return{}}var Z,F=H.fields||H.columns,f,U,J=0,V=H.footer?30:0,P=null,B,C,E,T={};function Y(h,k){var g;if((C=h)&&F[C]){E=k}else{if(!(C=H.default_sort)||!F[C]){g=O(U,true);C=(g.length?g[0]:U[0])}E=null}if(E==null){E=F[C].revsort}flex_sort(Z,F,C,E)}function b(g){return function(){Y(g,(g==C?!E:null));J=0;T.render()}}function K(){var h,g=H.row_hover;B=null;for(h=0;h<g.length;++h){g[h].apply(T,[P])}}function W(g){var k=this.id.substr(H.row_id_prefix.length),h;P=k;if(B){clearTimeout(B)}if((h=H.row_hover_over_timeout)==null&&(h=H.row_hover_timeout)==null){h=200}if(A.isFunction(h)){h=h.apply(T,[k])}B=setTimeout(K,h)}function e(g){var k=this.id.substr(H.row_id_prefix.length),h;if(P==k){P=null;if(B){clearTimeout(B)}if((h=H.row_hover_out_timeout)==null&&(h=H.row_hover_timeout)==null){h=200}if(A.isFunction(h)){h=h.apply(T,[k])}B=setTimeout(K,h)}}function N(g,h){if(h==undefined){h=g}return"<a class='page_link' href='#page"+g+"' onclick='return false'>"+h+"</a>"}function a(m,o){var r=2,q=2,g,n,k,h,p=[],l;h="<img src='"+Mkiconf.images+"btn_arrow_left_15x15.png' alt='&lt;-' style='vertical-align: middle";if(m>1){h=N(m-1,h+"' title='Previous page' />")
}else{h+="' />"}k=r+q+2;g=(m<=k?k+q:r);n=o-(m>o-k?k+q:r)+1;for(k=1;k<=o;++k){if(k==m){p.push("<strong>"+m+"</strong>")}else{if(o<=2*(r+q)+3||k<=g||k>=n||(k>=m-q&&k<=m+q)){p.push(N(k))}else{p.push("...");if(k<m){k=Math.min(m-q,n)-1}else{k=n-1}}}}l="<img src='"+Mkiconf.images+"btn_arrow_right_15x15.png' alt='-&gt;' style='vertical-align: middle'";if(m<o){l=N(m+1,l+" title='Next page' />")}else{l+=" />"}return"<td class='pgnum'>"+h+"&nbsp;"+p.join("&nbsp;|\n")+"&nbsp;"+l+"</td>"}function I(){var h=Z.length,m=V,k=H.items_per_page_options||[30,75,150,300,1000],l="<table class='ft_foot'><tfoot><tr class='ft_foot'>",g;if(V<=0){V=m=k[k.length-1]}else{if(V<k[0]){V=m=k[0]}}l+="<td class='pgsel'>";if(!!H.simple_footer||h<=k[0]||k.length==1){if(H.footer.tagName){return""}l+="<img src='"+Mkiconf.images+"1x1.gif' alt='' style='visibility: hidden; height: 5px' />"}else{l+="<select class='num_results'>";for(g=k.length-1;g>0&&(k[g]>m||k[g-1]>h);--g){}if((m=k[g])<h){V=m}for(g=0;g<k.length;++g){l+="<option value='"+k[g]+"'";if(m==k[g]){l+=" selected='selected'"}l+=">"+(k[g]>=h?"All":k[g])+"</option>";if(k[g]>=h){break}}l+="</select> results per page";J=Math.max(0,Math.min(h-h%m,J-J%m))}l+="</td>";if(h>V){l+=a(J/V+1,Math.ceil(h/V))}return l+"</tr></tfoot></table>"}function G(){var k=H.row_class_template||"ft[%= index % 2 %]",g="",h;if(typeof k==="string"||k.length==0){return k}else{if(k.length==1){return k[0]}}for(h=0;h<k.length-1;++h){g+=(h?"[% } else ":"[% ")+"if (index % "+k.length+" == "+h+") { %]"+k[h]}return g+"[% } else { %]"+k[k.length-1]+"[% } %]"}function X(g){var k=Z.length-1,h=V;if(h>=k||h<=0){return 0}else{return Math.max(0,Math.min(k-k%h,g-g%h))}}T.render=function(){var h=Z.length,v,z,w,t="",q,l,g,m,s,n,k,p,u,o=A(H.container),r=H.footer;if(h==0){q=H.no_items_html;for(l in H.items){if(H.items.hasOwnProperty(l)){q=H.no_matches_html||q;break}}if(q){T.empty_contents();A(o).html(q);if(r&&r.tagName){A(r).hide()}return }}window.flex_table_now=new Date().getTime()/1000;if(H.prerender){H.prerender(U)
}if(r){t=I()}w=V;if(w>h||w<=0){w=h}if(w>1000){w=1000}v=Math.max(Math.ceil(h/w),1);J=X(J);z=Z.slice(J,Math.min(J+w,h));if(A.inArray(C,U)==-1){Y(U[0],null)}n="";for(l=0;l<U.length;++l){q=F[U[l]];n+="<col "+(q.colwidth?'width="'+q.colwidth+'" ':"")+"/>"}n+="<thead><tr class='ft_head'>"+M()+"</tr></thead>";if(r&&r.tagName){A(r).show().html(t)}else{if(r){p="<tfoot><tr class='ft_foot'><td class='ft_foot' colspan='"+U.length+"'>"+t+"</td></tr></tfoot>"}}s='<tbody>[% var index, item; for (index = 0; index < this.items.length; ++index) { item = this.items[index]; %]<tr class="'+G();if(H.row_id_prefix){s+='" id="'+H.row_id_prefix+"[%= item.id %]"}q={items:z,base:J};if(H.render_context){A.extend(q,H.render_context)}s+='">'+L(q)+"</tr>[% } %]</tbody>";k=(new JSTemplate(s)).render(q);T.empty_contents();o.empty();o[0].innerHTML='<table class="filter'+(H.className?" "+H.className:"")+'">'+n+(p||"")+k+"</table>";for(l=0;l<U.length;++l){q=F[U[l]];g=A(">table>thead>tr>th."+U[l].replace(/\W/g,""),o);if(q.dashhelp&&window.dashhelp){m=g.find(".ftlegend");dashhelp(q.dashhelp,m.length?m:g)}if(q.l&&q.sort_by!==false&&q.sortprepare!==false){g.bind("click",b(U[l]))}}if(H.row_hover){S()}if(T.content_body_click){A(">table>tbody",o).each(function(){this.onclick=T.content_body_click})}if(r||p){q=(p?A(">table>tfoot",o):A(r));A("select.num_results",q).bind("change",function(){V=parseInt(this.value);T.render()});A("a.page_link",q).bind("click",function(){J=(this.hash.substr(5)-1)*V;T.render()})}if((q=H.preferences)){q.update({s:(E?"-":"+")+C,n:V,f:O(U,true)})}if(H.time_sensitive_fields){u=[];for(l=0;l<U.length;++l){if(H.time_sensitive_fields[U[l]]){u.push(U[l])}}if(u.length){f=setInterval(function(){T.rerender_columns(u)},60000)}}window.flex_table_now=null;if(T.table_rendered){T.table_rendered(z,o)}};T.rerender_columns=function(k){var q,g,o,p,m=A(H.container),l=A(">table>tbody",m)[0],h,n;if(!l){return }l=l.childNodes;window.flex_table_now=new Date().getTime()/1000;if(H.prerender){H.prerender(k)}for(q=0;
q<k.length;++q){o=k[q];if((g=A.inArray(o,U))<0||F[o].disabled){continue}n=A.extend({},H.render_context||{});p=new JSTemplate("[% var item = this.item; { %]"+R(o,false,n)+"[% } %]");for(h=0;h<l.length;++h){n.item=Z[J+h];l[h].childNodes[g].innerHTML=p.render(n)}}window.flex_table_now=null};function M(){var l=[],h,m,p,g,k,o,n;for(h=0;h<U.length;++h){m=U[h];if(F[m].disabled){l.push("<th></th>");continue}p=F[m];k=p.l==null?"":p.l;o=p.align=="right"?1:(p.align=="center"||p.align=="center-th"?2:0);n=(k!=""&&p.sort_by!==false&&p.sortprepare!==false);l.push("<th");if(p.t){l.push(' title="'+F[m].t+'"')}l.push(' class="ft ft'+(o?(o==1?"r ":"c "):"l ")+m.replace(/\W/g,""));if(!n){l.push(" nosort")}if(!n){l.push(' ftlegend">'+k+"</th>")}else{l.push('"><table class="lean"');if(o){l.push(' style="margin:0'+(o==1?" 0 0":"")+' auto"')}l.push('><tbody><tr style="vertical-align:bottom">');if(o&&m!=C){l.push('<td style="padding:0 5px'+(o==1?"":" 0 0")+'"></td>')}l.push('<td class="ftlegend">'+k+"</td>");if(m==C){g=(E?"down":"up");l.push('<td style="padding:0 0 2px"><img src="'+Mkiconf.images+"icon_arrow_"+g+'_10x10.png" title="Toggle sort order" alt="[Sorting '+g+']" style="width:10px;height:10px" /></td>')}else{if(o!=1){l.push('<td style="padding:0 5px'+(o==2?" 0 0":"")+'"></td>')}}l.push("</td></tr></tbody></table></th>")}}return l.join("")}function R(l,g,m){var n=F[l],k,h="";if(n.disabled){return"<td></td>"}if(n.prerender){n.prerender(m)}if(typeof n.render==="string"){k=n.render}else{if(n.render){k=n.render(U)}else{k=""}}if(typeof k==="string"){k={content:k}}else{k=A.extend({pre:"",post:""},k)}if(g){h+='<td class="ft '+(n.className||l.replace(/\W/g,""));if(n.align){h+=(n.align=="right"?" ftr":(n.align=="center"?" ftc":""))}h+='">'}if(k.pre){h+=k.pre}if(k.content){h+=k.content}else{h+='[%= escape(item["'+l+'"]) %]'}if(k.post){h+=k.post}if(g){h+="</td>"}return h}function L(h){var g="";A.each(U,function(k,l){g+=R(l,true,h)});return g}function O(h,l){var k,n=h.length,g=[],m={};if(H.row_num){h=["row_num"].concat(h)
}if(H.initial_fields){h=H.initial_fields.concat(h)}if(l){for(k=h.length-n-1;k>=0;--k){m[h[k]]=true}}for(k=0;k<h.length;++k){if(F[h[k]]&&!m[h[k]]){g.push(h[k]);m[h[k]]=true}}return g}function Q(g){var h,k=O([]);if(g){g=O(g)}if((!g||g.length<=k.length)&&H.selected_fields){g=O(H.selected_fields)}if(!g||g.length<=k.length){g=[];for(h in F){if(!F[h].synonym){g.push(h)}}g.sort(strcmp);g=O(g)}U=g;if(T.columns_changed){T.columns_changed(U,T)}}function D(g){var h=F[g];return h?h.synonym||g:g}function S(){var g=A(H.container);A(">table>tbody>tr",g).each(function(){this.onmouseover=W;this.onmouseout=e})}T.filter=function(g){Z=[].concat(g);Y(C,E);J=0;T.render()};T.scroll=function(g,k){var h;if(g==null){h=J+k*V}else{h=g*V}h=X(h);if(h!=J){J=h;T.render()}};T.items=function(g){if(g){var k=V,h=Z.length;if(k<=0){k=h}return Z.slice(J,Math.min(J+k,h))}else{return Z}};T.resort=function(){Y(C,E);T.render()};T.selected_fields=function(){return[].concat(U)};T.set_no_items_html=function(g){H.no_items_html=g};T.bind_row_hover=function(g){if(!H.row_hover){S()}H.row_hover=H.row_hover||[];H.row_hover.push(g)};T.hover_item_id=function(){return P};T.empty_contents=function(){var g=A(H.container),h=A(">table>tbody",g)[0];if(h){h.parentNode.removeChild(h)}if(f){clearInterval(f);f=undefined}};function d(h,g){var k=h.charAt(0);if(k=="-"){E=true,h=h.substring(1)}else{if(k=="+"){E=false,h=h.substring(1)}else{E=g?null:false}}C=D(h);if(!C||!F[C]){C=E=null}}function c(){var k,g,h;H=A.extend({},H);H.items=H.items||{};if(H.displayed){Z=[].concat(H.displayed)}else{if(A.isArray(H.items)){Z=[].concat(H.items)}else{Z=[];g=H.items;for(k in g){if(g.hasOwnProperty(k)){Z.push(g[k])}}}}if(H.row_id_prefix===true){H.row_id_prefix="item_"}if(H.items_per_page){V=H.items_per_page}if((g=H.footer)&&g!==true){H.footer=A(g)[0]}for(k in {table_rendered:1,columns_changed:1,items_changed:1,content_body_click:1}){if(H[k]){T[k]=H[k]}}F.row_num={l:"",render:"[%= this.base+index+1 %]",sort_by:false,colwidth:"0*",align:"right"};h=H.preferences;
Q((function(){var o,n,m=[],l=(h&&h.value("f"))||[];for(o=0;o<l.length;++o){if((n=D(l[o]))){m.push(n)}}return m})());if(h&&(g=h.value("s"))!=null){d(g,false)}if(!C&&(g=H.sort_field||H.sort_column)){d(g,true)}Y(C,E);if(h&&(g=h.value("n"))!=null&&typeof g==="number"){V=g}if(A.isFunction(H.row_hover)){H.row_hover=[H.row_hover]}if(H.column_customizer){A(H.column_customizer).bind("click",function(){var m={},l,n;l=H.initial_fields||[];for(n=l.length-1;n>=0;--n){m[l[n]]=false}if(H.row_num){m.row_num=false}l=H.unselectable_fields||[];for(n=l.length-1;n>=0;--n){m[l[n]]=false}make_flex_column_selector({fields:F,selected:U,selectable:m,callback:function(o){Q(o);T.render()}});return false})}delete H.displayed;T.render();A(window).bind("unload",function(){var l=V;if(l>Z.length||l<=0){l=Z.length}if(l>=150){T.empty_contents()}})}c();return T}})(window.jQuery);function make_list3_content_body_click(A){return function(C){var B;C=C||window.event;if(C&&(C.shiftKey||C.ctrlKey||C.altKey||C.metaKey)){return true}for(B=C?C.target||C.srcElement:null;B&&B!=this;B=B.parentNode){if(jQuery(B).hasClass("noclick")){return true}else{if(B.tagName.toUpperCase()=="A"){if(!B.target){show_spinner_at_mouse_click(C)}return true}else{if(B.tagName.toUpperCase()=="TR"){show_spinner_at_mouse_click(C);return A(B.id.replace(/^.*_/,""))}}}}}}function make_list3_flex_table(A){A=jQuery.extend({},A);A.columns_changed=function(B,C){jQuery(A.container).trigger("columns_changed",[B,C])};if(A.history){A.content_body_click=make_list3_content_body_click(A.history)}A.row_id_prefix=true;A.table_rendered=function(C,B){jQuery(A.container).trigger("table_rendered",[C])};A.items_changed=function(){jQuery(A.container).trigger("items_changed")};return make_flex_table(A)}






/* graph_util.js */
var mkigraph=(function(J){var H=4,L=[1,1.5,2,2.5,3,4,5,8,10],F,N,R={},O={};function M(Z,c){c=c||H;var b,Y=Z/c,a=1;while(Y>0&&Y<1){Y*=10;a/=10}while(Y>=10){Y/=10;a*=10}for(b=0;b<L.length;b++){if(L[b]>=Y){break}}return L[b]*a*c}function S(d){var Y=0,f=1,Z="b/s",e,b,a,c;
if(d.max>1024*1024*1024){f=1024*1024*1024;Y=M(d.max/f);Z="Gb/s"}else{if(d.max>1024*1024){f=1024*1024;Y=M(d.max/f);Z="Mb/s"}else{if(d.max>512){f=1024;Y=M(Math.max(d.max/f,1));Z="Kb/s"}else{f=1;Y=M(d.max);Z="b/s"}}}e=Y/H;b=[];for(a=0;a<=Y;a+=e){c=a.toFixed(2).replace(/\.?0*$/,"")+"\xA0"+Z;b.push([a*f,c])}return b}function U(Z,Y){Y=Y||H;return function(e){var b=M(e.max,Y),f=b/Y,c,d,a=[];for(c=0;c<=b;c+=f){d=c.toFixed(2).replace(/\.?0*$/,"")+Z;a.push([c,d])}return a}}function C(Y){return function(a,Z){return a.toFixed(2).replace(/\.?0*$/,"")+Y}}O.time_ticksize=function(f,d,e){var Z,c=400,Y,b;if(e&&typeof e==="string"){e=J(e)}if(e&&e.length){c=e.width()||400}Z=c/((d-f)/3600000);Y=[[1200,5,"minute"],[300,15,"minute"],[150,30,"minute"],[100,1,"hour"],[30,2,"hour"],[12.5,4,"hour"],[1.77,1,"day"],[0.6,3,"day"],[0.2,7,"day"],[-Infinity,1,"month"]];for(b=0;;++b){if(Z>=Y[b][0]||b==Y.length-1){return Y[b].slice(1,3)}}};O.tick_generators={bpsTickGenerator:S,msTickGenerator:U("\xA0ms"),msTickGenerator3:U("\xA0ms",3),rssiTickGenerator:U("\xA0dB"),lossTickGenerator:U("%")};O.tick_formatters={voltsTickFormatter:C("\xA0V"),ampsTickFormatter:C("\xA0A"),amphoursTickFormatter:C("\xA0Ah"),degcTickFormatter:C("&deg;C")};O.line_color="rgb(126,161,180)";O.fill_color="rgb(222,231,236)";O.highlight_line_color=["rgb(210,214,0)","rgb(214,136,0)","rgb(214,51,0)"];O.highlight_fill_color=["rgba(234,236,151,0.5)","rgba(236,208,151,0.5)","rgba(236,183,151,0.5)"];O.status_line_color=["rgb(76,173,0)","rgb(255,210,0)","rgb(255,0,0)","rgb(191,191,194)","rgb(191,191,194)","rgb(87,108,234)","rgb(246,147,60)","rgb(255,195,203)","rgb(166,124,189)"];O.status_fill_color=["rgba(76,173,0,0.5)","rgba(255,210,0,0.5)","rgba(255,0,0,0.5)","rgba(191,191,194,0.5)","rgba(191,191,194,0.5)","rgba(87,108,234,0.5)","rgba(246,147,60,0.5)","rgba(255,195,203,0.5)","rgba(166,124,189,0.5)"];O.add_plugin=function(Z,b,Y){var a,c=R[Z];Y=Y||0;if(!c){R[Z]=c=[]}for(a=c.length;a>0&&c[a-1].o>Y;--a){}c.splice(a,0,{f:b,o:Y})};function B(Y){if(Y.name){Y=Y.name
}else{if(typeof Y!=="string"){Y=Y[0]}}return R[Y]||[]}function T(c,d,a,f){var e=B(c),b,Z,Y=0;for(b=0;b<e.length&&e[b].o<1000;++b){Z=e[b].f(c,d,a,f);if(!Z){++Y}else{if(Z=="stop"){return 0}}}return Y}function I(Z,b){var a=B(Z),Y;for(Y=0;Y<a.length;++Y){if(a[Y].o>=1000){a[Y].f(Z,b)}}}function X(Y){if(typeof Y==="string"||Y.nodeType||Y.jquery){return{canvas:Y}}else{return Y}}function Q(a,Z,Y){return function(){V(a,Z,Y)}}function V(e,h,c){var Z,Y,g,b,d,a,f;h=X(h);Z=J(h.canvas);if(!Z.length){return null}c=c||0;Y=Z.width();g=Z.height();if((Y==0||g==0)&&c<=10){setTimeout(Q(e,h,c+1),250);return null}b=[];d=J.extend({xaxis:{mode:"time",timezoneOffset:true},yaxis:{min:0,ticks:O.tick_generators.bpsTickGenerator},lines:{show:true,fill:true,fillColor:O.fill_color},points:{show:false},bars:{show:false},shadowSize:0,canvasWidth:Y,canvasHeight:g},h);if(!T(e,b,d,Q(e,h))){return false}if(d.xaxis.min!==undefined&&d.xaxis.max!==undefined&&d.xaxis.tickSize===undefined){d.xaxis.tickSize=O.time_ticksize(d.xaxis.min,d.xaxis.max,Z)}for(a=0;a<b.length;++a){if(!b[a].data||!b[a].data.length){b.splice(a,1);--a}}Z.width(Y);f=J.plot(Z,b,d);I(e,f);return f}function A(Z,Y){return function(){E(Z,Y)}}F={lblue:{c:"rgb(173,212,235)",o:0},lred:{c:"rgb(240,139,128)",o:1},lgreen:{c:"rgb(162,230,170)",o:2},lyellow:{c:"rgb(251,237,157)",o:3},lpurple:{c:"rgb(229,173,235)",o:4},mtan:{c:"rgb(216,162,126)",o:5},laqua:{c:"rgb(144,236,220)",o:6},mblue:{c:"rgb(111,140,219)",o:7},lpink:{c:"rgb(249,203,203)",o:8},mpurple:{c:"rgb(208,108,197)",o:9},mgreen:{c:"rgb(105,185,63)",o:10},othergrey:{c:"rgb(190,190,198)"}};(function(){var Z,Y;N=[];for(Z in F){if((Y=F[Z].o)!=null){N[Y]=F[Z]}}})();function W(Y,c){var b,g,k,e=[],Z,f,l,d,a,h;for(b=0;b<c;++b){g=Y[b];if(!k||g.xgroup!=k.xgroup){k=g;e.push(k)}if((Z=g.color)){if((f=F[Z])){Z=f.c}else{if((f=J.color.parse(Z))){Z=f.toString()}else{Z=null}}g.color=Z}if(Z&&!k.color){k.color=Z}}l=0;d=N.length;c=e.length;for(b=0;b<c;++b){g=e[b];if(!g.color){Z=N[l%d].c;for(a=b-3;a<b+4;++a){if(a>=0&&a!=b&&(h=e[a])&&h.color==Z){++l;
Z=N[l%d].c;a=b-4}}g.color=Z;++l}else{if(g.color==N[l%d].c){++l}}}}function P(Y,h){var f=(Mkiconf.counter_sets[h.csid]||{}).rules,Z=h.save_rule_color,c,b,e,g,d,a;for(c=Y.length-1;c>=0;--c){e=Y[c];if((a=e.color)&&(g=e.rule_ids)){for(b=g.length-1;b>=0;--b){if((d=f[g[b]])){d[Z]=a}}}}}function G(Z,p){var d,c,l=0,g=Z.length,k=null,m,o,Y,h,n={},b,f,a;function e(r,q){var s=r.xgroup,t=q.xgroup;if(r.is_catchall!=q.is_catchall){return r.is_catchall?1:-1}if(s!=t){return n[t]-n[s]||strcasecmp(s,t)}if(r.is_group_catchall!=q.is_group_catchall){return r.is_group_catchall?1:-1}return q.value-r.value||strcasecmp(r.name,q.name)}for(d=g-1;d>=0;--d){m=Z[d];l+=m.value;h=m.xgroup=(p.grouped?m.group||m.name:"");n[h]=(n[h]||0)+m.value}Z.sort(e);if((o=p.min_slice)){o=l*o/360;for(d=g-1;d>=0&&!k;--d){if(Z[d].is_catchall){k=J.extend({},Z.splice(d,1)[0]);n[k.xgroup]-=k.value;--g}}k=k||{name:"Other",xgroup:"",is_catchall:true,value:0,rcvd:0,sent:0,color:"othergrey",rule_ids:[]};if((Y=p.max_catchall_slice)){Y=l*Y/360+k.value}d=g-1;while(d>=0){m=Z[d];if(n[m.xgroup]>=o||k.value+n[m.xgroup]>=Y){break}h=m.xgroup;while(d>=0&&(m=Z[d]).xgroup==h){k.rule_ids.push.apply(k.rule_ids,m.rule_ids);k.value+=m.value;k.rcvd+=m.rcvd;k.sent+=m.sent;--d}}if(k.value){Z.splice(d+1,g-d-1,k);g=Z.length;n[k.xgroup]=(n[k.xgroup]||0)+k.value}Z.sort(e);for(d=g-1;d>=0;--d){m=Z[d];if(m.is_catchall||(m.value>=o&&!m.is_group_catchall)){continue}k=J.extend({},m);c=d-1;while(c>=0&&(m=Z[c]).value<o&&m.xgroup==k.xgroup){k.rule_ids.push.apply(k.rule_ids,m.rule_ids);k.color=m.color||k.color;k.value+=m.value;k.rcvd+=m.rcvd;k.sent+=m.sent;--c}if(d-c==1){continue}if(c<0||m.xgroup!=k.xgroup){k.name=k.group}else{if(!k.is_group_catchall){k.name="Other"}}Z.splice(c+1,d-c,k);g-=d-c-1;d=c+1}}W(Z,g);f=Math.PI*2;b=f+f/4;h=0;for(d=0;d<g;++d){m=Z[d];m.angle2=b;m.angle1=b=b-f*m.value/l;if(d==0||Z[h].xgroup!=m.xgroup){h=d;a=m.color}m.color=J.color.interpolate("#fff",Math.min(0.2*(d-h),0.8),a).toString()}if(p.save_rule_color){P(Z,p)}return l}function K(e,Y,f,a){var b=Math.cos,Z=Math.sin,d=e.angle1,c=e.angle2;
return["M",Y,f,"L",Y+a*b(d),f-a*Z(d),"A",a,a,0,+(c-d>=Math.PI),0,Y+a*b(c),f-a*Z(c),"z"]}function D(a,d,Y,e,b){function Z(){var h=[colored_bullet(d.color)+"\xA0"],o=Math.PI*2,n=Math.PI,s=o-n/2,q=d.angle1,p=d.angle2,l,r,m,g,f,k;if(d.group&&d.group!=d.name){h.push(JSTemplate.escape(d.group),"&mdash;")}h.push("<b>",JSTemplate.escape(d.name),"</b><br />",unparse_size(d.value*1024,1,"B",false),"&nbsp;(","<span title='Received/downloaded' style='font-size:.95em'>↓<span class='thinsp'></span>",unparse_size(d.rcvd*1024,1,"B",false),"</span>,&nbsp;",'<span title="Sent/uploaded" style="font-size:.95em">↑<span class=\'thinsp\'></span>',unparse_size(d.sent*1024,1,"B",false),"</span>)");r=(p>o&&p-o>o-q)||(q<n&&n-q>p-n);if(p-q<=n/6){l=(q+p)/2}else{if(p>s&&q<s){l=Math.min(Math.max(s,q+n/12),p-n/12)}else{if(r?p>o:p<=s){l=p-n/12}else{l=q+n/12}}}m=J(a).offset();g={left:m.left+Y+(b-4)*Math.cos(l),top:m.top+e-(b-4)*Math.sin(l)};f={left:m.left+Y+15*Math.cos((q+p)/2),top:m.top+e-15*Math.sin((q+p)/2)};k=r?[g,g,f,g]:[f,g,g,g];hohelp(this,h.join(""),{offset:k,above:r,atleft:l>4*n/5&&l<6*n/5,atright:l>9*n/5&&l<11*n/5})}function c(){hohelp(this)}return[Z,c]}function E(e,d){var r,w,g,f,b,s,c={},AA,n,t,q,o,z,x,u,Z,Y=[],m=[],k,p,v,a,l;d=X(d);v=J.extend({legend_size:3},d);if(!T(e,Y,v,A(e,d))){return true}k=G(Y,d);r=J(d.canvas).html("");g=Raphael(r.attr("id"),r.width(),r.height());f=Math.floor(r.width()/2)-1;b=s=f+1;if(Y.length==0){g.circle(b,s,f).attr({fill:"#eee"})}else{if(Y.length==1){m[0]=g.circle(b,s,f).attr({fill:Y[0].color})}else{for(t=Y.length-1;t>=0;--t){m[t]=g.path(K(Y[t],b,s,f)).attr({fill:Y[t].color,stroke:"#fff"})}}}g.circle(b,s,f-0.5).attr({stroke:"#545454","stroke-width":1.75});if(v.legend_cont&&Y.length){p=[];for(t=q=0;q<v.legend_size&&t<Y.length;++q){slice=Y[t];o=Raphael.getRGB(slice.color).hex;a=slice.group||slice.name;l=slice.value;for(++t;t<Y.length&&((slice=Y[t]).group||slice.name)==a;++t){l+=slice.value}a=a.replace(/\s+\(.*\)\s*$/,"");p.push("<tr class='base'><td style='white-space:nowrap'>",colored_bullet(o),"\xA0</td><td style='padding:0 0.5em 0 0'>",JSTemplate.escape(a),"</td><td style='text-align:right;white-space:nowrap'>",unparse_fraction_as_percent(l,k),"</td></tr>")
}J(v.legend_cont).html("<table style='width:100%' class='lean'><col width='0*' /><col /><col width='0*' />"+p.join("")+"</table>")}else{if(v.legend_cont){J(v.legend_cont).html("")}}if(false){for(t in z){for(q in z[t].items){z[t].items[q].lighter()}}x=canvas.g.piechart(b,s,f,data.slices.slice(),{cut:d.max_slices});for(t=0;t<pie_data.length;++t){var h=data.hoverdetails[pie_data[t].order].combined/data.details[pie_data[t].order].combined;if(h==0){h=0.01}x.sectors[t].scale(h,h,b,s)}}if(v.hover&&Y.length){for(t=0;t<m.length;++t){u=D(d.canvas,Y[t],b,s,f);m[t].mouseover(u[0]).mouseout(u[1])}}if((Z=v.click)){for(t=0;t<m.length;++t){m[t].click(Z).attr("cursor","pointer")}}return Y}O.timeseries=V;O.piechart=E;O.stats_graph=function(b,Z,d){var a=Z.options,Y;if(!a.xaxis.hasOwnProperty("timezoneOffset")){a.xaxis.timezoneOffset=true}if((Y=a.yaxis.tickFormatter)){a.yaxis.tickFormatter=O.tick_formatters[Y]}if(typeof a.yaxis.ticks==="string"){a.yaxis.ticks=O.tick_generators[a.yaxis.ticks]}a.yaxis.labelSpacing=42;if(d&&d.upseries&&typeof outage_grapher!=="undefined"){outage_grapher.graph(b,d.t0,d.t1,d.upseries,a)}try{J.plot(J(b),[Z.data],a)}catch(c){}};return O})(window.jQuery);function graph_stats(D){var G="",C,E,B,A,F;if(D.id){G="_"+D.id}if(D.upseries){upseries_obscure(D.upseries)}for(C in D){if(D.hasOwnProperty(C)&&D[C]&&D[C].options){mkigraph.stats_graph("#"+C+"_graph_canvas"+G,D[C],D)}}if(D.upseries){outage_grapher.graph("#outage_graph_canvas"+G,D.t0,D.t1,D.upseries,"s")}}






/* outage_graph.js */
var outage_grapher=(function(){var I=false,K,F=1,G,Q,C,D,O={},M=[false,true,true,false,true];function A(R){return"#outage_graph_canvas_"+R}function J(R,S){if(S===1){jQuery(R).html("<img class='pl3outage_s0g0' src='"+Mkiconf.images+"outage-135x15.png' alt='[No outage]' />")}else{if(S===4){jQuery(R).html("<img class='pl3outage_s0g1' src='"+Mkiconf.images+"outage-135x15.png' alt='[Connected as gateway]' />")}else{if(S===0){jQuery(R).html("<img class='pl3outage_s2' src='"+Mkiconf.images+"outage-135x15.png' alt='[100% outage]' />")
}else{jQuery(R).html("<img class='pl3outage_s4' src='"+Mkiconf.images+"outage-135x15.png' alt='[Dead]' />")}}}return 0}function L(S){var R=A(S.id),U=S["last_active#"]||0,T=Mkijson.n.meta;if(S.upseries){return O.graph(R,T.t0,T.upseries,S.upseries,"l")}else{if(U&&T.t1-U<=Mkiconf.dead_node_thresh){return J(R,0)}else{return J(R)}}}function E(){var S,R,T=Mkijson.n.meta;if((!T.upseries||T.upseries+15<T.t1)&&!G){data3_load.ajax("n",{f:"upseries",t0:T.upseries||T.t0,t1:T.t1},O.loaded);return }for(S=R=0;S<K.length&&R<50;++S){R+=L(K[S])}K=K.slice(S,K.length);if(K.length){F*=1.5;G=setTimeout(E,Math.min(F,1500))}else{G=undefined}}function N(){var U,T,S,R;U=jQuery.color.make(156,183,104,1);T=jQuery.color.make(203,114,19,1);S=jQuery.color.make(109,200,109,1);R=jQuery.color.make(203,176,19,1);Q=[jQuery.color.make(221,0,0,1),U,U,T,S,R,T,R,R,T];U=jQuery.color.make(221,0,0,0);T=jQuery.color.make(160,133,104,0.25);R=jQuery.color.make(171,114,68,0.25),C=[jQuery.color.make(221,0,0,0.25),U,U,T,U,R,T,R,R,T];D=["No connectivity","Connected","Connected repeater","Disabled repeater (unable to mesh to a working gateway)","Connected gateway","Disabled gateway (bad DNS)","Repeater looking for gateway","Gateway warning (IP address conflict on local LAN)","Gateway warning (bad connectivity to controller, possible firewall or NAT issue)","Repeater warning (bad connectivity to controller, possible firewall or NAT issue)"]}function H(Z,U,W){var V=W,R=W+1,T,S,a,Y,X;while(V>0&&U[V-1][1]==U[V][1]){--V}while(R<U.length&&U[R][1]==U[R-1][1]){++R}if(V>0&&R<U.length){T=new Date(U[V][0]*1000);a=unparse_date(T,"%b %-d %H:%M",1);S=new Date(U[R][0]*1000);Y=unparse_date(S,"%b %-d %H:%M",1);if(U[V][0]-U[R][0]<86400&&(X=Y.lastIndexOf(" "),a.substring(0,X)==Y.substring(0,X))){Y=Y.substring(X+1)}Z+=" ("+a+"&ndash;"+Y+")"}else{if(V>0){T=new Date(U[V][0]*1000);Z+=unparse_date(T," (starting %b %-d %H:%M)",1)}else{if(R<U.length){S=new Date(U[R][0]*1000);Z+=unparse_date(S," (ending %b %-d %H:%M)",1)}}}return Z}function B(Z,S,Y,W,V,U){if(S>0&&!M[U[S-1][1]]){return S
}var a=S,X=S||1,R=Z.x/1000,T=2.5*(V-W)/(jQuery(Y).width()-4);while(1){if(a<=0||(a<U.length&&U[a][0]<R-T)){a=0;break}else{if(!M[U[a-1][1]]){if(U[a][0]-U[a-1][0]>=2*T){a=0}break}else{--a}}}while(1){if(X>=U.length-1||U[X-1][0]>R+T){X=0;break}else{if(!M[U[X-1][1]]){if(U[X][0]-U[X-1][0]>=2*T){X=0}break}else{++X}}}if(X&&(!a||(U[X-1][0]-R)<(R-U[a][0]))){return X}else{if(a){return a}else{return S}}}function P(S,U,T,R){var V=0;return[function(X,c,d,b){var Y=0,W=R.length,a,e,Z,f;while(Y<W){a=Y+((W-Y)>>1);if(R[a][0]>c.x/1000){W=a}else{Y=a+1}}W=B(c,W,S,U,T,R);if(W>0&&R[W-1][1]<D.length&&c.x>=U*1000&&c.x<=T*1000&&V>0){e=D[R[W-1][1]];if(!M[R[W-1][1]]||W>1){e=H(e,R,W-1)}Z=jQuery(S);f={bottom:-20,nostack:true};if(R[W-1][0]>=U&&R[W-1][0]<=T){f.left=b.getXPosition(R[W-1][0]*1000)}if(W<R.length&&R[W][0]>=U&&R[W][0]<=T){f.right=b.getXPosition(R[W][0]*1000)}hohelp(Z[0],e,f)}},function(W){++V},function(W){if(V>0){--V}hohelp(S,null,{nostack:true})}]}O.graph=function(R,d,b,g,e){var S=jQuery(R),X,W,n=[],l,k,h,T,V=(e==="l"?135:S.width()),Y,a,f=[],U,Z,m;if(!Q){N()}if(e.prototype!==String.prototype&&!e.grid){e.grid={}}if(e.grid){a=C;Y=(b-d)/(V-52)}else{a=Q;Y=(b-d)/(V-4)}for(l=0;l<a.length;++l){f.push(a[l].toString())}X=[d,0];for(l=0;l<g.length&&g[l][0]<d;++l){X=g[l]}W=(l<g.length?g[l]:[b,0]);U=d;Z=null;while(1){m=X[1];if(m==2||m>=a.length){m=1}if(l+1<=g.length&&W[1]<a.length&&a[W[1]]===a[m]){++l;W=(l<g.length?g[l]:[b,0]);continue}if(!Z&&W[0]<b&&W[0]<U+Y){Z=[]}if(Z){Z[m]=(Z[m]||0)+Math.min(W[0],U+Y)-X[0]}if(!Z){if(m!==1){n.push({x1:U*1000,x2:W[0]*1000,color:f[m]})}U=W[0]}else{if(W[0]>=U+Y||W[0]>=b){n.push({x1:U*1000,x2:(U+Y)*1000,color:jQuery.color.interpolate(a,Z).toString()});U=U+Y;Z=null}}if(U>=W[0]||Z){X=W;if(X[0]>=b){break}++l;W=(l<g.length?g[l]:[b,0])}}d*=1000,b*=1000;if(n.length&&n[n.length-1].x2>=b){n[n.length-1].x2+=Y*2000}if(e==="l"){if(n.length===0){return J(R,1)}else{if(n.length===1&&n[0].x1<=d&&n[0].x2>=b&&n[0].color===f[4]){return J(R,4)}else{if(n.length===1&&n[0].x1<=d&&n[0].x2>=b&&!n[0].color){return J(R,0)
}}}}else{if(e.grid){e.grid.coloredAreas=n;e.grid.coloredAreasColor=f[0];return e}}try{T={targetWidth:V,xaxis:{min:d,max:b,partialGrid:true},yaxis:{ticks:[],min:0,max:1},grid:{coloredAreas:n,tickColor:"rgba(0,0,0,0.4)",backgroundColor:"rgba(136,238,136,1)",coloredAreasColor:f[0]}};if(e==="l"){T.xaxis.ticks=[];T.targetHeight=15;T.noOverlay=true}else{if(e==="mi"){T.xaxis.ticks=[];T.grid.borderWidth=T.grid.labelMargin=T.xaxis.labelHeight=T.yaxis.labelWidth=0}else{T.xaxis.tickSize=mkigraph.time_ticksize(d,b,S);T.xaxis.mode="time";T.xaxis.timezoneOffset=true;T.xaxis.used=true}}if((h=jQuery(R+"_tooltip")).length){T.grid.hoverable=true}jQuery.plot(S,[],T);if(h.length){k=P(R,d/1000,b/1000,g);jQuery(R).unbind(".outage").bind("plothover.outage",k[0]).bind("mouseover.outage",k[1]).bind("mouseout.outage",k[2])}}catch(l){}return 1};O.bind_to=function(R){R.bind("columns_changed",function(S,T){I=(jQuery.inArray("outage_graph",T)!=-1)});R.bind("table_rendered",function(S,T){if(G){clearTimeout(G)}G=undefined;F=250;K=T;if(typeof G_vmlCanvasManager!=="undefined"&&history3.initializing()){setTimeout(O.loaded,100)}else{O.loaded()}})};O.loaded=function(){if(I){E()}};return O})();






/* smart_filter.js */
function make_smart_filter(){var J={"":function(){return"false"}},D={},U={"false":0,"true":1},O={},X={},T={},V=1,S=2,B=0,W=1,E=2,P=3,I=4,G=5;function a(c){var f,g,d;for(f in X){g=X[f];if((g&c)===0){return 0}else{if((g|c)===V){d=g}}}return d}function L(f,d,e){var c;if(f===P){if((c=a(d))===undefined){return V&~1}else{return(c?d^c:V)}}else{if(f===I){return d&e}else{if(f===G){if(a(d&e)!==undefined){return d|e}else{return(d|e)&~1}}else{return d}}}}function Y(e){var d=e,f=0,c;while((c=d.match(/^\s*(\(|\)|(?:[^\(\)\"\s]|\"[^\"]*\"?)+)(.*)$/))){if(c[1]==="("){++f}else{if(c[1]===")"){--f}}d=c[2];if(f===0){break}}return[e.slice(0,e.length-d.length),d]}function b(h,q,d){var n,e,f,o,p,l,g;q=jQuery.trim(q);e=q.match(/^(\(|-|(?:[^\(\)\"\s]|\"[^\"]*\"?)+)(.*)$/);if(!e){return[q,null,0]}else{if(e[1]==="("){return Z(h,q.substr(1),d,true)
}else{if(e[1]==="-"||e[1]==="NOT"){n=b(h,e[2],d);if(!n[1]){return n}return[n[0],[P,n[1]],L(P,n[2])]}}}if(e[1].charAt(e[1].length-1)===":"&&(g=J[e[1].slice(0,e[1].length-1)])&&(n=e[2].match(/^\s*(\(|-|(?:[^\(\)\"\s]|\"[^\"]*\"?)+)(.*)$/))){if(n[1]==="("||n[1]==="-"){if(g.take_expr&&!d.kwprefix){n=Y(e[2]);e[1]+=n[0];e[2]=n[1]}else{p=d.kwprefix;d.kwprefix+=e[1];n=b(h,e[2],d);d.kwprefix=p;return[n[0],n[1]&&[W,e[1],n[1]],n[2]]}}else{if(n[1]!=="OR"&&n[1]!=="AND"){e[1]+=n[1];e[2]=n[2]}}}f="";o=d.kwprefix+e[1];if((n=o.match(/^(.*?)(:|[=<>]=?|!=)(.*)$/))&&J[n[1]]){f=n[1];if(n[2]==":"||n[2]=="="||n[2]=="=="){o=n[3]}else{o=n[2]+n[3]}}g=J[f];if(!g.take_expr&&!g.case_sensitive){o=o.toLowerCase();if(o.match(/^\".*[^\"]$/)){o+='"'}}p=g(o,d,h,M);if((l=U[p])===undefined){l=V&~1}return[e[2],[B,p,e[1]],l]}function K(e,d,f){if(d.length===1){return[e,null,0]}else{if(d.length===2){return[e,d[1],f]}else{return[e,d,f]}}}function A(h,k,g){var f=[I],e,d,l=V;while((k=jQuery.trim(k))!==""){d=k.match(/^(\)|OR(?=[ \)]|$)|AND(?=[ \)]|$))(.*)$/);if(d&&d[1]==="AND"){k=d[2]}else{if(d){break}else{e=b(h,k,g);if(e[1]){f.push(e[1]);l&=e[2]}k=e[0]}}}return K(k,f,l)}function Z(h,k,g,f){var e=[G],d,l=0;while((k=jQuery.trim(k))!==""){if(k.charAt(0)===")"){k=k.substr(1);if(f){break}}else{if(k.match(/^OR(?: |$)/)){k=k.substr(2)}else{d=A(h,k,g);if(d[1]){e.push(d[1]);l=L(G,l,d[2])}k=d[0]}}}return K(k,e,l)}function H(c){var e,d,f;if(c[0]===B){return c[2]}for(e=1+(c[0]<P),d=[];e<c.length;++e){f=H(c[e]);d.push(c[e][0]>c[0]?"("+f+")":f)}d=d.join(c[0]>I?" OR ":" ");f=[null,c[1],null,"-"][c[0]];return(f||"")+d}function C(c){var e,d;if(c[0]===B){return c[1]}for(e=1+(c[0]<P),d=[];e<c.length;++e){d.push(C(c[e]))}if(c[0]===P){return"!("+d.join("")+")"}else{if(d.length===1){return d[0]}else{return"("+d.join(c[0]>I?")||(":")&&(")+")"}}}function R(d){var e,g,f;if(d[0]===B){g=U[d[1]];return(g!==undefined?[E,g,null]:d)}d=d.slice(0);g=(d[0]===G?0:V);for(e=1+(d[0]<P);e<d.length;++e){d[e]=R(d[e]);f=(d[e][0]===E?d[e][1]:V&~1);g=L(d[0],f,g);
if(d[0]!==G&&d[e][0]===E&&g!==(V&~1)&&!(d[e]=d[e][2])){d.splice(e,1);--e}}if(d[0]===G&&(g&1)){d=[G]}else{if(d[0]===G&&g!==(V&~1)){Q(d,g)}}if(d.length===1+(d[0]<P)){return[E,g,null]}else{if(g!==(V&~1)){return[E,g,d]}else{return d}}}function Q(d,g){var e,f;f=~g&V&~1;for(e=1;e<d.length;++e){if(d[e][1]===g){for(e=1;e<d.length;++e){if(d[e][1]!==(g|1)&&(d[e][1]|=f,(d[e][1]|1)===V)&&!(d[e]=d[e][2])){d.splice(e,1);--e}}break}}}function N(m){var h,f,n,k,d,g,l,c;if(!m||m[0]===B){return m}for(h=1+(m[0]<P);h<m.length;++h){if(!(m[h]=N(m[h]))){m.splice(h,1);--h}}if(m.length===1){return null}else{if(m[0]>=I&&m.length===2){return m[1]}else{if(m[0]!==E){return m}}}c=F();l=[];for(h in X){if((n=X[h])&&(k=m[1]&n)!==n){d=[],g=[];for(f=1;f<n;f<<=1){if(!(n&f)||!U[f]||T[f]){}else{if(k&f){d.push(b(null,U[f],c)[1])}else{g.push(b(null,"-"+U[f],c)[1])}}}if(!g.length){}else{if(g.length<d.length||!d.length){l=l.concat(g)}else{l.push(d.length===1?d[0]:[G].concat(d))}}}}if(l.length===0){return m[2]}else{if(m[2]&&m[2][0]!==I){return[I,m[2]].concat(l)}else{if(l.length===1&&!m[2]){return l[0]}else{return(m[2]||[I]).concat(l)}}}}function F(d){var c=jQuery.extend({kwprefix:"",helpers:[]},D);if(d){c.items=d}return c}function M(k,m){var f,g,n,h,l,d=F(),o={checkbox:{}};if(m!=null&&m!==""){g=Z(k,m,d);if(g[1]){h=build_func("function (x) { var t; return "+C(g[1])+" }",d)}l=g[2]}else{l=V}for(f in O){o.checkbox[f]=(l&O[f])!==0}if(d.unready){o.unready=d.unready}else{o.items=[];o.filtered=false;for(f in k){n=k[f];if(!h||h(n)){o.items.push(n)}else{o.filtered=true}}}return o}M.addkw=function(c){jQuery.extend(J,c)};M.getkw=function(c){return J[c]};M.mvars=function(){return F()};M.addmvars=function(c){jQuery.extend(D,c)};M.propmatch=function(g,c,d,h,f){var e=(f?"x."+g+"&&":"");c=c.replace(/[\\\"]/g,"");if(c.indexOf("*")>=0){c=c.replace(/[\[\]\\^$*+?.()|{}]/g,function(k){return k==="*"?".*":"\\"+k});d.helpers.push(new RegExp(c,h?"":"i"));return e+"helpers["+(d.helpers.length-1)+"].test(x."+g+")"}else{if(h){return e+"x."+g+'.indexOf("'+c+'")!==-1'
}else{return e+"x."+g+'.toLowerCase().indexOf("'+c.toLowerCase()+'")!==-1'}}};M.ids=function(m,p,d,o){var k,e,c=[],g,l,n;if(!d){d=F()}l=d.helpers;n=Z(m,p,d);d.helpers=l;if(n[1]){k=build_func("function (x) { var t; return "+C(n[1])+" }",d)}for(e in m||{}){if(!k||k(m[e])){c.push(e)}}if(o==="r"){if(c.length==0){return new RegExp("(?!.*)")}else{return new RegExp("\\b("+c.join("|")+")\\b")}}else{if(o==="h"){g={};for(e in c){g[c[e]]=true}return g}else{return c}}};M.add_checkbox_partition=function(){var g,d,h=0,c=0,k,e,f;f=arguments;if(f.length==1&&typeof f[0]==="object"){f=f[0]}if(f.length==0){return }for(g in X){h|=X[g]}for(g=0;g<f.length;++g){k=S;c|=k;S<<=1;e=f[g];d=Z(null,e,F());U[C(d[1])]=k|h|1;U[k]=e;O[e]=k}if(f.length==1){c|=S;S<<=1}X[f[0]]=c;for(g in U){if(!g.match(/^[0-9]+$/)&&U[g]&&!(U[g]&c)){U[g]|=c}}V|=c};M.add_checkbox_synonym=function(g,f){var m,h,d,c,l,k=0;d=Z(null,f,F());m=R(d[1]);if(!m||m[0]!==E||m[2]||!(c=a(m[1]))){throw new Error("y")}l=m[1]&c;for(h in X){if(X[h]!==c){k|=X[h]}}d=Z(null,g,F());U[C(d[1])]=l|k|1;U[l]=g;O[g]=l};M.set_checkbox_live=function(d,e){var f=O[d];if(e){delete T[f]}else{T[f]=true}};M.change_checkbox=function(d,f,g){var h,c;if(d!==""){h=Z(null,d,F());h=R(h[1])}if(!h||h[0]!==E){h=[E,V,h]}h[1]|=1;if((c=O[f])==null){throw new Error("y")}if(g){h[1]|=c}else{h[1]&=~c}h=N(h);return h?H(h):""};M.addprim=function(c,f,k){var l,g,d=F(),h;if(c!==""){l=Z(null,c,d)[1];if(l[0]===B){l=[I,l]}}if(!l||l[0]!==I){l=[I].concat(l?[l]:[])}h=l.length;if(k){for(g=1;g<l.length;++g){if(l[g][0]===B&&k.test(l[g][2])){l.splice(g,1);h=g;--g}}}if(f){l.splice(h,0,Z(null,f,d)[1])}return H(l)};M.findprim=function(c,h){var k,g,f=F(),d;if(c!==""){k=Z(null,c,f)[1];if(k[0]===B){k=[I,k]}}if(!k||k[0]!==I){k=[I].concat(k?[k]:[])}d=[];for(g=1;g<k.length;++g){if(k[g][0]===B&&h.test(k[g][2])){d.push(k[g][2])}}return d};return M}function make_bound_smart_filter(D,I,B){var H=[],L={},K=false,F={items:[],filtered:true};function A(){var O,P,N,M=A.text();N=D(I,M);if(N.unready){return N.unready
}for(O in N.checkbox){if((P=L[O])&&(P=document.getElementById(P))){if("checked" in P){if(P.checked!=!!N.checkbox[O]){P.checked=!!N.checkbox[O]}}else{if(P.selected!=!!N.checkbox[O]){P.selected=P.filterSelected=!!N.checkbox[O]}}}}F=N;for(O=0;O<H.length;++O){H[O](M,N.items,A)}if(!B){O=jQuery("#reset_search");O.attr("disabled",M!==""?"":"disabled");O[0].style.display=(M!==""?"inline":"none")}}function J(){return jQuery((B||"table.l3search")+" :input.smart_search")}A.checkbox_html=function(N,O){var P,M;do{M=++make_bound_smart_filter._helperctr;P="l3bfhelp_"+M}while(document.getElementById(P));L[P]=N;L[N]=P;return"<input id='"+P+"' class='filter_check' type='checkbox' checked='checked' />&nbsp;<label for='"+P+"'>"+O+"</label>"};A.option_html=function(N,O){var P,M;do{M=++make_bound_smart_filter._helperctr;P="l3bfhelp_"+M}while(document.getElementById(P));L[P]=N;L[N]=P;return"<option id='"+P+"' class='filter_option' selected='selected'>"+O+"</option>"};function G(){var M=D.change_checkbox(A.text(),L[this.id],this.checked);A.settext(M)}A.bind_checkbox_click=function(M){M.unbind("click.bound_filter").bind("click.bound_filter",G)};function C(){var M,O,N=A.text();for(M=0;M<this.options.length;++M){O=this.options[M];if(!("filterSelected" in O)){O.filterSelected=true}if(O.filterSelected!=O.selected){O.filterSelected=O.selected;N=D.change_checkbox(N,L[O.id],O.selected)}}A.settext(N)}A.bind_multiple_select_change=function(M){M.unbind("change.bound_filter").bind("change.bound_filter",C)};function E(N,P,M){var O=new RegExp("^"+N+":"+(P?"<=?":">=?"));return function(){var R=this.value,T,Q,S;T=R.match(/^(\d+\.?\d*|\.\d+)\s*([kmgt]?)(B|Bytes?)?$/i);if(!T){this.value=unparse_bytes(M,true);return }this.value=T[1]+" "+(T[2]?T[2].toUpperCase()+"B":"Bytes");S=P?"<=":">=";Q=parse_size(R,S);A.addprim(N+":"+S+T[1]+T[2].toUpperCase(),O)}}A.bind_size_change=function(O,N,P,M){O.unbind("change.bound_filter").bind("change.bound_filter",E(N,P,M))};A.bind_value_change=function(N,M){var O=new RegExp("^"+M+":");
N.unbind("change.bound_filter").bind("change.bound_filter",function(){var P=jQuery(this).val();A.addprim(P?M+":"+P:null,O)});A.bind(function(P,R,S){var Q=D.findprim(P,O);N.each(function(T){var U=jQuery(this);if(!Q.length||Q.length>1){U.val("")}else{U.val(Q[0].replace(O,""))}})})};A.text=function(){var M=J().val();return jQuery.trim(M).replace(/\s+/g," ")};A.settext=function(O,M){var P=J(),N=P.val();if(N!=O){J().val(O);K=!!M;jQuery((B||"table.l3search")+" form.smart_search").submit();return true}else{return false}};A.results=function(){return F.items};A.matchesall=function(){return !F.filtered};A.bind=function(M){H.push(M)};A.addprim=function(M,O,N){return A.settext(D.addprim(A.text(),M,O),N)};A.findprim=function(M){return D.findprim(A.text(),M)};A.set_checkbox_live=D.set_checkbox_live;A.setitems=function(M){I=M;A()};if(!B){jQuery("table.l3search form.smart_search").unbind("submit.bound_filter").bind("submit.bound_filter",function(){var N=A.text(),M=K;K=false;history3({searchhelp:undefined,n:undefined,c:undefined,q:N},M);return false});jQuery("#reset_search").unbind("click.bound_filter").bind("click.bound_filter",function(){A.settext("")})}return A}make_bound_smart_filter._helperctr=0;function make_smart_filter_match_ip(){var A=arguments;return function(C,D){var B,I,H,G,E,F;C=C.replace(/[\\\"]/g,"");if((B=C.match(/^([\d.]+)\/(\d+)$/))){G='show3_cidr_match(%, "'+B[1]+'", '+parseInt(B[2],10)+")"}else{if(C.match(/^\d+\.\d+\.\d+\.\d+$/)){G='%==="'+C+'"'}else{if(C.match(/^[\d.]+$/)){I=C.charAt(0)===".";H=C.charAt(C.length-1)===".";C=C.replace(/\./g,"\\.");if(!I){C=(H?"^":"(?:^|\\.)")+C}if(!H){C=C+(I?"$":"(?:$|\\.)")}D.helpers.push(new RegExp(C));G="helpers["+(D.helpers.length-1)+"].test(%)"}else{if((B=C.match(/^([\d.]*)\*([\d.]*)$/))){B[1]=B[1].replace(/\.$/,"");B[2]=B[2].replace(/^\./,"");C=(B[1].charAt(0)==="."?"^.*":"^");C+=B[1].replace(/\./g,"\\.")+"(?:$|\\.).*";C+=(B[2]===""?"":"\\.")+B[2].replace(/\./g,"\\.");D.helpers.push(new RegExp(C+"$"));G="helpers["+(D.helpers.length-1)+"].test(%)"
}else{return"false"}}}}for(F=0,E="";F<A.length;++F){B=G.replace("%","x['"+A[F]+"']");if(F==0){E+=B}else{E+="||(x['"+A[F]+"']&&"+B+")"}}return E}}function smart_filter_match_usage(B,A){return function(D,E){var F,G,H,C;if(B=="usage"){if(A==null){G="(x.usage[0]+x.usage[1])"}else{G="x.usage["+A+"]"}H=1024}else{if(A!=null){G='((x["'+B+'"]||[])['+A+"]||0)";H=1024}else{G='(x["'+B+'"]||0)';H=1}}C=D.match(/^([<>=]?=?)\s*((?:\d+\.?\d*|\.\d+)\s*[kmgt]?(?:B|Bytes?)?)$/i);if(C&&(C[1]==="="||C[1]==="=="||C[1]==="")){F=parse_size(C[2],">=")/H;return"(t="+G+",t>="+(0.9*F)+"&&t<="+(1.1*F)+")"}else{if(C){F=parse_size(C[2],C[1])/H;return G+C[1]+F}else{return"false"}}}}






/* l3.js */
function network_useblocks(F,D){var C=nodes_all,G=C.nuseblocks,E=!!G,B,A;if(!G&&(A=C.nsuseblocks)){G=[];for(B in A){blockseries_add(G,A[B])}}else{if(!G){G=[]}}if(typeof clients_all!=="undefined"&&clients_all.cuseblocks){if(E){G=[].concat(G)}blockseries_add(G,clients_all.cuseblocks)}return G}function useblocks_graphseries(Q,I,H,U){var T,P,S,O,N,R,E,D,M,L,K,J,C,B,A,G,F;if(!Q||Q.length<2){return[[I*1000,0],[H*1000,0]]}P=Math.max(timeseries_upper_bound(Q,I)-1,1);O=Q[P-1][0];S=Q[P];N=S[0];R=N-O;B=A=0;D=R+1;E=O-D;L=0;T=[[(E+D/2)*1000,0]];max_area_error_factor=(H-I)/64;while(1){if(R==0){throw new Error("bad blockseries")}K=S[1]||0;J=S[2]||0;if(K||J){if(O<I||N>H){C=(Math.min(N,H)-Math.max(O,I))/R;if(C>=0){B+=K*C,A+=J*C}}else{B+=K,A+=J}M=(K+J)*8192/R}else{M=0}if(L!=M){G=Math.min(D,R,max_area_error_factor);F=(O-G/2)*1000;if(F>T[T.length-1][0]){T.push([F,L])}T.push([(O+G/2)*1000,M])}else{T.push([(O+R/2)*1000,M])}if(O>=H||(P>=Q.length&&M==0)){if(U){U[0]=B,U[1]=A}return T}++P;L=M;D=R;E=O;O=N;S=Q[P]||[O+D];N=S[0];R=N-O}}function graph_network_useblocks_base(G,D,K){var J=Mkijson.main.meta,H,C,I,B,A,F=Mkijson.n.allmeta.t0||J.t0,E=J.grapht1||J.t1;if(F==null||E==null){return"stop"}H=network_useblocks(F,E);C={t:[]};D.push({data:useblocks_graphseries(H,F,E,C.t),color:mkigraph.line_color});if((B=Mkiconf.ssid_number)!=null&&B>=0&&(I=Mkijson.n.all.nsuseblocks)){D[D.length-1].color="rgb(224,224,224)";
C[B]=[0,0];if(I[B]){D.push({data:useblocks_graphseries(I[B],F,E,C[B]),color:mkigraph.line_color})}}K.xaxis.min=F*1000;K.xaxis.max=E*1000;if(J.at&&E-J.at>600){A=K.grid=K.grid||{};A.coloredAreas=A.coloredAreas||[];A.coloredAreas.push({x1:J.at*1000,x2:K.xaxis.max,color:"rgba(100,100,100,0.5)",mode:"top"})}if((I=graph_network_useblocks_base.callback)){I(C)}}var graph_network_use=(function(D){var A,E=0,G,B=false;function H(){var K=D("#transferreds_graph_canvas"),J=K.parent().width();if(J!=K.width()){K.empty().width(J);F()}}function I(M,O,L,N){var K=Math.max(clients_meta.cuseblocks_fullt1||0,nodes_allmeta.nuseblocks_fullt1||0,clients_allmeta.cuseblocks_fullt1||0)*1000,J=K&&O.x>K;if(J&&E>0){hohelp("#transferreds_graph_canvas",Mkiconf.graph_out_of_date_html,{bottom:-25,left:N.getXPosition(K),right:N.getXPosition(N.getAxes().xaxis.max),nostack:true})}else{if(!J){hohelp("#transferreds_graph_canvas",null,{nostack:true})}}}function C(L,N,J,O){var K,M=Math.max(clients_meta.cuseblocks_fullt1||0,nodes_allmeta.nuseblocks_fullt1||0,clients_allmeta.cuseblocks_fullt1||0)*1000;if(J.xaxis.max-J.xaxis.min<86400000&&M&&M<J.xaxis.max){K=J.grid=J.grid||{};K.coloredAreas=K.coloredAreas||[];K.coloredAreas.push({x1:M,x2:J.xaxis.max,color:"rgba(220,220,220,0.5)",mode:"top"});K.hoverable=true;K.autoHighlight=false}}function F(){if(!A){G=make_network_use_loader(F);mkigraph.add_plugin("network_useblocks",graph_network_useblocks_base);A=true;if(F.resizable){D(window).resize(H);H()}}F.timeseries_flot=mkigraph.timeseries("network_useblocks",{canvas:"#transferreds_graph_canvas",usage_loader:G});if(window.graph_network_rusage&&Mkiconf.base=="usage3"){graph_network_rusage(G)}B=!G.empty();D("#transferreds_graph_spinner").toggle(B);F.loader_paused?G.clear():G.discharge()}F.show_fullt1_warning=function(){mkigraph.add_plugin("network_useblocks",C,3);$j("#transferreds_graph_canvas").bind("plothover",I).mouseover(function(){++E}).mouseout(function(){if(E>0){--E}hohelp("#transferreds_graph_canvas",null,{nostack:true})
})};F.loading=function(){return B};return F})(jQuery);function make_network_use_loader(E){var A=null,H={},F=1,B={};B.prepare=function(J,M,N){var K=0,L=function(R,Q,O,T){var W,V,U,S,P;O=(O.join?O:[O]);if(J=="c"&&!O.length){return }W=[J,M,T].join(",");if(!(U=H[W])){H[W]=U={type:J,p:M,callbacks:[],htype:T,ptype_bit:F};H[F]=U;F<<=1}if(N&&U.callbacks[0]!=N){U.callbacks.push(N)}V=U.ptype_bit;W=[J,R,Q].join(",");A=A||{};if(!(U=A[W])){A[W]=U={t0:R,t1:Q,type:J,ptype_mask:0,ids:{}}}U.ptype_mask|=V;S=U.ids;for(P in O){S[O[P]]=(S[O[P]]||0)|V}++K};L.empty=function(){return K==0};return L};function C(K){var J,L=0;for(J in K.ids){++L}return L}function G(N,M){var J=jQuery.extend({},N,{ids:{},ptype_mask:M}),K,L=0;for(K in N.ids){if(N.ids[K]&M){J.ids[K]=true;++L}}if(L>30){J.agg=1}return L>0?J:null}function I(M,L){var J=M.ids,K;M.ptype_mask|=L.ptype_mask;for(K in L.ids){J[K]=true}}function D(K){var J=[];(function(){var P,O,L,N,M;for(N=1;N<F;N<<=1){if(!(N&K)){continue}M=H[N].callbacks;for(P=0;P<M.length;++P){L=M[P];J.push(L);for(O=J.length-2;O>=0;--O){if(J[O]==L){J.pop();break}}}}})();return function(){var L;for(L=0;L<J.length;++L){J[L]()}if(E){E()}}}B.discharge=function(){var L=[],N,M,J,K;if(!A){return }for(N in A){if(C(A[N])<=30){L.push(A[N])}else{for(K=1;K<F;K<<=1){if((J=G(A[N],K))){L.push(J)}}}}for(N=0;N<L.length;++N){L[N].clean_ids=data3_load.clean_ids(L[N].ids)}for(N=0;N<L.length;++N){for(M=N+1;M<L.length;++M){if(L[N].clean_ids==L[M].clean_ids&&L[N].type==L[M].type){I(L[N],L[M]);L.splice(M,1);--M}}}for(N=0;N<L.length;++N){J=jQuery.extend({},L[N]);if(Mkiconf.ssid_number!=null){J.ssid=Mkiconf.ssid_number}delete J.ptype_mask;delete J.type;delete J.clean_ids;J.f=[];for(K=1;K<F;K<<=1){if(L[N].ptype_mask&K){J.f.push(H[K].p)}}J.f=J.f.join(" ");data3_load.ajax(L[N].type,J,{complete:D(L[N].ptype_mask)})}B.clear()};B.clear=function(){A=null;H=[];F=1};B.empty=function(){return !A};return B}function graph_client_useblocks_base(B,E,A,H){var G=B[1],F=clients_hash[G],D=clients_meta.t0,C=clients_meta.grapht1||clients_meta.t1;
A.xaxis.min=D*1000,A.xaxis.max=C*1000;if(!F){E.push({data:[[D*1000,0],[C*1000,0]],color:mkigraph.line_color})}else{if(!F.cuseblocks){data3_load.ajax("c",{t0:D,t1:clients_meta.t1,f:"cuseblocks",ids:G},H);return true}else{E.push({data:useblocks_graphseries(F.cuseblocks,D,C),color:mkigraph.line_color})}}}graph_client_use=(function(){var A;return function(B,C){if(!A){mkigraph.add_plugin("client_useblocks",graph_client_useblocks_base);A=true}loader=make_network_use_loader(function(){graph_client_use(B,C)});mkigraph.timeseries(["client_useblocks",C],B);if(Mkiconf.has_rusage&&window.graph_client_rusage){if(graph_client_rusage(C,loader)=="retry"){setTimeout(function(){graph_client_use(B,C)},50)}}graph_client_use.loader_paused?loader.clear():loader.discharge()}})();function mki_manage_url(C,E,D){var B,A;if(!(B=Mkiconf.manage_nonetwork)){return null}if(E){B+=E+"/"}else{if((A=Mkiconf.administered_networks[C])&&A.t){B+=A.t+"/"}}B+="n/"+C+"/";return B+(D||"")}list3_check_stale=(function(){var A;return function(){var F=(Mkiconf.usage?"last_seen_at#":"last_active#"),E=Mkijson.main.meta[F],C=new Date().getTime()/1000-data3_load.timeoffset(F),D=(C-E>=300),B;if(D){B=unparse_interval(C-E);jQuery("#w3stale").html("Information on this page is "+B+" old").slideDown();jQuery("#w3staleago").html("&nbsp;("+B+"&nbsp;ago)").fadeIn();if(A!=null){flex_table.render()}}else{jQuery("#w3stale").slideUp();jQuery("#w3staleago").fadeOut()}A=D}})();function l3_clean_mac(A){A=A.toLowerCase();if(A.match(/^:?[0-9a-f]{2}(:[0-9a-f]{2}){0,5}:?$/)){return A}A=A.replace(/[-.]/g,":").replace(/(^|:)([0-9a-f])(?=$|:)/g,"$010");if(A.match(/^:?[0-9a-f]{2}(:[0-9a-f]{2}){0,5}:?$/)){return A}if(A.match(/^(?:[0-9a-f][0-9a-f]:?)+$/)){A=A.replace(/:/g,"");if(A.length<=12&&(A.length%2)==0){return A.replace(/(..)/g,"$1:").slice(0,-1)}}return undefined}function show3_cidr_match(I,H,F){if(!I){return false}var E=I.split("."),C=H.split("."),G,B,A,D;for(G=0;G<4&&F>0;++G,F-=8){B=parseInt(E[G]||0,10);A=parseInt(C[G]||0,10);if(F<8){D=256-(1<<(8-F));
B&=D;A&=D}if(B!==A){return false}}return true}function ip_sortable_string(A){if(A){return A.replace(/\d+/g,function(B){return("000"+B).slice(-3)})}else{return"~~"}}function range_match(D,C,A){var B;if(!D){return false}if(D.length==null){D=[D]}for(B=0;B<D.length;++B){if(D[B]>=C&&D[B]<A){return true}}return false}function split_text_comparison(B){var A=B.match(/^([=!<>]?=?)\s*(.*)/);if(A[1]==""){A[1]="=="}else{if(A[1]=="="||A[1]=="!"){A[1]+="="}}return[A[1],A[2]]}function l3_match_channel(B,D,C,G){var F,E,A;if(/^[0-9]+$/.test(B)){F=E=parseInt(B,10)}else{if((A=B.match(/^([0-9]+)-([0-9]+)$/))){F=parseInt(A[1],10),E=parseInt(A[2],10)}else{if(/^([!=<>]=?)\s*([0-9]+)$/.test(B)){A=split_text_comparison(B);return"x.channel"+A[0]+parseInt(A[1],10)}else{if(/^(?:[bg]+|2(?:\.4)?\s*g(?:hz)?)$/i.test(B)){F=1,E=14}else{if(/^(?:[an]+|5\s*g(?:hz)?)$/i.test(B)){F=36,E=165}else{if(/^[abgn]+$/i.test(B)){F=1,E=165}else{return"false"}}}}}}return"range_match(x.channel,"+F+","+(E+1)+")"}function data3_bind_change(A,B){jQuery(document).bind("node_change",function(D,C){var F,G,E;for(F in C){if(C.hasOwnProperty(F)&&!B[F]){G=true}}if(G){A.resort()}else{E=A.selected_fields();G=[];for(F=0;F<E.length;++F){if({last_active:1,last_seen_at:1,first_seen_at:1}[E[F]]){G.push(E[F])}}if(G.length){A.rerender_columns(G)}}})}function data3_column_loader(B,A){return function(C,F,D){var E,G=[],H=(B=="n"?nodes_meta:clients_meta);for(E=0;E<F.length;++E){if(A[F[E]]&&!H[F[E]]){G.push(F[E])}}if(G.length){data3_load.ajax(B,{t0:H.t0,t1:H.t1,f:G.join(" ")},D.resort)}}}function list3_paner(C,B){var A,D;B=B||{};A=jQuery(B.selector||"#l3filter");D=A.is(":visible");A.slideToggle("fast");if(B.ab){C.innerHTML=(D?"Advanced search\xA0\xBB":"\xAB\xA0Basic search")}else{C.className=(C.className==="l3closer"?"l3opener":"l3closer")}if(B.open_value){jQuery(B.open_value).val(D?"0":"1")}return false}function l3_edit_times(A){jQuery("#w3times").toggle(!A);jQuery("#w3times_edit").toggle(!!A);return false}checkbox3=(function(){var F,C={},B=[];
function E(I,H,G){if(G==null){G=document.getElementById("cb"+I.id)}if(G){G.checked=!!H}if(I&&!!I.checked!==!!H){if(H){I.checked=true;C[I.id]=I;++D.nchecked}else{if(I){delete I.checked;delete C[I.id];--D.nchecked}}return 1}else{return 0}}function A(G){var H;if(G){for(H=0;H<B.length;++H){B[H](D)}}}function D(L,O,G){var J=Mkijson.main.hash,K,I,N,H,M=0;if(G&&G.shiftKey&&F){if(F<=O){K=F-1;I=O-2}else{K=O;I=F-1}N=flex_table.items();for(;K<=I&&K<N.length;++K){if((H=document.getElementById("cb"+N[K].id))){M+=E(J[N[K].id],L.checked,H)}}}F=O;M+=E(J[L.name],L.checked,false);A(M);return true}D.bind=function(G){B.push(G)};D.unbind=function(H){for(var G=B.length-1;G>=0;--G){if(B[G]==H){B.splice(G,1)}}};D.checked=C;D.nchecked=0;D.select=function(H){var L,J,I,G=0,M=Mkijson.main.hash,K;if(H===true){switch(Mkiconf.h3mode){case"u":K=clients_hash_filter;break;case"r":K=rogue_aps_hash_filter;break;case"p":K=pcc_hash_filter;break;case"l":case"m":default:K=nodes_hash_filter;break}L=K.results()}else{if(!H){L={}}else{if(typeof H==="object"){L=H}}}if(jQuery.isArray(L)){I=L,L={};for(J=I.length-1;J>=0;--J){L[I[J].id]=true}}if(H||D.nchecked){for(J in M){G+=E(M[J],L?L[J]:H(M[J]))}}A(G);return false};D.toggle=function(H,G){if(G==null){G=!H.checked}A(E(H,G))};D.unchecked_alert=function(){var G={u:"clients",l:"access points",m:"access points",r:"rogue APs",p:"clients"}[Mkiconf.h3mode];alert("No "+G+" selected.\nPlease select one or more "+G+" and try again.");return false};D.sorted_checked=function(L,I){var H=[],J,K,G;I=I||{};if((K=I.renderf)){for(J in C){if((G=K(C[J]))!=null){H.push(G)}}}else{for(J in C){H.push(C[J])}}H.sort(L);if(I.max&&H.length>I.max){H.length=I.max;if(I.andothers){H[I.max]="and others"}}return I.commajoin?commajoin(H):H};return D})();function checked_json_submit(D,G,C){var E=[],B,F,A;for(B in checkbox3.checked){E.push(B)}if(E.length==0){return checkbox3.unchecked_alert()}C=C||{};if(C.prompt_for){G=jQuery.extend({},G);G[C.prompt_for]=prompt(C.prompt||"Enter text.");if(G[C.prompt_for]==null){return false
}}else{if(C.confirm){if(!confirm(C.confirm)){return false}}}B=(Mkiconf.usage?"#usage3_action_menu":"#l3_action_menu");A=jQuery(B+" .dmenub_ptr").offset();F=jQuery('<img src="'+Mkiconf.images+'spinner.gif" alt="Working" />').css({position:"absolute",left:A.left+2,top:A.top-2}).appendTo("body");A=null;jQuery.ajax({type:"POST",url:D,data:jQuery.extend({ids:E.join(" ")},G),dataType:"json",success:function(H){F.remove();if(H.errf){alert(br2nl(H.error))}else{if(H.clients||H.nodes){data3_load(H)}else{if(H.nodes_networks&&Mkiconf.h3nodes){$h3.paused=true;$h3({n:undefined});window.location.reload(true)}}}if(jQuery.isFunction(C.successCallback)){C.successCallback(H)}},error:function(J,K,I){var H=xhr_extract_error_json(J);F.remove();alert(br2nl(H.error))}})}make_l3_action_menu=(function(B){function D(){B(this).find("a").click()}function C(F,E){return function(G){var H=E.slice(0);H.push(G);F.apply(this,H)}}function A(E){return{jquery:E,add_link:function(G,I){var F=Array.prototype.slice.call(arguments).slice(2),H=B("<div class='dmenuitem'><a href='#'></a></div>");H.find("a").click(C(I,F)).append(G);return H.appendTo(E)},add_space:function(){return B("<div class='dmenugap'></div>").appendTo(E)},add_subhead:function(F){var G=B("<h3 class='dmenu'></h3>").append(F);return G.appendTo(E)}}}return function(G,L){var J,F;function K(){if(J){B(J).remove();J=null;B(F).removeClass("dmenub_down");B("body").unbind("click",K)}}function H(){var O,N,Q,M,P=B(F);N=P.offset();Q=B("<div style='position: absolute; visibility: hidden; top: "+(N.top+P.outerHeight()-1)+"px; z-index: 1000;'><div class='dmenuctr'><div class='dmenuctr1'></div></div></div>");M=Q.find(".dmenuctr1");if((O=L(A(M)))){M.append(O)}Q.find("div.dmenuitem").click(D);B("body")[0].appendChild(Q[0]);position_horizontally_in_viewport(Q,P);Q.css({visibility:"visible"}).click(function(R){R.stopPropagation()});B("body").click(K);J=Q}function I(){if(!F){F=B(G)[0]}}function E(M){I();if(J){K()}else{H();B(F).addClass("dmenub_down")}M.stopPropagation();
return false}E.enable=function(M){I();B(F).toggleClass("dmenub_disabled",!M)};E.blur_soon=function(M){if(M){if(M.stopPropagation){M.stopPropagation()}M.cancelBubble=true}if(J){B(J).contents().blur();K()}return false};E.init=function(){B(G).click(E);checkbox3.bind(function(){E.enable(checkbox3.nchecked>0)});E.enable(false)};return E}})(window.jQuery);






/* l3_datatypes.js */
function timeseries_t0(A){return A[0][0]}function timeseries_t1(A){return A[A.length-1][0]}function timeseries_upper_bound(B,E){var C=0,D=B.length,A;while(C<D){A=C+((D-C)>>1);if(B[A][0]<=E){C=A+1}else{D=A}}return C}function timed_property_splice(F,A,H,C,B){var I=F[H],G=A[H],E,D;if(!G||!G.length){}else{if(!I||!I.length){F[H]=A[H]}else{if(I[I.length-1][0]<=C){I.push.apply(I,G)}else{E=timeseries_upper_bound(I,C);D=timeseries_upper_bound(I,B);if(D==I.length){I.splice(E,D-E);I.push.apply(I,G)}else{meraki_array_splice_apply(I,[E,D-E].concat(G))}}}}}function blockseries_check(A){var C,E,B=0,D;if(typeof console!=="undefined"&&typeof console.log==="function"){D=console.log}else{D=function(){}}for(C=0;C<A.length;++C){if(!A[C]||!A[C].length){D("blockseries object fail: "+C);D(A[C]);++B;continue}if(C>0&&A[C-1]&&A[C-1].length&&A[C][0]<=A[C-1][0]){D("blockseries time fail: "+(C-1)+"="+A[C-1][0]+", "+C+"="+A[C][0]);D(A[C-1]);D(A[C]);++B}if(A[C].length>1&&!E){E=A[C].length}if(A[C].length>1&&A[C].length!=E){D("blockseries block fail: "+C+" length "+A[C].length+", not "+E);++B}}if(B){throw new Error("blockseries fail")}}blockseries=(function(){var G=meraki_array_splice_apply;function E(I,L,K){var M=(K-I[L-1][0])/(I[L][0]-I[L-1][0]),H=[K],J;for(J=1;J<I[L].length;++J){H[J]=I[L][J]*M;I[L][J]-=H[J]}I.splice(L,0,H)}function A(H,J,I){return J>0&&J<H.length&&H[J-1][0]<I&&H[J][0]>I&&H[J].length>1}function C(O,K,N,M){var H,P=[M],I,L=O[K-1],J=O[K];if(!J||M<=L[0]||J[0]<=N){return P}if(N==L[0]&&M==J[0]){return J}else{H=(M-N)/(J[0]-L[0]);for(I=1;I<J.length;++I){P.push(J[I]*H)}return P}}function D(H,J){var I=timeseries_upper_bound(H,J);
if(A(H,I,J)){E(H,I,J);++I}return I}function F(T,P,O){var I,M,Q=[Infinity],N,R,K,J,S,L,H;if(!P||P.length<2){return }R=O;if(!R||R<P[0][0]){R=P[0][0]}I=timeseries_upper_bound(P,R);M=timeseries_upper_bound(T,R);if(M==0){T.splice(0,0,[R]);M=1}N=[M,0];if(M>0&&T[M-1][0]<R){L=C(T,M,T[M-1][0],R);N.push(L)}while(1){while(I<P.length&&(P[I].length==1||P[I][0]<=R)){++I}while(M<T.length&&(T[M].length==1||T[M][0]<=R)){++M}if(I==P.length){if(M==T.length){break}if(T[M-1][0]>=P[I-1][0]){if(T[M-1][0]>R){N.push([T[M-1][0]])}break}}K=Math.max(R,Math.min(P[I-1][0],T[M-1][0]));if(K>R){N.push([K])}J=Math.min((P[I]||Q)[0],(T[M]||Q)[0]);if(P[I-1][0]>K){J=Math.min(J,P[I-1][0])}if(T[M-1][0]>K){J=Math.min(J,T[M-1][0])}S=C(P,I,K,J);L=C(T,M,K,J);if(L.length==1){N.push(S)}else{if(S.length==1){N.push(L)}else{if(S==P[I]){S=[].concat(S)}for(H=1;H<S.length;++H){S[H]+=L[H]}N.push(S)}}R=J}N[1]=M-N[0];G(T,N)}function B(I,H){var K,J;K=D(I,H[0][0]);J=D(I,H[H.length-1][0]);if(K>0&&I[K-1][0]==H[0][0]){H=H.slice(1,H.length)}if(J==I.length){I.splice(K,J-K)}if(K==I.length){I.push.apply(I,H)}else{I.splice.apply(I,[K,J-K].concat(H))}}return{splice:B,split:D,add:F}})();blockseries_splice=blockseries.splice;blockseries_split=blockseries.split;blockseries_add=blockseries.add;function blocked_property_add(F,E,D,B){var A=E[D],C=F[D]=F[D]||[];if(A&&A.length>=2){blockseries.add(C,A,B)}}function blocked_property_splice(E,D,C){var B=E[C],A=D[C];if(!A||A.length<2){}else{if(!B||B.length<2){E[C]=D[C]}else{blockseries.splice(B,A)}}}function mapped_blocked_property_add(E,A,H,F){var B=A[H],D,C,G,I;if(B){D=E[H]=E[H]||{};for(C in B){G=B[C];if(G&&G.length>=2){I=D[C]=D[C]||[];blockseries.add(I,G,F)}}}}function vector_sum(A){var B,C=0;if(A){for(B=A.length-1;B>=0;--B){C+=A[B]||0}}return C}function vector_add(B,A){var C;for(C=A.length-1;C>=0;--C){B[C]=(B[C]||0)+(A[C]||0)}return B}function vector_property_add(E,D,C){var B=E[C],A=D[C];if(!A||!A.length){}else{if(!B||!B.length){E[C]=D[C]}else{vector_add(B,A)}}}function rusage_sum(B,A){var C;
for(C in A){B[C]=B[C]||{};counter_set_sum(B[C],A[C])}}function counter_set_sum(B,A){var C;for(C in A){B[C]=B[C]||[];vector_add(B[C],A[C])}}






/* l3_data.js */
function data3_now(){return window.flex_table_now||(new Date().getTime()/1000)}node3_calculate_status=(function(){var C=0,E=1,A=2,F=3,D=4,B=[true,false,false,true,false,true,true,true,true,true];return function(G,K,I,M){var H=G["last_active#"],O,J,N;function L(P,Q){G["status#"]=P;if(Q){G.alerting=true}else{delete G.alerting}}if(G.is_virtual){return L(C)}if(!H||H<=G["created_at#"]){return L(D)}if(K-H>Mkiconf.dead_node_thresh){return L(F)}O=G["alert_clear#"]||0;if(K-H>Mkiconf.node_timeout){return L(A,O<=H)}if(H>=O){if(M>=Mkiconf.downtime_alert_thresh||B[I]){return L(E,O<=K-86400)}N=G["config_new_at#"],J=G["config_fetch_at#"];if((N&&N>O&&(!J||N-J>Mkiconf.config_alert_thresh))||(H-O>Mkiconf.stale_config_thresh&&(!J||H-J>Mkiconf.stale_config_thresh))){return L(E,true)}N=G["eapol_test_failed_at#"];if(N&&N>O){return L(E,true)}}return L(C)}})();function node3_update_upseries(E,J,A){var H,C=E.upseries,D=E["last_active#"]||0,M=false,I=0,K=J-86400,F=0,L=Math.max(K,E["alert_clear#"]||0,E["created_at#"]||0),N=0,G,O,B;A=A||{};if(C){H=timeseries_upper_bound(C,K);if(H>0){I=C[H-1][1];M=M||I>1}for(;H<C.length;++H){if(C[H][0]>K){if(!I){F+=C[H][0]-K}K=C[H][0]}if(C[H][0]>L){if(!I){N+=C[H][0]-L}L=C[H][0]}if(I){D=C[H][0]}I=C[H][1];M=M||I>1}}if(I){D=J}else{F+=J-K;N+=J-L}if(F!=E["outage_graph#"]){E["outage_graph#"]=F;A["outage_graph#"]=1}if(D&&D!=E["last_active#"]){E["last_active#"]=D;A["last_active#"]=1}B=E["status#"];G=E.alerting;node3_calculate_status(E,J,I,N);if(!M&&B==1&&E["status#"]==0){E["status#"]=0}if(E["status#"]!=B){A["status#"]=1}if(E.alerting!=G){alert_count+=(G?-1:1);A.alerting=1}O=(I==4||I==5||I==8);if(M&&I&&O!=E.is_gateway){E.is_gateway=O;A.is_gateway=1}}upseries_obscure=(function(){var B=[1264743400,1264745150];function C(E,H,G){var F=timeseries_upper_bound(E,H),D;if(F>0&&E[F-1][0]==H){--F}D=(F>0?E[F-1][1]:1);
D=(D==2?1:D);for(;F<E.length&&H<=E[F][0]&&E[F][0]<=G;++F){if(!E[F][1]){E[F][1]=D}}}function A(G){var H,F=B.length,E,D;if(!G||!G.length){return }E=G[0][0],D=G[G.length-1][0];if(B[0]<=D&&B[F-1]>=E){for(H=0;H<F;H+=2){if(B[H]<=D&&B[H+1]>=E){C(G,B[H],B[H+1])}}}}A.bounds=function(){return[B[0],B[B.length-1]]};return A})();data3_load=(function(D){var L=[],P=false,R,B;function N(){var V,U;window.Mkijson=B=window.Mkijson||{};window.extra_nodes_hash=window.extra_nodes_hash||{};for(V in {n:1,c:1,g:1}){B[V]=B[V]||{}}for(V in {hash:1,meta:1,all:1,allmeta:1}){U="nodes_"+V;B.n[V]=window[U]=window[U]||B.n[V]||{};U="clients_"+V;B.c[V]=window[U]=window[U]||B.c[V]||{};B.g[V]=B.g[V]||{}}for(V in B){B[V].type=V;B[V].all.count=B[V].all.count||0}if(/^[cu]$/.test(Mkiconf.h3mode)){B.main=B.c}else{if(Mkiconf.h3mode=="g"){B.main=B.g}else{B.main=B.n}}P=true}R={n:function(V,U){if(V.uname&&V.name==null){V.name=V.uname}if(V.name==null||V.name==""||V.name==V.mac){V.name=""}if(V.name==""){V["name$"]="~"+V.mac}else{V["name$"]=human_sortable_string(V.name)}if(U){++B.n.all.count}},c:function(U,W){var V=nodes_hash[U.node_id||0];U.last_seen_by=(V?V.name||V.mac:null)||"(unknown)";U["description$"]=human_sortable_string(U.description||U.netbios||U.dhcp_hostname||(U.mac?"~"+U.mac:"~~"));U.usage=U.usage||[0,0];if(W){++B.c.all.count}},g:function(U,V){U["token$"]=human_sortable_string(U.token);if(V){++B.g.all.count}}};function Q(W,V,U){var X=V?", t=t||x[0]":"";return"if ((b=n."+W+")) {for (r=s=t=0, i=b.length-1; i>=0; --i) {x=b[i];if (x.length>1)r+=x[1]||0, s+=x[2]||0"+X+";}"+U+"}"}function E(Y,X,Z,b){var a="",V,W,U;if(Y=="n"&&Z.nuseblocks&&!b.backfill&&!Z["usage#"]){a+=Q("nuseblocks",false,"if (r+s) n['usage#'] = (r+s)*1024;");Z["usage#"]=Z.nuseblocks}if(Y=="n"&&Z.nuseblocks&&b.ids){a+="n.nuseblocks=n.nuseblocks||[];"}if(Y=="n"&&Z.upseries&&!X.incr){U=upseries_obscure.bounds();if(X.t1>=U[0]&&X.t0<=U[1]){a+="upseries_obscure(n.upseries);"}}if(Y=="c"&&Z["last_seen_by#"]&&!Z.node_id){a+="n.node_id=n['last_seen_by#'];"
}if(Y=="c"&&Z.cuseblocks&&!b.backfill&&(!Z.usage||!Z["last_seen_at#"])){V="",W=false;if(!Z.usage){V+="if (r+s) n.usage = [r,s];";Z.usage=Z.cuseblocks}if(!Z["last_seen_at#"]){V+="if (t) n['last_seen_at#'] = t;";Z["last_seen_at#"]=Z.cuseblocks;W=true}a+=Q("cuseblocks",W,V)}if(Y=="c"&&Z.cuseblocks&&b.ids){a+="n.cuseblocks=n.cuseblocks||[];"}if(Y=="c"&&Z.susage&&!Z.cuseblocks&&!b.backfill&&!Z.usage){a+="if ((b=n.susage)) { for(x=[0,0],i=b.length-1;i>=0;--i) x[i&1]+=b[i]; if(x[0]+x[1]) n.usage=x; }";Z.usage=Z.susage}if(Y=="c"&&X.allclient&&!X.allclient.ass_at_cutoff&&typeof X.allclient.ass_ago_cutoff==="number"){X.allclient.ass_at_cutoff=new Date().getTime()/1000-X.allclient.ass_ago_cutoff}if(Y=="c"&&Z.ass_ago){a+="if (!n.ass_at&&n.ass_ago!=null) { n.ass_at="+(X.at||new Date().getTime()/1000)+"-n.ass_ago; }"}if(Y=="c"&&Z.ass_ago_weak){a+="if (!n.ass_at&&!n.ass_at_weak&&n.ass_ago_weak!=null) { n.ass_at_weak="+(X.at||new Date().getTime()/1000)+"-n.ass_ago_weak; }"}if(Y=="c"&&Z.ass_at_weak&&X.allclient&&typeof X.allclient.ass_at_cutoff==="number"){a+="if (n.ass_at==null&&n.ass_at_weak==null) { n.ass_at_weak="+X.allclient.ass_at_cutoff+"; }"}if(a==""){return null}else{return build_func("function(n){var i,b,x,r,s,t;"+a+"}",{})}}function A(V,U){if(arguments.length==0){return function(Y,X,W){Y[W]=X[W];delete Y[W+"_missing"]}}else{return function(Y,X,W){Y[W]=X[W];Y[W+"_missing"]=[V,U]}}}function T(b,V,Z,a){var Y,U,W,X;if(a[V]==Z){return true}Y=V+"_missing";if((U=b[Y])){for(X=a.t1,W=U.length-2;W>=0;W-=2){if(U[W]==Z&&U[W+1]==X){if(U.length==2){delete b[Y]}else{U.splice(W,2)}return true}}}return false}function I(W,X,V){var U=W.t1,Y=X.t1;if(W.incr){return V}else{if((!X.t0||W.t0==X.t0)&&(!Y||U>=Y)){return A()}else{if(!X.t0||W.t0==X.t0){return A(U,Y)}else{return function(b,a,Z){if(!b[Z]||T(b,Z,U,X)){V(b,a,Z)}}}}}}function S(V,W){var U=V.t1,X=W.t1;if(V.incr){return timed_property_splice}else{if((!W.t0||V.t0==W.t0)&&(!X||U>=X)){return A()}else{if(!W.t0||V.t0==W.t0){return A(U,X)}else{return function(c,b,Y,a,Z){if(T(c,Y,U,W)){timed_property_splice(c,b,Y,a,Z)
}}}}}}function F(V,W){var U=V.t1,X=W.t1;if(V.incr||(!W.t0&&!X)){return null}else{if((!W.t0||V.t0==W.t0)&&(!X||U>=X)){return A()}else{if(!W.t0||V.t0==W.t0){return A(U,X)}else{return function(a,Z,Y){if(T(a,Y,U,W)){a[Y]=(a[Y]||0)+Z[Y]}}}}}}function M(V,W){var U=V.t1,X=W.t1;if(V.incr||(!W.t0&&!X)){return vector_property_add}else{if((!W.t0||V.t0==W.t0)&&(!X||U>=X)){return A()}else{if(!W.t0||V.t0==W.t0){return A(U,X)}else{return function(a,Z,Y){if(T(a,Y,U,W)){vector_property_add(a,Z,Y)}}}}}}function K(AC,b,AA,AD){var h,z,t,u,Y,l=AC.t0,k=AC.t1,o={},U=[],AH={n:"node",c:"client",g:"login"}[b],m=AC[AH+"s"],AF,AE,X,w=AC.incr,g,AB,AG,c,a,v,s,d,e=R[b],r=B[b],W=r.hash,p=r.meta,V,Z;if(!AD||AD===true){AD={}}AF=AC["meta"+AH]||{};if((AE=AC["all"+AH])){X=AC["metaall"+AH]}if(!m||(w&&(!l||!k||AC.partial))){return }if(w&&l!=p.t1){for(h in AF){if(p[h]&&h!=="id"&&p[h]!=l&&AA[h]){return }}}if(!w&&l&&p.t0){for(h in AF){if(p[h]&&h!=="id"){AD.backfill=true}}if((AF.nuseblocks&&p["usage#"])||(X&&X.nuseblocks&&p["usage#"])||(AF.cuseblocks&&p.usage)){AD.backfill=true}}a=I(AC,p,blocked_property_add);d=I(AC,p,mapped_blocked_property_add);c=S(AC,p);v=F(AC,p);s=M(AC,p);AG=E(b,AC,AF,AD);function q(AN,AM,AL,AK){var f,AJ,AI=AL;for(f in AM){AJ=AA[f];if(!AJ){if(AN[f]!==AM[f]){AN[f]=AM[f];AK[f]=true}}else{if(AJ=="f"){if(AN[f]!==AM[f]){AN[f]=AM[f];AK[f]=AI=true}}else{if(AJ=="s"){c(AN,AM,f,l,k)}else{if(AJ=="b"){if(AN[f]||!w){a(AN,AM,f)}}else{if(AJ=="v"){s(AN,AM,f)}else{if(AJ=="+"){if(!v){AN[f]=(AN[f]||0)+AM[f]}else{v(AN,AM,f)}if(AM[f]){AK[f]=true}}else{if(AJ==">"){if(!AN[f]||AM[f]>AN[f]){AN[f]=AM[f];AK[f]=true}}else{if(AJ=="mb"){if(AN[f]||!w){d(AN,AM,f)}}}}}}}}}}if(AI){e(AN,AL)}}if(AD.ids){u=AD.ids;if(typeof u==="string"){u=u.split(/\s+/)}else{if(!D.isArray(u)){u=[];for(z in AD.ids){u.push(z)}}}for(z=u.length-1;z>=0;--z){t=u[z];if(t!==""&&!m[t]){m[t]={}}}}for(t in m){u=m[t];if(AG){AG(u)}Y=W[t];if(Y){q(Y,u,false,o)}else{if(w){U.push(t)}else{if(!AD.backfill){Y=W[t]={id:t};q(Y,u,true,o)}}}}if(U.length&&C.adder){C.adder(b,U)
}if((!AC.partial||!p.t0)&&!AD.backfill){for(h in AF){p[h]=AF[h]}if(l&&(!p.t0||l<p.t0)){p.t0=l}if(k&&(!p.t1||k>p.t1)){p.t1=k}else{if(AC.at&&!p.t1){p.t1=AC.at}}if(AC.at){p.at=AC.at}if(!p.timeoffset){p.timeoffset={}}if(k){p.timeoffset[k]=Math.round(new Date().getTime()/1000-(AC.at||k))}}else{if(!AC.partial){for(h in AF){if(!p[h]||l==p[h]){p[h]=AF[h]}}}}if(AE&&(!AC.partial||AD.ids)){if((AG=E(b,AC,X,AD))){AG(AE)}V=C.aggobject(b,AD.ids,true);q(V.data,AE,false,{});for(h in X){V.meta[h]=X[h]}if(!V.meta.t0||V.meta.t0>l){V.meta.t0=l}for(h in X){if(AF[h]&&AA[h]){throw new Error("XJ")}}}if(AF.upseries&&!AF["last_active#"]){p["last_active#"]=AF.upseries}if(AF.upseries){for(t in W){Y=W[t];node3_update_upseries(Y,k,o)}}else{if((AF["alert_clear#"]||AF["config_new_at#"]||AF["config_fetch_at#"]||AF["eapol_test_failed_at#"])&&p.upseries){for(t in m){Y=W[t];node3_update_upseries(Y,p.t1,o)}}}if(!AD.backfill){g="",V=r.all,Z=r.allmeta;for(z in {nuseblocks:1,cuseblocks:1}){if(AF[z]){V[z]=V[z]||[];Z[z]=AF[z];g+="if ((x=n['"+z+"'])) blockseries_add(allobj['"+z+"'], x);"}}for(z in {usage:1,susage:1}){if(AF[z]){V[z]=V[z]||[];Z[z]=AF[z];g+="if ((x=n['"+z+"'])) vector_add(allobj['"+z+"'], x);"}}if(AF.rusage){Mkijson.n.all.rusage=Mkijson.c.all.rusage=Mkijson.n.all.rusage||{};Mkijson.n.allmeta.rusage=Mkijson.c.allmeta.rusage=AF.rusage;g+="if ((x=n['rusage'])) rusage_sum(allobj.rusage, x);"}for(z in {"usage#":1,downtime:1,uptime:1}){if(AF[z]){V[z]=V[z]||0;Z[z]=AF[z];g+="allobj['"+z+"'] += n['"+z+"']||0;"}}if(g!=""){AB=build_func("function (jhash, allobj) {var x,id,n;for (id in jhash) {n = jhash[id];"+g+"}}",{});AB(m,V)}if(V.usage){V.tusage=vector_sum(V.usage)}}if(AC.products){if(!Mkiconf.products){Mkiconf.products={}}D.extend(Mkiconf.products,AC.products)}D(document).trigger("node_change",[o])}function C(U,V){var W;if(!P){N()}if(U.nodes){W={upseries:"s",bootseries:"s",nuseblocks:"b",nsuseblocks:"mb","usage#":"+",mac:"f",name:"f",downtime:"+",uptime:"+"};K(U,"n",W,V)}if(U.clients){W={cuseblocks:"b",usage:"v",susage:"v",tusage:"+","last_seen_at#":">",description:"f",netbios:"f",dhcp_hostname:"f",mac:"f"};
K(U,"c",W,V)}if(U.logins){W={token:"f",mac:"f"};K(U,"g",W,V)}}function G(U){function V(X,a,Z,Y){var W=E(Y,X,Z||{},{}),b=R[Y],d,c;for(d in a){c=a[d];c.id=d;if(W){W(c)}b(c,false)}}if(!P){N()}if(U.nodes){V(U,U.nodes,U.metanode,"n")}if(U.clients){V(U,U.clients,U.metaclient,"c")}}function O(U,V){return function(Z,W){var X,Y;for(X=L.length-1;X>=0;--X){if((Y=L[X]).s==U){if(W==="success"||W==="notmodified"){L.splice(X,1)}else{Y.backoff=Math.min((Y.backoff||0.5)*2,64);Y.timeout=new Date().getTime()+Y.backoff*1000}}}if(V){V.apply(true,arguments)}}}function H(U){U=U||function(){};return function(){U(null,"notexecuted")}}function J(W){var V,U,X;if(typeof W==="string"){W=W.split(/\s+/)}else{if(!D.isArray(W)){U=[];for(V in W){U.push(V)}W=U}else{W=[].concat(W)}}W.sort(strcmp);for(V=X=0;V<W.length;++V){if(!W[V]||(V-X>0&&W[V-X-1]==W[V])){++X}else{W[V-X]=W[V]}}W.length=W.length-X;return W.join(" ")}C.ajax=function(Y,b,Z,W){var X,a,V,U=null;if(!P){N()}if(Z&&typeof Z!=="function"){W=Z;Z=W.success}W=D.extend({},W||{});if(Y=="n"){W.url=Mkiconf.node_json_url}else{if(Y=="c"){W.url=Mkiconf.client_json_url}else{if(Y=="g"){W.url=Mkiconf.login_json_url}else{throw new Error("x")}}}if(Y=="n"&&Mkiconf.pinstatus){W.data=D.extend({pinstatus:1},b)}else{W.data=D.extend({},b)}if(W.data.ssid!=null&&W.url.match(/&ssid/)){W.url=W.url.replace(/&ssid=[-\d]+/,"")}if(W.data.ids){W.data.ids=J(W.data.ids)}if(W.data.huge==null&&(B[Y].allsize||0)>1000){W.data.huge=true}W.dataType=W.jsonp="jsonp";W.success=function(c){C(c,b);if(Z){Z(c,b)}};if(W.data.ids&&W.data.ids.length>900){W.type="POST"}U=Y+":"+stable_json_stringify(W.data);for(X=L.length-1;X>=0;--X){if((a=L[X]).s==U){V=new Date().getTime();if(!a.timeout){return false}else{if(a.timeout>V){setTimeout(H(W.complete),V-a.timeout);return false}else{break}}}}if(X<0){L.push({s:U})}W.complete=O(U,W.complete);return D.ajax(W)};C.aggobject=function(Z,Y,a){var X=B[Z],V=X.aggs=X.aggs||[],W,U=new Date().getTime()/1000;Y=J(Y);if(!Y){return{ids:null,data:X.all,meta:X.allmeta}
}for(W=V.length-1;W>=0;--W){if(V[W].ids==Y){V[W].lru=U;return V[W]}}if(a){if(V.length>=8){V.sort(function(d,c){return d.lru-c.lru});V.shift()}V.push({ids:Y,data:{},meta:{},lru:U});return V[V.length-1]}else{return null}};C.timeoffset=function(W,U){var V=Mkijson[U||"main"].meta;if(!V[W]){return undefined}if(!V.timeoffset){V.timeoffset={}}if(V.timeoffset[V[W]]==undefined){V.timeoffset[V[W]]=Math.round(new Date().getTime()/1000-V[W])}return V.timeoffset[V[W]]};C.showtimes=function(){if(!P){N()}var V=Mkijson.main.meta,U="%b %-d% #Y %H:%M% Z";D("#w3times .t0").html(unparse_date(V.t0,U,1));D("#w3times .t1").html(unparse_date(V.grapht1||V.t1,U,1))};C.canonicalize=G;C.clean_ids=J;C.mark_unready=function(V,W,Z){var X=V.unready=V.unready||{},U=X[W]=X[W]||{},Y=U.f=U.f||[];Y.push(Z)};return C})(window.jQuery);






/* l3_render.js */
function mki_render_ssid(B){var A=Mkiconf.ssids[B];if(A){return JSTemplate.escape(A.name||"SSID "+B)}else{return"(unknown)"}}function render_ago_interval(D,B,E,A,F){if(E&&B-E>=A){if(B-D<23328000){return unparse_date(D,"%b %d %H:%M",1)}else{return unparse_date(D,"%b %d %Y",1)}}var C=(B||new Date().getTime()/1000)-D;if(F&&C<F){return"now"}else{return unparse_interval(C)+"\xA0ago"}}function node3_render_name(G,F,B){var E=nodes_hash[G.id]||extra_nodes_hash[G.id],A,C,D;if(!E||!E.mac){E=G}D="<a";if(B&&B.aclass){D+=' class="'+B.aclass+'"'}if(B&&B.titlename){D+=' title="'+JSTemplate.escape(node_name(E))+'"'}D+=' href="';F=F||JSTemplate.escape(node_name(E));if(B&&B.prefix){F=B.prefix+F}if(B&&B.suffix){F+=B.suffix}if(!Mkiconf.node_show_url||!G.id||(B&&B.nolink)){return F}else{if(G.show_url||E.show_url){return D+(G.show_url||E.show_url)+'">'+F+"</a>"}else{if(E.network_eid&&E.network_eid!=Mkiconf.network_eid){if(!(A=mki_manage_url(E.network_eid,E.network_url_tag))){return F}F=D+make_query_url(A+"manage/nodes/show/"+E.id,show3.get_time_query())+'">'+F+"</a>";if(E.network_name){F+=' <small>[<i>in\xA0<a href="'+A+'">'+JSTemplate.escape(E.network_name)+"</a></i>]</small>"
}return F}else{if(Mkiconf.h3nodes){C=(B?B.linkhash:null)||("#n="+G.id);return D+C+'" onclick="return $h3(this)">'+F+"</a>"}else{return D+make_query_url(Mkiconf.node_show_url.replace("%23",G.id),show3.get_time_query())+'">'+F+"</a>"}}}}}function node3_render_tags(C,B){var A;if(!C.tags){return B==null?'<span class="deftext">None</span>':B}if(Mkiconf.h3nodes){A='<a href="#q=tag:*" onclick="return $h3(this)">*</a>'}else{A='<a href="'+Mkiconf.node_list_url+'#q=tag:*">*</a>'}return jQuery.trim(C.tags).replace(/[-._\w]+/g,function(D){return A.replace(/\*/g,D)})}function node3_render_to_gw_route(E,B){var C=E.to_gw_route.split(" "),A,D=[s3node.name||s3node.mac];for(A=0;A<C.length;++A){if(C[A]!==""){D.push(node3_render_name({id:C[A]}))}}return D.join(B?"\xA0&gt;<br />":"\xA0&gt; ")}function node3_render_client_description(A){return'<a href="'+make_query_url(Mkiconf.client_show_url.replace("%23",A.client_id),show3.get_time_query())+'">'+A.description+"</a>"}node3_render_status=(function(){var D=["active","warning","inactive","dead","dead"],C=["Active","Alerting","Inactive","Dormant","Dormant"],A={},B={};return function(E,G){var N=E["status#"],I=(E.is_gateway?"_gw":""),M,K,F,J,L,H=E.model;if(N==null||N<0||N>4){N="x"}if(H&&(L=(G?B:A)[H])&&(L=L[N+I])){return L}F=(G?"ni_sm":"ni");J=F+"_";if(N=="x"){M="";K="blank"}else{M=C[N]+" ";K=D[N]}M+=node_product_info(E,"short_description","AP");L='<div class="pc'+F+'"><img src="'+Mkiconf.images+"node_icons/"+node_product_info(E,"icon","unknown")+(G?"_small":"_all")+'.png?5" class="p'+J+K+(I?"_gw":"")+'" alt="'+(H||"UNKNOWN")+'" title="'+M+'" /></div>';if(H){K=(G?B:A);K[H]=K[H]||{};K[H][N+I]=L}return L}})();function node3_render_channel(D,B){var A,C=D.channel;if(C&&C.length&&C.length>1){for(A=1;A<C.length;++A){if(C[A]&&C[A]!=C[0]){return node3_render_channel.hard(D,C,B)}}}if(typeof (C)==="object"){return C[0]||""}else{return C||""}}node3_render_channel.hard=function(F,D,C){var B,E=[],A=node_product_info(F,"interface_names");for(B=0;B<D.length;
++B){if(D[B]){E.push([A[B]||B,D[B]])}}E.sort(function(H,G){return strcmp(H[0],G[0])});for(B=0;B<E.length;++B){E[B]=E[B][1]+(C?" ("+E[B][0]+")":"")}return E.join(", ")};l3_render_rusagecol={percent:function(A,D){var B,C;if((D||0)<=0){return"N/A"}B=100*(A||0)/D;C=unparse_fraction_as_percent(A,D);if(B<=0.5){return C}return"<table class='lean' style='margin:0 0 0 auto'><tr><td style='width:7.5em'><div class='rmbar_gy' style='width:"+B.toFixed(1)+"%'></div></td><td style='text-align:right;width:3.5em'>"+C+"</td></tr></table>"}};node3_render_neighcol=(function(){function C(H,G){var E=Math.round(G.fwd_rate*G.rev_rate/100),F="<td style='width:5em'><div class='rmbar";if(E<40){F+="_r"}else{if(E<70){F+="_y"}}return F+"' style='width:"+E+"%'></div></td><td style='text-align:right;width:2.5em'>"+E+"%</td>"}function B(E){return Math.round(E)+"%"}function A(E,H,I,F){var K="<table class='lean'"+(F||"")+">",G,L=E.stats,M,J;for(G=0;G<L.length;++G){M=L[G];J=(M.is_wired?I:H(E,M));K+=(G?"<tr class='fade'>":"<tr>")+J+"</tr>"}return K+"</table>"}function D(L,K,F){var I="",H,G=L.stats,J,E;for(H=0;H<G.length;++H){J=G[H];E=(J.is_wired?F:K(L,J));I+=(H?"<br /><span class='fade'>"+E+"</span>":E)}return I}return{recv_signal:function(E){return D(E,function(H,G){var F=G.rssi_11b;return F>=0?F+"\xA0dB":"N/A"},"&mdash;")},linkqual:function(E){return A(E,C,"<td colspan='2' style='text-align:right'>&mdash;</td>"," style='margin:0 0 0 auto'")},fwd:function(E){return D(E,function(G,F){return B(F.fwd_rate)},"&mdash;")},outr:function(E){return D(E,function(G,F){return"&nbsp;<small>"+B(F.fwd_rate)+"</small>"},"&mdash;")},rev:function(E){return D(E,function(G,F){return B(F.rev_rate)},"&mdash;")},inr:function(E){return D(E,function(G,F){return"&nbsp;<small>"+B(F.rev_rate)+"</small>"},"&mdash;")},interfaces:function(F){var E=node_product_info(s3node,"interface_names");return D(F,function(H,G){return E[G.inum-1]||""},"wired")}}})();function node3_render_last_active(D){var B=D["last_active#"]||0,A,C;if(!B){return"never"
}A=data3_now()-data3_load.timeoffset("last_active#");C=Mkiconf[nodes_meta.upseries?"node_upseries_thresh":"node_timeout"];return render_ago_interval(B,A,nodes_meta["last_active#"],300,C)}function client3_render_description(C,B){var A=C.description||C.netbios||C.dhcp_hostname||C.mac||"(unknown)";return B?A:JSTemplate.escape(A)}function client3_render_last_seen_at(C){var B=C["last_seen_at#"]||0,A;if(!B){return"unknown"}A=data3_now()-data3_load.timeoffset("last_seen_at#");return render_ago_interval(B,A,clients_meta["last_seen_at#"],300,client3_render_last_seen_at.now_expiry)}client3_render_last_seen_at.now_expiry=30;function client3_render_first_seen_at(C){var B=C["first_seen_at#"]||0,A;if(!B){return"unknown"}A=data3_now()-data3_load.timeoffset("first_seen_at#");return render_ago_interval(B,A,clients_meta["last_seen_at#"],300)}function client3_render_last_seen_by(B){var C=nodes_hash[B.node_id||0],A=(C?C.name||C.mac:null)||"(unknown)";if(Mkiconf.node_show_url&&B.node_id){return'<a href="'+Mkiconf.node_show_url.replace("%23",B.node_id)+'" target="_blank">'+A+"</a>"}else{return A}}function client3_render_ass_at(C){var B=C.ass_at||0,A;if(!B){return"unknown"}A=data3_now()-data3_load.timeoffset("ass_at");return render_ago_interval(B,A,clients_meta.ass_at,300,client3_render_last_seen_at.now_expiry)}function client3_render_connection(A){if(!A.wiretype){return"wireless"}else{if(A.wiretype==2){return"wired, wireless"}else{if(A.wiretype==1){return"wired"}else{return"(unknown)"}}}}function client3_access_status(B){var A=clients_meta.ssidlistmask||1;if((B.blockmask||0)&A){return -1}else{if((B.whitemask||0)&A){return 1}else{return 0}}}function client3_render_access_status(B){var A=client3_access_status(B);if(A<0){return"<span class='as_blocked'>blocked</span>"}else{if(A>0){return"<span class='as_whitelisted'>whitelisted</span>"}else{return"<span class='as_normal'>normal</span>"}}}function client3_render_capf(B){var A=B.capf||0;return general_capf(A)}function general_capf(B){var A;A="802.11"+"bgnnaann".charAt(B&7);
return A+", "+(B&4?"2.4 and 5\xA0GHz":"2.4\xA0GHz")}function client3_render_rssi(A){if(!A||A<0){return"&mdash;"}return"<table class='lean'><tr><td style='width:3em'><div class='rmbar_gy' style='width:"+Math.round(100*Math.max(Math.min(A,50),0)/50)+"%'></div></td><td style='text-align:right;width:3em'>"+A+"\xA0dB</td></tr></table>"}function login3_render_login_at(A){var C=A.login_at||0,B;if(!C){return"unknown"}B=data3_now()-data3_load.timeoffset("login_at");return render_ago_interval(C,B,Mkijson.g.meta.login_at,300,30)}function login3_render_client_mac(A,B){var D,C=A.mac;if(!C&&(D=clients_hash[A.client_key||0])){C=D.mac}C=C||"(unknown)";if(Mkiconf.client_show_url&&A.client_key&&(!B||!B.nolink)){return'<a href="'+Mkiconf.client_show_url.replace("%23",A.client_key)+'" target="_blank">'+C+"</a>"}else{return C}}function login3_render_client_description(A,B){var D=clients_hash[A.client_key||0],C=(D?client3_render_description(D):A.mac||"(unknown)");if(Mkiconf.client_show_url&&A.client_key&&(!B||!B.nolink)){return'<a href="'+Mkiconf.client_show_url.replace("%23",A.client_key)+'" target="_blank">'+C+"</a>"}else{return C}}function login3_render_gateway(A,B){var D=nodes_hash[A.gateway||0],C=(D?D.name||D.mac:null)||"(unknown)";if(Mkiconf.node_show_url&&A.gateway&&(!B||!B.nolink)){return'<a href="'+Mkiconf.node_show_url.replace("%23",A.gateway)+'" target="_blank">'+C+"</a>"}else{return C}}






/* l3_nodes.js */
Mkiconf=window.Mkiconf||{};function node3_match_loadable(B,A){return function(C,E,D,F){if(!nodes_meta.hasOwnProperty(B)){data3_load.mark_unready(E,"n",B);return"false"}return A(C,E,D,F)}}function make_mki_nodes_filter(){if(typeof mki_nodes_filter!=="undefined"){return }var R={mini:"Mini",id2:"Indoor",od1:"Outdoor",od2:"Outdoor",od3:"MR58",wpg:"Wallplug",sol:"Solar",mo1:"MR58",mr11:"MR11",mr14:"MR14"},N={mini:/^MINI(?!-OD)/,indoor:/^ID2/,wallplug:/^WPG/,outdoor:/^(?:MINI-OD|OD2)/,solar:/^SOL/,other:/^(?!ID2|MINI|MR11|MR14|MR58|OD2|OD3|SOL|WPG)/,id2:/^ID2/,od1:/^MINI-OD/,od2:/^OD2/,od3:/^OD3/,wpg:/^WPG/,sol:/^SOL/,mr58:/^(?:OD3|MR58)/,mr11:/^MR11/,mr14:/^MR14/},K={mini:"D",indoor:"D",wallplug:"D",outdoor:"D",solar:"D",other:"D",id2:"D",od1:"D",od2:"D",od3:"D",wpg:"D",sol:"D",mr58:"D",mr11:"D",mr14:"D",gw:"x.is_gateway",gateway:"x.is_gateway",rep:"!x.is_gateway",repeater:"!x.is_gateway",active:"S<2",on:"S<2",live:"S<2",alive:"S<2",reachable:"S<2",up:"S<2",online:"S<2",inactive:"S>1",off:"S>1",dead:"S>1",unreachable:"S>1",down:"S>1",offline:"S>1",dormant:"S==3",unseen:"S==4",alerting:"x.alerting",any:"true","true":"true"},T={alert:"x.alerting",noalert:"!x.alerting"},Q={alert:"!x.alerting"},H=make_smart_filter();
function B(V,Y,W){var U,X;if(V.charAt(1)==="+"||V.charAt(1)==="-"){U=V.substr(2).split(",");for(X=0;X<U.length;++X){U[X]=Y+(W?"==='"+U[X]+"'":"=="+U[X])}return(V.charAt(1)==="+"?U.join("||"):"!("+U.join("||")+")")}else{if(W){return Y+"==='"+V.substr(1)+"'"}else{return Y+V.substr(1)}}}function E(U){return function(V,X){var W=U[V];if(!W){return"false"}else{if(W==="D"){return"devre."+V+".test(x.model || '')"}else{if(W.charAt(0)=="S"){return B(W,"x['status#']",false)}else{return W}}}}}function L(U){return node3_match_loadable(U,function(V,X,W,Y){return Y.propmatch(U,V,X,false,true)})}function J(V,X,W,Y){var U=[];V=V.replace(/[_\s\"]/,"");if(V.match(/^[-0-9a-f]+$/i)){U.push("x.serial.indexOf('"+V.toLowerCase()+"')>=0")}if(V.match(/^[-2-9A-HJ-NP-Z]+$/i)){U.push("x.serial.indexOf('"+V.toUpperCase()+"')>=0")}if(!U.length){U.push("false")}return U.join("||")}function P(U,W,V,X){return X.propmatch("tags"," "+U+" ",W,false,true)}function F(V,X,W,Y){var U=split_text_comparison(V);if(/^\d+$/.test(U[1])){return"x['clients#']"+U[0]+parseInt(U[1],10)}else{return"false"}}function S(V,X,W,Y){var U=split_text_comparison(V);if((U[1]=parse_time(U[1],"h"))!==false){if(U[0]==="=="){return"x['outage_graph#']>="+(U[1]*0.9)+"&&x['outage_graph#']<="+(U[1]*1.1)}else{if(U[0]==="!="){return"x['outage_graph#']<"+(U[1]*0.9)+"||x['outage_graph#']>"+(U[1]*1.1)}else{return"x['outage_graph#']"+U[0]+U[1]}}}else{return"false"}}function C(V,X,W,Z){var U=split_text_comparison(V),Y;if(/^\d+$/.test(U[1])){return"x['gwhops#']"+U[0]+parseInt(U[1],10)}else{X.helpers.push(Z.ids(W,V,X,"r"));Y="helpers["+(X.helpers.length-1)+"]";return Y+".test(x.id) || "+Y+".test(x.gateway_route)"}}function M(U,W,V,Z){var X,Y=Z.ids(V,U,W),a={};for(X in Y){a[nodes_hash[Y[X]].gateway_id]=true}W.helpers.push(a);return"helpers["+(W.helpers.length-1)+"][x.id]"}M.take_expr=true;function O(U,W,V,X){W.helpers.push(X.ids(V,U,W,"h"));return"helpers["+(W.helpers.length-1)+"][x.gateway_id]"}O.take_expr=true;function G(U,W,V,Z){var X,Y=Z.ids(V,U,W),a={};
for(X in Y){a[nodes_hash[Y[X]].gateway_id]=true}W.helpers.push(a);return"helpers["+(W.helpers.length-1)+"][x.gateway_id]"}G.take_expr=true;function D(U,W,V,X){U=U.replace(/[\\\"]/g,"");W.helpers.push(custom_map_placements(U)||{});return"helpers["+(W.helpers.length-1)+"][x.id]"}function A(V,X,W,Y){var U;V=V.replace(/[\\\"]/g,"");if((U=V.match(/^([0-9]+)\s*ssids$/i))){return"node_product_info(x,'max_ssid',3)>="+(parseInt(U[1],10)-1)}else{return"false"}}function I(U,X,W,Y){var V=[Y.propmatch("name",U,X)],Z;if(U.match(/^[-0-9a-f:.]+$/)&&(Z=l3_clean_mac(U))){V.push(Y.propmatch("mac",Z,X,true))}if(U.match(/^(?:\.[\d.]+|\d+\.[\d.]*|\d+\/\d+)(?:\/\d+)?$/)){V.push(Y.getkw("ip")(U,X,W,Y))}if(U.match(/^[-0-9a-f]{3,11}$/i)||U.match(/^[-2-9A-HJ-NP-Z]{4,14}$/i)){V.push(J(U,X,W,Y))}if(U.match(/^[-.\w]+$/)){V.push(P(U,X,W,Y))}return V.join("||")}H.addmvars({known_device_types:R,devre:N});H.addkw({"":I,is:E(K),has:E(T),no:E(Q),name:function(U,V){return H.propmatch("name",U,V)},mac:function(U,V){U=l3_clean_mac(U);return U?H.propmatch("mac",U,V,true):"false"},serial:J,ip:make_smart_filter_match_ip("ip","local_ip"),tag:P,label:P,notes:L("notes"),uplink:L("uplink_provider"),route:C,hops:C,hop:C,"gateway-for":M,"gw-for":M,"has-gateway":O,"has-gw":O,"shares-gateway":G,"shares-gw":G,usage:smart_filter_match_usage("usage#"),clients:F,offline:S,channel:node3_match_loadable("channel",l3_match_channel),supports:A});if(typeof (custom_map_placements)!=="undefined"){H.addkw({"on-map":D})}(function(){var V,X,W=[],U={};for(V in R){X=R[V];if(!U[X]){W.push("is:"+X.toLowerCase());U[X]=true}}W.push("is:other");H.add_checkbox_partition(W);H.add_checkbox_partition("is:online","is:offline");H.add_checkbox_partition("has:alert","no:alert");H.add_checkbox_partition("is:gateway","is:repeater")})();mki_nodes_filter=H}function make_nodes_hash_filter(){make_mki_nodes_filter();var D,B=false;function C(){var G,F,E,I,K,L,J,H,M=D.checkbox_html;I=nodes_meta.upseries;for(E in nodes_hash){F=nodes_hash[E];if(F.upseries&&F.upseries.length){node3_update_upseries(F,I)
}}B={count:0,gateway:0,repeater:0,online:0,offline:0,has_alert:0,no_alert:0,min_usage:Infinity,max_usage:0,max_ping_latency:0};known_device_types=mki_nodes_filter.mvars().known_device_types;for(G in nodes_hash){F=nodes_hash[G];++B.count;(F.is_gateway?++B.gateway:++B.repeater);if(F["usage#"]<B.min_usage){B.min_usage=F["usage#"]}if(F["usage#"]>B.max_usage){B.max_usage=F["usage#"]}if(F["ping_latency#"]>B.max_ping_latency){B.max_ping_latency=F["ping_latency#"]}L=known_device_types[node_product_info(F,"type","")]||"Other";B[L]=(B[L]||0)+1;(F["status#"]<2?++B.online:++B.offline);(F.alerting?++B.has_alert:++B.no_alert)}J=[];K=[];H=["Mini","Indoor","Outdoor","Wallplug","Solar","MR11","MR14","MR58","Other"];for(G=0;G<H.length;++G){if(B[H[G]]){K.push(M("is:"+H[G].toLowerCase(),H[G]))}}J.push("<h3>Device type</h3>"+K.join("<br />"));K=[];if(B.online){K.push(M("is:online","Online"))}if(B.offline){K.push(M("is:offline","Offline"))}if(B.has_alert){K.push(M("has:alert","Has alert"))}if(B.no_alert){K.push(M("no:alert","No alert"))}if(K.length){J.push("<h3>Status</h3>"+K.join("<br />"))}K=[];if(B.gateway){K.push(M("is:gateway","Gateway"))}if(B.repeater){K.push(M("is:repeater","Repeater"))}if(K.length){J.push("<h3>Role</h3>"+K.join("<br />"))}if(B.count){J.push("<h3>Usage</h3>Transferred <input id='usage_min' type='text' size='8' value=\""+unparse_bytes(B.min_usage,true)+"\" /> to <input id='usage_max' type='text' size='8' value=\""+unparse_bytes(B.max_usage,true)+'" />')}if(J.length){jQuery("#l3filter").html("<table><tr><td class='l3filter'>"+J.join("</td><td class='l3filter'>")+"</td></tr></table>");D.bind_checkbox_click(jQuery("#l3filter input:checkbox"));D.bind_size_change(jQuery("#usage_min"),"usage",false,B.min);D.bind_size_change(jQuery("#usage_max"),"usage",true,B.max)}alert_count=B.has_alert}function A(F,G){var E,H;if(B.count!==G.length){E="<span class='result'>"+pluralize(G.length,"result")+"</span> in "+pluralize(B.count,"access point")}else{E="<span class='result'>"+pluralize(B.count,"access point")+"</span>"
}if(alert_count>0){E+="<br /><a class='alert_count' href='#q=has%3Aalert' onclick='return $h3(this)'>"+alert_count+"\xA0alerting</a> &nbsp;|&nbsp; "+alert_extra}jQuery("#node_count").html(E).show();if((H=jQuery("#node3_count")).length){if(B.count!==G.length){E="<b>"+pluralize(G.length,"match")+"</b> in "+B.count}else{E="<b>"+pluralize(B.count,"access point")+"</b>"}if(alert_count>0){E+=" <span class='barsep'>|</span> <a class='alert_count' href='#q=has%3Aalert' onclick='return $h3(this)'>"+alert_count+"\xA0alerting</a>"}H.html(E)}}D=make_bound_smart_filter(mki_nodes_filter,nodes_hash);D.bind(A);jQuery(document).bind("node_change",function(F,E){var G,H;for(G in E){if(!({id:true,nuseblocks:true,cuseblocks:true})[G]){H=true}}if(H){D()}});C();D();return D}function node_list3_load(){outage_grapher.bind_to(jQuery("#nodes_div"));jQuery("#nodes_div").bind("columns_changed",data3_column_loader("n",{"watchdog#":true,channel:true,nass:true}));jQuery.extend(node_list3_load.table_options,{items:nodes_hash,footer:jQuery("#nodes_footer")[0]||true,displayed:nodes_hash_filter.results()});Mkijson.n.flex_table=flex_table=make_list3_flex_table(node_list3_load.table_options);data3_bind_change(flex_table,{id:true,notes:true,tags:true,upseries:true,nuseblocks:true});list3_check_stale();setInterval(list3_check_stale,60000)}node_list3_load.link_prerender=function(A){A.nlink=$h3.hash({n:undefined});if(A.nlink!="#"){A.nlink+="/"}A.nlink+="n="};node_list3_load.make_link_render=function(A){return function(D){var C={name:1,mac:1,serial:1},B,E;for(B=0;B<D.length&&!C[D[B]];++B){}E=A=="name"?"escape(item."+A+" || item.mac)":"item."+A;if(D[B]==A){return"[%= node3_render_name(item, "+E+", {linkhash: this.nlink + item.id}) %]"}else{return"[%= "+E+" %]"}}};node_list3_load.table_options={container:"#nodes_div",className:"nodes_filter",column_customizer:"#prefs_link",row_num:true,history:function(A){return history3({n:A})}};nodes3_actions=(function(D,F){function C(G){checked_json_submit(F.multiedit_json_url,{clear_alerts:1});
return nodes3_actions.blur_soon(G)}function E(G){if(checkbox3.nchecked==0){checkbox3.unchecked_alert()}else{if(show3.confirm_remove_network(checkbox3.nchecked)){checked_json_submit(F.multiedit_json_url,{abandon:1})}}return nodes3_actions.blur_soon(G)}function A(J){var I,G;if(checkbox3.nchecked==0){checkbox3.unchecked_alert()}else{G=checkbox3.sorted_checked(strcmp,{renderf:function(K){return"&ldquo;"+JSTemplate.escape(node_name(K))+"&rdquo;"},max:30,andothers:1});G=pluralize(G.length,"Access point",{nc:1})+" "+commajoin(G);I=D("<div class='flora' title='Change network'><p style='max-width: 30em'>"+G+" will be moved to the selected network.</p><p><select class='field_select'>"+show3.network_selector_options()+"</select></p><br /><br /><br /></div>");function H(N,M,L){var K=D("select",I).val();if(K!==F.network_eid&&show3.confirm_change_network(checkbox3.nchecked)){checked_json_submit(F.multiedit_json_url,{network:K})}}I.bind("dialogclose",function(){I.parents(".ui-dialog").remove()});I.dialog({autoOpen:true,modal:true,width:"",height:"",buttons:{Cancel:function(){I.dialog("close")},OK:function(){H();I.dialog("close")}},overlay:{"background-color":"#000",opacity:0.5}})}return nodes3_actions.blur_soon(J)}function B(I,H){var G=I?"add":"remove";checked_json_submit(F.multiedit_json_url,{},{prompt:"Enter the tag or tags to "+G+":",prompt_for:G+"_tags"});return nodes3_actions.blur_soon(H)}return make_l3_action_menu("#l3_action_menu",function(G){G.add_link("Clear alerts",C);G.add_space();G.add_link("Remove from network",E);if((F.num_administered_networks_movable||0)>1){G.add_link("Change network...",A)}G.add_subhead("Tags");G.add_link("Add tags",B,1);G.add_link("Remove tags",B,0);if(typeof custom_maps_dialog!=="undefined"&&typeof floorplans!=="undefined"&&floorplans&&floorplans.length){G.add_subhead("Custom maps");G.add_link("Add to maps...",custom_maps_dialog,true);G.add_link("Remove from maps...",custom_maps_dialog,false)}})})(window.jQuery,Mkiconf);






/* l3_clients.js */
function make_mki_clients_filter(){if(window.mki_clients_filter){return }var E=make_smart_filter();function F(G,H){if(G==="normal"){return"!(((x.blockmask||0)+(x.whitemask||0))&"+clients_meta.ssidlistmask+")"}else{if(G==="white"||G==="whitelist"||G==="whitelisted"){return"((x.whitemask||0)&"+clients_meta.ssidlistmask+")"}else{if(G==="black"||G==="blacklist"||G==="blacklisted"||G==="blocked"){return"((x.blockmask||0)&"+clients_meta.ssidlistmask+")"}else{if(G==="wired"){return"((x.wiretype||0)>0)"}else{if(G==="wireless"){return"(!x.wiretype||x.wiretype==2)"}else{if(G==="wiredonly"){return"((x.wiretype||0)==1)"}else{if(G==="wirelessonly"){return"!x.wiretype"}else{if(G==="both"){return"((x.wiretype||0)==2)"}else{if(G==="unknown"){return"((x.wiretype||0)<0)"}else{return"false"}}}}}}}}}}function A(G,J,I,L){var H=[L.getkw("name")(G,J,I,L)],K;if(G.match(/^[-0-9a-f:.]+$/)){H.push(L.getkw("mac")(G,J,I,L))}if(G.match(/^(?:\.[\d.]+|\d+\.[\d.]*|\d+\/\d+)(?:\/\d+)?$/)){H.push(L.getkw("ip")(G,J,I,L))}H.push(L.getkw("manufacturer")(G,J,I,L));H.push(L.getkw("os_fingerprint")(G,J,I,L));H.push(L.getkw("notes")(G,J,I,L));K=((Mkiconf.user_dashboard_prefs||{}).clients_list||{}).f||[];if(jQuery.inArray("last_seen_by",K)>=0){H.push(L.getkw("recent-ap")(G,J,I,L))}if(jQuery.inArray("authuser",K)>=0){H.push(L.getkw("user")(G,J,I,L))}return H.join("||")}function D(G,J,I,M){var K=Mkijson,H,L;if(!K.c.meta.hasOwnProperty("nusage")){data3_load.mark_unready(J,"c","nusage");return"false"}make_mki_nodes_filter();H=mki_nodes_filter.ids(K.n.hash,G);if(H.length==0){return"false"}else{for(L=H.length-1;L>=0;--L){H[L]="x.nusage["+H[L]+"]"}return"x.nusage&&("+H.join("||")+")"}}function C(G,I,H,J){make_mki_nodes_filter();I.helpers.push(mki_nodes_filter.ids(nodes_hash,G,null,"r"));return"helpers["+(I.helpers.length-1)+"].test(x.node_id)"}function B(G,I,H,J){var K=Mkijson.c.meta;if(!K.hasOwnProperty("authuser")){data3_load.mark_unready(I,"c","authuser");return"false"}return J.propmatch("authuser",G,I,false,true)
}E.addkw({"":A,is:F,name:function(G,H){return"("+E.propmatch("description",G,H,false,true)+")||("+E.propmatch("dhcp_hostname",G,H,false,true)+")||("+E.propmatch("netbios",G,H,false,true)+")"},netbios:function(G,H){return E.propmatch("netbios",G,H,false,true)},dhcp_hostname:function(G,H){return E.propmatch("dhcp_hostname",G,H,false,true)},mac:function(G,I,H,J){var K=l3_clean_mac(G);if(K){return J.propmatch("mac",K,I,true,true)}else{if(G==="unknown"){return"!x.mac"}else{return false}}},ip:make_smart_filter_match_ip("ip"),os_fingerprint:function(G,H){return E.propmatch("os_fingerprint",G,H,false,true)},os:function(G,H){return E.propmatch("os_fingerprint",G,H,false,true)},manufacturer:function(G,H){return E.propmatch("mfr",G,H,false,true)},mfr:function(G,H){return E.propmatch("mfr",G,H,false,true)},notes:function(G,H){return E.propmatch("notes",G,H,false,true)},"used-ap":D,"last-ap":C,"recent-ap":C,ap:C,at:C,loc:C,usage:smart_filter_match_usage("usage"),sent:smart_filter_match_usage("usage",1),rcvd:smart_filter_match_usage("usage",0),received:smart_filter_match_usage("usage",0),recv:smart_filter_match_usage("usage",0),user:B});E.add_checkbox_partition("is:normal","is:whitelisted","is:blocked");E.add_checkbox_partition("is:wiredonly","is:wirelessonly","is:both","is:unknown");E.add_checkbox_synonym("is:wired","is:wiredonly OR is:both");E.add_checkbox_synonym("is:wireless","is:wirelessonly OR is:both");mki_clients_filter=E}function make_clients_hash_filter(){var E,C=false;function B(){var H,K,I,J,F,G={count:0,access:0,conn:0,min_usage:Infinity,max_usage:0,version:clients_meta.stats_version};for(H in clients_hash){K=clients_hash[H];++G.count;I=!!((K.blockmask||0)&clients_meta.ssidlistmask);J=!!((K.whitemask||0)&clients_meta.ssidlistmask);if(!I&&!J){G.access|=1}if(J){G.access|=2}if(I){G.access|=4}G.conn|=1<<Math.min(3,Math.max(0,(K.wiretype||0)+1));F=vector_sum(K.usage)*1024;if(F<G.min_usage){G.min_usage=F}if(F>G.max_usage){G.max_usage=F}}return G}function D(){var G,I,H,J,F=E.checkbox_html;
C=B();G=["is:normal","is:whitelisted","is:blocked"];for(I=0;I<G.length;++I){E.set_checkbox_live(G[I],(C.access&(1<<I))!==0)}G=["is:unknown","is:wirelessonly","is:wiredonly","is:both"];for(I=0;I<G.length;++I){E.set_checkbox_live(G[I],(C.conn&(1<<I))!==0)}J=[];G=[];if(C.access&1){G.push(F("is:normal","Normal"))}if(C.access&2){G.push(F("is:whitelisted","Whitelisted"))}if(C.access&4){G.push(F("is:blocked","Blocked"))}if(C.access!=1){J.push("<h3>Access type</h3>"+G.join("<br />"))}G=[];H=(C.conn&8?" only":"");if(C.conn&2){G.push(F("is:wirelessonly","Wireless"+H))}if(C.conn&4){G.push(F("is:wiredonly","Wired"+H))}if(C.conn&8){G.push(F("is:both","Wired &amp; wireless"))}if(C.conn&1){G.push(F("is:unknown","Unknown"))}if(C.conn!=2){J.push("<h3>Connection</h3>"+G.join("<br />"))}if(C.count){J.push("<h3>Usage</h3>Transferred <input id='usage_min' type='text' size='8' value=\""+unparse_bytes(C.min_usage,true)+"\" /> to <input id='usage_max' type='text' size='8' value=\""+unparse_bytes(C.max_usage,true)+'" />')}if(J.length){jQuery("#l3filter").html("<table><tr><td class='l3filter'>"+J.join("</td><td class='l3filter'>")+"</td></tr></table>");E.bind_checkbox_click(jQuery("#l3filter input:checkbox"));E.bind_size_change(jQuery("#usage_min"),"usage",false,C.min);E.bind_size_change(jQuery("#usage_max"),"usage",true,C.max)}}function A(F,G){var H=jQuery("#usage3_count");if(!C||C.version!=clients_meta.stats_version){D()}if(C.count!==G.length){H.html("<b>"+pluralize(G.length,"match")+"</b> in "+C.count)}else{H.html("<b>"+pluralize(C.count,"client device")+"</b>")}}make_mki_clients_filter();E=make_bound_smart_filter(mki_clients_filter,clients_hash);E.bind(A);jQuery("#clients_div").bind("items_changed",function(){E()});D();E();return E}function usage_list3_load(){var A;jQuery("#clients_div").bind("columns_changed",data3_column_loader("c",{capf:true,authuser:true}));jQuery.extend(usage_list3_load.table_options,{items:clients_hash,footer:jQuery("#clients_footer")[0]||true,displayed:clients_hash_filter.results()});
Mkijson.c.flex_table=flex_table=make_list3_flex_table(usage_list3_load.table_options);A="netuseblocks";if(Mkiconf.ssid_number!=null&&Mkiconf.ssid_number>=0){A="netsuseblocks"}if(Mkiconf.has_rusage){A=A+" netrusage"}data3_load.ajax("n",{t0:clients_meta.t0,t1:clients_meta.t1,f:A},function(){graph_network_use()});graph_network_use.resizable=true;graph_network_use.show_fullt1_warning();data3_bind_change(flex_table,{id:true,cuseblocks:true});list3_check_stale();setInterval(list3_check_stale,60000)}usage_list3_load.link_prerender=function(A){A.clink=$h3.hash({c:undefined});if(A.clink!="#"){A.clink+="/"}A.clink+="c="};usage_list3_load.make_link_render=function(A){return function(D){var C={description:1,mac:1,ip:1},B,E;for(B=0;B<D.length&&!C[D[B]];++B){}if(A=="description"){E="[%= client3_render_description(item) %]"}else{E="[%= escape(item."+A+" || '(unknown)') %]"}if(D[B]==A&&Mkiconf.h3clients){return'<a href="[%= this.clink %][%= item.id %]" onclick="return $h3(this)">'+E+"</a>"}else{if(D[B]==A&&Mkiconf.client_show_url){return'<a href="'+Mkiconf.client_show_url.replace("%23","[%= item.id %]")+'">'+E+"</a>"}else{return E}}}};usage_list3_load.table_options={container:"#clients_div",className:"usage_filter",column_customizer:"#prefs_link",row_num:true,history:function(A){return history3({c:A})}};function usage3_access_selected(B,A){checked_json_submit(Mkiconf.client_edit_url,{access:B});return usage3_actions.blur_soon(A)}usage3_actions=make_l3_action_menu("#usage3_action_menu",function(){var A=[];A.push('<h3 class="dmenu_first">Access control</h3>\n');A.push('<div class="dmenuitem"><a href="#" onclick="return usage3_access_selected(\'whitelisted\', event)">Whitelist</a></div>');A.push('<div class="dmenuitem"><a href="#" onclick="return usage3_access_selected(\'blocked\', event)">Block</a></div>');A.push('<div class="dmenuitem"><a href="#" onclick="return usage3_access_selected(\'normal\', event)">Normal</a></div>');return A.join("")});






/* l3_logins.js */
function logins_list3_load(){jQuery.extend(logins_list3_load.table_options,{items:Mkijson.g.hash,footer:jQuery("#logins_footer")[0]||true});
Mkijson.g.flex_table=flex_table=make_list3_flex_table(logins_list3_load.table_options);list3_check_stale();setInterval(list3_check_stale,60000)}logins_list3_load.table_options={container:"#logins_div",className:"logins_filter",row_num:true,default_sort:"login_at"};






/* l3_events.js */
function make_mki_events_filter(){if(typeof mki_events_filter!=="undefined"){return }var C=make_smart_filter(),B,D;function A(E,H,G,I){var F=[I.getkw("ap")(E,H,G,I)];F.push(I.getkw("client")(E,H,G,I));F.push(I.getkw("type")(E,H,G,I));F.push(I.getkw("ssid")(E,H,G,I));return F.join("||")}C.addkw({"":A,ap:function(F,H){var G=[C.propmatch("ap_name",F,H,false,true)],E;if(F.match(/^[-0-9a-f:.]+$/)&&(E=l3_clean_mac(F))){G.push(C.propmatch("ap_mac",E,H,false,true))}if(F.match(/^(?:\.[\d.]+|\d+\.[\d.]*|\d+\/\d+)(?:\/\d+)?$/)){G.push((make_smart_filter_match_ip("ap_ip"))(F,H));if(Mkiconf.admin){G.push((make_smart_filter_match_ip("ap_hashed_ip"))(F,H))}}return G.join("||")},client:function(F,H){var G=[C.propmatch("cli_name",F,H,false,true)],E;if(F.match(/^[-0-9a-f:.]+$/)&&(E=l3_clean_mac(F))){G.push(C.propmatch("cli_mac",E,H,false,true))}if(F.match(/^(?:\.[\d.]+|\d+\.[\d.]*|\d+\/\d+)(?:\/\d+)?$/)){G.push((make_smart_filter_match_ip("cli_ip"))(F,H))}return G.join("||")},type:function(E,F){return"("+C.propmatch("type",E,F,false,true)+")||("+C.propmatch("category",E,F,false,true)+")"},ssid:function(E,F){var G,H={};for(G in ssid_names){if(ssid_names[G].indexOf(E)>=0){H[G]=true}}F.helpers.push(H);return"helpers["+(F.helpers.length-1)+"][x.ssid_idx]"}});D=[];for(B in Mkiconf.event_categories){D.push("type:"+Mkiconf.event_categories[B][1])}C.add_checkbox_partition(D);mki_events_filter=C}function make_events_hash_filter(){make_mki_events_filter();var D,B=false;function C(){B={count:0};var G,F="<h3>Event type</h3><table><tr>",E=0,H;for(G in events_hash){++B.count}for(G in Mkiconf.event_categories){H=Mkiconf.event_categories[G];F+="<td class='l3filter'>"+D.checkbox_html("type:"+H[1],H[0])+"</td>";
if((++E+1)%4==0){F+="</tr><tr>"}}F+="</tr></table>";jQuery("#l3filter").html(F);D.bind_checkbox_click(jQuery("#l3filter input:checkbox"))}function A(F,G){var E,H;if(!B){C()}if(B.count!==G.length){E="<span class='result'>"+pluralize(G.length,"result")+"</span> in "+pluralize(B.count,"event")}else{E="<span class='result'>"+pluralize(B.count,"event")+"</span>"}jQuery("#node_count").html(E).show();if((H=jQuery("#node3_count")).length){if(B.count!==G.length){E="<b>"+pluralize(G.length,"match")+"</b> in "+B.count}else{E="<b>"+pluralize(B.count,"event")+"</b>"}H.html(E)}}D=make_bound_smart_filter(mki_events_filter,events_hash);D.bind(A);C();D();return D}events_list3=(function(){var B={radio:1,vap:1,rssi:1,p:1};function A(E){return(E.details.n==1?"1 event was not logged":(E.details.n+" events were not logged"))}function D(F){var G=[],I,J,E=F.details,H;if(E.saddr){I=E.saddr+(E.sport?":"+E.sport:"")}if(E.daddr){J=E.daddr+(E.dport?":"+E.dport:"")}if(I&&J){G.push(I+" &rarr; "+J)}else{if(I){G.push("src "+I)}else{if(J){G.push("dst "+J)}}}for(H in F.details){if(((H=="saddr"||H=="sport")&&I)||((H=="daddr"||H=="dport")&&J)||B[H]){continue}if(H=="identity"){G.push(H+" '"+F.details[H]+"'")}else{G.push(H+" "+F.details[H])}}return G}function C(H){var E,G,F=H.details,I=D(H);E=node_product_info(nodes_hash[H.ap_id],"interface_names",[])[F.radio||0];if(E){G="radio "+E;if(F.rssi){G+=" ("+F.rssi+"\xA0dB)"}I.push(G)}return I.join(", ")}return{render_ap_column:function(){var F="[% node = nodes_hash[item.ap_id] %][%= node ? escape(node.name || node.mac) : 'N/A' %]",E=Mkiconf.node_show_url;return'<a href="'+E.replace("%23","[%= item.ap_id %]")+'">'+F+"</a>"},render_client_column:function(){var F="[%= escape(item.cli_name || item.cli_mac || item.cli_ip || '') %]",E=Mkiconf.client_show_url;return'<a href="'+E.replace("%23","[%= item.cli_key %]")+'">'+F+"</a>"},render_details_column:function(E){switch(E.category){case"dropped":return A(E);case"80211":return C(E);case"dhcp":case"config":case"wpa":case"8021x":default:return D(E).join(", ")
}}}})();






/* l3_rogue_aps.js */
function make_mki_rogue_aps_filter(){if(typeof mki_rogue_aps_filter!=="undefined"){return }var B=make_smart_filter();function A(C,F,E,G){var D=[G.getkw("ap")(C,F,E,G)];D.push(G.getkw("ssid")(C,F,E,G));return D.join("||")}B.addkw({"":A,is:function(C,D){if(C==="wired"){return"!!x.wired_mac"}else{if(C==="encrypted"){return"(x.using_wpa1||x.using_wpa2)"}else{if(C==="known"){return"!!x.is_known"}else{return"false"}}}},not:function(C,D){if(C==="wired"){return"!x.wired_mac"}else{if(C==="encrypted"){return"!(x.using_wpa1||x.using_wpa2)"}else{if(C==="known"){return"!x.is_known"}else{return"false"}}}},ssid:function(C,D){return B.propmatch("ssid",C,D,false,true)},ap:function(D,F){var E=[B.propmatch("ap_name",D,F,false,true)],C;if(D.match(/^[-0-9a-f:.]+$/)&&(C=l3_clean_mac(D))){E.push(B.propmatch("ap_mac",C,F,false,true))}if(D.match(/^(?:\.[\d.]+|\d+\.[\d.]*|\d+\/\d+)(?:\/\d+)?$/)){E.push((make_smart_filter_match_ip("ap_ip"))(D,F));if(Mkiconf.admin){E.push((make_smart_filter_match_ip("ap_hashed_ip"))(D,F))}}return E.join("||")},encryption:function(C,D){return"("+B.propmatch("encryption",C,D,false,true)+")||("+B.propmatch("encryption",C,D,false,true)+")"},details:function(C,D){return B.propmatch("details",C,D,false,true)}});B.add_checkbox_partition("is:known","not:known");B.add_checkbox_partition("is:encrypted","not:encrypted");B.add_checkbox_partition("is:wired","not:wired");mki_rogue_aps_filter=B;return true}function make_rogue_aps_hash_filter(){make_mki_rogue_aps_filter();var B,C=false,E;function D(){C={count:0};var G,F="<h3>Rogue AP type</h3><table><tr>";for(G in rogue_aps){++C.count}F+="<td class='l3filter'>"+B.checkbox_html("not:known","Unknown")+"<br />";F+=B.checkbox_html("is:known","Known")+"</td>";F+="<td class='l3filter'>"+B.checkbox_html("is:encrypted","Encrypted")+"<br />";F+=B.checkbox_html("not:encrypted","Unencrypted")+"</td>";F+="<td class='l3filter'>"+B.checkbox_html("is:wired","Connected to wired network")+"<br />";F+=B.checkbox_html("not:wired","Not connected to wired network")+"</td>";
F+="</tr></table>";jQuery("#l3filter").html(F);B.bind_checkbox_click(jQuery("#l3filter input:checkbox"))}function A(G,H){var F,I;if(!C){D()}if(C.count!==H.length){F="<span class='result'>"+pluralize(H.length,"result")+"</span> in "+pluralize(C.count,"rogue AP")}else{F="<span class='result'>"+pluralize(C.count,"rogue AP")+"</span>"}jQuery("#node_count").html(F).show();if((I=jQuery("#node3_count")).length){if(C.count!==H.length){F=pluralize(H.length,"match")}else{F=pluralize(C.count,"rogue AP")}I.html("<b>"+F+"</b>")}}B=make_bound_smart_filter(mki_rogue_aps_filter,rogue_aps);B.bind(A);D();E=B.setitems;B.setitems=function(F){var G;C.count=0;for(G in F){++C.count}E(F)};B();return B}function rogue_aps_known_selected(B,A){checked_json_submit(Mkiconf.rogue_ap_edit_url,{mark_as:B},{successCallback:function(C){jQuery.each(C,function(D,E){rogue_aps[D].is_known=E.is_known});flex_table.render()}});return rogue_aps_actions.blur_soon(A)}rogue_aps_actions=make_l3_action_menu("#l3_action_menu",function(){var A=[];A.push('<h3 class="dmenu_first">Known APs</h3>\n');A.push('<div class="dmenuitem"><a href="#" onclick="return rogue_aps_known_selected(\'known\', event)">Mark as known</a></div>');A.push('<div class="dmenuitem"><a href="#" onclick="return rogue_aps_known_selected(\'unknown\', event)">Mark as unknown</a></div>');return A.join("")});rogue_aps_ui=function(){var C={scan_now_last_change_ts:false,scan_now_xhrs:0,scan_now_xhrs_without_change:0,t_ceil:new Date().getTime()/1000,t_floor:false},E=function(){};E.init=function(I){jQuery.extend(C,I);flex_table.set_no_items_html(C.no_results_static);G();D();jQuery("#timespan_controls li.timespan_link_container:first a").click()};function B(){var I,J,K={};for(I in rogue_aps){J=rogue_aps[I];if(J.last_seen_at_utc>=C.t_floor){K[I]=J}}rogue_aps_hash_filter.setitems(K);flex_table.filter(rogue_aps_hash_filter.results())}function G(){jQuery("#timespan_controls .timespan_link").click(function(){jQuery("#timespan_controls").find(".timespan_link").show().end().find(".timespan_currently_selected").hide().end().find("#scan_now_timespan_link.timespan_link").toggle(C.scan_now_clicked).end();
jQuery(this).hide().siblings(".timespan_currently_selected").show();if(C.scan_now_clicked&&!C.scan_now_finished&&jQuery(this).is("#scan_now_timespan_link")){flex_table.set_no_items_html(C.no_results_scanning)}else{flex_table.set_no_items_html(C.no_results_static)}F(parseInt(jQuery(this).attr("data_floor")));return false})}function F(K,J){C.t_ceil=(J)?Math.max(J,C.t_ceil):C.t_ceil;C.t_floor=(K)?K:C.t_floor;jQuery("#table_header_and_timespan_controls").find(".t0").html(unparse_date(C.t_floor,"%b %-d% #Y %H:%M% Z",1)).end().find(".t1").html(unparse_date(C.t_ceil,"%b %-d% #Y %H:%M% Z",1)).end();B();var I=jQuery("#download_xml_link");I.attr("href",I.attr("data_base_href")+"?t_floor="+C.t_floor+"&t_ceil="+C.t_ceil);return true}function D(){jQuery("#timespan_controls .scan_now").click(function(){if(!confirm("Warning: Running an active scan will interrupt client traffic for 10-15 seconds. Client devices may roam or be temporarily disconnected.  You can schedule active scans to run during periods of inactivity on the Network Settings page under the Configure tab. \n\n Are you sure you want to run an active scan right now?")){return false}var I=new Date(),J=(I.getTime()/1000)+Mkiconf.t_offset-30;jQuery.get(C.grab_url,{},function(K,L){F(parseInt(K));jQuery("#timespan_controls a#last_scan_timespan_link").attr("data_floor",K)},"html");jQuery(this).attr("disabled","disabled").attr("title","Currently scanning your network");jQuery("#timespan_controls").find("a#last_scan_timespan_link").attr("data_floor",J).click().end().find("#active_scan_spinner").show().end();setTimeout(A,30000);return false});return true}function A(){jQuery.ajax({type:"GET",dataType:"json",url:C.live_stats_url,success:function(J,K){var I=false;C.scan_now_xhrs++;rogue_aps=J;jQuery.each(rogue_aps,function(L,M){if(!C.scan_now_last_change_ts||C.scan_now_last_change_ts<M.last_seen_at_utc){I=true;C.scan_now_last_change_ts=M.last_seen_at_utc}});if(I){C.scan_now_xhrs_without_change=0;F(false,new Date().getTime()/1000);B()
}else{C.scan_now_xhrs_without_change++}if((C.scan_now_xhrs<=3)||(C.scan_now_xhrs_without_change<=2)){setTimeout(A,10000)}else{H()}}})}function H(){jQuery("#active_scan_spinner").hide();jQuery("#scan_now_button").attr("disabled","").attr("title","");flex_table.set_no_items_html(C.no_results_static);F();return true}E.make_link_render=function(I){return function(J){if(I=="seen_by_infos"){return'<span class="seen_by_strongest"><a href="[%= Mkiconf.node_show_url.replace("%23", item.seen_by_infos[0].id) %]">[%= item.seen_by_infos[0].name %]</a> ([%= item.seen_by_infos[0].rssi %]&nbsp;dB)</span><span class="seen_by_all_expando" style="[%= (item.seen_by_infos.length==1) ? "display:none" : "" %]">    <br/><a href="#show_all" onClick="rogue_aps_ui.seen_by_first_all_toggle(this, true); return false;">[%= item.seen_by_infos.length-1 %] more &raquo;</a></span><span class="seen_by_all" style="display:none">[%= jQuery.map(item.seen_by_infos, function(node_info) {        return \'<a href="\'+Mkiconf.node_show_url.replace("%23", node_info.id)+\'" title="&quot;\'+node_info.name+\'&quot; saw this access point with RSSI \'+node_info.rssi+\'">\'+node_info.name+\'</a> (\'+node_info.rssi+\'&nbsp;dB)\';    }).join(\'<br/>\') %]    <br/><a href="#show_strongest" onclick="rogue_aps_ui.seen_by_first_all_toggle(this, false); return false;">Show strongest &raquo;</a></span>'}else{if(I=="encryption"){return'[%= (item.using_wep || item.using_wpa1 || item.using_wpa2) ? "Encrypted" : "Unencrypted" %]'}else{if(I=="first_seen_at"){return'[%= unparse_date(item.first_seen_at_utc, "%b %-d% #Y %H:%M", 1) %]'}else{if(I=="last_seen_at"){return'[%= unparse_date(item.last_seen_at_utc, "%b %-d% #Y %H:%M", 1) %]'}else{if(I=="capabilities"){return"[%= general_capf(item.capf) %]"}}}}}};return };E.seen_by_first_all_toggle=function(J,I){jQuery(J).parents("td").find(".seen_by_strongest, .seen_by_all_expando").toggle(!I).end().find(".seen_by_all").toggle(I).end();return true};E.render_status=function(M){var K=M.is_known,L,I,J;
if(K){L="ni_known_rogue_ap";J="Known AP";I="known_ap"}else{L="ni_unknown_rogue_ap";J="Unknown AP";I="unknown_ap"}return'<img src="'+Mkiconf.images+'1x1.gif" class="ni ni_rogue '+L+'" alt="'+I+'" title="'+J+'" />'};return E}();






/* l3_history.js */
history3=(function(E){var X,T,B,S=true,W,Q;function C(d,Z,e){E("#node_search_spinner").show()}function V(g,e){var f=E("table.l3search :input.smart_search").val(),b=(g.q===undefined?"":g.q),d,a,c,Z;if(!(d=H())){return false}if(b!==f){E("table.l3search :input.smart_search").val(b)}if(b!==f||b!==this.last_search||e){try{a=d()}catch(Z){}if(a){for(c in a){if(a[c].f&&(Z=Mkijson[c])){data3_load.ajax(c,{f:a[c].f,backfill:true,t0:Z.meta.t0,t1:Z.meta.t1},{success:Q.reload,error:C})}}E("#node_search_spinner").show()}else{E("#node_search_spinner").hide()}this.last_search=b;return true}else{return false}}function A(c,a,d){var b=c.n,Z,e,h,g,f;if(P(true)=="l"&&window.flex_table){Z=flex_table.items()}else{Z=flex_sort(Mkijson.n.hash,node_list3_load.table_options.columns,"name",false)}for(e=Z.length-1;e>=0;--e){if(Z[e].id==b){break}}h="";if((g=Mkijson.n.filter)&&!g.matchesall()){f="AP in search"}else{f="AP"}if(e>0){h=node3_render_name(Z[e-1],"&#8249; Previous "+f,{titlename:1})}E("#node_prev_"+b).html(h).toggle(!!h);h="";if(e<Z.length-1){h+=node3_render_name(Z[e+1],"Next "+f+" &#8250;",{titlename:1})}E("#node_next_"+b).html(h).toggle(!!h)}function G(Z){E("#detail_area, #spinner").hide();E("#table_area").show().removeClass("l3 m3").addClass("sh3");var a=E("#searchhelp_area");if(a.attr("data_loaded")=="true"){a.show()}else{a.load("search_help",{},function(){Q.reload()})}}B={c:{is_detail:true,confirm_stop:function(){return show3_client.confirm_stop()},ajax_post:function(a){var b=a.c,Z=b+"?l=1&ssid="+clients_meta.ssid;if(a.timespan&&a.timespan.match(/^\d+$/)){Z+="&timespan="+a.timespan}if(a.tend&&a.tend.match(/^\d+$/)){Z+="&tend="+a.tend}else{if(a.tend_ago&&a.tend_ago.match(/^\d+$/)){Z+="&tend_ago="+((new Date().getTime()/1000)-a.tend_ago)
}}return Mkiconf.client_show_url.replace("%23",Z)},leave:function(){show3_client.stop()}},e:{hotkeys:true,is_table:true,enter:function(a,Z){Z=V.apply(this,[a,Z]);flex_table.filter(events_hash_filter.results())}},g:{hotkeys:true,is_table:true,enter:function(a,Z){if(typeof flex_table==="undefined"){logins_list3_load()}}},h:{is_submode:true,enter:G},l:{hotkeys:true,is_table:true,enter:function(a,Z){Z=V.apply(this,[a,Z]);if(typeof flex_table==="undefined"){node_list3_load()}else{if(Z){flex_table.filter(nodes_hash_filter.results())}}E("h1").html("Access points")}},m:{enter:function(a,Z){Z=V.apply(this,[a,Z]);E("#detail_area").hide();E("#table_area").show().removeClass("l3 sh3").addClass("m3");if(typeof W==="undefined"){stretch_gmap_height();E(window).resize(stretch_gmap_height);W=make_map3({map_el:"#gmap",user_prefs:true,custom_map_editing:true},{description_container:"h1"})}else{if(Z){W.refresh(nodes_hash_filter.results(),true)}}W.enter(a.mt)},leave:function(){W.blur()}},n:{is_detail:true,confirm_stop:function(){return show3.confirm_stop()},ajax_post:function(a){var b=a.n,Z=b+"?"+a.m+"=1";if(a.q){Z+="&q="+encodeURIComponent(a.q)}if(a.timespan&&a.timespan.match(/^\d+$/)){Z+="&timespan="+a.timespan}if(a.tend&&a.tend.match(/^\d+$/)){Z+="&tend="+a.tend}else{if(a.tend_ago&&a.tend_ago.match(/^\d+$/)){Z+="&tend_ago="+((new Date().getTime()/1000)-a.tend_ago)}}return Mkiconf.node_show_url.replace("%23",Z)},check_ajax_data:function(a,Z){if(nodes_hash.hasOwnProperty(a.n)){return true}else{Q({n:undefined});return false}},enter:A,leave:function(){show3.stop()}},o:{},p:{hotkeys:true,is_table:true,enter:function(a,Z){Z=V.apply(this,[a,Z]);if(typeof flex_table==="undefined"){pcc_list3_load()}else{if(Z){flex_table.filter(pcc_hash_filter.results())}}}},pn:{is_detail:true,ajax_post:function(b){var a=b.pn,Z=a+"?"+b.m+"=1";if(b.q){Z+="&q="+encodeURIComponent(b.q)}return Mkiconf.pcc_machine_show_url.replace("%23",Z)},enter:function(c,a,d){pcc_conn_log_load();pcc_conn_log_filter=make_pcc_conn_log_filter();
var b=c.pn,Z,e,h,g,f;if(P(true)=="p"&&window.flex_table){Z=flex_table.items()}else{Z=flex_sort(Mkijson.pccm.hash,pcc_list3_load.table_options.columns,"system_name",false)}for(e=Z.length-1;e>=0;--e){if(Z[e].id==b){break}}h="";if((g=Mkijson.n.filter)&&!g.matchesall()){f="Client in search"}else{f="Client"}if(e>0){h=pcc_render_name(Z[e-1],"&#8249; Previous "+f,{titlename:1})}E("#client_prev_"+b).html(h).toggle(!!h);h="";if(e<Z.length-1){h+=pcc_render_name(Z[e+1],"Next "+f+" &#8250;",{titlename:1})}E("#client_next_"+b).html(h).toggle(!!h)}},q:{},r:{hotkeys:true,is_table:true,enter:function(a,Z){Z=V.apply(this,[a,Z]);flex_table.filter(rogue_aps_hash_filter.results())}},u:{hotkeys:true,is_table:true,enter:function(a,Z){Z=V.apply(this,[a,Z]);if(typeof flex_table==="undefined"){usage_list3_load()}else{if(Z){flex_table.filter(clients_hash_filter.results())}}}}};function N(){}function U(){}function H(){var Z=Mkiconf.h3mode;if(B[Z]&&B[Z].filter){return B[Z].filter()}else{if(Z=="u"){if(typeof clients_hash_filter==="undefined"){Mkijson.c.filter=clients_hash_filter=make_clients_hash_filter()}return clients_hash_filter}else{if(Z=="e"){if(typeof events_hash_filter==="undefined"){events_hash_filter=make_events_hash_filter()}return events_hash_filter}else{if(Z=="r"){if(typeof rogue_aps_hash_filter==="undefined"){rogue_aps_hash_filter=make_rogue_aps_hash_filter()}return rogue_aps_hash_filter}else{if(/^[lm]$/.test(Z)){if(typeof nodes_hash_filter==="undefined"){Mkijson.n.filter=nodes_hash_filter=make_nodes_hash_filter()}return nodes_hash_filter}else{if(Z=="p"){if(typeof pcc_hash_filter==="undefined"){pcc_hash_filter=make_pcc_hash_filter()}return pcc_hash_filter}else{return null}}}}}}}function P(Z){return Z?X:T}function F(a){var Z;if(!Mkiconf.h3supported.test(a)){throw new N()}if(T&&(Z=B[T])&&Z.confirm_stop&&!Z.confirm_stop.apply(Z,[])){throw new U()}}function R(Z,c,a){var d=E(Z),b=d.text();d.html(a.replace("*",b));d.closest(".tabnavh_sub").toggleClass("tabnavh_subsel",c)}function Y(){flex_table.scroll(null,-1)
}function I(){flex_table.scroll(null,1)}function D(b,e,f){var Z,c,d,a,g=M();B[T]=B[T]||{};a=B[b]=B[b]||{};if(!B[T].hotkeys&&a.hotkeys){E.hotkeys.add("left",{type:"keydown",disableInInput:true},Y);E.hotkeys.add("right",{type:"keydown",disableInInput:true},I)}else{if(B[T].hotkeys&&!a.hotkeys){E.hotkeys.remove("left");E.hotkeys.remove("right")}}if((Z=B[T])&&Z.leave){Z.leave.apply(Z,[])}for(Z in extra_nodes_hash){delete nodes_hash[Z]}extra_nodes_hash={};H();if(a.is_detail){E("#detail_area").html(f);E("#table_area, #spinner").hide();E("#detail_area").show()}else{if(a.is_table){E("#detail_area, #spinner").hide();E("#table_area").show().removeClass("m3 sh3").addClass("l3")}}if(a.enter){a.enter.apply(a,[g,e,f])}Z=Mkiconf.h3supported;d={l:"list3",m:"map3",u:"clients3"};for(c in d){if(Z.test(c)){R("#"+d[c]+"_subtab",b===c,"<a href='#m="+c+"' onclick='return $h3(this)' class='subtabnav'>*</a>")}}if(b!==T||a.is_submode||a.is_detail){window.scrollTo(0,0)}T=b;if(!a.is_submode&&!a.is_detail){X=b}}function L(Z,a){return function(c,d){var b=B[Z];if(Q.hash()===a&&(!b.check_ajax_data||b.check_ajax_data.apply(b,[M(),c]))){D(Z,false,c)}}}function O(e,d){var a,Z,c=Mkiconf.h3supported,b=e.m;for(a in B){if(e[a]&&(B[a].is_submode||B[a].is_detail)){b=a}}if(e.searchhelp&&c.test("h")){b="h"}F(b);Z=B[b];if(Z&&Z.ajax_post&&(a=Z.ajax_post.apply(Z,[e]))){E.post(a,{},L(b,Q.hash()),"text")}else{D(b,d)}}function M(e){if(e==null){e=location.href.replace(/^[^#]*#?/,"")}var d={},c=e.split("/"),b,Z;for(b=0;b<c.length;++b){if(c[b].match(/^\d+$/)){d[Mkiconf.usage?"c":"n"]=parseInt(c[b],10)}else{if((Z=c[b].match(/^(\w+)(?:=|%3[Dd])(.*)$/))){d[Z[1]]=decodeURIComponent(Z[2])}else{if(c[b]==="list"||c[b]==="map"){d.m=c[b].substr(0,1)}else{if(c[b].match(/^\w+$/)){d[c[b]]=true}}}}}if(d.m=="l"&&Mkiconf.h3mode=="u"){d.m="u"}if(!d.m){d.m=Mkiconf.h3mode}if(d.n&&d.c){delete d[Mkiconf.usage?"n":"c"]}if(d.n&&!/^[lm]$/.test(d.m)){d.m="l"}if(d.c&&d.m!=="u"){d.m="u"}if(d.m!=="m"){delete d.mt}return d}function K(c){var a,Z,b=M(c);
try{if(!Q.paused){O(b,false)}else{if(typeof Q.paused==="number"){--Q.paused}}}catch(a){if(a instanceof N){Z=Mkiconf.manage_base;if(!Z){return }else{if(b.n||b.m==="l"){Z=Z.replace(/(?=\?|$)/,"/nodes/list")}else{if(b.pn||b.m==="p"){Z=Z.replace(/(?=\?|$)/,"/pcc/index")}else{if(b.c||b.m==="u"){Z=Z.replace(/(?=\?|$)/,"/usage/list")}else{if(b.m==="m"){Z=Z.replace(/(?=\?|$)/,"/nodes/map")}else{if(b.m==="g"){Z=Z.replace(/(?=\?|$)/,"/usage/logins")}else{if(b.m!=="o"){return K("")}}}}}}}if(b.c){Z+="#c="+b.c}else{if(b.n){Z+="#n="+b.n}else{if(b.pn){Z+="#pn="+b.pn}}}window.location.replace(Z)}else{if(a instanceof U){Q.paused=1;setTimeout(function(){window.history.back()},10)}else{throw a}}}}function J(b,f,d){var e=M(),c,g=false,Z;if(b.hasOwnProperty("m")&&!b.hasOwnProperty("searchhelp")){b.searchhelp=undefined}if(b.searchhelp==="t"){b.searchhelp=E("#table_area").hasClass("sh3")?undefined:true}if(Mkiconf.h3mode==(b.hasOwnProperty("m")?b:e).m){b.m=undefined}c=Mkiconf.usage?"c":"n";if(!b.hasOwnProperty(c)){b[c]=undefined}for(c in b){if(b.hasOwnProperty(c)){if(b[c]===undefined){if(e.hasOwnProperty(c)){delete e[c];g=true}}else{if(!e.hasOwnProperty(c)||e[c]!==b[c]){e[c]=b[c];g=true}}}}if(g||f){Z=[];if(e.q==""&&(e.n||e.c||e.m)){delete e.q}for(c in e){if(e.hasOwnProperty(c)){if(e[c]===true){Z.push(c)}else{Z.push(c+"="+encodeURIComponent(e[c]))}}}Z.sort()}if(f){return"#"+Z.join("/")}if(g){E.history.load(Z.join("/"),d)}return false}Q=function(Z,b){var a;E=E||window.jQuery;if(Z===undefined||Z===E){a=Mkiconf.h3supported;if(E.isArray(a)){Mkiconf.h3supported=a=new RegExp("^("+a.join("|")+")$")}else{if(typeof a==="string"||!a){Mkiconf.h3supported=a=new RegExp("^"+(a||Mkiconf.h3mode)+"$")}}Mkiconf.h3nodes=a.test("l")||a.test("m")||a.test("o");Mkiconf.h3clients=a.test("u");if(X===undefined){X=T="";E.history.init(K,{unescape:true});if(typeof GUnload!=="undefined"){E(window).unload(GUnload)}S=false}}else{if(Z.parentNode&&Z.href&&Z.href.match(/#/)){return J(M(Z.hash.replace(/^#/,"")))}else{return J(Z,false,b)
}}};Q.reload=function(){O(M(),true)};Q.mode=P;Q.current_map=function(){return(T=="m"?W:null)};Q.initializing=function(){return S};Q.hash=function(Z){if(Z&&Z.parentNode&&Z.href&&Z.href.match(/#/)){return J(M(Z.hash.replace(/^#/,"")),true)}else{return J(Z||{},true)}};Q.add_mode=function(Z,a){B[Z]=a};return Q})(window.jQuery);window.$h3=history3;






/* live_tests.js */
var mki_live_tests=(function(W){var I=false,C=0,F={},M={tcp:{name:"tcp",render:Y,delay:2,l:"Run a throughput test",data_url:"live_tcp_test_data/%N",closeable:true},spectral:{name:"spectral",render:g,l:"Perform an intereference scan",data_url:"spectral_data/%N",closeable:true},ping:{name:"ping",render:p,delay:1.5,l:"Ping this access point",data_url:"live_ping_data/%N",closeable:true},associations:{name:"associations",render:k,delay:1.5,l:"Currently associated clients",data_url:"associations_data/%N",closeable:true},clientarping:{name:"clientarping",render:L,delay:1.5,l:"Ping client MAC",data_url:"clientarping_data/%N?client=%C",param:[{n:"C",l:"Client MAC"}],closeable:true},clientfind:{name:"clientfind",render:L,delay:1.5,l:"Find client",data_url:"clientfindarping_data?client=%C&mac=%M&ass_only=1",closeable:true},clientfindarping:{name:"clientfindarping",render:L,delay:1.5,l:"Ping client",data_url:"clientfindarping_data?client=%C&mac=%M",closeable:true},clientpctr:{name:"clientpctr",render:J,delay:1.5,l:"Packet counters",data_url:"clientpctr_data?client=%C&mac=%M",closeable:true}},l,a,e,U;function d(s){return"&nbsp;<span class='barsep'>|</span>&nbsp;<a href='javascript:mki_live_tests.close(\""+s+"\")'><img src='"+Mkiconf.images+"1x1.gif' class='ltclose' alt='Close' title='Close test' /></a>"}function Z(v,u){var AA=M[v],z,w,t,s;if(!I||!AA){return false}if((z=AA.param)&&z.length&&!u){w=AA.values;s=["<div style='padding-bottom:5px'><table class='lean'>"];for(t=0;t<z.length;++t){s.push("<tr class='base'><td>"+z[t].l+":&nbsp;</td><td><input id='testp_"+v+"_"+z[t].n+"' type='text' size='20' /></td></tr>")
}s.push("</table></div><button type='button' onclick='mki_live_tests(\""+v+"\",2)'>Run test</button>");W("#testc_"+AA.name).html(s.join(""));for(t=0;w&&t<z.length;++t){W("#testp_"+v+"_"+z[t].n).val(w[z[t].n]||"")}W("#teststat_"+v).html(d(v));f(v,"s")}else{AA.result={_starting:1,status:1};n(AA,"s");V(AA)}}function V(x){var t=x.data_url,u=(x.result&&x.result.reqid)||0,w,v,s;for(s in F){t=t.replace("%"+s,encodeURIComponent(F[s]))}if((w=x.param)){v=x.values;for(s=0;s<w.length;++s){t=t.replace("%"+w[s].n,encodeURIComponent(v[w[s].n]))}}W.getJSON(Mkiconf.test_url.replace("test/%23",t),(u>0?{reqid:u}:{}),S(x.name,C))}function S(t,s){return function(u){var w=M[t],v=(w&&w.result&&w.result.reqid)||0;if(w&&s==C&&w.result&&w.result.status>0&&(!u.id||!F.N||u.id==F.N)&&(v<=0||v==u.reqid)){if(w.timeout){clearTimeout(w.timeout)}w.timeout=null;if((u.status||0)<0&&u.retry){w.retry_timeout=Math.min((w.retry_timeout||0.5)*2,64);w.timeout=setTimeout(X(w.name,v),w.retry_timeout*1000);return }w.result=u;if(u.at){u.__at_offset=new Date().getTime()/1000-u.at}n(w,"j");if(u.status>0&&u.reqid&&w.delay){w.timeout=setTimeout(X(w.name,u.reqid),w.delay*1000)}}}}function X(t,s){return function(){var u=M[t];if(u){u.timeout=null;if(u.result&&((u.result.reqid||0)<=0||u.result.reqid==s)){V(u)}}}}function n(z,w){var AA=W("#testc_"+z.name),AC=z.result,t,AB,u=W("#teststat_"+z.name),s=u.length>0,AD="&nbsp;<span class='barsep'>|</span>&nbsp;";t=W("#testhb_"+z.name);if(t.length){if(!AC||!AC.status||AC.status<0){t.html("<img src='"+Mkiconf.images+"1x1.gif' class='ltplay' alt='Go' title='Run test' /> ")}else{t.html("<img src='"+Mkiconf.images+"1x1.gif' class='ltstop' alt='Stop' title='Stop' /> ")}}if(s){if(AC&&!AC._starting){z.render(z,AC,s)}else{AA.html("")}f(z.name,w)}else{if(!AC){AA.html("<a href='#' onclick='return mki_live_tests(\""+z.name+"\",1)'>"+z.l+"</a>")}else{if(!AC._starting){z.render(z,AC,s)}else{AA.html(AC.status>0?"Starting test...":"Stopped.")}if(!AC.status||AC.status<0){AA.append("<div><a href='#' onclick='return mki_live_tests(\""+z.name+"\",1)'>Restart</a></div>")
}else{AA.append("<div><a id='test0_"+z.name+"' href='#' onclick='return mki_live_tests(\""+z.name+"\",-1)'>Stop</a></div>")}}}if(u.length){if(!AC){AB=""}else{if(AC.status==null){AB=AD+"Stopped"}else{if(AC.status<0){AB=AD+"Failed"}else{if(AC.status==0){AB=AD+"Done"}else{if(z.quiet_status){AB=AD+"Running..."}else{AB=AD+baseline_spinner_html()+" Running..."}}}}}if(z.closeable&&AC){AB+=d(z.name)}u.html(AB)}}function T(s,u,t){if(u){return""}else{if(s.status==null){return"Stopped. "}else{if(s.status<0){return"Test failed. "}else{if(s.status==0){return"Finished. "}else{return t}}}}}var R=0;function g(u,s,t){if((s.status||0)>0&&!s.spectral_data){V(u)}if(s.spectral_data){if(!b){b=s.spectral_data;V(u);c=0}else{P=s.spectral_data}if(!D){D=setInterval(O,400)}}}var P,b;var D,c;var H,o,N=[];var q={width:224,height:100};function O(){var u=[];o=o||[];if(!M.spectral||!M.spectral.result.status||M.spectral.result.status<0){clearInterval(D);D=null;return }W.each([b[0][c],b[1][c]],function(){var AE=this.frequency==2432?96:128;var AH=this.frequency==2432?0:96;for(var AF=0;AF<AE;AF++){var x=AF+AH;var AG=this.fftSamples[AF];u.push([x,AG]);o[x]=o[x]||[];o[x][AG]=o[x][AG]||0;o[x][AG]+=1;N[x]=Math.max(N[x]||10,o[x][AG])}});W("#testc_spectral_canvas").show();W.plot("#testc_spectral_canvas",[{data:u,color:"rgba(126,161,180,1)",lines:{show:true,lineWidth:1,fill:true,fillColor:"rgba(222,231,236,1)",shadowSize:0}}],{yaxis:{min:0,max:100,ticks:mkigraph.tick_generators.rssiTickGenerator3},xaxis:{tickFormatter:function(x){return((x*0.3125+2402)/1000).toFixed(3)+" GHz"}}});if(!H){W("#testc_spectral_heatmap").show();var w=W.plot("#testc_spectral_heatmap",[[[0,0]]],{yaxis:{min:0,max:100,ticks:mkigraph.tick_generators.rssiTickGenerator3},xaxis:{min:0,max:224,tickFormatter:function(x){return((x*0.3125+2402)/1000).toFixed(3)+" GHz"}}});H=W("#testc_spectral_heatmap canvas").last();H.attr(q);H.css({top:"9px",left:"23px",width:w.width()+"px",height:w.height()+"px"})}var AD=H.get(0).getContext("2d");AD.fillStyle="white";
AD.clearRect(0,0,q.width,q.height);for(var AC=0;AC<q.width;AC++){for(var AA=0;AA<q.height;AA++){var t;if(AC>=o.length){t=0}else{if(AA>=o[AC].length){t=0}else{if(!o[AC][AA]){t=0}else{t=o[AC][AA]*100/N[AC]}}}if(t<1){continue}var s=255,v=255,z=0,AB=1;if(t<=50){s=Math.floor((t)/50*255)}else{v=Math.floor((100-t)/50*255)}if(t<=20){AB=t/30}AD.fillStyle="rgba("+s+","+v+","+z+","+AB+")";AD.fillRect(AC,q.height-AA,1,1)}}c+=1;if(c==b[0].length){if(P){b=P;P=null;c=0;V(M.spectral)}else{b=null;clearInterval(D);D=null}}}function p(z,s,w){var u=T(s,w,"Pinging in progress... "),x;if((s.sent||0)>0){u+="Sent "+s.sent+" ping packet"+(s.sent>1?"s":"")+" from meraki.com.<br />";u+="Round-trip loss rate "+((s.sent-s.rcvd)/s.sent*100).toFixed(1).replace(/\.0$/,"")+"%";if(s.rcvd){u+=", average latency "+s.rtt.toFixed(2)+"\xA0ms"}u+=".";if(s.sent>20){u+="<br />Last 20 pings: round-trip loss rate "+((20-s.rcvd_20)/20*100).toFixed(1).replace(/\.0$/,"")+"%";if(s.rcvd_20){u+=", average latency "+s.rtt_20.toFixed(2)+"\xA0ms"}u+="."}x=W("#testc_ping_canvas");W.plot(x.show(),[{data:s.data,color:"rgba(126,161,180,1)",lines:{show:true,lineWidth:1,fill:true,fillColor:"rgba(222,231,236,1)",shadowSize:0}}],{yaxis:{min:0,ticks:mkigraph.tick_generators.msTickGenerator3}})}W("#testc_ping").html(u)}function Y(AA,u,z){var w=T(u,z,"Running test... "),s;s=(w?[w]:[]);if((u.status||0)<0){s.push("No connection available or connection is too weak.")}else{if(u.gateway_id){s.push("Gateway is "+node3_render_name(nodes_hash[u.gateway_id]||{id:u.gateway_id,name:u.gateway_name})+".")}if(u["gwhops#"]&&u["gwhops#"]>1){u.my_name=nodes_hash[F.N].name||nodes_hash[F.N].mac;s.push("Using "+u["gwhops#"]+"-hop route "+node3_render_to_gw_route(u))}else{if(u["gwhops#"]){s.push("Using a one-hop (direct) route.")}}if(u["dl_speed#"]){s.push("Got "+unparse_size(u["dl_speed#"]*8*1024,true,"bps",true)+" from "+(u.gateway_id?"gateway.":"meraki.com."))}}W("#testc_tcp").html("<div style='max-width:40em'>"+s.join("<br />")+"</div>")}function Q(s){var t;
for(t in s){if(s[t].channel){return true}}return false}function k(x,s,w){var u=T(s,w,"Running... ");if(s.status==0){data3_load.canonicalize(s);make_flex_table({items:s.clients,render_context:{json:s},container:"#testc_associations_list",className:"usage_filter",columns:usage_list3_load.table_options.columns,selected_fields:["description","mac","ssid",(Q(s.clients)?"channel":"xxx"),"rssi_bar","ltx_ass_for",(Mkiconf.ltx_clientarping_template?"ltx_clientarping":"xxx")],no_items_html:"No client devices are currently associated.",row_class_template:"[% if (!item.auth) { %]ft lowlight[% } else { %]ft[%= index % 2 %][% } %]"});W("#testc_associations_list").show()}W("#testc_associations").html(u)}function L(AE,AJ,w){var AK=T(AJ,w,"Pinging in progress... "),AB,s,AI,AD,AH,AG,AA,AC,AF,z,u=new Date().getTime()/1000-(AJ.__at_offset||0);AH=null;for(AH in AJ.clients||{}){}AB=(AH?AJ.clients[AH]:null)||{};s=[];if(AB.ssid!=null){s.push("on "+mki_render_ssid(AB.ssid))}if((AB.node_id&&(AA=nodes_hash[AB.node_id]))||(AB["last_seen_by#"]&&(AA=nodes_hash[AB["last_seen_by#"]]))){s.push("at "+node3_render_name(AA))}if(AB.ass_at){s.push("for "+unparse_interval(u-AB.ass_at))}else{if(AB.ass_at_weak){s.push("for &gt;\xA0"+unparse_interval(u-AB.ass_at_weak))}else{if(AB.ass_ago){s.push("for "+unparse_interval(AB.ass_ago))}else{if(AB.ass_ago_weak){s.push("for &gt;\xA0"+unparse_interval(AB.ass_ago_weak))}}}}if(s.length){s=["Associated "+s.join(" ")+"."]}AH=[];if(AB.is_wired){AH.push("Connection:\xA0wired")}else{if(AB.channel){AH.push("Channel:\xA0"+AB.channel)}else{if(AB.inum){if(AB.node_id){AA=nodes_hash[AB.node_id]}else{if(AB["last_seen_by#"]){AA=nodes_hash[AB["last_seen_by#"]]}else{AA=window.s3node}}if(AA&&(AG=node_product_info(AA,"interface_names")[AB.inum-1])){AH.push("Via\xA0radio\xA0"+JSTemplate.escape(AG))}}}}if((AG=AB.rssi_samples)&&W.isArray(AG)){AC=10000,AF=0;for(AD=AG.length-1;AD>=0;--AD){AC=Math.min(AC,AG[AD]);AF=Math.max(AF,AG[AD])}AG=AG[AG.length-1]}else{if(AB.rssi){AC=AF=AG=AB.rssi}else{AG=0
}}if(AG&&AC==AG&&AF==AG){AH.push("Signal:\xA0"+AG+"\xA0dB")}else{if(AG){AH.push("Signal:\xA0"+AG+"\xA0dB (range "+AC+"&ndash;"+AF+"\xA0dB)")}}if(AB.ass_identity){AH.push("Identity:\xA0"+JSTemplate.escape(AB.ass_identity))}if(AH.length){s.push(AH.join(" <span class='barsep'>|</span> "))}if(AB.auth===false){s.push("<span class='redbold'>Client not authenticated.</span>")}if(s.length){AK+="<div style='padding:0 0 5px'>"+s.join("<br />")+"</div>"}if((AJ.status||0)<0&&AJ.error){AK+=AJ.error}else{if((AJ.status||0)>=0){if((AI=AB.arping)&&AI.sent>0){AK+="Sent "+AI.sent+" ping packet"+(AI.sent>1?"s":"")+" to client.<br />";AK+="Round-trip loss rate "+((AI.sent-AI.rcvd)/AI.sent*100).toFixed(1).replace(/\.0$/,"")+"%";if(AI.rcvd){AK+=", average latency "+AI.rtt.toFixed(2)+"\xA0ms"}AK+=".";if(AI.sent>20){AK+="<br />Last 20 pings: round-trip loss rate "+((20-AI.rcvd_20)/20*100).toFixed(1).replace(/\.0$/,"")+"%";if(AI.rcvd_20){AK+=", average latency "+AI.rtt_20.toFixed(2)+"\xA0ms"}AK+="."}z=W("#testc_"+AE.name+"_canvas");W.plot(z.show(),[{data:AI.data,color:"rgba(126,161,180,1)",lines:{show:true,lineWidth:1,fill:true,fillColor:"rgba(222,231,236,1)",shadowSize:0}}],{yaxis:{min:0,ticks:mkigraph.tick_generators.msTickGenerator3}})}}}W("#testc_"+AE.name).html(AK)}function h(AA,w){var u,v=G(),t,s,z="ltx_clientarping"+AA.replace(/[^0-9a-f]/ig,"");if(!W("#testc_"+z).length){for(u=1;u<v.length-1;++u){if(E(v[u])=="associations"){break}}s=new JSTemplate("<td>"+Mkiconf.ltx_clientarping_template+"</td>");W(v[u]).after(s.render({id:z,mac:AA,description:w||AA}));t=W(v[u].childNodes[0]);M[z]={name:z,render:L,delay:1.5,l:"Ping "+(w||AA),data_url:"clientarping_data/%N?client="+encodeURIComponent(AA),closeable:true,delete_on_close:true}}s=M[z];if(!s.result||(s.result.status||0)<=0){Z(s.name,true)}}function J(AD,z,AC){var AA=T(z,AC,"In progress... "),AB=(AD.param=AD.param||{id:1}),w,u,s;s=null;for(s in z.clients||{}){}w=(s?z.clients[s]:null)||{};u=w.ass_pctr||w.usage_pctr;if(u&&(u[0]!==AB.recv||u[1]!==AB.sent)){if(AB.recv==null){mki_odometer("#testc_"+AD.name+"_recv, #testc_"+AD.name+"_sent",null)
}AD.quiet_status=true;W("#testc_"+AD.name+"_ctrs").show();mki_odometer("#testc_"+AD.name+"_recv",u[0]);mki_odometer("#testc_"+AD.name+"_sent",u[1]);AB.recv=u[0],AB.sent=u[1]}if(z.status<0&&z.error){AA+=z.error}else{if(w.auth===false){AA+="<span class='redbold'>Client not authenticated.</span>"}}W("#testc_"+AD.name).html(AA)}function G(s){s=s||W("#s3nlt_tools");return s.find(">tbody>tr").children()}function E(s){return s.childNodes[0].id.substr(6)}function B(v,u){var z=M[v],w,t,s;if(!I||!z){return false}if(u==null){u=(z.result&&(z.result.status||0)>0?-1:1)}if(u>1){s={},w=z.param;for(t=0;t<w.length;++t){s[w[t].n]=W("#testp_"+v+"_"+w[t].n).val()}z.values=s;Z(v,true)}else{if(u>0){Z(v)}else{if(u<0&&z.result){z.result.status=null;z.result.reqid=0;n(z)}}}return false}function K(s){n(M[s]);dashhelp("test_"+s,"#testh_"+s,{above:true})}function r(s){return function(){a=s}}function A(u){var z=W("#s3nlt_tools"),w=z.width(),t=z.height(),v=G(z),x=W("#s3nlt_container").width(),s;u=(typeof u==="number"?u:0);l=Math.max(0,Math.min(v.length-2,l+(u||0)));s=l?W(v[l+1]).position().left-20:0;if(u||a<0){W("#s3nlt_shifter").stop().animate({left:-s},{complete:r(s)});a=-1}else{if(a!=s){W("#s3nlt_shifter").stop().css({left:-s});a=s}}if(l!=0){W("#s3nlt_left").show().height(t)}else{W("#s3nlt_left").hide()}if(w>s+x&&l+2<v.length){W("#s3nlt_right").show().height(t)}else{W("#s3nlt_right").hide()}}function f(z,v){var w,s,u,AB,x,t,AA=l;if(v==="s"||z==e){e=z;w=G();for(s=1;s<w.length;++s){if(E(w[s])==z){break}}if(s<w.length&&AA!=s-1){u=W(w[s]).position().left;x=AA?W(w[AA+1]).position().left:0;if(u<x){AA=s-1}else{AB=u+W(w[s]).width();t=W("#s3nlt_container").width();while(AB>x+t&&u>x+40&&AA<w.length-2){++AA;x=W(w[AA+1]).position().left}}}}A(AA-l)}function m(u){var s=M[u];if(s&&s.closeable){if(s.delete_on_close){delete M[u];W("#s3nlt_"+u).parent().remove();A(0)}else{delete s.values;delete s.result;delete s.retry_timeout;delete s.quiet_status;W("#testc_"+u).html("");W("#s3nlt_"+u).find(".ltsupplement").hide();
n(s)}}}U=B;U.initialize=function(t){var s;I=true;F=W.extend({},t);++C;l=a=0;e=null;for(s in M){if(W("#testc_"+s).length){K(s)}}W("#s3nlt_left").click(function(){A(-1);e=false});W("#s3nlt_right").click(function(){A(1);e=false});A(0);jQuery(window).bind("resize.show3",A)};U.cleanup=function(){var s,t={};I=false;F={};++C;jQuery(window).unbind("resize.show3");for(s in M){delete M[s].result;if(M[s].closeable){t[s]=true}}for(s in t){m(s)}};U.close=m;U.ltx_clientarping=h;return U})(window.jQuery);






/* show3.js */
var show3=(function(L){var H=[["12\xA0hours",43200],["1\xA0day",86400],["2\xA0days",172800],["1\xA0week",604800]],V,g=0,U=new Date(),P=U,W,h,M,d,R=[["&#171;\xA01\xA0week",-604800],["&#8249;\xA01\xA0day",-86400],["&#8249;\xA012\xA0hours",-43200,0],["12\xA0hours\xA0&#8250;",43200,0],["1\xA0day\xA0&#8250;",86400],["1\xA0week\xA0&#187;",604800]],b=0,c=1,J=2,S=3;function B(){var o=new Date(P-1000*H[g][1]),m="Performance data from "+unparse_date(o,"%a %b %-d %Y %H:%M% Z",1)+" to "+unparse_date(P,"%a %b %-d %Y %H:%M% Z",1),n,l;L("#timespan_title").text(m);n="Zoom:";for(l=0;l<H.length;l++){if(l==g){n+="&nbsp;&nbsp;<strong>"+H[l][0]+"</strong>"}else{n+='&nbsp;&nbsp;<a href="javascript:void(null)" onclick="return show3.zoom('+l+')">'+H[l][0]+"</a>"}}L("#timespan_len").html(n)}function e(){var m="Pan:",l;for(l=0;l<R.length;l++){if(U-P>=1000*R[l][1]&&(R[l].length==2||g<=R[l][2])){m+='&nbsp;&nbsp;<a href="javascript:void(null)" onclick="return show3.pan('+R[l][1]+')">'+R[l][0]+"</a>"}}if(U-P>0){m+='&nbsp;&nbsp;<a href="javascript:void(null)" onclick="return show3.pan(\'now\')">back to present</a>'}L("#timespan_pan").html(m)}function Q(){var l=nodes_hash[V];h=make_map3({map_el:"#small_map",save_maptype_changes:false,check_type_display:true,minimal_controls:true},{displayed:[l],noInfoWindow:true,show3:true,hoverAny:true,pinned:l})}function k(q){var n=[],s=[],p,l,o,m,r=nodes_hash;for(p in q){l=q[p];if((((o=l["fwd_rates#"])&&(m=l["rev_rates#"])&&o*m>=6950)||(l.stats&&l.stats[0]&&l.stats[0].is_wired))&&r[l.id]){n.push(l)
}else{s.push(l)}}return[n,s]}function D(n){var p={},m,l,s,q,o=nodes_hash;l=n.routes||[];for(m in l){s=l[m];q=s.gateway_node_id;if(q&&o[q]){p[q]=(p[q]||0)+s["usage#"]/100}}return p}function Z(s){var n=0,o=0,u=0,m=D(s),p,l,q,t;q=s.ping_tests||[];for(p in q){l=q[p];if(l.gateway_node_id==0){t=1}else{if(!(t=m[l.gateway_node_id])){continue}}n+=l.send_count*t;o+=l.recv_count*t;u+=Math.max(l.avg_latency*l.recv_count*t,0)}return n?[o/n,u/o]:null}function O(m){var q=[],l,n=D(m),s=m.ping_tests,p=mkigraph,o;for(l=0;l<s.length;++l){o=s[l];if(o.gateway_node_id==0||n[o.gateway_node_id]){q.push([o.ts*1000,o.avg_latency])}}return{data:{data:q,color:p.line_color},options:{xaxis:{mode:"time",min:m.t0*1000,max:m.t1*1000},yaxis:{min:0,ticks:"msTickGenerator",autoscaleMargin:0.3},points:{show:false,radius:1},lines:{show:false},bars:{show:true,fill:true,fillColor:p.fill_color,barWidth:3600000},shadowSize:0}}}function f(m){var l;if(!(l=Z(m||window.s3nodestats||{}))){return"N/A"}else{if(l[0]<=0){return"100% loss"}else{return unparse_fraction_as_percent(1-l[0],1)+" loss, "+l[1].toFixed(1)+"\xA0ms average latency"}}}function F(n){var q=V,o=nodes_hash[q],m,l,p=(o.is_gateway?"meraki.com:":"gateway:");if(n.id!=q||n.t1!=P.getTime()/1000||n.t1-n.t0!=H[g][1]){return }window.s3nodestats=n;if(n.tz){add_time_zone_info(n.tz)}if(n.extra_nodes){L.extend(extra_nodes_hash,n.extra_nodes)}L("#s3ping_label_"+q).html("Ping to "+p);L("#s3ping_"+q).html(f(n));L("#s3tput_label_"+q).html("Throughput to "+p);if(!n["dl_speed#"]){L("#s3tput_"+q).html("N/A")}else{L("#s3tput_"+q).html(unparse_size(n["dl_speed#"]*8*1024,true,"bps",true))}l=(n.routes&&n.routes.length)||!s3node.is_gateway;L("#show3_routes, #s3routes_hdr_"+q).toggle(!!l);if(l){make_flex_table({items:n.routes,container:"#show3_routes",className:"routes_filter",columns:show3_route_columns,selected_fields:["to_gw_route","avg_mbps","avg_to_gwm","usage"],default_sort:"usage",row_class_template:"ft[%= index % 2 %][%= item.out_of_network ? ' errorhighlight' : '' %]",no_items_html:"No route data available."})
}if(!s3node.iswd){s3node.neighbors=n.neighbors;m={className:"neighbors_filter",row_id_prefix:"neighbor_",columns:show3_neighbor_columns,selected_fields:["icon","name","distance","interfaces","linkqual","recvqual","sendqual","recv_signal"],default_sort:"linkqual",row_class_template:"ftp[%= index % 2 %][%= nodes_hash[item.id] ? '' : ' errorhighlight' %]",content_body_click:make_list3_content_body_click(function(r){return history3({n:r})}),no_items_html:"No known neighbors."};l=k(n.neighbors);if(l[0].length){make_flex_table(L.extend({items:l[0],container:"#show3_strong_neighbors"},m))}if(l[1].length||!l[0].length){make_flex_table(L.extend({items:l[1],container:"#show3_neighbors"},m))}L("#show3_strong_neighbors, #s3strong_neighbors_hdr_"+q).toggle(!!l[0].length);L("#s3neighbors_hdrtxt_"+q).html((l[0].length?"Other n":"N")+"eighbors");L("#show3_neighbors, #s3neighbors_hdr_"+q).toggle(!!l[1].length||!l[0].length)}L("#stats_loading").hide();L("#stats_contents").show();if(d&&d.t0==n.t0&&d.t1==n.t1&&d.id==V&&n.ping_tests){I({})}}function I(u){var m,o,l=show3_graph_list,r,s,t,p,q,n;if(u.id&&u.id!==V){return }delete u.id;if(u.upseries){upseries_obscure(u.upseries);d={id:V,t0:u.t0,t1:u.t1,upseries:u.upseries}}n=window.s3nodestats||{};if(n.t0!=u.t0||n.t1!=u.t1||n.id!=V){n={}}t={item:nodes_hash[V],stats:n};for(m=0;m<l.length;++m){o=l[m];p=o.id.slice(0,-6);if(p=="outage"){r=!!u.upseries}else{if(p=="latency"){r=!!n.id}else{r=!!u[p]}}if(r&&o.condition){s=new JSTemplate("[%=("+o.condition+")?1:''%]");r=s.render(t)}if(!r){continue}q=o.id+"_hdr_"+V;s="<h3 class='s3graph' id='"+q+"'>"+o.name+"</h3>";if(o.subhead){s+=o.subhead}s+="<div class='gholder' id='"+o.id+"_canvas'></div>";if(o.className){s='<div class="'+o.className+'">'+s+"</div>"}s=new JSTemplate(s);r=s.render(t);L("#"+o.id+"_body_"+V).html(r);if(p=="outage"){outage_grapher.graph("#outage_graph_canvas",u.t0,u.t1,u.upseries,"s")}else{if(p=="latency"){mkigraph.stats_graph("#latency_graph_canvas",O(n),d)}else{mkigraph.stats_graph("#"+o.id+"_canvas",u[p],d)
}}if(o.help_name){dashhelp(o.help_name,"#"+q,{above:true})}}}function T(){var m,l=W.get_time_query(true);B();e();Q();if((m=window.s3nodestats)&&m.t1==P.getTime()/1000&&m.t1-m.t0==H[g][1]){F(m)}else{L("#stats_contents").hide();L("#stats_loading").show();L.getJSON(make_query_url(Mkiconf.node_show_stats_json_url.replace("%23",V),l),F)}L.getJSON(make_query_url(SHOW3_GRAPH_DATA_URL,l),I)}function E(){return L("#nodeedit"+V)}function N(o,m,l,n){if(!m){o.html('<span class="deftext">'+(l||"None")+"</span>")}else{if(n){o.html(m)}else{o.html(html_entity_encode(m,true))}}}function K(l){var o=E(),q=nodes_hash[V],p,m=(l==J||l==S);o.stop().css("opacity",1).find(":submit, :reset, button").attr("disabled","");if(!M){M=make_change_tracker({selector:o,nobox:1,highlight:o.find(".s3actions > div")})}if(l==J){o.find("input[name=name]").val(q.name||"");p=o.find("select[name=network]");if(p.children().length==0){p.html(W.network_selector_options())}p.toggle(p.children().length>1);o.find("#nodeedit"+V+"_networksep").toggle(p.children().length>1);o.find("select[name=network]").val(Mkiconf.network_eid);o.find("input[name=abandon]").val("");o.find(".s3abandon").hide();o.find("textarea[name=notes]").val(q.notes||"");o.find("textarea[name=tags]").val(L.trim(q.tags||""));o.find("textarea[name=address]").val(q.address||"");o.find("input[name=geocode_address]").attr("checked",q.address&&!q.address_latlng?"":"checked");o.find("input[name=lat]").val(q.lat||"");o.find("input[name=lng]").val(q.lng||"");o.find(".errf").removeClass("errf");o.find(".bad").hide()}if(l!=S){M.reset()}L("#nodeedit"+V+"_editb").attr("disabled",m?"disabled":"");L(".s3macserial").toggle(m);if(l==c){N(L(".s3name"),q.name,q.mac)}p=L("#nodeinfo"+V);if(l==c){p.find(".s3notes").parent().toggle(!!q.notes);N(p.find(".s3notes"),q.notes);p.find(".s3tags").parent().toggle(!!q.tags);p.find(".s3tags").html(node3_render_tags(q));p.find(".s3address").parent().toggle(!!q.address);N(p.find(".s3address"),q.address)}p.toggle(!m);o.toggle(m)}function a(p,o){var m=E(),l,q=nodes_hash[V];
m.find(".errf").removeClass("errf");if(p.errf){for(l=0;l<p.errf.length;++l){m.find(":input[name="+p.errf[l]+"]").addClass("errf")}m.find(".bad").html(p.error||"").show();K(S)}else{if(p.nodes){data3_load(p);K(c);h.reposition(q);h.refresh([q],true)}else{if(p.network){history3.paused=true;history3({n:undefined});window.location.reload(true)}}}}function C(m,n,l){a(xhr_extract_error_json(m))}function Y(){var l=E();l.fadeTo("slow",0.6);L.ajax({url:l.attr("action"),type:"POST",dataType:"json",data:l.serialize(),error:C,success:a})}function G(n,l){var m=E();if(l==null){alert('Couldn\'t geocode address; access point position is unchanged on the map.\nBe sure to include the city, state/province, and country.\nYou may also enter raw latitude and longitude, such as "37.76N 122.4W" or "37d46m7.34s N 122d24m10s W".')}else{m.find("input[name=lat]").val(n);m.find("input[name=lng]").val(l)}Y()}function X(){var m=E(),l;m.submit(function(){if(m.find("select[name=network]").val()!=Mkiconf.network_eid&&!W.confirm_change_network(1)){return false}var p,o,q=nodes_hash[V];m.find(":submit, :reset, button").attr("disabled","disabled");p=m.find("input[name=geocode_address]:checked").length>0;if(p&&(o=m.find("textarea[name=address]").val())&&(!M||!M.changed||M.changed("address")||!q.address_latlng)){m.fadeTo("slow",0.6);verifyAddress(o,G,G)}else{Y()}return false});m.find(":reset").click(function(){K(b)});m.find("select[name=network]").change(function(){var n=m.find("select[name=network]").val();m.find(".s3abandon").toggle(n=="0")});L("#nodeedit"+V+"_editb").click(function(){K(J);E().find("input[name=name]").focus();return false});L("#nodeedit"+V+"_abandonb").click(function(){if(W.confirm_remove_network(1)){E().find("input[name=abandon]").val("1").end().submit()}});L("#detail_area .editable").mouseover(function(){L(this).addClass("editable_highlight")}).mouseout(function(){L(this).removeClass("editable_highlight")});if((l=window.UPDATE_EXTRA_CONFIG_OPTIONS_URL)){L("#node_extra_config_options").editable(l,{type:"textarea",rows:8,cols:60,cancel:"Cancel",submit:"OK",tooltip:"Click to edit",error:function(o,n){alert("Failed to save: "+n)
}})}if((l=window.UPDATE_UPLINK_PROVIDER_URL)){L("#node_uplink_provider").editable(l,{data:"{ '':'N/A', 'Speakeasy':'Speakeasy', 'Stephouse':'Stephouse' }",type:"select",submit:"OK",tooltip:"Click to change",error:function(o,n){alert("Failed to save: "+n)}})}if((l=window.UPDATE_INSTALLER_NAME_URL)){L("#node_installer_name").editable(l,{data:"{ '':'N/A', 'Meraki':'Meraki', 'CSI':'CSI', 'Meraki + CSI':'Meraki + CSI', 'User':'User' }",type:"select",submit:"OK",tooltip:"Click to change",error:function(o,n){alert("Failed to save: "+n)}})}}function A(){var n,l=[],m=show3_graph_list;for(n=0;n<m.length;++n){l.push("<div id='"+m[n].id+"_body_"+V+"' class='show3_graph "+m[n].id+"'></div>")}L("#graphs").html(l.join(""))}W=function(l){var m;L=L||window.jQuery;if(l&&l.timespan){for(m=0;m<H.length;++m){if(H[m][1]==l.timespan){g=m}}}if(l&&l.tend){P=new Date(l.tend*1000)}V=l.id;X();A();mki_live_tests.initialize({N:V});T()};W.confirm_stop=function(){return !M||M.confirm()};W.stop=function(){if(h){h.destroy()}if(M){M.kill()}V=h=M=null;mki_live_tests.cleanup()};W.get_time_query=function(m){var l=[];if(H[g][1]!=86400){l.push("timespan="+H[g][1])}if(U!=P){l.push("tend="+Math.round(P.getTime()/1000))}if(l.length){return l.join(m?"&":"&amp;")}else{return""}};W.pan=function(l){if(l==="now"){P=U}else{P=new Date(P.getTime()+1000*l)}T();return false};W.zoom=function(l){g=l;T();return false};W.confirm_remove_network=function(l){var n=pluralize(l||1,"access point",{these:1,nc:1}),m=pluralize(l||1,"serial number",{their:1,nc:1}),o=((l||1)>1?"them":"it");return window.confirm("Are you sure you want to remove "+n+" from all your networks?\nYou will need "+m+" to add "+o+" again.\n\nPress OK to remove, or Cancel to cancel.")};W.confirm_change_network=function(l){var m=pluralize(l||1,"access point",{these:1,nc:1});return window.confirm("Are you sure you want to remove "+m+" from this network?")};W.network_selector_options=function(){var m=[],n,l;for(n in Mkiconf.administered_networks){if((l=Mkiconf.administered_networks[n]).movable){m.push([n,l.n])
}}m.sort(function(p,o){return strcasecmp(p[1],o[1])});for(n=m.length-1;n>=0;--n){l=m[n];m[n]='<option value="'+l[0]+(l[0]==Mkiconf.network_eid?'" selected="selected':"")+'">'+l[1]+"</option>"}return m.join("")};W.tester=mki_live_tests;W.test_close=mki_live_tests.close;W.ltx_clientarping=mki_live_tests.ltx_clientarping;W.ping_summary_html=function(m){var l=f();return m&&l==="N/A"?"":l};return W})(window.jQuery);






/* show3d.js */
var show3_client=(function(D){var L,P,K,G=0,O=1,E=2,I=3;function B(){return D("#clientedit"+L)}function N(T,R,Q,S){if(!R){T.html('<span class="deftext">'+(Q||"None")+"</span>")}else{if(S){T.html(R)}else{T.html(html_entity_encode(R,true))}}}function H(S){var U=B(),W=clients_hash[L],V,T=(S==E||S==I),Q,R;U.stop().css("opacity",1).find(":submit, :reset").attr("disabled","");if(!K){K=make_change_tracker({selector:U,nobox:1,highlight:U.find(".s3actions > div")})}Q=client3_access_status(W);if(S==E){U.find("input[name=description]").val(W.description||W.netbios||"").parent();U.find("textarea[name=notes]").val(W.notes||"");V=U.find(".s3blocked");V.toggle(Q<0);V.find(".s3blocked_nodevmsg").toggle(!W.blockmsg);V.find(".s3blocked_hasdevmsg").toggle(!!W.blockmsg);R=U.find("input[name=access]");R.filter("*[value=normal]").attr("checked",Q==0?"checked":"");R.filter("*[value=whitelisted]").attr("checked",Q>0?"checked":"");R.filter("*[value=blocked]").attr("checked",Q<0?"checked":"");U.find("textarea[name=blockmsg]").val(W.blockmsg||"");U.find(".errf").removeClass("errf");U.find(".bad").hide()}if(S!=I){K.reset()}D("#clientedit"+L+"_editb").attr("disabled",T?"disabled":"");if(S==O){N(D(".s3name"),W.description||W.netbios,W.mac||"(unknown)")}V=D("#clientinfo"+L);if(S==O){V.find(".s3notes").parent().toggle(!!W.notes);N(V.find(".s3notes"),W.notes);N(V.find(".s3access"),client3_render_access_status(W),null,true);V.find(".s3blockmsg").parent().toggle(!!(Q<0&&W.blockmsg));N(V.find(".s3blockmsg"),W.blockmsg)}V.toggle(!T);U.toggle(T)}function C(T,S){var R=B(),Q;
R.find(".errf").removeClass("errf");if(T.errf){for(Q=0;Q<T.errf.length;++Q){if(T.errf[Q]=="access"){R.find(".s3access").addClass("errf")}else{R.find(":input[name="+T.errf[Q]+"]").addClass("errf")}}R.find(".bad").html(T.error||"").show();H(I)}else{if(T.clients){data3_load(T);H(O)}}}function J(R,S,Q){C(xhr_extract_error_json(R))}function F(){var Q=B(),R=Q.serialize(),S=clients_hash[L];Q.fadeTo("slow",0.6);if(S.netbios&&R.description==S.netbios){R.description=""}D.ajax({url:Q.attr("action"),type:"POST",dataType:"json",data:Q.serialize(),error:J,success:C})}function A(){var Q=B();Q.submit(function(){Q.find(":submit, :reset").attr("disabled","disabled");F();return false});Q.find(":reset").click(function(){H(G)});Q.find("input[name=access]").click(function(){var R=Q.find("input[name=access]:checked").val();Q.find(".s3blocked")[R=="blocked"?"slideDown":"slideUp"]("fast")});D("#clientedit"+L+"_editb").click(function(){H(E);B().find("input[name=description]").focus();return false})}function M(){graph_client_use("#transferreds_graph_canvas_"+L,L)}P=function(Q){var R=clients_hash[Q.id]||{};D=D||window.jQuery;L=Q.id;A();M();mki_live_tests.initialize({C:L,M:R.mac});D(window).bind("resize."+L,function(){var T=D("#transferreds_graph_canvas_"+L),S=T.parent().width();if(S!=T.width()){T.empty().width(S);M()}})};P.current_client_id=function(){return L};P.confirm_stop=function(){return !K||K.confirm()};P.stop=function(){if(K){K.kill()}mki_live_tests.cleanup();D(window).unbind("."+L);L=K=null};return P})(window.jQuery);






/* change_tracker2.js */
var make_change_tracker=(function(){var A=[],B=window.onbeforeunload;window.onbeforeunload=function(E){var D,C;if(typeof B==="function"){D=B(E);if(typeof D==="string"){return D}}E=E||window.event;for(C=0;C<A.length;++C){if(A[C].count(null,true)){D="Your changes have not been saved.";if(E){E.returnValue=D}return D}}};return function(N){var O=0,C,J={},M=[],H,D,P;function K(){var Q=jQuery(this).mval();if(Q!==undefined){P.change(this.name,Q,this)
}}function E(){D.suppress_alert=true}function I(){var R,Q;if(D&&D.highlight){jQuery(D.highlight).toggleClass("unsaved",O>0)}if(!H&&!O){return }else{if(!H){H=jQuery("<div class='change_tracker hidden' title=\"Don't forget to save your changes before leaving this page!\"></div>").appendTo("body");if(D.opacity!==1){H.bind("mouseenter",function(){H.animate({opacity:1},D.fadeInTime)}).bind("mouseleave",function(){H.animate({opacity:D.opacity},D.fadeOutTime)})}}}R="You have ";if(!D.toggle){R+=O}R+=" unsaved change"+(!D.toggle&&O===1?".":"s.");Q=(O==0||D.nobox?null:R);if(C===Q){return }C=Q;H.html(R);if(Q){H.removeClass("hidden").stop().css("opacity",1).animate({},500).animate({opacity:D.opacity},1000)}else{H.stop().addClass("hidden")}}function G(){var Q,R;if(D&&!D.nodom){R=jQuery(D.selector||"form.monitor_unsaved_changes");R.unbind("submit",E);R.find(".suppress_unsaved_changes_alert").unbind("click",E)}for(Q=0;Q<J.length;++Q){jQuery(J[Q]).unbind("change",K).filter(":checkbox, :radio").unbind("click",K).end().filter("textarea").unbind("keyup",K)}O=0;M={};J=[];I()}function L(Q){Q=jQuery(Q);if(Q.is("select")){return Q.find("option[value='"+Q.val()+"']").text()}if(Q.is(":radio")){return Q.siblings("label").text()}if(Q.is(":checkbox")){return Q.is(":checked")?"yes":"no"}return Q.val()}function F(Q){var R=jQuery(Q).parents(".cfgo").siblings(".cfgq").text();if(!R){return""}return jQuery.trim(R).split(/\s\s+/)[0]}P=function(Q){var R;G();D=jQuery.extend({opacity:0.95,fadeInTime:100,fadeOutTime:500,send_with_form:false},Q||{});if(!D.nodom){R=jQuery(D.selector||"form.monitor_unsaved_changes");R.find("input, select, textarea").not(".notrack, [name='']").each(function(){P.track(this)});if(D.send_with_form&&R.find("#settings_change_hash").length==0){R.append("<input type='hidden' id='settings_change_hash' name='settings_change_hash' />")}R.bind("submit",E);R.find(".suppress_unsaved_changes_alert").bind("click",E)}if(jQuery.inArray(P,A)<0){A.push(P)}};P.pack_changes=function(){changes={};
if(D.send_with_form){jQuery.each(M,function(R,Q){if(Q[0]!==Q[1]){changes[R]=Q[2]}});jQuery("#settings_change_hash").val(JSON.stringify(changes))}};P.track=function(Q,V){var S,R,U;if(!Q){return }var T={label:"",new_text:"",old_text:""};if(typeof Q==="object"&&"nodeType" in Q&&Q.name){for(S=0;S<J.length;++S){if(J[S]==Q){break}}if(S==J.length){J.push(Q);jQuery(Q).bind("change",K).filter(":checkbox, :radio").bind("click",K).end().filter("textarea").bind("keyup",K)}T.label=F(Q);T.old_text=T.new_text=L(Q);if((R=jQuery(Q).mval())===undefined){return }if(V===undefined){V=R}U=Q.name}else{if(typeof Q==="string"){R=V;T.label=Q;T.old_text=T.new_text=V;U=Q}else{throw new Error("bad change_tracker.track")}}if(M.hasOwnProperty(U)&&M[U][0]!==M[U][1]){--O}M[U]=[V,R,T];if(V!==R){++O}I()};P.untrack=function(Q){var R;if(!Q){return }else{if(typeof Q==="object"&&"nodeType" in Q&&Q.name){for(R=0;R<J.length;++R){if(J[R]==Q){J.splice(R,1);break}}jQuery(Q).unbind("change",K).filter(":checkbox, :radio").unbind("click",K).end().filter("textarea").unbind("keyup",K);Q=Q.name}else{if(typeof Q!=="string"){throw new Error("bad change_tracker.untrack")}}}if(M.hasOwnProperty(Q)){P.change(Q,M[Q][0])}delete M[Q]};P.change=function(S,T,R){var U,Q;if(M[S]===undefined){return }if(T!==M[S][1]){U=(M[S][0]!==M[S][1]);Q=(M[S][0]!==T);if(U&&!Q){--O}else{if(!U&&Q){++O}}I()}M[S][1]=T;M[S][2].new_text=R?L(R):T};P.changed=function(Q){return M[Q]!==undefined&&M[Q][0]!==M[Q][1]};P.count=function(Q,T){var R,S=0;if(T&&D.suppress_alert){return false}if(!Q){return O}for(R=0;R<Q.length;++R){if(M.hasOwnProperty(Q[R])&&M[Q[R]][0]!==M[Q[R]][1]){++S}}return S};P.reset=function(){P(D);jQuery(document).trigger("change_tracker_reset")};P.confirm=function(){if(!O||D.suppress_alert){return true}return confirm("Are you sure you want to navigate away from this page?\n\nYour changes have not been saved.\n\nPress OK to continue, or Cancel to stay on the current page.")};P.kill=function(){var Q;G();if((Q=jQuery.inArray(P,A))>=0){A.splice(Q,1)
}};P(N);return P}})();var change_tracker=make_change_tracker({nodom:1,nobox:1});






/* dragzoom.js */
var make_DragZoomControl=(function(){var A;function B(){function C(E,F,I){this.globals={draggingOn:false,cornerTopDiv:null,cornerRightDiv:null,cornerBottomDiv:null,cornerLeftDiv:null,mapPosition:null,outlineDiv:null,mapWidth:0,mapHeight:0,mapRatio:0,startX:0,startY:0,borderCorrection:0};this.globals.style={opacity:0.2,fillColor:"#000",border:"2px solid blue"};var H=this.globals.style;for(var G in E){H[G]=E[G]}var D=H.border.split(" ");H.outlineWidth=parseInt(D[0].replace(/\D/g,""));H.outlineColor=D[2];H.alphaIE="alpha(opacity="+(H.opacity*100)+")";this.globals.backStack=[];this.globals.options={buttonHTML:"zoom ...",buttonStartingStyle:{width:"52px",border:"1px solid black",padding:"2px",display:"block"},buttonStyle:{background:"#FFF"},backButtonHTML:"zoom back",backButtonStyle:{background:"#FFF",display:"none"},buttonZoomingHTML:"Drag a region on the map",buttonZoomingStyle:{background:"#FF0"},overlayRemoveTime:6000,backButtonEnabled:false,stickyZoomEnabled:false,disabledButtonOpacity:0.5};for(var G in F){this.globals.options[G]=F[G]}if(I==null){I={}}this.globals.callbacks=I}C.prototype=new GControl();C.prototype.initButton_=function(D){var E=this.globals;var F=document.createElement("div");F.innerHTML=E.options.buttonHTML;F.id="gzoom-control";DragZoomUtil.style([F],{cursor:"pointer"});DragZoomUtil.style([F],E.options.buttonStartingStyle);DragZoomUtil.style([F],E.options.buttonStyle);D.appendChild(F);E.buttonOpacity=F.style.opacity;E.buttonFilterIE="alpha(opacity="+(F.style.opacity*100)+")";E.disabledButtonFilterIE="alpha(opacity="+(E.options.disabledButtonOpacity*100)+")";return F};C.prototype.initBackButton_=function(D){var E=this.globals;var F=document.createElement("div");F.innerHTML=E.options.backButtonHTML;F.id="gzoom-back";DragZoomUtil.style([F],{cursor:"pointer"});DragZoomUtil.style([F],E.options.buttonStartingStyle);DragZoomUtil.style([F],E.options.backButtonStyle);
D.appendChild(F);return F};C.prototype.setButtonMode_=function(E){var D=this.globals;if(E=="zooming"){D.buttonDiv.innerHTML=D.options.buttonZoomingHTML;DragZoomUtil.style([D.buttonDiv],D.options.buttonStartingStyle);DragZoomUtil.style([D.buttonDiv],D.options.buttonZoomingStyle)}else{D.buttonDiv.innerHTML=D.options.buttonHTML;DragZoomUtil.style([D.buttonDiv],D.options.buttonStartingStyle);DragZoomUtil.style([D.buttonDiv],D.options.buttonStyle)}};C.prototype.initialize=function(D){var K=this.globals;var I=this;var L=D.getContainer();var N=document.createElement("div");DragZoomUtil.style([N],{cursor:"pointer"});var J=this.initButton_(N);var E=this.initBackButton_(N);L.appendChild(N);var F=document.createElement("div");F.id="gzoom-map-cover";F.innerHTML='<div id="gzoom-outline" style="position:absolute;display:none;"></div><div id="gzoom-cornerTopDiv" style="position:absolute;display:none;"></div><div id="gzoom-cornerLeftDiv" style="position:absolute;display:none;"></div><div id="gzoom-cornerRightDiv" style="position:absolute;display:none;"></div><div id="gzoom-cornerBottomDiv" style="position:absolute;display:none;"></div>';DragZoomUtil.style([F],{position:"absolute",display:"none",overflow:"hidden",cursor:"crosshair",zIndex:101});L.appendChild(F);K.listeners={button:GEvent.addDomListener(J,"click",function(G){I.buttonclick_(G)}),backButton:GEvent.addDomListener(E,"click",function(G){I.backbuttonclick_(G)}),mouseDown:GEvent.addDomListener(F,"mousedown",function(G){I.coverMousedown_(G)}),mouseMove:GEvent.addDomListener(L,"mousemove",function(G){I.drag_(G)}),mouseUp:GEvent.addDomListener(L,"mouseup",function(G){I.mouseup_(G)})};var M=["maptypechanged","zoomend","moveend"];for(var H=0;H<M.length;++H){K.listeners[M[H]]=GEvent.addListener(D,M[H],function(G){I.updateZoomInButton_();return false})}K.mapPosition=DragZoomUtil.getElementPosition(L);K.outlineDiv=DragZoomUtil.gE("gzoom-outline");K.buttonDiv=DragZoomUtil.gE("gzoom-control");K.backButtonDiv=DragZoomUtil.gE("gzoom-back");
K.mapCover=DragZoomUtil.gE("gzoom-map-cover");K.cornerTopDiv=DragZoomUtil.gE("gzoom-cornerTopDiv");K.cornerRightDiv=DragZoomUtil.gE("gzoom-cornerRightDiv");K.cornerBottomDiv=DragZoomUtil.gE("gzoom-cornerBottomDiv");K.cornerLeftDiv=DragZoomUtil.gE("gzoom-cornerLeftDiv");K.map=D;K.borderCorrection=K.style.outlineWidth*2;this.setDimensions_();this.initStyles_();K.mapCover.onselectstart=function(){return false};return N};C.prototype.remove=function(){var D,E=this.globals.listeners;for(D in E){if(E.hasOwnProperty(D)){GEvent.removeListener(E[D])}}jQuery("#gzoom-map-cover").remove()};C.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(3,120))};C.prototype.coverMousedown_=function(E){var D=this.globals;var F=this.getRelPos_(E);D.startX=F.left;D.startY=F.top;DragZoomUtil.style([D.mapCover],{background:"transparent",opacity:1,filter:"alpha(opacity=100)"});DragZoomUtil.style([D.outlineDiv],{left:D.startX+"px",top:D.startY+"px",display:"block",width:"1px",height:"1px"});D.draggingOn=true;D.cornerTopDiv.style.top=(D.startY-D.mapHeight)+"px";D.cornerTopDiv.style.display="block";D.cornerLeftDiv.style.left=(D.startX-D.mapWidth)+"px";D.cornerLeftDiv.style.top=D.startY+"px";D.cornerLeftDiv.style.display="block";D.cornerRightDiv.style.left=D.startX+"px";D.cornerRightDiv.style.top=D.startY+"px";D.cornerRightDiv.style.display="block";D.cornerBottomDiv.style.left=D.startX+"px";D.cornerBottomDiv.style.top=D.startY+"px";D.cornerBottomDiv.style.width="0px";D.cornerBottomDiv.style.display="block";if(D.callbacks.dragstart!=null){D.callbacks.dragstart(D.startX,D.startY)}return false};C.prototype.drag_=function(E){var D=this.globals;if(D.draggingOn){var F=this.getRelPos_(E);rect=this.getRectangle_(D.startX,D.startY,F,D.mapRatio);if(rect.left){addX=-rect.width}else{addX=0}if(rect.top){addY=-rect.height}else{addY=0}DragZoomUtil.style([D.outlineDiv],{left:D.startX+addX+"px",top:D.startY+addY+"px",display:"block",width:"1px",height:"1px"});D.outlineDiv.style.width=rect.width+"px";
D.outlineDiv.style.height=rect.height+"px";D.cornerTopDiv.style.height=((D.startY+addY)-(D.startY-D.mapHeight))+"px";D.cornerLeftDiv.style.top=(D.startY+addY)+"px";D.cornerLeftDiv.style.width=((D.startX+addX)-(D.startX-D.mapWidth))+"px";D.cornerRightDiv.style.top=D.cornerLeftDiv.style.top;D.cornerRightDiv.style.left=(D.startX+addX+rect.width+D.borderCorrection)+"px";D.cornerBottomDiv.style.top=(D.startY+addY+rect.height+D.borderCorrection)+"px";D.cornerBottomDiv.style.left=(D.startX-D.mapWidth+((D.startX+addX)-(D.startX-D.mapWidth)))+"px";D.cornerBottomDiv.style.width=(rect.width+D.borderCorrection)+"px";if(D.callbacks.dragging!=null){D.callbacks.dragging(D.startX,D.startY,rect.endX,rect.endY)}return false}};C.prototype.mouseup_=function(I){var P=this.globals;if(P.draggingOn){var K=this.getRelPos_(I);P.draggingOn=false;var L=this.getRectangle_(P.startX,P.startY,K,P.mapRatio);if(L.left){L.endX=L.startX-L.width}if(L.top){L.endY=L.startY-L.height}this.resetDragZoom_();var Q=new GPoint(L.startX,L.startY);var D=new GPoint(L.endX,L.startY);var N=new GPoint(L.endX,L.endY);var J=new GPoint(L.startX,L.endY);var F=P.map.fromContainerPixelToLatLng(Q);var E=P.map.fromContainerPixelToLatLng(D);var H=P.map.fromContainerPixelToLatLng(N);var O=P.map.fromContainerPixelToLatLng(J);var M=new GPolyline([F,E,H,O,F],P.style.outlineColor,P.style.outlineWidth+1,0.4);try{P.map.addOverlay(M);setTimeout(function(){P.map.removeOverlay(M)},P.options.overlayRemoveTime)}catch(I){}polyBounds=M.getBounds();var E=polyBounds.getNorthEast();var O=polyBounds.getSouthWest();var H=new GLatLng(O.lat(),E.lng());var F=new GLatLng(E.lat(),O.lng());zoomLevel=P.map.getBoundsZoomLevel(polyBounds);center=polyBounds.getCenter();P.map.setCenter(center,zoomLevel);if(P.callbacks.dragend!=null){P.callbacks.dragend(F,E,H,O,Q,D,N,J)}if(P.options.stickyZoomEnabled){this.initCover_();if(P.options.backButtonEnabled){this.saveBackContext_(P.options.backButtonHTML,false)}P.backButtonDiv.style.display="none"}}};C.prototype.setDimensions_=function(){var D=this.globals;
var E=D.map.getSize();D.mapWidth=E.width;D.mapHeight=E.height;D.mapRatio=D.mapHeight/D.mapWidth;DragZoomUtil.style([D.mapCover,D.cornerTopDiv,D.cornerRightDiv,D.cornerBottomDiv,D.cornerLeftDiv],{left:"0px",width:D.mapWidth+"px",height:D.mapHeight+"px"})};C.prototype.initStyles_=function(){var D=this.globals;DragZoomUtil.style([D.mapCover,D.cornerTopDiv,D.cornerRightDiv,D.cornerBottomDiv,D.cornerLeftDiv],{filter:D.style.alphaIE,opacity:D.style.opacity,background:D.style.fillColor});D.outlineDiv.style.border=D.style.border};C.prototype.buttonclick_=function(){var D=this.globals;D.backButtonDiv.style.display="none";if(D.mapCover.style.display=="block"){this.resetDragZoom_();if(D.options.backButtonEnabled){this.restoreBackContext_();if(D.backStack.length==0){D.backButtonDiv.style.display="none"}}}else{this.initCover_();if(D.options.backButtonEnabled){this.saveBackContext_(D.options.backButtonHTML,false)}}};C.prototype.backbuttonclick_=function(){var D=this.globals;if(D.options.backButtonEnabled&&D.backStack.length>0){this.restoreBackContext_();if(D.callbacks.backbuttonclick!=null){D.callbacks.backbuttonclick(D.methodCall)}}};C.prototype.saveBackContext_=function(H,D){var E=this.globals;var F={};F.center=E.map.getCenter();F.zoom=E.map.getZoom();F.maptype=E.map.getCurrentMapType();F.text=E.backButtonDiv.innerHTML;F.methodCall=D;E.backStack.push(F);E.backButtonDiv.innerHTML=H};C.prototype.restoreBackContext_=function(){var D=this.globals;var E=D.backStack.pop();D.map.setCenter(E.center,E.zoom,E.maptype);D.backButtonDiv.innerHTML=E.text;D.methodCall=E.methodCall;if(D.backStack.length==0){D.backButtonDiv.style.display="none"}};C.prototype.updateZoomInButton_=function(){var D=this.globals;var E=this;var F;F=D.map.getCurrentMapType().getMaximumResolution(D.map.getCenter());if(D.map.getZoom()>=F){if(D.listeners.button){GEvent.removeListener(D.listeners.button);DragZoomUtil.gE("gzoom-control").style.opacity=D.options.disabledButtonOpacity;DragZoomUtil.gE("gzoom-control").firstChild.style.filter=D.disabledButtonFilterIE;
D.listeners.button=null}}else{if(D.listeners.button==null){DragZoomUtil.gE("gzoom-control").style.opacity=D.buttonOpacity;DragZoomUtil.gE("gzoom-control").firstChild.style.filter=D.buttonFilterIE;D.listeners.button=GEvent.addDomListener(D.buttonDiv,"click",function(G){E.buttonclick_(G)})}}};C.prototype.initCover_=function(){var D=this.globals;D.mapPosition=DragZoomUtil.getElementPosition(D.map.getContainer());this.setDimensions_();this.setButtonMode_("zooming");DragZoomUtil.style([D.mapCover],{display:"block",background:D.style.fillColor});DragZoomUtil.style([D.outlineDiv],{width:"0px",height:"0px"});if(D.callbacks.buttonclick!=null){D.callbacks.buttonclick()}};C.prototype.getRelPos_=function(E){var F=DragZoomUtil.getMousePosition(E);var D=this.globals;return{top:(F.top-D.mapPosition.top),left:(F.left-D.mapPosition.left)}};C.prototype.getRectangle_=function(G,E,K,H){var J=false;var I=false;var F=K.left-G;var D=K.top-E;if(F<0){F=F*-1;J=true}if(D<0){D=D*-1;I=true}delta=F>D?F:D;return{startX:G,startY:E,endX:G+delta,endY:E+parseInt(delta*H),width:delta,height:parseInt(delta*H),left:J,top:I}};C.prototype.resetDragZoom_=function(){var D=this.globals;DragZoomUtil.style([D.mapCover,D.cornerTopDiv,D.cornerRightDiv,D.cornerBottomDiv,D.cornerLeftDiv],{display:"none",opacity:D.style.opacity,filter:D.style.alphaIE});D.outlineDiv.style.display="none";this.setButtonMode_("normal");if(D.options.backButtonEnabled&&(D.backStack.length>0)){D.backButtonDiv.style.display=D.options.buttonStartingStyle.display}};return C}return function(C,D,E){if(!A){A=B()}return new A(C,D,E)}})();var DragZoomUtil={};DragZoomUtil.gE=function(A){return document.getElementById(A)};DragZoomUtil.getMousePosition=function(A){var C=0;var B=0;if(!A){var A=window.event}if(A.pageX||A.pageY){C=A.pageX;B=A.pageY}else{if(A.clientX||A.clientY){C=A.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);B=A.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)
}}return{left:C,top:B}};DragZoomUtil.getElementPosition=function(C){var B=C.offsetLeft;var A=C.offsetTop;var D=C.offsetParent;while(D!=null){B+=D.offsetLeft;A+=D.offsetTop;D=D.offsetParent}return{left:B,top:A}};DragZoomUtil.style=function(D,C){if(typeof (D)=="string"){D=DragZoomUtil.getManyElements(D)}for(var A=0;A<D.length;A++){for(var B in C){D[A].style[B]=C[B]}}};DragZoomUtil.getManyElements=function(D){var B=D.split(",");var C=[];for(var A=0;A<B.length;A++){C[C.length]=DragZoomUtil.gE(B[A])}return C};






/* map_overlay.js */
function make_map3_overlay(d,r,AL,AI){var AZ=window.jQuery,An=[],Ad={},V,b,E,AJ=0,J=0,AR=0,Au=0,G=null,p=[],R={},X=[],AB={},AP=0,Av=0,AG,Ay,H,F=[],AF,I=[],Ao,Ap,U,C=false,w,P,l,B,Ar=null,K,M=false,AE=false,AD=null,Af,u,Ae,N,o={},Aa=false,AW=[],Aq={};Aq.prototype=new GOverlay();AL=AZ.extend({serialize_move:function(Az){return{save:{id:Az.id,lat:Az.latlng.lat(),lng:Az.latlng.lng()},undo:{id:Az.id,lat:Az.n.lat,lng:Az.n.lng}}},apply_serialized_move:function(Az,A0){Az.lat=A0.lat;Az.lng=A0.lng},move_url:Mkiconf.move_url,locator:function(Az){if(Az.lat!=null&&Az.lng!=null){return new GLatLng(Az.lat,Az.lng)}else{return null}}},AL||{});function AQ(Az){var A0;this.prio=Math.floor(Az.prio||0);this.ctx=null;this.empty=true;for(A0 in {init:1,noder:1,sizer:1,decorator:1,backgrounder:1,nobuf:1,nodisp:1,nobounds:1,refreshers:1,disabled:1,name:1,setprefs:1,prefsmenu:1,colorer:1,tooltip_labeler:1}){this[A0]=Az[A0]}}AQ.prototype.begin=function(Az){if(!this.ctx){if(!this.canvas){c(this)}this.ctx=this.canvas.getContext("2d");this.ctx.save();this.ctx.translate(Ae,N)}if(Az){this.empty=false}return this.ctx};AQ.prototype.unbegin=function(){if(this.ctx){this.ctx.restore();this.ctx=null}};AQ.prototype.show=function(){if(!this.empty&&this.canvas){this.canvas.style.left=(-Ae)+"px";this.canvas.style.top=(-N)+"px";this.canvas.style.visibility="visible"}};AQ.prototype.get_image=function(Az){var A0=R[Az];if(!A0){A0=new Image();R[Az]=A0;A0.onload=function(){f(A0)};
A0.src=(Az.match(/^https?:/)?Az:Mkiconf.images+Az)}return A0};AQ.prototype.node_marker_dimensions=function(Az){var A0={height:0.4*Az.img.image.height,width:0.7*Az.img.image.width,top_offset:Az.img.top_offset};if(Az.img.shape=="ptr"||Az.img.shape=="pst"){A0.height=0.3*Az.img.image.height;A0.width=0.6*Az.img.image.width;if(Az.img.shape=="ptr"){A0.top_offset=0.8*Az.img.top_offset}else{A0.top_offset=0.9*Az.img.top_offset}}return A0};AQ.prototype.node_label=function(A0,BA){var A5=this.get_image("dingle-digits-z9.png"),A9,A2,A8,A1,A4,BD,A3,A7,BC,BB,Az,A6;if(!A5.width){X.push(A5)}if(!A5.width||!A0.img||!A0.img.shape){return }BA=BA.toString().replace(/[^0-9]/g,"");A9=A5.width/10;A2=A5.height/2;A8=(A5.width/10)*BA.length;A4=this.node_marker_dimensions(A0);BD=Math.min(A4.height/A2,A4.width/A8);A3=d.fromLatLngToDivPixel(A0.latlng);A7=(A0.img.color==1?A2:0);BC=A3.x-A0.img.horiz_offset+(A0.img.image.width-A8*BD)/2;BB=A3.y-A4.top_offset+(0.8*A0.img.image.height-A2*BD)/2;Az=A9*BD;A6=A2*BD;this.begin(true);for(A1=0;A1<BA.length;++A1,BC+=Az){this.ctx.drawImage(A5,A9*(BA.charCodeAt(A1)-48),A7,A9,A2-1,BC,BB,Az,A6)}};AQ.prototype.node_image_label=function(Az,A0,A5,A4,A6,A1){var A3,A9,A2,A8,A7;if(!A0.width){X.push(A0)}if(!A0.width||!Az.img||!Az.img.shape){return }if(arguments.length==2){A6=A0.width,A1=A0.height}else{if(arguments.length==4){A6=A5,A1=A4}}if(arguments.length<6){A5=A4=0}A3=this.node_marker_dimensions(Az);A9=Math.min(1,A3.height*1.3/A1,A3.width*1.3/A6);A2=d.fromLatLngToDivPixel(Az.latlng);A8=A2.x-Az.img.horiz_offset+(Az.img.image.width-A6*A9)/2;A7=A2.y-A3.top_offset+(0.75*Az.img.image.height-A1*A9)/2;this.begin(true);this.ctx.drawImage(A0,A5,A4,A6,A1,A8,A7,A6*A9,A1*A9)};function n(){var A2,A1,Az,A4,A0,A3=V,A5=b;AB={};V=b=E=null;for(A2=An.length-1;A2>=0;--A2){Az=An[A2];if(Az.disabled){continue}A0=false;if(!V&&Az.sizer){V=A0=Az}if(!b&&Az.colorer){b=A0=Az}if(!E&&Az.tooltip_labeler){E=Az}if((A4=Az.refreshers)){for(A1=0;A1<A4.length;++A1){AB[A4[A1]]=(A0?2:1)}}}if((A3!==V||A5!==b)&&K){AN()
}}function AV(A0){if(!A0.name||Ad[A0.name]){throw new Error("duplicate layer")}var Az=new AQ(A0),A1;Ad[A0.name]=Az;for(A1=0;A1<An.length&&An[A1].prio<=Az.prio;++A1){}An.splice(A1,0,Az);if(Az.setprefs){Az.setprefs.apply(Az,[Aq,AI])}n();return Az}function L(){var Az=d.getCurrentMapType();return !(Az===G_SATELLITE_MAP||Az===G_HYBRID_MAP)}function a(A0,A1,Az){if(L()){A0.className="map3bg_light"}else{A0.className="map3bg_dark"}}function AU(A1,Az){var A3="neighbors."+(Az.type||"Map"),A0=(L()?"d":"l"),A2=window.Mkijson?Mkijson.n.meta:nodes_meta;if((Az[A3]||"")==A0){Az[A3]=null}if(Az.neighbors!=null&&Az.neighbors!="x"){Az.neighbors=null}this.disabled=(Az.neighbors=="x");if(!this.disabled&&!AL.show3&&A2.lat&&!A2.curnbrs){data3_load.ajax("n",{f:"curnbrs",t0:A2.t0,t1:A2.t1})}}function Aj(A1,A2,A0){var Az=A1.getContext("2d"),A3=A0["neighbors."+(A0.type||"Map")];if(!A3){A3=(L()?"d":"l")}Az.lineCap="butt";Az.lineJoin="miter";if(A3=="d"){Az.strokeStyle="rgba(30,47,16,0.2)"}else{if(A3=="r"){Az.strokeStyle="rgba(200,24,0,0.4)"}else{Az.strokeStyle="rgba(210,219,220,0.32)"}}}function Ag(A0,A4,Az,A3){var A2,A1,BA,A9,A7,BD,BB,A8,BC,BE,A6;BD=Az.fromLatLngToDivPixel(A0.latlng);A6=this.count;function A5(BH,BF,BG){if(BG<=0){return }if(!BE){BE=BH.begin(true)}if(BG<4){BE.lineWidth=2}else{if(BG<22){BE.lineWidth=3}else{BE.lineWidth=5}}BE.beginPath();BB=Az.fromLatLngToDivPixel(BF.latlng);AA(BE,BD,BB);BE.stroke();++BH.count}if((BC=A0.n.curnbrs)){for(A2 in BC){if((A7=H[A2])&&(A7.n.id<A0.n.id||!A7.disp||!A7.n.curnbrs||!A7.n.curnbrs[A0.n.id]||!A4.containsLatLng(A7.latlng))){A5(this,A7,BC[A2])}}}else{if((BC=A0.n.nbrs)){for(A2 in BC){if((A7=H[A2])&&(A7.n.id<A0.n.id||!A7.disp||!A7.n.nbrs||!A7.n.nbrs[A0.n.id]||!A4.containsLatLng(A7.latlng))){A8=0;rateprod=0;for(A1 in BC[A2]){BA=BC[A2][A1];A9=BA[1]*BA[2];if(BA[0]<1000&&A9>rateprod){A8=BA[0];rateprod=A9}}A5(this,A7,A8)}}}else{if((BC=A0.n.neighbors)){for(A2=0;A2<BC.length;++A2){if((A7=H[BC[A2].id])){A8=0;if(BC[A2].stats&&BC[A2].stats[0]){A8=BC[A2].stats[0].rssi_11b||0
}A5(this,A7,A8)}}}}}if(typeof (G_vmlCanvasManager)!="undefined"&&Math.floor(A6/250)!=Math.floor(this.count/250)){return true}}function c(A2){var A1,A0,Az;if(A2.setprefs){A2.setprefs.apply(A2,[Aq,AI])}if(A2.disabled){Z(A2,true);return }if(!A2.canvas){A2.canvas=A0=document.createElement("canvas");A0.width=Af;A0.height=u;A0.style.position="absolute";A0.style.visibility="hidden";A0.style.zIndex=A2.prio;AZ("body").append(A0);if(typeof (G_vmlCanvasManager)!="undefined"){if(G_vmlCanvasManager.initElementNoFix){A2.canvas=G_vmlCanvasManager.initElementNoFix(A2.canvas)}else{A2.canvas=G_vmlCanvasManager.initElement(A2.canvas)}}for(A1=An.length-1,Az=null;A1>=0&&An[A1]!=A2;--A1){Az=An[A1].canvas||An[A1].xcanvas||Az}d.getPane(G_MAP_MARKER_PANE).insertBefore(A2.canvas,Az)}else{A0=A2.canvas;A0.width=Af;A0.height=u;A0.style.visibility="hidden"}A2.empty=true;if(A2.init){A2.unbegin();A2.init.apply(A2,[A2.canvas,Aq,AI]);if(A2.xcanvas){A2.init.apply(A2,[A2.xcanvas,Aq,AI])}}}function Z(A2,Az){var A1=A2.canvas,A0;if(A1&&(A1.width!=Af||A1.height!=u)){c(A2)}else{if(A1&&!A2.empty){A2.unbegin();A1.style.visibility="hidden";A0=A1.getContext("2d");A0.clearRect(0,0,Af,u);A2.empty=true}}if(Az&&A2.xcanvas){A2.xcanvas.style.visibility="hidden"}}function AO(A0,Az){return(Az.n["status#"]-A0.n["status#"])||(A0.z-Az.z)||(A0.latlng.lng()-Az.latlng.lng())||(A0.id-Az.id)}Aq.add_layer=function(Az){AV(Az);if(Ad.n){Aq.refresh()}};Aq.remove_layer=function(Az){if(Az=="n"||Az=="nbg"||Az=="route"){throw new Error("special layer")}for(var A0=0;A0<An.length;++A0){if(An[A0].name==Az){An.splice(A0,1);break}}delete Ad[Az];n();if(Ad.n){Aq.refresh()}};function e(){var A0,Az,A1;AG.sort(AO);Ay.sort(function(A3,A2){return A3.latlng.lat()-A2.latlng.lat()});for(A0 in H){Az=H[A0];if(A1){A1.extend(Az.latlng)}else{A1=new GLatLngBounds(Az.latlng,Az.latlng)}}if(A1){A1=A1.toSpan();B=(A1.latRadians()*A1.lngRadians())/(AG.length||1)}}function Am(A1,A4){var A3,A5,A0,A2,A6,Az;AG=[];Ay=[];H={};A2=A4==null;Az=AL.locator;for(A3 in A1){A5=A1[A3];
A6=Az(A5);if(A5["status#"]==undefined||!A6){continue}A0={id:A5.id,n:A5,z:GOverlay.getZIndex(A6.lat()),latlng:A6,disp:A2};AG.push(A0);Ay.push(A0);H[A3]=A0}for(A3 in (A4||{})){A0=H[A4[A3].id];if(A0){A0.disp=true}}e()}Aq.reposition=function(){var A0,Az,A2,A1;for(A0=0;A0<arguments.length;++A0){if((Az=H[arguments[A0].id])&&(A2=AL.locator(Az.n))){Az.z=GOverlay.getZIndex(A2.lat());Az.latlng=A2;A1=true}}if(A1){e()}};Aq.displayed=function(A0){var A1=[],Az;for(Az in H){if(H[Az].disp||A0){A1.push(H[Az].n)}}return A1};Aq.clear_tooltip=function(){AZ("#nodemap_tooltip").fadeOut(200);clearTimeout(P);P=w=null};function Ab(){var A2=d.fromLatLngToContainerPixel(w.latlng),A3,A0=[0,0,0,0],Az,A4,A1;if(w.n.gateway_route){Az=w.n.gateway_route.split(" ");for(A1=0;A1<Az.length;++A1){A4=H[Az[A1]];if(A4){A3=d.fromLatLngToContainerPixel(A4.latlng);A0[A3.y<A2.y?0:2]++;if(Math.abs(A3.y-A2.y)<30){A0[A3.x<A2.x?3:1]++}}}}l=2;for(A1=0;A1<4;++A1){if(A0[A1]<A0[l]){l=A1}}}function Aw(A3){var A0,A2,A4,A1,Az;A4=AZ(d.getContainer()).offset();A0=A3.width();A2=A3.height();A1=d.fromLatLngToContainerPixel(w.latlng);A1.x+=A4.left;A1.y+=A4.top;Az=A3.find("#nodemap_tooltip_pointer");if(l==0){A3.css({top:A1.y-w.img.height-A2-6,left:A1.x-A0/2,zIndex:100});Az.css({top:A2-5,left:A0/2-4.5});Az[0].className="hhptr_downs"}else{if(l==1){A3.css({top:A1.y-A2/2-w.img.height/2,left:A1.x+w.img.width/2+9,zIndex:100});Az.css({top:A2/2-4.5,left:-5});Az[0].className="hhptr_lefts"}else{if(l==3){A3.css({top:A1.y-A2/2-w.img.height/2,left:A1.x-w.img.width/2-A0-6,zIndex:100});Az.css({top:A2/2-4.5,left:A0-5});Az[0].className="hhptr_rights"}else{A3.css({top:A1.y+9,left:A1.x-A0/2,zIndex:100});Az.css({top:-5,left:A0/2-4.5});Az[0].className="hhptr_ups"}}}}function AM(Az){var A0=AZ("#nodemap_tooltip"),A1;if(A0.length&&Az){w=Az;Ab();A1="<div style='position:relative'><div id='nodemap_tooltip_pointer' class='hhptr_ups'>&nbsp;</div><table class='lean'><tr><td class='hhsh_tls' style='width:4px;height:4px'></td><td class='hhsh_ts' style='height:4px'></td><td class='hhsh_trs' style='width:4px;height:4px'></td></tr><tr><td class='hhsh_ls' style='width:4px'></td><td><div class='nodemap_tooltip_contents'><table class='lean'><tr><td>"+node3_render_status(Az.n,true)+"</td><td>\xA0</td><td>";
if(E){A1+=E.tooltip_labeler.apply(E,[Az,Aq])}else{A1+=node3_render_name(Az.n)}A1+="</td></tr></table></div></td><td class='hhsh_rs' style='width:4px'></td></tr><tr><td class='hhsh_bls' style='width:4px;height:4px'></td><td class='hhsh_bs' style='height:4px'></td><td class='hhsh_brs' style='width:4px;height:4px'></td></tr></table></div>";A0.html(A1);Aw(A0);A0.fadeIn(200);clearTimeout(P);P=null}else{if(A0.length&&!P&&w){P=setTimeout(Aq.clear_tooltip,500)}}}Aq.show_tooltip=function(A1,A0){var Az=A1?H[A1.id||A1]:null;AM(Az);if(A0){Ax(Az,false)}};function O(Az){var A0;if(Az!==w||(Az&&P)){AM(Az)}A0=Ao;Ao=Az||Ap;if(Ao!==A0){S(A0);S(Ao);AY();if(AL.onnodehover){AL.onnodehover(Ao,Aq)}}}function AH(A0){var A1,A2,Az;if(A0.type==="mouseover"&&P){clearTimeout(P);P=null;O(w)}else{if(A0.type==="mouseout"&&w&&!P){P=setTimeout(Aq.clear_tooltip,500);if(AL.show3){O(null)}}else{if(A0.type==="mousemove"&&w&&!M){A1=AZ("#nodemap_tooltip");A2=A1.offset();if(l==0){Az=A0.pageY>A2.top+A1.height()-10&&Math.abs(A0.pageX-A2.left-A1.width()/2)>8}else{if(l==1){Az=A0.pageX<A2.left+10&&Math.abs(A0.pageY-A2.top-A1.height()/2)>8}else{if(l==3){Az=A0.pageX>A2.left+A1.width()-10&&Math.abs(A0.pageY-A2.top-A1.height()/2)>8}else{Az=A0.pageY<A2.top+10&&Math.abs(A0.pageX-A2.left-A1.width()/2)>8}}}if(Az){A2=AZ(d.getContainer()).offset();O(Ak(d.fromContainerPixelToLatLng(new GPoint(A0.pageX-A2.left,A0.pageY-A2.top))))}}}}}function AK(){if(!Aq.map_type_changing){clearTimeout(Ar);Ar=setTimeout(function(){var Az=(map3_type_is_custom(d)?"."+AI.type:""),A0=d.getCenter();AI["lat"+Az]=A0.lat();AI["lng"+Az]=A0.lng();AI["zoom"+Az]=d.getZoom();v(0);Ar=null},1600)}}function x(Az){Az=Az||window.event;if(Az.keyCode==16){Aa=true}}function As(Az){Az=Az||window.event;if(Az.keyCode==16){Aa=false}}Aq.initialize=function(A0){var Az;Af=d.getSize().width;u=d.getSize().height;AV({name:"n",prio:20});AV({name:"nbg",prio:10,init:a});AV({name:"route",prio:100,nobuf:true});AV({name:"link",prio:0,setprefs:AU,init:Aj,noder:Ag,nobounds:AL.show3,refreshers:["nbrs","curnbrs"],prefsmenu:function(A3,A1){var A2=L()?null:"d",A4=L()?"l":null;
return[{group:"Neighbors",name:"neighbors",value:"x",text:"No lines",prio:0},{group:"Neighbors",name:"neighbors",value:A2,text:"Dark lines",maptype_specific:true},{group:"Neighbors",name:"neighbors",value:A4,text:"Light lines",maptype_specific:true},{group:"Neighbors",name:"neighbors",value:"r",text:"Red lines",maptype_specific:true}]}});AV({name:"producticon",prio:-1,sizer:function(A1,A2,A3){return A1+3},decorator:function(A1,A3,A4,A6,A5){var A2=A4.get_image("node_icons/"+node_product_info(A1.n,"icon","unknown")+"_all.png?4");A4.node_image_label(A1,A2,0,88,26,22)},refreshers:["model","product_icon"],setprefs:function(A2,A1){this.disabled=A1.markers!="p"},prefsmenu:{group:"Markers",name:"markers",value:"p",text:"AP type",pos:10}});AV({name:"clientcount",sizer:function(A1,A3,A4){var A2=A3["clients#"];return A1+(A2?A2-1:-2)},decorator:function(A1,A2,A3,A5,A4){if(A1.n["clients#"]){A3.node_label(A1,A1.n["clients#"])}},refreshers:["clients#"],setprefs:function(A2,A1){this.disabled=!!A1.markers},prefsmenu:{group:"Markers",name:"markers",value:null,text:"Clients",pos:20}});AV({name:"hopcount",sizer:function(A1,A2,A3){if((A2.is_gateway||(A2["gwhops#"]||0)<=2)&&A2["status#"]<=2){return A1}else{return A1-1}},decorator:function(A1,A2,A3,A5,A4){if(!A1.n.is_gateway&&A1.n["gwhops#"]&&A1.n["status#"]<=2){A3.node_label(A1,A1.n["gwhops#"])}},refreshers:["is_gateway","gwhops#"],setprefs:function(A2,A1){this.disabled=A1.markers!="h"},prefsmenu:{group:"Markers",name:"markers",value:"h",text:"Hops to gateway",pos:40}});if(typeof map3_layers!=="undefined"){for(Az=0;Az<map3_layers.length;++Az){AV(map3_layers[Az])}}AZ("#nodemap_tooltip").bind("mouseover mouseout mousemove",AH);GEvent.addListener(d,"mousemove",function(A1){if(!M){O(Ak(A1))}});GEvent.addListener(d,"mouseout",function(){AH({type:"mouseout"})});GEvent.addListener(d,"movestart",function(){AE=true});GEvent.addListener(d,"move",function(){if(w){AM(w)}});GEvent.addListener(d,"moveend",function(){AE=false;if(AJ==1){AR=0;Aq.redraw()}});
GEvent.addListener(d,"dragend",AK);GEvent.addListener(d,"zoomend",AK);K=AZ(d.getContainer().firstChild.firstChild);AW.push(GEvent.addDomListener(document,"keydown",x));AW.push(GEvent.addDomListener(document,"keyup",As));m()};Aq.redraw=function(A2){var A0,Az,A1;if(!K){return }A1=d.getZoom();if(AD!=null&&AD!=A1){for(j=0;j<An.length;++j){Z(An[j],true)}}AD=A1;A0=d.getSize();Af=A0.width;u=A0.height;Ae=parseInt(K.css("left"));N=parseInt(K.css("top"));if(U==null){U=0;for(A0 in checkbox3.checked){Az=H[A0];if(Az&&Az.n.checked){S(Az)}}}k(true)};Aq.remove=function(){var A0,Az;for(A0=0;A0<An.length;++A0){Az=An[A0];if(Az.canvas){Az.canvas.parentNode.removeChild(Az.canvas)}if(Az.xcanvas){Az.xcanvas.parentNode.removeChild(Az.xcanvas)}Az.canvas=Az.xcanvas=null}for(A0=0;A0<p.length;++A0){if(p[A0]._meraki_node){delete p[A0]._meraki_node.marker}delete p[A0]._meraki_node;d.removeOverlay(p[A0])}for(A0=0;A0<AW.length;++A0){GEvent.removeListener(AW[A0])}checkbox3.unbind(s);AG=Ay=[];H={};p=[];R={};Ao=Ap=w=null;AW=[];AZ("#nodemap_tooltip").hide();AZ(document).unbind("node_change",Ac);T(0);X=[];clearTimeout(P);P=null;clearTimeout(Ar);Ar=null};Aq.refresh=function(A0,A7){var A5,A3,A2,Az,A1,A6,A4;if(A0){for(A3 in AG){AG[A3].disp=false}A6=A4=0;Az=map3_bounds_expand(d.getBounds(),0.94);A1=new GLatLngBounds();for(A3 in A0){A2=H[A0[A3].id];if(!A2){continue}A2.disp=true;++A4;if(Az.containsLatLng(A2.latlng)){++A6}A1.extend(A2.latlng)}A1.extend(new GLatLng(A1.getNorthEast().lat()+(Av/u)*Az.toSpan().lat(),A1.getNorthEast().lng()));A3=Math.min(d.getBoundsZoomLevel(A1),d.getCurrentMapType().getMaximumResolution());if(A7===false||A6>=50){}else{if(A4>0&&A6==0){if(A3<=d.getZoom()){map3_set_center(d,A1)}else{d.panTo(A1.getCenter())}}else{if(A4>A6&&A3+1==d.getZoom()){d.zoomOut();d.panTo(A1.getCenter())}else{if(A4>A6&&A3>=d.getZoom()){map3_set_center(d,A1,true)}}}}}if(Ao&&!Ao.disp&&!AL.hoverAny){A5=Ao;Ao=undefined;S(A5)}if(Ap&&!Ap.disp){Ax(undefined)}for(A3=0;A3<p.length;++A3){if(!p[A3].isHidden()&&p[A3]._meraki_node){p[A3].setLatLng(p[A3]._meraki_node.latlng)
}}Aq.redraw(true);m()};function Al(Az,A0){var BA,A8="pno",A7,A9,A3=V,A1=b,A2,A6,A5,A4;A2=Aq.node_scalestep;if((BA=Az.tags)){if(BA.indexOf(" triangle ")>=0){A8="ptr"}else{if(BA.indexOf(" square ")>=0){A8="psq"}else{if(BA.indexOf(" star ")>=0){A8="pst"}}}}if(A3){A2=A3.sizer.apply(A3,[A2,Az,Aq]);A2=Math.max(Math.min(Math.round(A2),100),-2);if(A2<=2){A5=[0.2,0.225,0.265625,0.328125,0.34][Math.max(Math.round(A2),-2)+2]}else{A5=0.34+Math.sqrt(A2)*0.031}}if(A1){A6=A1.colorer.apply(A1,[Az,Aq]);A6=Math.max(Math.min(Math.round(A6||0),8),0)}else{A6=Az["status#"]||0}A7=A8+"-z"+A2+(A3?"z":"");A9=A7+"-s"+A6+"-g"+(Az.is_gateway?1:0);if(A0&&A0.highlight=="partial"){A9+="-hx"}else{if(A0&&A0.highlight){A9+="-h"}}if(!(A4=R[A9])){R[A9]=A4={image:new Image(),color:A6};A4.image.onload=function(){if(A3){this.width=Math.round(this.width*A5);this.height=Math.round(this.height*A5)}AP=Math.max(this.width,AP);Av=Math.max(this.height,Av);A4.width=this.width;A4.height=this.height;A4.horiz_offset=Math.ceil(this.width/2);A4.vert_offset=Math.ceil(this.height/2);A4.top_offset=this.height;A4.bot_offset=0;A4.shape=A8;var BB=new GIcon();BB.iconSize=new GSize(this.width,this.height);BB.iconAnchor=new GPoint(A4.horiz_offset,A4.top_offset);BB.infoWindowAnchor=new GPoint(A4.horiz_offset,A4.vert_offset);BB.image=BB.transparent=BB.printImage=BB.mozPrintImage=Mkiconf.images+"1x1.gif";BB.shadow=BB.printShadow=null;A4.gicon=BB;f(A4)};BA=A7+"/dingle-"+A9+".png";if(A3){BA=BA.replace(/-z-?\d+z/g,"-z9")}A4.image.src=Mkiconf.images+"dingle-"+BA}return A4}function f(Az){var A0;for(A0 in Az.markers_waiting||{}){S(H[A0],true)}if(Az.markers_waiting){delete Az.markers_waiting}if(X.length){for(A0=0;A0<X.length;++A0){if(X[A0]==Az){X.splice(A0,1);--A0}else{if(X[A0]===true){X=[]}}}if(X.length==0){Aq.redraw(true)}}}function AN(){var A2,Az,A1,A0=false;for(A2 in H){Az=H[A2];A1=Al(Az.n);if(A1!==Az.img){Az.img=A1;if(Az.highlight){S(Az)}A0=true}}return A0}function A(){M=true;Z(Ad.route);if(Ap==this._meraki_node){d.closeInfoWindow()
}Aq.clear_tooltip();return false}function AX(){var A4=this._meraki_node,A1=[],A3,A0,A2,Az;M=false;if(!A4){return }A3=this.getLatLng().lat()-A4.latlng.lat();A0=this.getLatLng().lng()-A4.latlng.lng();if(!AL.show3){for(A2 in checkbox3.checked){A1.push(H[A2])}}if(AL.show3||!this._meraki_node.n.checked){A1.push(this._meraki_node)}for(A2=A1.length-1;A2>=0;--A2){Az=A1[A2];Az.latlng=new GLatLng(Az.latlng.lat()+A3,Az.latlng.lng()+A0);Az.z=GOverlay.getZIndex(Az.latlng.lat())}e();At(A1);Aq.refresh()}function q(){Ax(this._meraki_node,true)}function S(A1,A2){var A3,A0,A5,Az,A6,A4;if(!A1){return }A5=A1.marker;if(Ap==A1||(!AL.show3&&A1.n.checked)){A6=true}else{if(A1.in_pinned_route){A6="partial"}}if(!!A6!=!!A1.highlight){U+=(A6?1:-1)}if(A6){A1.highlight=Al(A1.n,{highlight:A6})}else{delete A1.highlight}if(!A1.highlight&&A1!=Ao){delete A1.marker}else{Az=A1.highlight||A1.img;if(!Az||(A5&&A5.getIcon()==Az.gicon)){return }if(!Az.gicon){Az.markers_waiting=Az.markers_waiting||{};Az.markers_waiting[A1.id]=true;if(Az==A1.img||!A1.img||!A1.img.gicon){return }Az=A1.img}for(A3=0;A3<p.length;++A3){if(p[A3].getIcon()==Az.gicon&&p[A3].isHidden()){A0=p[A3];break}}if(!A0){A4=!!(Mkiconf.read_only||AL.read_only);A0=new GMarker(d.getCenter(),{icon:Az.gicon,bouncy:false,clickable:A4,draggable:!A4});GEvent.addListener(A0,"click",q);if(!A4){GEvent.addListener(A0,"dragstart",A);GEvent.addListener(A0,"dragend",AX)}d.addOverlay(A0);A0.hide();p.push(A0)}A1.marker=A0;A0._meraki_node=A1;A0.setLatLng(A1.latlng);A0.show()}if(A5){A5.hide();delete A5._meraki_node}if(A2&&!G){G=setTimeout(function(){if(G){G=null;AY()}},100)}}function AC(A2,A6,A1){if(!A2||!A2.n.gateway_route){return }var A7=A6.ctx,A4,A5,Az,A3={},A0={};A7.lineWidth=(A1?5:3);A7.lineCap="round";A7.lineJoin="miter";A7.strokeStyle=(A1?"rgba(119,142,233,0.8)":"rgba(215,110,211,0.8)");Az=A2.n.gateway_route.split(" ");A3=d.fromLatLngToDivPixel(A2.latlng);A7.beginPath();for(A4=0;A4<Az.length;++A4){A5=H[Az[A4]];if(A5){A0=d.fromLatLngToDivPixel(A5.latlng);AA(A7,A3,A0);
A3=A0}else{}}A7.stroke();if(A1){for(A4=0;A4<Az.length;++A4){if((A5=H[Az[A4]])){Ai(A5)}}}}function AA(A1,BB,BC){var A5=A1.lineWidth*2,A3=-A5-Ae,A7=Af+A5-Ae,Az=-A5-N,A6=u+A5-N,A2,BA,A0,A9,A8,BD,A4;if((BB.x>=A3)&&(BB.x<=A7)&&(BB.y>=Az)&&(BB.y<=A6)&&(BC.x>=A3)&&(BC.x<=A7)&&(BC.y>=Az)&&(BC.y<=A6)){A1.moveTo(BB.x,BB.y);A1.lineTo(BC.x,BC.y);return }if(BB.x==BC.x){if((BB.x<A3)||(BB.x>A7)){return }A2=A0=BB.x;BA=Math.max(Math.min(BB.y,BC.y),Az);A9=Math.min(Math.max(BB.y,BC.y),A6);A1.moveTo(A2,BA);A1.lineTo(A0,A9);return }if(BB.y==BC.y){if((BB.y<Az)||(BB.y>A6)){return }BA=A9=BB.y;A2=Math.max(Math.min(BB.x,BC.x),A3);A0=Math.min(Math.max(BB.x,BC.x),A7);A1.moveTo(A2,BA);A1.lineTo(A0,A9)}if(BC.x<BB.x){A4=BC;BC=BB;BB=A4}if((BB.x>A7)||(BC.x<A3)){return }A8=(BC.y-BB.y)/(BC.x-BB.x);BD=BC.y-(A8*BC.x);if((BB.x<A3)||(BB.y<Az)||(BB.y>A6)){A2=Math.max(BB.x,A3);BA=A8*A2+BD;if(BA<Az){BA=Az;A2=(BA-BD)/A8}else{if(BA>A6){BA=A6;A2=(BA-BD)/A8}}if((A2<A3)||(A2>A7)){return }}else{A2=BB.x;BA=BB.y}if((BC.x>A7)||(BC.y<Az)||(BC.y>A6)){A0=Math.min(BC.x,A7);A9=A8*A0+BD;if(A9<Az){A9=Az;A0=(A9-BD)/A8}else{if(A9>A6){A9=A6;A0=(A9-BD)/A8}}if((A0<A3)||(A0>A7)){console.log("oops!");assert(false)}}else{A0=BC.x;A9=BC.y}A1.moveTo(A2,BA);A1.lineTo(A0,A9)}function Q(A3,A0,A2,Az){if(!A3.latlng||!A2.containsLatLng(A3.latlng)||(!A3.disp&&Az)||!A3.img||!A3.img.shape){return false}var A5=d.fromLatLngToDivPixel(A3.latlng),A1=A3.img,A4=[A1.top_offset,A1.horiz_offset,A1.bot_offset,A1.horiz_offset];if(A3==w){A4[l]+=4}return A0.x>=A5.x-A4[3]&&A0.x<=A5.x+A4[1]&&A0.y>=A5.y-A4[0]&&A0.y<=A5.y+A4[2]}function Ak(A1){var A8,A9,A3,Az,A5,A2,A0,A7,A6,A4;A8=d.fromLatLngToDivPixel(A1);A9=new GPoint(A8.x-AP,A8.y+Av);A3=new GPoint(A8.x+AP,A8.y-Av);Az=new GLatLngBounds(d.fromDivPixelToLatLng(A9),d.fromDivPixelToLatLng(A3));A6=Az.getSouthWest().lat();A4=Az.getNorthEast().lat();for(A5=p.length-1;A5>=0;--A5){if((A0=p[A5]._meraki_node)&&Q(A0,A8,Az,false)){return A0}}A2=0,A0=Ay.length;while(A2<A0){A5=A2+((A0-A2)>>1);if(Ay[A5].latlng.lat()<A6){A2=A5+1
}else{A0=A5}}A7=[];A0=!AL.hoverAny;for(;A2<Ay.length&&Ay[A2].latlng.lat()<=A4;++A2){if(Q(Ay[A2],A8,Az,A0)){A7.push(Ay[A2])}}A7.sort(AO);return A7.length?A7[A7.length-1]:undefined}function t(Az){var A0=Az.xcanvas;if(A0){A0.style.visibility="hidden";A0.getContext("2d").clearRect(0,0,A0.width,A0.height)}if(!Az.empty){Az.unbegin();Az.canvas.style.left=(-Ae)+"px";Az.canvas.style.top=(-N)+"px";Az.canvas.style.visibility="visible";Az.xcanvas=Az.canvas;Az.canvas=A0}Az.empty=true}function T(A0,A1){var Az;if(A0||J){Az=++J;AJ=A0}if(A0){setTimeout(function(){if(J==Az){if(J>10000){J=0}AJ=0;if(A0==1){k(false)}else{if(A0==2){h()}else{if(A0==-1){D()}}}}},A1)}}function k(A0){var Az;if(AJ>0||(A0===true&&AE)){AR=Math.max((AE?50:25),Math.min(2*AR,200));T(1,AR);return }Au=0;AR=0;for(Az=0;Az<An.length;++Az){An[Az].count=0;An[Az].paused=null;if(!An[Az].nobuf){Z(An[Az])}An[Az].unbegin()}AF=[];h()}function AT(){var Az=d.getBounds(),A0;A0=new GPoint(-Ae-AP/2,-N+u+Av);Az.extend(d.fromDivPixelToLatLng(A0));A0=new GPoint(-Ae+Af+AP/2,-N);Az.extend(d.fromDivPixelToLatLng(A0));return Az}function h(){var A7,A6,A5,A4,BB,A2,A1,Az,A8,A3,BC,BA,A0,BD,A9;Az=d.getBounds().toSpan();A2=B*(Af/Az.lngRadians())*(u/Az.latRadians());A1=(A2<800?0:1);if(A1!==Aq.node_scalestep){Aq.node_scalestep=A1;for(A7 in H){A5=H[A7];A5.img=Al(A5.n);if(A5.highlight){S(A5)}}}Az=AT();A8=map3_bounds_expand(Az,1.1);BD=Ad.n;BD.begin();BC=[],BA=[];for(A7=0;A7<An.length;++A7){A9=An[A7];if(A9.disabled){continue}if(A9.noder){BC.push(A9)}if(A9.decorator){BA.push(A9)}if(A9.backgrounder&&A9.paused!==false){A9.paused=(A9.backgrounder.apply(A9,[A8,d,Aq])===true)}}A3=Math.max(50,AG.length/(250/10));for(;Au<AG.length;++Au){A4=AG[Au];A2=Az.containsLatLng(A4.latlng);if(A2){if(--A3<=0){break}if(!A4.img||!A4.img.shape){X.push(A4.img||true);continue}BB=d.fromLatLngToDivPixel(A4.latlng);if(!A4.disp&&!A0){A0=Ad.nbg;A0.begin()}A6=A4.disp?BD:A0;A6.empty=false;A6.ctx.drawImage(A4.img.image,BB.x-A4.img.horiz_offset,BB.y-A4.img.top_offset,A4.img.image.width,A4.img.image.height);
AF.push(A4)}A2=A2||A8.containsLatLng(A4.latlng);for(A6=0;A6<BA.length;++A6){if((A2||BA[A6].nobounds)&&(A4.disp||BA[A6].nodisp)){BA[A6].decorator.apply(BA[A6],[A4,A8,(A4.disp?BD:Ad.nbg),d,Aq])}}for(A6=0;A6<BC.length;++A6){if((A2||BC[A6].nobounds)&&(A4.disp||BC[A6].nodisp)&&!BC[A6].paused){A1=BC[A6].noder.apply(BC[A6],[A4,A8,d,Aq]);if(A1===true){BC[A6].paused=Au+1}}}}if(Au<AG.length){T(2,10)}else{A2=false;for(A7=0;A7<An.length;++A7){if(An[A7].nobuf||An[A7].disabled){continue}if(!An[A7].paused){t(An[A7])}else{A2=true}}AY();F=AF;if(A2){T(-1,75)}else{T(0)}}}function D(){var A1,A6,A0,A3,A5,A4,A2,Az;A2=AT();Az=map3_bounds_expand(A2,1.1);for(A6=0;A6<An.length;++A6){A0=An[A6];if(!A0.paused||A0.disabled){continue}if(A0.backgrounder){if(A0.backgrounder.apply(A0,[Az,d,Aq])===true){break}}else{for(A1=A0.paused;A1<AG.length;++A1){A3=AG[A1];A5=Az.containsLatLng(A3.latlng);if((A5||A0.nobounds)&&(A3.disp||A0.nodisp)){A4=A0.noder.apply(A0,[A3,Az,d,Aq]);if(A4===true){break}}}if(A1<AG.length-1){A0.paused=A1+1;break}}A0.paused=false;if(!A0.nobuf){t(A0)}}if(A6<An.length){T(-1,75)}else{T(0)}}Aq.num_visible=function(){return F.length};function Ai(A3){var A2=Ad.route,Az=A3.highlight,A1,A0;if(!Az||!Az.image||!Az.gicon){Az=A3.img}if(!Az||!Az.image||!Az.gicon){return }A1=d.fromLatLngToDivPixel(A3.latlng);A2.ctx.drawImage(Az.image,A1.x-Az.horiz_offset,A1.y-Az.top_offset,Az.image.width,Az.image.height);for(A0=0;A0<An.length;++A0){if(An[A0].decorator&&!An[A0].disabled){An[A0].decorator.apply(An[A0],[A3,null,A2,d,Aq])}}}function AY(){var Az,A0;if(G){clearTimeout(G);G=null}if(AL.pinned){Az=H[AL.pinned.id];delete AL.pinned;Ax(Az)}Z(Ad.route);if(M||(!Ao&&!Ap&&!U)){return }Ad.route.begin(true);if(Ao&&Ao!==Ap){AC(Ao,Ad.route,false)}if(Ap){AC(Ap,Ad.route,true)}for(A0=p.length-1;A0>=0;--A0){Az=p[A0];if(!Az.isHidden()&&Az._meraki_node&&Az._meraki_node!==Ao){Ai(Az._meraki_node)}}if(Ao){Ai(Ao)}Ad.route.show()}function AS(A2){var A0=A2.n.gateway_route?A2.n.gateway_route.split(" "):[],A1,Az;for(A1 in A0){if((Az=H[A0[A1]])){delete Az.in_pinned_route;
S(Az)}}d.closeInfoWindow()}function Ah(Az,A3){var A0,A1,A2,A4;if(A3&&Az&&AL.show3){if(!Az.disp){history3({n:Az.id})}return }if(A3&&Az&&Aa){if(Ap){AS(Ap);Ap=null;AY()}checkbox3.toggle(Az.n);S(Az);return }if(A3&&Az&&Ap==Az){history3({n:Az.id});return }A0=Ap;Ap=Az;if(A3){checkbox3.select(false)}for(A2=p.length-1;A2>=0;--A2){if((A4=p[A2]._meraki_node)){S(A4)}}if(A0){AS(A0)}if(Az){if(A3){checkbox3.toggle(Az.n,true)}S(Az)}if(Az&&!AL.show3){A1=Az.n.gateway_route?Az.n.gateway_route.split(" "):[];for(A2 in A1){if((A4=H[A1[A2]])){A4.in_pinned_route=true;S(A4)}}}AY()}function Ax(Az,A0){C=true;Ah(Az,A0);C=false}Aq.blur=function(){Aq.clear_tooltip();Ax(null,false)};function s(){var A0,Az;if(!C){for(A0 in H){Az=H[A0];if(!Az.highlight!==!Az.n.checked){S(Az,true)}}if(Ap){Ax(null,false)}}}checkbox3.bind(s);function g(A0){var Az;for(Az=0;Az<AG.length;++Az){if(AG[Az].id===A0){AG[Az].disp=false;AG.splice(Az,1);for(Az=0;Az<Ay.length;++Az){if(Ay[Az].id===A0){Ay.splice(Az,1);break}}Aq.refresh();break}}}function Ac(A0,Az){var A2,A3,A1=false,A4=false;if(Az.id){delete o[Az.id];if(Az["delete"]){g(Az.id);return }A3=H[Az.id];if(!A3){return }}if((Az.tags||Az["status#"])&&AN()){A1=true}if(!A1){for(A2 in AB){if(Az[A2]){A1=true;A4=A4||AB[A2]>1;break}}}if(A4){AN()}if(A1){Aq.refresh()}}AZ(document).bind("node_change",Ac);function Y(){var Az=d.getContainer(),A0;if(AZ("div.map3saveloc",Az).length==0){A0=AZ(Az).append("<div class='map3saveloc'><table class='table_map3saver'><tr><td class='td_map3saver'>Move saved.</td><td class='td_map3saver'><button class='b_map3saver undo'>Undo</button> &nbsp;<button class='b_map3saver ok'>OK</button></td></tr></table></div>");AZ("button.undo",A0).bind("click",W);AZ("button.ok",A0).bind("click",function(){I=[];GEvent.trigger(d,"meraki.move_done");AZ("div.map3saveloc",d.getContainer()).remove()})}}function z(A5,A4,A2,A3){var Az=H,A1=AL;function A0(A8){var A6,A9,A7;if(!A8||!A8.error){if(A4){I.push(A4);Y()}}else{if(!A4){return }A5=A4;A3=function(){e();Aq.refresh()}}for(A6=0;
A6<A5.length;++A6){A9=A5[A6];A7=Az[A9.node_id||A9.id];A1.apply_serialized_move(A7.n,A9);A7.latlng=A1.locator(A7.n)}if(A3){A3()}}if(!AL.move_url){return }if(A2){show_spinner_at_mouse_click(A2)}AZ.ajax({type:"POST",url:set_uri_param(AL.move_url,"move_version",new Date().getTime()/1000),contentType:"application/json",data:JSON.stringify(A5),success:A0,complete:(A2?hide_spinner_at_mouse_click:null)})}function W(A0){var Az=I[I.length-1];z(Az,null,A0,function(){e();Aq.refresh();I.pop();if(I.length==0){GEvent.trigger(d,"meraki.move_done");AZ("div.map3saveloc",d.getContainer()).remove()}})}function At(A1){var A2,A3,A0=[],Az=[];if(!AZ.isArray(A1)){A1=[A1]}for(A2=A1.length-1;A2>=0;--A2){A3=AL.serialize_move(A1[A2]);A0.push(A3.save);Az.push(A3.undo)}GEvent.trigger(d,"meraki.move_pending");z(A0,Az)}Aq.get_prefsmenu=function(){var A3=[{group:"Markers",name:"markers",value:"x",text:"Plain",pos:0,grouppos:-1}],A0={"":10000,Markers:-1},A2,A1,Az;for(A2=0;A2<An.length;++A2){Az=An[A2].prefsmenu;if(typeof Az==="function"){Az=Az(Aq,AI)}if(Az&&Az.length==null){Az=[Az]}for(A1=0;A1<(Az||[]).length;++A1){if(!A0.hasOwnProperty(Az[A1].group||"")){A0[Az[A1].group]=(Az[A1].prio==null?A3.length:Az[A1].prio)}A3.push(AZ.extend({pos:A3.length,grouppos:A0[Az[A1].group||""]},Az[A1]))}}A3.sort(function(A5,A4){return(A5.grouppos-A4.grouppos)||strcmp(A5.name,A4.name)||(A5.pos-A4.pos)});for(A2=0;A2<A3.length;){for(A1=A2+1;A1<A3.length&&A3[A1].name==A3[A2].name;++A1){}if(A1==A2+1&&(A3[A2].type||"radio")=="radio"){A3.splice(A2,1)}else{A2=A1}}return A3};Aq.change_prefs=function(){var Az;if(AG.length>0){for(Az=0;Az<An.length;++Az){if(An[Az].setprefs||An[Az].init){c(An[Az])}}n();Aq.refresh()}else{m()}v(300)};function v(Az){var A0=AL.prefs_key||"n."+Mkiconf.network_eid+"/map";if(json_select(Mkiconf.user_dashboard_prefs,A0)===AI){setTimeout(save_user_dashboard_prefs,Az,A0)}}function m(){var Az;if(AL.description_container){if(!AI.markers){Az="Map of clients per access point"}else{if(AI.markers=="h"){Az="Map of hops to gateway"
}else{Az="Access point map"}}AZ(AL.description_container).html(Az)}}Aq.enter=m;Aq.canvas_offset=function(){return{left:Ae,top:N}};Am(r,AL.displayed);d.addOverlay(Aq);GEvent.addListener(d,"click",function(A0,A1,Az){if(!A0){Ax(null,true)}});return Aq}function Map3PrefsGMapControl(B,A){this.map3=B;this.prefs=A}Map3PrefsGMapControl.prepare=function(){Map3PrefsGMapControl.sequencer=1;Map3PrefsGMapControl.prototype=new GControl();Map3PrefsGMapControl.prototype.initialize=function(B){var C=jQuery("<div class='gmap_button' style='width: 83px'><div class='gmap_button0'><div class='gmap_button1'><div class='gmap_button2'>Options<div class='gmap_menu_pointer'></div></div></div></div></div>"),A=this;C.mousedown(function(){if(A.prefform){A.blur()}else{A._render_prefsmenu(A.map3.get_prefsmenu());jQuery(A.button).addClass("gmap_buttondown")}});B.getContainer().appendChild(C[0]);return(this.button=C[0])};Map3PrefsGMapControl.prototype.blur=function(){if(this.prefform){jQuery(this.prefform).remove();this.prefform=null;jQuery(this.button).removeClass("gmap_buttondown");jQuery("body").unbind("click",this.blurprefform);this.blurprefform=null}};Map3PrefsGMapControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(7,32))};Map3PrefsGMapControl.prototype._make_prefsmenu_clicker=function(){var A=this;return function(C){var D,B;if((D=this.name)){if(this.value==""&&this.type=="checkbox"){B=this.checked?null:"1"}else{B=this.checked?this.value||null:null}if(jQuery(this).hasClass("maptype_specific")){A.prefs[D]=null;A.prefs[D+"."+(A.prefs.type||"Map")]=B}else{A.prefs[D]=B}A.map3.change_prefs()}C.stopPropagation()}};Map3PrefsGMapControl.prototype._prefsmenu_div_clicker=function(){jQuery(this).find("input")[0].click()};Map3PrefsGMapControl.prototype._render_prefsmenu=function(F){var E=[],D,H,C,A,G,B;D=jQuery(this.button).offset();E.push("<div style='position: absolute; visibility: hidden; top: "+(D.top+jQuery(this.button).outerHeight()-1)+"px; z-index: 1000;'><div class='dmenuctr map3pref'><div class='dmenuctr1'>");
A=Map3PrefsGMapControl.sequencer++;for(D=0;D<F.length;++D){C=F[D];if(C.group&&(D==0||C.group!=F[D-1].group)){E.push('<h3 class="'+(D==0?"dmenu_first":"dmenu")+'">'+C.group+"</h3>\n")}G="map3pref_"+A+"_"+D;B=C.name;E.push('<div class="dmenuitem"><input id="'+G+'" name="'+B+'" value="'+(C.value||"")+'"');if(C.type=="checkbox"){E.push(' type="checkbox"')}else{E.push(' type="radio"')}E.push(' class="dmenu');if(C.maptype_specific){E.push(" maptype_specific");B+="."+(this.prefs.type||"Map")}if(this.prefs[B]==C.value){E.push('" checked="checked')}E.push('" />&nbsp;<label for="'+G+'">'+C.text+"</label></div>")}E.push("</div></div></div>");H=jQuery(E.join(""));H.find("input, label").click(this._make_prefsmenu_clicker());H.find("div.dmenuitem").click(this._prefsmenu_div_clicker);jQuery("body")[0].appendChild(H[0]);position_horizontally_in_viewport(H,jQuery(this.button));H.css({visibility:"visible"}).click(function(I){I.stopPropagation()});this.blurprefform=(function(I){return function(){I.blur()}})(this);jQuery("body").click(this.blurprefform);this.prefform=H};delete Map3PrefsGMapControl.prepare};function make_map3(K,I){var U,L,S,C,A,Q,M={},O=0,N="gmap",D=[];K=jQuery.extend({},(typeof map3_settings==="object"?map3_settings:{}),K);(function(){var W=K.prefs_key||"n."+Mkiconf.network_eid+"/map",V="user_dashboard_prefs",X=V+"_saved";Mkiconf[V]=json_ensure(Mkiconf[V],W);Mkiconf[X]=json_ensure(Mkiconf[X],W);C=json_select(Mkiconf[V],W);if(!K.user_prefs){C=jQuery.extend(true,{},C);if(I.show3){C.markers="x"}}})();function T(W,X,Y,V){var Z;if(!M){return }if(!M[W]&&Y){M[W]={c:Y,dd:X,p:V}}if((Z=M[W])){if(X&&!Z.d){U.addControl(Z.c,Z.p);if(W==="overview"){Z.c.hide(true)}}else{if(!X&&Z.d){U.removeControl(Z.c);if(W==="dragzoom"){Z.c.remove()}}}Z.d=X;if(X!=null){Z.dd=X}}}function P(){var Z=0,V,X,W,Y=new GOverviewMapControl();for(V in GOverviewMapControl.prototype){++Z}if(O>0&&(Z>30||O>=50)){W=M.overview&&M.overview.d;X=!map3_type_is_custom(U)&&!K.minimal_controls;T("overview",X,Y);if(X&&!W){T("map_type",false)
}if(M&&(!M.map_type||!M.map_type.d)){T("map_type",true,new GMenuMapTypeControl())}}else{++O;setTimeout(P,100)}}function J(X){var a=map3_type_is_custom(U),f=a?"."+S.get_map_type():"",V,c,Y,Z,d,e;if(X&&A){return }A=true;function W(b){if(b.lat!=null&&b.lng!=null){Y=new GLatLng(b.lat,b.lng);V.extend(Y);return 1}else{return 0}}if(C["lat"+f]!=null&&C["lng"+f]!=null&&C["zoom"+f]!=null&&!I.show3){U.setCenter(new GLatLng(C["lat"+f],C["lng"+f]),C["zoom"+f])}else{if(a&&L){L.recenter()}else{V=new GLatLngBounds();Z=0;if(I.show3){e=I.displayed;for(c=0;e&&c<e.length;++c){Z+=W(e[c])}}if(!Z){e=nodes_hash;for(c in e){Z+=W(e[c])}}if(!Z){A=false;d=K.bounds||[];for(c=d.length-1;c>=0;--c){Y=new GLatLng(d[c][0],d[c][1]);V.extend(Y)}}map3_set_center(U,V)}}U.savePosition()}function G(){var V;V=jQuery.extend({},I,L?L.map_overlay_options():{},{});if(V.displayed){}else{if(typeof nodes_hash_filter!=="undefined"){V.displayed=nodes_hash_filter.results()}}if(!!Q){U.removeOverlay(Q)}Q=make_map3_overlay(U,nodes_hash,V,C);R()}function R(){var V;if((V=jQuery("#custom_maps_empty_message")).length){V.toggle(!!(L&&L.get_current_map()&&Q&&Q.displayed(true).length==0))}}function H(V,Y){var X=U.getMapTypes(),W,a,Z=Q;if(Y&&L){X=L.filter_types_to_display(X,Q.displayed())}if(!V){V=U.getCurrentMapType().getName(true)}a=X[0];for(W=0;W<X.length;++W){if(X[W].getName(false)==V||X[W].getName(true)==V){a=X[W];break}}if(a){Z.map_type_changing=true;U.setMapType(a);delete Z.map_type_changing}return U.getCurrentMapType()}function F(){C.type=U.getCurrentMapType().getName(true);if(C.type=="Map"){C.type=null}Q.change_prefs();if(M.dopts&&M.dopts.c){M.dopts.c.blur()}}function B(V){if(V!==N){N=V;P();T("scale",N=="gmap"||N=="floorplan_scale")}}function E(){var Z=jQuery(K.map_el),W,X,V,Y;if(!GBrowserIsCompatible()){alert("Sorry, the Google Maps API is not compatible with this browser");return }if((W=Z.width())<=0||(X=Z.height())<=0){setTimeout(E,10);return }U=new GMap2(Z[0]);U.addMapType(G_PHYSICAL_MAP);new GKeyboardHandler(U);if(C.lat==null&&C.lng==null&&C.zoom==null){C.lat=K.lat;
C.lng=K.lng;C.zoom=K.zoom}J();G();V=GEvent.addListener(U,"maptypechanged",F);D.push(V);V=GEvent.addListener(U,"meraki.maptype",B);D.push(V);T("small_nav",!!K.minimal_controls,new GSmallZoomControl());T("large_nav",!K.minimal_controls,new GLargeMapControl());P();T("dragzoom",!K.minimal_controls,make_DragZoomControl({},{backButtonEnabled:true,buttonStartingStyle:{display:"inline"},buttonHTML:'<img src="'+Mkiconf.images+'zoom-button.gif" alt="Zoom" title="Zoom to region" />',backButtonHTML:'<img src="'+Mkiconf.images+'zoom-button-out.gif" alt="Zoom out" title="Zoom back" />',buttonZoomingHTML:'<img src="'+Mkiconf.images+'zoom-button-activated.gif" alt="Zooming" />'},{}),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(80,7)));T("scale",!K.minimal_controls,new GScaleControl());if(Map3PrefsGMapControl.hasOwnProperty("prepare")){Map3PrefsGMapControl.prepare()}T("dopts",!K.minimal_controls,new Map3PrefsGMapControl(S,C));if(typeof (make_custom_map_manager)!=="undefined"){if(K.check_type_display){Y=Q.displayed()}L=make_custom_map_manager(S,Y);custom_map_placements.bind(G)}H(C.type||"Map",K.check_type_display)}S={get_gmap:function(){return U},recenter:J,blur:function(){if(Q){Q.blur()}if(M&&M.dopts&&M.dopts.c){M.dopts.c.blur()}},show_tooltip:function(){if(Q){Q.show_tooltip.apply(-1,arguments)}},refresh:function(){if(Q){Q.refresh.apply(-1,arguments)}},reposition:function(){if(Q){Q.reposition.apply(-1,arguments)}},num_visible:function(){return Q?Q.num_visible.apply(-1,arguments):0},get_prefsmenu:function(){return Q?Q.get_prefsmenu.apply(-1,arguments):{}},change_prefs:function(){return Q?Q.change_prefs.apply(-1,arguments):undefined},enter:function(V){if(U){U.checkResize()}if(V){H(V)}if(Q){Q.enter()}R()},destroy:function(){var V;if(Q){U.removeOverlay(Q)}if(L){L.stop();custom_map_placements.unbind(G)}for(V=(D?D.length:0)-1;V>=0;--V){GEvent.removeListener(D[V])}Q=L=D=M=S=null},rebuild_overlay:G,control:T,hide_controls:function(){for(var V in M||{}){T(V,null)}},show_controls:function(){for(var V in M||{}){T(V,M[V].dd)
}},get_map_type:function(){return U.getCurrentMapType().getName()},set_map_type:H};googleMapsLoad(E);return S}function map3_bounds_expand(D,B){var E,A=D.getCenter(),C=D.toSpan();E=new GLatLngBounds(D.getSouthWest(),D.getNorthEast());B*=0.5;E.extend(new GLatLng(A.lat()-C.lat()*B,A.lng()-C.lng()*B));E.extend(new GLatLng(A.lat()+C.lat()*B,A.lng()+C.lng()*B));return E}map3_set_center=(function(){var B=0,C=[];function A(G,D,F,E){return function(H){if("zoom" in H){C.push({latlng:D,zoom:H.zoom});if(B==E&&G.getCenter().equals(D)&&H.zoom<F){G.setCenter(D,H.zoom)}}}}return function(E,D,L){var G,J,I,H,F,M,O,K;++B;function N(P,S,Q,R){if(S<R){return Q}else{if(P-S/2<=Q-R/2&&P+S/2>=Q+R/2){return P}else{if(P-S/2>Q-R/2){return Q-R/2+S/2}else{return Q+R/2-S/2}}}}if(L){G=E.getBounds();if(G.containsBounds(D)){return }H=G.getCenter();J=G.toSpan();F=D.getCenter();I=D.toSpan();I=new GLatLng(I.lat()+J.lat()*0.08,I.lng()+J.lng()*0.08);E.setCenter(new GLatLng(N(H.lat(),J.lat(),F.lat(),I.lat()*1.2),N(H.lng(),J.lng(),F.lng(),I.lng()*1.2)),E.getZoom())}else{D=map3_bounds_expand(D,1.08);F=D.getCenter();M=E.getCurrentMapType();O=Math.min(E.getBoundsZoomLevel(D),M.getMaximumResolution());if((M==G_SATELLITE_MAP||M==G_HYBRID_MAP)&&M.getMaxZoomAtLatLng){for(K=0;K<C.length;++K){if(C[K].latlng.distanceFrom(F)<=10000){O=Math.min(C[K].zoom,O);break}}E.setCenter(F,O);if(K>=C.length){M.getMaxZoomAtLatLng(F,A(E,F,O,B))}}else{E.setCenter(F,O)}}}})();function map3_type_is_custom(B){var A=B.getCurrentMapType();return A!==G_NORMAL_MAP&&A!==G_SATELLITE_MAP&&A!==G_HYBRID_MAP&&A!==G_PHYSICAL_MAP};