egroupware/phpgwapi/js/jsapi.min.js
Hadi Nategh 784aa2c82f Mobile theme W.I.P:
- Fix view mode loads with wrong context
- Fix mail view actions
2016-03-03 14:10:08 +00:00

37 lines
876 KiB
JavaScript

/*!
* EGroupware (http://www.egroupware.org/) minified Javascript
*
* full sources are available under https://svn.stylite.de/viewvc/egroupware/
*
* build Thu Mar 03 2016 15:03:58
*/
function egw_insertJS(_html){if(_html){var in_pos=-1,out_pos=-1;do{var in_pos=_html.search(/<script/im),out_pos=_html.search(/<\/script>/im);if(in_pos>-1&&out_pos>-1){if(out_pos>in_pos){var scriptStart=_html.indexOf(">",in_pos);if(scriptStart>in_pos){var script=_html.substring(scriptStart+1,out_pos);try{var tag=document.createElement("script");tag.setAttribute("type","text/javascript"),tag.text=script,document.getElementsByTagName("head")[0].appendChild(tag)}catch(e){"undefined"!=typeof console&&"undefined"!=typeof console.log&&console.log("Error while inserting JS code:",_e)}}}_html=_html.substr(out_pos+9)}}while(in_pos>-1&&out_pos>-1)}}function egw_topWindow(){return"undefined"!=typeof window.parent&&"undefined"!=typeof window.parent.top?window.parent.top:"undefined"!=typeof window.opener&&"undefined"!=typeof window.opener.top?window.opener.top:window.top}function egw_appWindow(_app){var framework=egw_getFramework();return framework&&framework.egw_appWindow?framework.egw_appWindow(_app):window}function egw_appWindowOpen(_app,_url){"undefined"==typeof _url&&(_url="about:blank"),window.location=_url}function egw_getApp(_name){return window.parent.framework.getApplicationByName(_name)}function egw_getAppName(){return"undefined"==typeof egw_appName?"egroupware":egw_appName}function egw_refresh(_msg,_app,_id,_type,_targetapp,_replace,_with,_msg_type){egw(window).refresh(_msg,_app,_id,_type,_targetapp,_replace,_with,_msg_type)}function egw_message(_msg,_type){egw(window).message(_msg,_type)}function egw_app_header(_header,_app){egw(window).app_header(_header,_app)}function egw_open(id,app,type,extra,target){window.egw.open(id,app,type,extra,target)}function egw_set_checkbox_multiselect_enabled(_id,_enabled){var ms=document.getElementById("exec["+_id+"]");if(null!==ms){var label_color="";_enabled?(ms.style.backgroundColor="white",label_color="black"):(ms.style.backgroundColor="#EEEEEE",label_color="gray");for(var i=0;i<ms.childNodes.length;i++)"LABEL"==ms.childNodes[i].nodeName&&(ms.childNodes[i].style.color=label_color,ms.childNodes[i].childNodes.length>=1&&"INPUT"==ms.childNodes[i].childNodes[0].nodeName&&(ms.childNodes[i].childNodes[0].disabled=!_enabled,ms.childNodes[i].childNodes[0].checked&=_enabled))}}function egw_openWindowCentered2(_url,_windowName,_width,_height,_status,_app,_returnID){return egw(window).openPopup(_url,_width,_height,_windowName,_app,_returnID,_status)}function egw_openWindowCentered(_url,_windowName,_width,_height){return egw_openWindowCentered2(_url,_windowName,_width,_height,"no",!1,!0)}function egw_getWindowLeft(){try{if(is_mozilla)return window.screenX}catch(e){}return window.screenLeft}function egw_getWindowTop(){try{if(is_mozilla)return window.screenY}catch(e){}return window.screenTop-90}function egw_getWindowInnerWidth(){return is_mozilla?window.innerWidth:document.body.clientWidth}function egw_getWindowInnerHeight(){return is_mozilla?window.innerHeight:document.documentElement.clientHeight}function egw_getWindowOuterWidth(){try{if(is_mozilla)return window.outerWidth}catch(e){}return egw_getWindowInnerWidth()}function egw_getWindowOuterHeight(){try{if(is_mozilla)return window.outerHeight}catch(e){}return egw_getWindowInnerHeight()}function dropdown_menu_hack(el){function showMenu(){function selectMenu(obj){var o=document.createElement("option");for(o.value=obj.value,o.text=obj.innerHTML,o.text=o.text.replace("<NOBR>",""),o.text=o.text.replace("</NOBR>",""),""!=o.value&&(o.innerHTML=o.text);el.options.length>0;)el.options[0].removeNode(!0);el.appendChild(o),el.title=o.innerHTML,el.contentIndex=obj.selectedIndex,el.menu.hide(),el.onchange&&el.onchange()}el.menu.show(0,el.offsetHeight,10,10,el);var mb=el.menu.document.body;mb.style.cssText="border:solid 1px black;margin:0;padding:0;overflow-y:auto;overflow-x:auto;background:white;font:12px Tahoma, sans-serif;";var t=el.contentHTML;t=t.replace(/<select/gi,"<div"),t=t.replace(/<option/gi,"<span"),t=t.replace(/<\/option/gi,"</span"),t=t.replace(/<\/select/gi,"</div"),t=t.replace(/<optgroup label=\"([\w\s\wäöüßÄÖÜ]*[^>])*">/gi,'<span value="i-opt-group-lable-i">$1</span>'),t=t.replace(/<\/optgroup>/gi,'<span value="">---</span>'),mb.innerHTML=t,el.select=mb.all.tags("div")[0],el.select.style.cssText="list-style:none;margin:0;padding:0;",mb.options=el.select.getElementsByTagName("span");for(var i=0;i<mb.options.length;i++)mb.options[i].selectedIndex=i,mb.options[i].style.cssText="list-style:none;margin:0;padding:1px 2px;width/**/:100%;white-space:nowrap;","i-opt-group-lable-i"!=mb.options[i].value&&(mb.options[i].style.cssText=mb.options[i].style.cssText+"cursor:hand;cursor:pointer;"),mb.options[i].title=mb.options[i].innerHTML,mb.options[i].innerHTML="<nobr>"+mb.options[i].innerHTML+"</nobr>","i-opt-group-lable-i"==mb.options[i].value&&(mb.options[i].innerHTML="<b><i>"+mb.options[i].innerHTML+"</b></i>"),"i-opt-group-lable-i"!=mb.options[i].value&&(mb.options[i].onmouseover=function(){mb.options.selected&&(mb.options.selected.style.background="white",mb.options.selected.style.color="black"),mb.options.selected=this,this.style.background="#333366",this.style.color="white"}),mb.options[i].onmouseout=function(){this.style.background="white",this.style.color="black"},"i-opt-group-lable-i"!=mb.options[i].value&&(mb.options[i].onmousedown=function(){selectMenu(this)},mb.options[i].onkeydown=function(){selectMenu(this)}),i==el.contentIndex&&(mb.options[i].style.background="#333366",mb.options[i].style.color="white",mb.options.selected=mb.options[i]);var mw=Math.max(el.select.offsetWidth+22,el.offsetWidth+22);mw=Math.max(mw,mb.scrollWidth+22);var mh=15*mb.options.length+8,mx=ie5?-3:0,docW=document.documentElement.offsetWidth,sideW=docW-el.getBoundingClientRect().left;mw>sideW&&(mx=mx-mw+sideW-5);var my=el.offsetHeight-2;my+=5;var docH=document.documentElement.offsetHeight,bottomH=docH-el.getBoundingClientRect().bottom;mh=Math.min(mh,Math.max(docH-el.getBoundingClientRect().top-50,100)),mh>bottomH&&(mh=Math.max(bottomH-12,10),100>mh&&(my=-100),mh=Math.max(mh,100)),self.focus(),el.menu.show(mx,my,mw,mh,el),sync=null,mb.options.selected&&(mb.scrollTop=mb.options.selected.offsetTop),window.onresize=function(){el.menu.hide()}}function switchMenu(){if(event.keyCode)40==event.keyCode?el.contentIndex++:38==event.keyCode&&el.contentIndex--;else{if(!event.wheelDelta)return!0;event.wheelDelta>=120?el.contentIndex++:event.wheelDelta<=-120&&el.contentIndex--}el.contentIndex>el.contentOptions.length-1?el.contentIndex=0:el.contentIndex<0&&(el.contentIndex=el.contentOptions.length-1);var o=document.createElement("option");for(o.value=el.contentOptions[el.contentIndex].value,o.innerHTML=el.contentOptions[el.contentIndex].text;el.options.length>0;)el.options[0].removeNode(!0);el.appendChild(o),el.title=o.innerHTML}if(el.runtimeStyle){if("undefined"==typeof enable_ie_dropdownmenuhack)return;if(1!=enable_ie_dropdownmenuhack)return;if("none"==el.runtimeStyle.behavior.toLowerCase())return;if(el.runtimeStyle.behavior="none",1==el.multiple)return;if(el.size>1)return;var ie5=null==document.namespaces;if(el.ondblclick=function(e){return window.event.returnValue=!1,!1},null==window.createPopup){var fid="dropdown_menu_hack_"+Date.parse(new Date);window.createPopup=function(){if(null==window.createPopup.frameWindow){el.insertAdjacentHTML("MyFrame","<iframe id='"+fid+"' name='"+fid+"' src='about:blank' frameborder='1' scrolling='no'></></iframe>");var f=document.frames[fid];f.document.open(),f.document.write("<html><body></body></html>"),f.document.close(),f.fid=fid;var fwin=document.getElementById(fid);fwin.style.cssText="position:absolute;top:0;left:0;display:none;z-index:99999;",f.show=function(px,py,pw,ph,baseElement){py=py+baseElement.getBoundingClientRect().top+Math.max(document.body.scrollTop,document.documentElement.scrollTop),px=px+baseElement.getBoundingClientRect().left+Math.max(document.body.scrollLeft,document.documentElement.scrollLeft),fwin.style.width=pw+"px",fwin.style.height=ph+"px",fwin.style.posLeft=px,fwin.style.posTop=py,fwin.style.display="block"},f_hide=function(e){return window.event&&window.event.srcElement&&window.event.srcElement.tagName&&"select"==window.event.srcElement.tagName.toLowerCase()?!0:void(fwin.style.display="none")},f.hide=f_hide,document.attachEvent("onclick",f_hide),document.attachEvent("onkeydown",f_hide)}return f}}null==dropdown_menu_hack.menu&&(dropdown_menu_hack.menu=window.createPopup(),document.attachEvent("onkeydown",dropdown_menu_hack.menu.hide)),el.menu=dropdown_menu_hack.menu,el.contentOptions=new Array,el.contentIndex=el.selectedIndex,el.contentHTML=el.outerHTML;for(var i=0;i<el.options.length;i++)el.contentOptions[el.contentOptions.length]={value:el.options[i].value,text:el.options[i].innerHTML},el.options[i].selected||(el.options[i].removeNode(!0),i--);el.onkeydown=switchMenu,el.onclick=showMenu,el.onmousewheel=switchMenu}}function egw_link_handler(_link,_app){egw(window).link_handler(_link,_app)}function addOption(id,label,value,do_onchange){selectBox=document.getElementById(id);for(var i=0;i<selectBox.length;i++)if(selectBox.options[i].value==value){selectBox.options[i].selected=!0;break}i>=selectBox.length&&(do_onchange||(selectBox.length&&""==selectBox.options[0].value&&(selectBox.options[0]=null),selectBox.multiple=!0,selectBox.size=4),selectBox.options[selectBox.length]=new Option(label,value,!1,!0)),selectBox.onchange&&do_onchange&&selectBox.onchange()}function _egw_json_escape_string(input){for(var len=input.length,res="",i=0;len>i;i++)switch(input.charAt(i)){case'"':res+='\\"';break;case"\n":res+="\\n";break;case"\r":res+="\\r";break;case"\\":res+="\\\\";break;case"/":res+="\\/";break;case"\b":res+="\\b";break;case"\f":res+="\\f";break;case" ":res+="\\t";break;default:res+=input.charAt(i)}return res}function _egw_json_encode_simple(input){switch(input.constructor){case String:return'"'+_egw_json_escape_string(input)+'"';case Number:return input.toString();case Boolean:return input?"true":"false";default:return null}}function egw_json_encode(input){return egw.debug("warn","Function %s is deprecated, use egw.jsonEncode() instead",arguments.callee.name),egw.jsonEncode(input)}function egw_json_register_plugin(_callback,_context){egw.debug("warn","Function %s is deprecated",arguments.callee.name),"undefined"==typeof _context&&(_context=window),_egw_json_plugins[_egw_json_plugins.length]={callback:_callback,context:_context}}function _egw_json_plugin_handle(_type,_response,_context){for(var i=0;i<_egw_json_plugins.length;i++)try{var plugin=_egw_json_plugins[i],context=plugin.context;if(plugin.context||"undefined"==typeof _context||(context=_context),plugin.callback.call(context,_type,_response))return!0}catch(e){"undefined"!=typeof console&&console.log(e)}return!1}function egw_json_request(_menuaction,_parameters,_context){egw.debug("warn","Function %s is deprecated",arguments.callee.name),this.context=window.document,"undefined"!=typeof _context&&(this.context=_context),"undefined"!=typeof _parameters?this.parameters=_parameters:this.parameters=new Array,_menuaction.match(/json.php\?menuaction=[a-z_0-9]*\.[a-z_0-9]*\.[a-z_0-9]*/i)?this.url=_menuaction:this.url=this._assembleAjaxUrl(_menuaction),this.request=null,this.sender=null,this.callback=null,this.alertHandler=this.alertFunc,this.onLoadFinish=null,this.loadedJSFiles={},this.handleResponseDone=!1,this.app=null,window.egw_alertHandler&&(this.alertHandler=window.egw_alertHandler)}function _egw_json_debug_log(_msg,_e){"undefined"!=typeof console&&"undefined"!=typeof console.log&&console.log(_msg,_e)}function egw_json_getFormValues(_form,_filterClass){egw.debug("warn","Function %s is deprecated",arguments.callee.name);var elem=null;elem="object"==typeof _form?_form:document.getElementsByName(_form)[0];var serialized=new Object;return"undefined"!=typeof elem&&elem&&elem.childNodes&&("undefined"==typeof _filterClass&&(_filterClass=null),_egw_json_getFormValues(serialized,elem.childNodes,_filterClass)),serialized}function _egw_json_getFormValues(serialized,children,_filterClass){egw.debug("warn","Function %s is deprecated",arguments.callee.name);for(var i=0;i<children.length;++i){var child=children[i];"undefined"!=typeof child.childNodes&&_egw_json_getFormValues(serialized,child.childNodes,_filterClass),_filterClass&&!$j(child).hasClass(_filterClass)||"undefined"==typeof child.name||_egw_json_getFormValue(serialized,child)}}function _egw_json_getObjectLength(_obj){var res=0;for(key in _obj)_obj.hasOwnProperty(key)&&res++;return res}function _egw_json_getFormValue(serialized,child){if(!("undefined"==typeof child.name||child.disabled&&1==child.disabled||child.type&&("radio"==child.type||"checkbox"==child.type||"button"==child.type||"submit"==child.type)&&!child.checked)){var name=child.name,values=null;if("select-multiple"==child.type){values=new Array;for(var j=0;j<child.length;++j){var option=child.options[j];1==option.selected&&values.push(option.value)}}else values=child.value;var keyBegin=name.indexOf("[");if(keyBegin>=0){var n=name,k=n.substr(0,n.indexOf("[")),a=n.substr(n.indexOf("["));"undefined"==typeof serialized[k]&&(serialized[k]=new Object);for(var p=serialized;0!=a.length;){var sa=a.substr(0,a.indexOf("]")+1),lk=k,lp=p;a=a.substr(a.indexOf("]")+1),p=p[k],k=sa.substr(1,sa.length-2),""==k&&("select-multiple"==child.type?(k=lk,p=lp):k=_egw_json_getObjectLength(p)),"undefined"==typeof p[k]&&(p[k]=new Object)}p[k]=values}else"undefined"!=typeof values&&(serialized[name]=values)}}function dtmlXMLLoaderObject(a,b,c,d){return this.xmlDoc="",this.async="undefined"!=typeof c?c:!0,this.onloadAction=a||null,this.mainObject=b||null,this.waitCall=null,this.rSeed=d||!1,this}function callerFunction(a,b){return this.handler=function(c){return c||(c=window.event),a(c,b),!0}}function getAbsoluteLeft(a){return getOffset(a).left}function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){for(var b=0,c=0;a;)b+=parseInt(a.offsetTop),c+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:b,left:c}}function getOffsetRect(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,g=window.pageXOffset||d.scrollLeft||c.scrollLeft,f=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-f,k=b.left+g-h;return{top:Math.round(i),left:Math.round(k)}}function getOffset(a){return a.getBoundingClientRect?getOffsetRect(a):getOffsetSum(a)}function convertStringToBoolean(a){switch("string"==typeof a&&(a=a.toLowerCase()),a){case"1":case"true":case"yes":case"y":case 1:case!0:return!0;default:return!1}}function getUrlSymbol(a){return-1!=a.indexOf("?")?"&":"?"}function dhtmlDragAndDropObject(){return window.dhtmlDragAndDrop?window.dhtmlDragAndDrop:(this.dragStartObject=this.dragStartNode=this.dragNode=this.lastLanding=0,this.tempDOMM=this.tempDOMU=null,this.waitDrag=0,window.dhtmlDragAndDrop=this,this)}function j(){return this.catches||(this.catches=[]),this}function dhtmlXHeir(a,b){for(var c in b)"function"==typeof b[c]&&(a[c]=b[c]);return a}function dhtmlxEvent(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}function xmlPointer(data){this.d=data}function dhtmlXTreeObject(htmlObject,width,height,rootId){if(_isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e){}"object"!=typeof htmlObject?this.parentObject=document.getElementById(htmlObject):this.parentObject=htmlObject,this.parentObject.style.overflow="hidden",this._itim_dg=!0,this.dlmtr=",",this.dropLower=!1,this.enableIEImageFix(),this.xmlstate=0,this.mytype="tree",this.smcheck=!0,this.width=width,this.height=height,this.rootId=rootId,this.childCalc=null,this.def_img_x="18px",this.def_img_y="18px",this.def_line_img_x="18px",this.def_line_img_y="18px",this._dragged=new Array,this._selected=new Array,this.style_pointer="pointer",this._aimgs=!0,this.htmlcA=" [",this.htmlcB="]",this.lWin=window,this.cMenu=0,this.mlitems=0,this.iconURL="",this.dadmode=0,this.slowParse=!1,this.autoScroll=!0,this.hfMode=0,this.nodeCut=new Array,this.XMLsource=0,this.XMLloadingWarning=0,this._idpull={},this._pullSize=0,this.treeLinesOn=!0,this.tscheck=!1,this.timgen=!0,this.dpcpy=!1,this._ld_id=null,this._oie_onXLE=[],this.imPath=window.dhx_globalImgPath||"",this.checkArray=new Array("iconUncheckAll.gif","iconCheckAll.gif","iconCheckGray.gif","iconUncheckDis.gif","iconCheckDis.gif","iconCheckDis.gif"),this.radioArray=new Array("radio_off.gif","radio_on.gif","radio_on.gif","radio_off.gif","radio_on.gif","radio_on.gif"),this.lineArray=new Array("line2.gif","line3.gif","line4.gif","blank.gif","blank.gif","line1.gif"),this.minusArray=new Array("minus2.gif","minus3.gif","minus4.gif","minus.gif","minus5.gif"),this.plusArray=new Array("plus2.gif","plus3.gif","plus4.gif","plus.gif","plus5.gif"),this.imageArray=new Array("leaf.gif","folderOpen.gif","folderClosed.gif"),this.cutImg=new Array(0,0,0),this.cutImage="but_cut.gif",dhtmlxEventable(this),this.dragger=new dhtmlDragAndDropObject,this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this),this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none",this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow",this.allTree=this._createSelf(),this.allTree.appendChild(this.htmlNode.htmlNode),dhtmlx.$customScroll&&dhtmlx.CustomScroll.enable(this),_isFF&&(this.allTree.childNodes[0].width="100%",this.allTree.childNodes[0].style.overflow="hidden");var self=this;return this.allTree.onselectstart=new Function("return false;"),_isMacOS&&(this.allTree.oncontextmenu=function(e){return self._doContClick(e||window.event,!0)}),this.allTree.onmousedown=function(e){return self._doContClick(e||window.event)},this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,!0,this.no_cashe),_isIE&&this.preventIECashing(!0),window.addEventListener&&window.addEventListener("unload",function(){try{self.destructor()}catch(e){}},!1),window.attachEvent&&window.attachEvent("onunload",function(){try{self.destructor()}catch(e){}}),this.setImagesPath=this.setImagePath,this.setIconsPath=this.setIconPath,dhtmlx.image_path&&this.setImagePath(dhtmlx.image_path),dhtmlx.skin&&this.setSkin(dhtmlx.skin),this}function cObject(){return this}function dhtmlXTreeItemObject(itemId,itemText,parentObject,treeObject,actionHandler,mode){return this.htmlNode="",this.acolor="",this.scolor="",this.tr=0,this.childsCount=0,this.tempDOMM=0,this.tempDOMU=0,this.dragSpan=0,this.dragMove=0,this.span=0,this.closeble=1,this.childNodes=new Array,this.userData=new cObject,this.checkstate=0,this.treeNod=treeObject,this.label=itemText,this.parentObject=parentObject,this.actionHandler=actionHandler,this.images=new Array(treeObject.imageArray[0],treeObject.imageArray[1],treeObject.imageArray[2]),this.id=treeObject._globalIdStorageAdd(itemId,this),this.treeNod.checkBoxOff?this.htmlNode=this.treeNod._createItem(1,this,mode):this.htmlNode=this.treeNod._createItem(0,this,mode),this.htmlNode.objBelong=this,this}function jsonPointer(data,parent){this.d=data,this.dp=parent}function egwActionStoreJSON(_data,_obj,_setterOnly){for(var key in _data)"_"!=key.charAt(0)&&("function"==typeof _obj["set_"+key]?_obj["set_"+key](_data[key]):"undefined"==typeof _obj[key]||_setterOnly?"data"===_setterOnly&&("undefined"==typeof _data.data&&(_data.data={}),_data.data[key]=_data[key],_obj.set_data(_data.data)):_obj[key]=_data[key])}function egwSetBit(_set,_bit,_state){return _state?_set|=_bit:_set&=~_bit}function egwBitIsSet(_set,_bit){return(_set&_bit)>0}function egwObjectLength(_obj){var len=0;for(var k in _obj)len++;return len}function egwGetShiftState(e){var state=EGW_AO_SHIFT_STATE_NONE;return state=egwSetBit(state,EGW_AO_SHIFT_STATE_MULTI,e.ctrlKey||e.metaKey),state=egwSetBit(state,EGW_AO_SHIFT_STATE_BLOCK,e.shiftKey)}function egwPreventSelect(e){return egwGetShiftState(e)>EGW_AO_SHIFT_STATE_NONE?(this.onselectstart=function(){return!1},!1):!0}function egwResetPreventSelect(elem){}function egwUnfocus(){document.activeElement&&document.activeElement.blur()}function egwCallAbstract(_obj,_fn,_args){if(_fn)return _fn.apply(_obj,_args);throw"egw_action Exception: Abstract function call in JS code."}function egwArraysEqual(_ar1,_ar2){for(var result=_ar1.length==_ar2.length,i=0;i<_ar1.length;i++)result=result&&_ar1[i]==_ar2[i];return result}function egwQueueCallback(_proc,_args,_context,_id){if(_proc){var cur_id=0;cur_id="undefined"==typeof _egwQueuedCallbacks[_id]?_egwQueuedCallbacks[_id]=1:++_egwQueuedCallbacks[_id],window.setTimeout(function(){_egwQueuedCallbacks[_id]==cur_id&&(_proc.apply(_context,_args),delete _egwQueuedCallbacks[_id])},0)}}function egwEventQueue(){this.events={},this.key_id=0}function egwFnct(_context,_default,_acceptedTypes){"undefined"==typeof _context&&(_context=null),"undefined"==typeof _default&&(_default=!1),"undefined"==typeof _acceptedTypes&&(_acceptedTypes=["boolean"]),this.context=_context,this.acceptedTypes=_acceptedTypes,this.fnct=null,this.value=null,this.isDefault=!1,this.setValue(_default)}function egwIsMobile(){if(null==_egw_mobileBrowser){var ua=navigator.userAgent;_egw_mobileBrowser=ua.match(/iPhone/i)||ua.match(/iPad/i)||ua.match(/iPod/)||ua.match(/Android/i)||ua.match(/SymbianOS/i)}return _egw_mobileBrowser}function str_repeat(i,m){for(var o=[];m>0;o[--m]=i);return o.join("")}function sprintf(){for(var a,m,p,c,x,i=0,f=arguments[i++],o=[],s="";f;){if(m=/^[^\x25]+/.exec(f))o.push(m[0]);else if(m=/^\x25{2}/.exec(f))o.push("%");else{if(!(m=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)))throw'Invalid sprintf format "'+arguments[0]+'"';if(null==(a=arguments[m[1]||i++])||void 0==a)throw"Too few arguments.";if(/[^s]/.test(m[7])&&"number"!=typeof a)throw"Expecting number but found "+typeof a;switch(m[7]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a);break;case"e":a=m[6]?a.toExponential(m[6]):a.toExponential();break;case"f":a=m[6]?parseFloat(a).toFixed(m[6]):parseFloat(a);break;case"o":a="number"==typeof a?a.toString(8):JSON.stringify(a);break;case"s":a=(a=String(a))&&m[6]?a.substring(0,m[6]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}a=/[def]/.test(m[7])&&m[2]&&a>=0?"+"+a:a,c=m[3]?"0"==m[3]?"0":m[3].charAt(1):" ",x=m[5]-String(a).length-s.length,p=m[5]?str_repeat(c,x):"",o.push(s+(m[4]?a+p:p+a))}f=f.substring(m[0].length)}return o.join("")}function egw_getActionManager(_id,_create,_search_depth){"undefined"==typeof _create&&(_create=!0),"undefined"==typeof _search_depth&&(_search_depth=Number.MAX_VALUE);var res=egw_globalActionManager;return null==egw_globalActionManager&&(res=egw_globalActionManager=new egwActionManager),"undefined"!=typeof _id&&null!=_id&&(res=egw_globalActionManager.getActionById(_id,_search_depth),null==res&&_create&&(res=egw_globalActionManager.addAction("actionManager",_id))),res}function egw_getObjectManager(_id,_create,_search_depth){"undefined"==typeof _create&&(_create=!0),"undefined"==typeof _search_depth&&(_search_depth=Number.MAX_VALUE);var res=egw_globalObjectManager;return null==res&&(res=egw_globalObjectManager=new egwActionObjectManager("_egwGlobalObjectManager",egw_getActionManager())),"undefined"!=typeof _id&&null!=_id&&(res=egw_globalObjectManager.getObjectById(_id,_search_depth),null==res&&_create&&(res=new egwActionObjectManager(_id,egw_getActionManager(_id,!0,_search_depth)),egw_globalObjectManager.addObject(res))),res}function egw_getAppObjectManager(_create){return egw_getObjectManager(egw_getAppName(),_create,1)}function egw_getAppActionManager(_create){return egw_getActionManager(egw_getAppName(),_create,1)}function egwActionHandler(_executeEvent){this.execute=_executeEvent}function egwAction(_parent,_id,_caption,_iconUrl,_onExecute,_allowOnMultiple){if(_parent&&("string"!=typeof _id||!_id)&&"actionManager"!=_parent.type)throw"egwAction _id must be a non-empty string!";"undefined"==typeof _caption&&(_caption=""),"undefined"==typeof _iconUrl&&(_iconUrl=""),"undefined"==typeof _onExecute&&(_onExecute=null),"undefined"==typeof _allowOnMultiple&&(_allowOnMultiple=!0),this.id=_id,this.caption=_caption,this.iconUrl=_iconUrl,this.allowOnMultiple=_allowOnMultiple,this.enabled=new egwFnct(this,!0),this.hideOnDisabled=!1,this.data={},this.type="default",this.canHaveChildren=!1,this.parent=_parent,this.children=[],this.onExecute=new egwFnct(this,null,[]),null!==_onExecute&&this.set_onExecute(_onExecute),this.hideOnMobile=!1}function _egwActionTreeContains(_tree,_elem){for(var i=0;i<_tree.length;i++){if(_tree[i].action==_elem)return _tree[i];if("undefined"!=typeof _tree[i].children){var elem=_egwActionTreeContains(_tree[i].children,_elem);if(elem)return elem}}return null}function egwActionManager(_parent,_id){"undefined"==typeof _parent&&(_parent=null),"undefined"==typeof _id&&(_id=!1);var action=new egwAction(_parent,_id);return action.type="actionManager",action.canHaveChildren=!0,action}function egwActionImplementation(){this.doRegisterAction=function(){throw"Abstract function call: registerAction"},this.doUnregisterAction=function(){throw"Abstract function call: unregisterAction"},this.doExecuteImplementation=function(){throw"Abstract function call: executeImplementation"},this.type=""}function egwActionLink(_manager){this.enabled=!0,this.visible=!0,this.actionId="",this.actionObj=null,this.manager=_manager}function egwActionObject(_id,_parent,_iface,_manager,_flags){"undefined"==typeof _manager&&"object"==typeof _parent&&_parent&&(_manager=_parent.manager),"undefined"==typeof _flags&&(_flags=0),this.id=_id,this.parent=_parent,this.children=[],this.actionLinks=[],this.manager=_manager,this.flags=_flags,this.data=null,this.setSelectedCallback=null,this.registeredImpls=[],this.selectedChildren=[],this.focusedChild=null,this.setAOI(_iface)}function egwActionObjectInterface(){this.doGetDOMNode=function(){return null},this.doSetState=function(_state,_outerCall){},this.doTriggerEvent=function(_event,_data){return!1},this.doMakeVisible=function(){},this._state=EGW_AO_STATE_NORMAL||EGW_AO_STATE_VISIBLE,this.stateChangeCallback=null,this.stateChangeContext=null,this.reconnectActionsCallback=null,this.reconnectActionsContext=null}function egwActionObjectManager(_id,_manager){var ao=new egwActionObject(_id,null,new egwActionObjectInterface,_manager,EGW_AO_FLAG_IS_CONTAINER);return ao.triggerCallback=function(){return!1},ao}function egw_keycode_makeValid(_keyCode){var idx=EGW_VALID_KEYS.indexOf(_keyCode);return idx>=0?_keyCode:-1}function _egw_nodeIsInInput(_node){if(null!=_node&&_node!=document){var tagName=_node.tagName.toLowerCase();return"input"==tagName||"select"==tagName||"textarea"==tagName||"button"==tagName?!0:_egw_nodeIsInInput(_node.parentNode)}return!1}function egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt){return"_"+_keyCode+"_"+(_shift?"S":"")+(_ctrl?"C":"")+(_alt?"A":"")}function egw_registerGlobalShortcut(_keyCode,_shift,_ctrl,_alt,_handler,_context){var idx=egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt);egw_registeredShortcuts[idx]={handler:_handler,context:_context,shortcut:{keyCode:_keyCode,shift:_shift,ctrl:_ctrl,alt:_alt}}}function egw_unregisterGlobalShortcut(_keyCode,_shift,_ctrl,_alt){var idx=egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt);delete egw_registeredShortcuts[idx]}function egw_keyHandler(_keyCode,_shift,_ctrl,_alt){var idx=egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt);if("undefined"!=typeof egw_registeredShortcuts[idx]){var shortcut=egw_registeredShortcuts[idx],result=shortcut.handler.call(shortcut.context,shortcut.shortcut);if(result)return result}var appMgr=egw_getAppObjectManager(!1);if(appMgr){var focusedObject=appMgr.getFocusedObject();if(!focusedObject){for(var cntr=null,i=0;i<appMgr.children.length;i++){var child=appMgr.children[i];if(egwBitIsSet(EGW_AO_FLAG_DEFAULT_FOCUS,child.flags)){cntr=child;break}}cntr&&cntr.children.length>0&&(cntr.children[0].setFocused(!0),focusedObject=cntr.children[0])}if(focusedObject){var cntr=focusedObject.getContainerRoot(),handled=!1;return cntr&&(handled=cntr.handleKeyPress(_keyCode,_shift,_ctrl,_alt)),handled?handled:focusedObject.executeActionImplementation({keyEvent:{keyCode:_keyCode,shift:_shift,ctrl:_ctrl,alt:_alt}},"popup",EGW_AO_EXEC_SELECTED)}}return!1}function _egwGenMenuItem(_parent,_id,_caption,_iconUrl,_onClick){"undefined"==typeof _parent&&(_parent=null),"undefined"==typeof _id&&(_id=""),"undefined"==typeof _caption&&(_caption=""),"undefined"==typeof _iconUrl&&(_iconUrl=""),"undefined"==typeof _onClick&&(_onClick=null);var item=new egwMenuItem(_parent,_id);return item.set_caption(_caption),item.set_iconUrl(_iconUrl),item.set_onClick(_onClick),item}function _egwGenMenuStructure(_elements,_parent){for(var items=[],i=0;i<_elements.length;i++){var obj=_elements[i],item=new egwMenuItem(_parent,null);for(var key in obj)"children"==key&&obj[key].constructor===Array?item.children=_egwGenMenuStructure(obj[key],item):"id"!=key&&"caption"!=key&&"iconUrl"!=key&&"checkbox"!=key&&"checked"!=key&&"groupIndex"!=key&&"enabled"!=key&&"default"!=key&&"onClick"!=key&&"hint"!=key&&"shortcutCaption"!=key||item["set_"+key](obj[key]);items.push(item)}return items}function _egwSearchMenuItem(_elements,_id){for(var i=0;i<_elements.length;i++){if(_elements[i].id===_id)return _elements[i];var item=_egwSearchMenuItem(_elements[i].children,_id);if(item)return item}return null}function _egwSetMenuOnClick(_elements,_onClick){for(var i=0;i<_elements.length;i++)null===_elements[i].onClick&&(_elements[i].onClick=_onClick),_egwSetMenuOnClick(_elements[i].children,_onClick)}function egwMenu(){this.children=[],this.instance=null}function egwMenuItem(_parent,_id){this.id=_id,this.caption="",this.checkbox=!1,this.checked=!1,this.groupIndex=0,this.enabled=!0,this.iconUrl="",this.onClick=null,this.default=!1,this.data=null,this.shortcutCaption=null,this.children=[],this.parent=_parent}function egwPopupAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple){var action=new egwAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple);return action.type="popup",action.canHaveChildren=["popup"],action.default=!1,action.order=0,action.group=0,action.hint=!1,action.checkbox=!1,action.radioGroup=0,action.checked=!1,action.shortcut=null,action.set_default=function(_value){action.default=_value},action.set_order=function(_value){action.order=_value},action.set_group=function(_value){action.group=_value},action.set_hint=function(_value){action.hint=_value},action.set_checkbox=function(_value){action.checkbox=_value},action.set_checked=function(_value){action.checked=_value},action.set_radioGroup=function(_value){action.radioGroup=_value},action.set_shortcut=function(_value){if(_value){var sc={keyCode:-1,shift:!1,ctrl:!1,alt:!1};"object"==typeof _value&&"undefined"!=typeof _value.keyCode&&"undefined"!=typeof _value.caption&&(sc.keyCode=_value.keyCode,sc.caption=_value.caption,sc.shift="undefined"==typeof _value.shift?!1:_value.shift,sc.ctrl="undefined"==typeof _value.ctrl?!1:_value.ctrl,sc.alt="undefined"==typeof _value.alt?!1:_value.alt),this.shortcut=sc}else this.shortcut=!1},action}function getPopupImplementation(){return _popupActionImpl||(_popupActionImpl=new egwPopupActionImplementation),_popupActionImpl}function egwPopupActionImplementation(){var ai=new egwActionImplementation;return ai.type="popup",ai.auto_paste=!0,ai._registerDefault=function(_node,_callback,_context){var defaultHandler=function(e){if(egwIsMobile&&"A"==e.target.tagName)return!0;if("undefined"!=typeof document.selection&&"undefined"!=typeof document.selection.empty)document.selection.empty();else if("undefined"!=typeof window.getSelection){var sel=window.getSelection();sel.removeAllRanges()}return _callback.call(_context,"default",ai),e.stopPropagation(),e.cancelBubble=!0,_egw_active_menu&&1==e.which&&_egw_active_menu.hide(),!1};egwIsMobile()?$j(_node).bind("click",defaultHandler):_node.ondblclick=defaultHandler},ai._getDefaultLink=function(_links){var defaultAction=null;for(var k in _links)if(_links[k].actionObj.default&&_links[k].enabled){
defaultAction=_links[k].actionObj;break}return defaultAction},ai._searchShortcut=function(_key,_objs,_links){for(var i=0;i<_objs.length;i++){var sc=_objs[i].shortcut;if(sc&&sc.keyCode==_key.keyCode&&sc.shift==_key.shift&&sc.ctrl==_key.ctrl&&sc.alt==_key.alt&&"popup"==_objs[i].type&&("undefined"==typeof _links[_objs[i].id]||_links[_objs[i].id].enabled))return _objs[i];var obj=this._searchShortcut(_key,_objs[i].children,_links);if(obj)return obj}},ai._searchShortcutInLinks=function(_key,_links){var objs=[];for(var k in _links)_links[k].enabled&&objs.push(_links[k].actionObj);return ai._searchShortcut(_key,objs,_links)},ai._handleKeyPress=function(_key,_selected,_links,_target){if(_key.keyCode==EGW_KEY_ENTER&&!_key.ctrl&&!_key.shift&&!_key.alt){var defaultAction=this._getDefaultLink(_links);if(defaultAction)return defaultAction.execute(_selected),!0}if(_key.keyCode==EGW_KEY_MENU&&!_key.ctrl)return this.doExecuteImplementation({posx:0,posy:0},_selected,_links,_target);var obj=this._searchShortcutInLinks(_key,_links);return obj?(obj.execute(_selected),!0):!1},ai._registerContext=function(_node,_callback,_context){var contextHandler=function(e){if(egwIsMobile()&&(3==e.originalEvent.which,jQuery(".nm-mob-header .nm_action_header").toggleClass("back",_egw_active_menu)),e||(e=window.event),_egw_active_menu)_egw_active_menu.hide();else if(!e.ctrlKey&&3==e.which||0===e.which){var _xy=ai._getPageXY(e),_implContext={event:e,posx:_xy.posx,posy:_xy.posy};_callback.call(_context,_implContext,ai)}return e.cancelBubble=!e.ctrlKey||1==e.which,e.stopPropagation&&e.cancelBubble&&e.stopPropagation(),!e.cancelBubble};$j(_node).on("contextmenu",contextHandler)},ai.doRegisterAction=function(_aoi,_callback,_context){var node=_aoi.getDOMNode();return node?(this._registerDefault(node,_callback,_context),this._registerContext(node,_callback,_context),!0):!1},ai.doUnregisterAction=function(_aoi){},ai.doExecuteImplementation=function(_context,_selected,_links,_target){if("undefined"==typeof _target&&(_target=null),ai._context=_context,"object"==typeof _context&&"object"==typeof _context.keyEvent)return ai._handleKeyPress(_context.keyEvent,_selected,_links,_target);if("default"!=_context){if(("number"!=typeof _context.posx||"number"!=typeof _context.posy)&&"undefined"!=typeof _context.id){var node=_context;x=$j(node).offset().left,y=$j(node).offset().top,_context={posx:x,posy:y}}var menu=ai._buildMenu(_links,_selected,_target);return menu.showAt(_context.posx,_context.posy),!0}var defaultAction=ai._getDefaultLink(_links);return defaultAction&&defaultAction.execute(_selected),!1},ai._groupLayers=function(_layer,_links,_parentGroup){for(var link_groups={},i=0;i<_layer.children.length;i++){var actionObj=_layer.children[i].action,grp=actionObj.group;"undefined"==typeof link_groups[grp]&&(link_groups[grp]=[]);var visible=!0,enabled=!0;"undefined"!=typeof _links[actionObj.id]&&(visible=_links[actionObj.id].visible,enabled=_links[actionObj.id].enabled);for(var inserted=!1,groupObj={actionObj:actionObj,visible:visible,enabled:enabled,groups:[]},j=0;j<link_groups[grp].length;j++){var elem=link_groups[grp][j].actionObj;if(elem.order>actionObj.order){inserted=!0,link_groups[grp].splice(j,0,groupObj);break}}inserted||link_groups[grp].push(groupObj),_layer.children[i].children.length>0&&this._groupLayers(_layer.children[i],_links,groupObj)}var groups=[];for(var k in link_groups)groups.push({grp:k,links:link_groups[k]});groups.sort(function(a,b){var ia=parseInt(a.grp),ib=parseInt(b.grp);return ia>ib?1:ib>ia?-1:0});for(var groups2=[],i=0;i<groups.length;i++)groups2.push(groups[i].links);_parentGroup.groups=groups2},ai._buildMenuLayer=function(_menu,_groups,_selected,_enabled,_target){for(var firstGroup=!0,i=0;i<_groups.length;i++){for(var firstElem=!0,j=0;j<_groups[i].length;j++){var link=_groups[i][j];if(link.visible){!firstGroup&&firstElem&&_menu.addItem("","-"),firstElem=!1;var item=_menu.addItem(link.actionObj.id,link.actionObj.caption,link.actionObj.iconUrl);if(item.default=link.actionObj.default,"popup"==link.actionObj.type&&(item.set_hint(link.actionObj.hint),item.set_checkbox(link.actionObj.checkbox),item.set_checked(link.actionObj.checked),item.set_groupIndex(link.actionObj.radioGroup),link.actionObj.shortcut)){var sc=link.actionObj.shortcut;item.set_shortcutCaption(sc.caption)}item.set_data(link.actionObj),link.enabled&&_enabled?item.set_onClick(function(elem){return elem.data.menu_context=ai._context,"undefined"!=typeof elem.data.checked&&(elem.data.checked=elem.checked),elem.data.execute(_selected,_target),"undefined"!=typeof elem.data.checkbox&&elem.data.checkbox?elem.data.checked:void 0}):item.set_enabled(!1),link.groups&&this._buildMenuLayer(item,link.groups,_selected,link.enabled,_target)}}firstGroup=firstGroup&&firstElem}},ai._buildMenu=function(_links,_selected,_target){var tree={root:[]};this.auto_paste&&this._addCopyPaste(_links,_selected);for(var k in _links)_links[k].actionObj.appendToTree(tree);var groups={groups:[]};tree.root.length>0&&this._groupLayers(tree.root[0],_links,groups);var menu=new egwMenu;return this._buildMenuLayer(menu,groups.groups,_selected,!0,_target),menu},ai._getPageXY=function(event){var scrollTop=document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop,scrollLeft=document.body.scrollLeft?document.body.scrollLeft:document.documentElement.scrollLeft;return{posx:event.clientX+scrollLeft,posy:event.clientY+scrollTop}},ai._addCopyPaste=function(_links,_selected){var drag=_selected[0].getSelectedLinks("drag").links,drop=_selected[0].getSelectedLinks("drop").links;if(drag&&!jQuery.isEmptyObject(drag)||drop&&!jQuery.isEmptyObject(drop)){var mgr=_selected[0].manager,copy_action=mgr.getActionById("egw_copy"),add_action=mgr.getActionById("egw_copy_add"),clipboard_action=mgr.getActionById("egw_os_clipboard"),paste_action=mgr.getActionById("egw_paste");if(this._context.event){var ui={position:{top:0,left:0},offset:{top:0,left:0}},event=this._context.event.originalEvent;ui.position={top:event.pageY,left:event.pageX},ui.offset={top:event.offsetY,left:event.offsetX}}if(drag&&!jQuery.isEmptyObject(drag)){null==copy_action&&(copy_action=mgr.addAction("popup","egw_copy",egw.lang("Copy to clipboard"),egw.image("copy"),function(action,selected){var clipboard={type:[],selected:[]};for(var k in drag)drag[k].enabled&&drag[k].actionObj.dragType.length>0&&(clipboard.type=clipboard.type.concat(drag[k].actionObj.dragType));clipboard.type=jQuery.unique(clipboard.type);for(var k in selected)selected[k].id&&clipboard.selected.push({id:selected[k].id,data:selected[k].data});egw.setSessionItem("phpgwapi","egw_clipboard",JSON.stringify(clipboard))},!0),copy_action.group=2.5),null==add_action&&(add_action=mgr.addAction("popup","egw_copy_add",egw.lang("Add to clipboard"),egw.image("copy"),function(action,selected){var clipboard=JSON.parse(egw.getSessionItem("phpgwapi","egw_clipboard"))||{type:[],selected:[]};for(var k in drag)drag[k].enabled&&drag[k].actionObj.dragType.length>0&&(clipboard.type=clipboard.type.concat(drag[k].actionObj.dragType));clipboard.type=jQuery.unique(clipboard.type);for(var k in selected)selected[k].id&&clipboard.selected.push({id:selected[k].id,data:selected[k].data});egw.setSessionItem("phpgwapi","egw_clipboard",JSON.stringify(clipboard))},!0),add_action.group=2.5),null==clipboard_action&&(clipboard_action=mgr.addAction("popup","egw_os_clipboard",egw.lang("Copy to OS clipboard"),egw.image("copy"),function(action){document.queryCommandSupported("copy")&&$j(action.data.target).trigger("copy")},!0),clipboard_action.group=2.5);var os_clipboard_caption=this._context.event.originalEvent.target.innerHTML.trim();clipboard_action.set_caption(egw.lang('Copy "%1"',os_clipboard_caption.length>20?os_clipboard_caption.substring(0,20)+"...":os_clipboard_caption)),clipboard_action.data.target=this._context.event.originalEvent.target,$j(clipboard_action.data.target).off("copy").on("copy",function(event){var target=$j(clipboard_action.data.target),old_select=target.css("user-select");target.css("user-select","all");var range=document.createRange();range.selectNode(clipboard_action.data.target),window.getSelection().removeAllRanges(),window.getSelection().addRange(range),target.css("user-select",old_select);var successful=!1;try{"undefined"!=typeof event.target.setActive&&window.clipboardData&&window.clipboardData.setData("Text",$j(clipboard_action.data.target).text().trim()),event.clipboardData&&(event.clipboardData.setData("text/plain",$j(clipboard_action.data.target).text().trim()),event.clipboardData.setData("text/html",$j(clipboard_action.data.target).html())),egw.message(egw.lang("Use Ctrl-C/Cmd-C to copy")),successful=document.execCommand("copy")}catch(err){}return successful?(egw.message(""),window.getSelection().removeAllRanges(),target.css("user-select",old_select),!1):void 0}),"undefined"==typeof _links[copy_action.id]&&(_links[copy_action.id]={actionObj:copy_action,enabled:!0,visible:!0,cnt:0}),"undefined"==typeof _links[add_action.id]&&(_links[add_action.id]={actionObj:add_action,enabled:!0,visible:!0,cnt:0}),"undefined"==typeof _links[clipboard_action.id]&&(_links[clipboard_action.id]={actionObj:clipboard_action,enabled:os_clipboard_caption.length>0,visible:os_clipboard_caption.length>0,cnt:0})}if(drop&&!jQuery.isEmptyObject(drop)){var paste_exec=function(action,selected){var clipboard=JSON.parse(egw.getSessionItem("phpgwapi","egw_clipboard"));drop[action.id].actionObj.ui=ui,drop[action.id].actionObj.paste=!0,drop[action.id].actionObj.execute(clipboard.selected,selected[0]),drop[action.id].actionObj.paste=!1},clipboard=JSON.parse(egw.getSessionItem("phpgwapi","egw_clipboard"))||{type:[],selected:[]};null==paste_action&&(paste_action=mgr.addAction("popup","egw_paste",egw.lang("Paste"),egw.image("editpaste"),paste_exec,!0),paste_action.group=2.5,paste_action.order=9,paste_action.canHaveChildren.push("drop"));var hint=egw.lang("Clipboard")+":\n["+clipboard.type.join(",")+"]\n";paste_action.set_hint(hint);for(var i=0;i<clipboard.selected.length;i++){var id=clipboard.selected[i].id.split("::");egw.link_title(id[0],id[1],function(title){title&&(this.hint+=title+"\n")},paste_action)}for("undefined"==typeof _links[paste_action.id]&&(_links[paste_action.id]={actionObj:paste_action,enabled:!1,visible:null!=clipboard,cnt:0});paste_action.children.length>0;)paste_action.children[0].remove();if(null==clipboard||"object"!=typeof clipboard.type)return;for(var k in drop){var drop_clone=jQuery.extend({},drop[k].actionObj);drop_clone.parent=paste_action,drop_clone.onExecute=new egwFnct(this,null,[]),drop_clone.set_onExecute(paste_exec),paste_action.children.push(drop_clone),paste_action.allowOnMultiple=paste_action.allowOnMultiple&&drop_clone.allowOnMultiple,_links[k]=jQuery.extend({},drop[k]),_links[k].actionObj=drop_clone,_links[k].enabled=!1,_links[k].visible=!1;for(var i=0;i<drop_clone.acceptedTypes.length;i++)if(-1!=clipboard.type.indexOf(drop_clone.acceptedTypes[i])){_links[paste_action.id].enabled=!0,_links[k].enabled=!0,_links[k].visible=!0;break}}}}},ai}function egwDragAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple){var action=new egwAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple);return action.type="drag",action.dragType="default",action.hideOnDisabled=!0,action.set_dragType=function(_value){action.dragType=_value},action}function getDragImplementation(){return _dragActionImpl||(_dragActionImpl=new egwDragActionImplementation),_dragActionImpl}function egwDragActionImplementation(){var ai=new egwActionImplementation;return ai.type="drag",ai.helper=null,ai.ddTypes=[],ai.selected=[],ai.defaultDDHelper=function(_selected){for(var table=$j(document.createElement("table")).addClass("egwGridView_grid et2_egw_action_ddHelper_row"),moreRow=$j(document.createElement("tr")).addClass("et2_egw_action_ddHelper_moreRow"),div=$j(document.createElement("div")).append(table),rows=[],maxRows=3,itemLabel=egw.lang(egw.link_get_registry(egw.app_name(),_selected.length>1?"entries":"entry")||egw.app_name()),index=0,i=0;i<_selected.length;i++){var row=$j(_selected[i].iface.getDOMNode()).clone();if(row&&(rows.push(row),table.append(row)),index++,index==maxRows){var spanCnt=$j(document.createElement("span")).addClass("et2_egw_action_ddHelper_itemsCnt").appendTo(div);spanCnt.text(_selected.length+" "+itemLabel);var restRows=_selected.length-maxRows;restRows&&moreRow.text(_selected.length-maxRows+" "+egw.lang("more %1 selected ...",itemLabel)),table.append(moreRow);break}}var text=$j(document.createElement("div")).addClass("et2_egw_action_ddHelper_tip");if(div.append(text),"draggable"in document.createElement("span")&&navigator&&navigator.userAgent.indexOf("Chrome")>=0&&"filemanager"==egw.app_name()){var key=["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform)<0?egw.lang("Alt"):egw.lang("Command ⌘");text.text(egw.lang("Hold [%1] and [%2] key to drag %3 to your desktop",key,egw.lang("Shift ⇧"),itemLabel))}return div},ai.doRegisterAction=function(_aoi,_callback,_context){var node=_aoi.getDOMNode();if(node){if(node.onselectstart=function(){return!1},!(window.FileReader&&"draggable"in document.createElement("span")))return;var action=null,groups=_context.getActionImplementationGroups();if(!groups.drag)return;for(var i=0;i<groups.drag.length;i++)if("file"==groups.drag[i].link.actionObj.dragType||groups.drag[i].link.actionObj.dragType.indexOf("file")>-1){action=groups.drag[i].link.actionObj;break}return action?(jQuery.event.props.push("dataTransfer"),$j(node).off("mousedown").on("mousedown",function(event){var dragOut=_context.isDragOut(event);if($j(this).attr("draggable",dragOut?"true":""),$j(node).draggable("option","disabled",dragOut),dragOut)$j(node).removeClass("ui-draggable-disabled ui-state-disabled");else if(_context.isSelection(event)?($j(node).draggable("disable"),$j(node).removeClass("ui-draggable-disabled ui-state-disabled")):3!=event.which&&document.getSelection().removeAllRanges(),!dragOut||!this.addEventListener)return}).on("mouseup",function(event){_context.isSelection(event)&&$j(node).draggable("enable")}).on("dragstart",function(event){if(!_context.isSelection(event)&&null!=event.dataTransfer){event.dataTransfer.effectAllowed="copy";var selected=[_context];_context.parent.setAllSelected(!1),_context.setSelected(!0);for(var i=0;i<selected.length;i++){var data=selected[i].data||egw.dataGetUIDdata(selected[i].id).data||{};if(data&&data.mime&&data.download_url){var url=data.download_url;"/"==url[0]&&(url=egw.link(url)),"/"==url[0]&&(url=window.location.origin+url),navigator&&navigator.userAgent.indexOf("Chrome")?event.dataTransfer.setData("DownloadURL",data.mime+":"+data.name+":"+url):event.dataTransfer.setData("text/uri-list",url)}}if(0==event.dataTransfer.types.length)return void event.preventDefault();_callback.call(_context,_context,ai),$j("body").append(ai.helper),event.dataTransfer.setDragImage(ai.helper[0],-12,-12)}}).on("drag",function(e){null!=e.dataTransfer&&ai.helper.remove()})):$j(node).off("mousedown").on({mousedown:function(event){_context.isSelection(event)?($j(node).draggable("disable"),$j(node).removeClass("ui-draggable-disabled ui-state-disabled")):3!=event.which&&document.getSelection().removeAllRanges()},mouseup:function(){$j(node).draggable("enable"),$j("body").css({cursor:"auto"})}}),$j(node).draggable({distance:20,cursor:"move",cursorAt:{top:-12,left:-12},helper:function(e){return _callback.call(_context,!1,ai),$j(node).data("ddTypes",ai.ddTypes),$j(node).data("selected",ai.selected),ai.helper?(ai.helper.addClass("et2_egw_action_ddHelper"),$j("body").append(ai.helper),ai.helper):ai.defaultDDHelper(ai.selected)},start:function(e){var $target=$j(e.originalEvent.target);return e.originalEvent.pageX-$target.offset().left+15>$target.innerWidth()?!1:null!=ai.helper},revert:function(valid){var dTarget=this;if(valid)return!1;var tipTelorance=10,helperTop=ai.helper.position().top;if(helperTop>=dTarget.offset().top&&helperTop<=dTarget.height()+dTarget.offset().top+tipTelorance){var key=["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform)<0?egw.lang("Ctrl"):egw.lang("Command ⌘");egw.message(egw.lang("Hold [%1] key to select text eg. to copy it",key),"info")}return!0},refreshPositions:!0,scroll:!1,iframeFix:!0,delay:300}),!0}return!1},ai.doUnregisterAction=function(_aoi){var node=_aoi.getDOMNode();node&&$j(node).data("uiDraggable")&&$j(node).draggable("destroy")},ai.doExecuteImplementation=function(_context,_selected,_links){this.helper=null;var hasLink=!1;this.ddTypes=[],this.selected=_selected;for(var k in _links)if(_links[k].visible){hasLink=!0,!this.helper&&_links[k].actionObj.onExecute.hasHandler()&&(this.helper=_links[k].actionObj.execute(_selected));for(var type=$j.isArray(_links[k].actionObj.dragType)?_links[k].actionObj.dragType:[_links[k].actionObj.dragType],i=0;i<type.length;i++)-1==this.ddTypes.indexOf(type[i])&&this.ddTypes.push(type[i])}return!this.helper&&hasLink&&(this.helper=ai.defaultDDHelper(_selected)),!0},ai}function egwDropAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple){var action=new egwAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple);return action.type="drop",action.acceptedTypes=["default"],action.canHaveChildren=["drag","popup"],action.default=!1,action.order=0,action.group=0,action.set_default=function(_value){action.default=_value},action.set_order=function(_value){action.order=_value},action.set_group=function(_value){action.group=_value},action.set_acceptedTypes=function(_value){_value instanceof Array?action.acceptedTypes=_value:action.acceptedTypes=[_value]},action}function getDropImplementation(){return _dropActionImpl||(_dropActionImpl=new egwDropActionImplementation),_dropActionImpl}function egwDropActionImplementation(){var ai=new egwActionImplementation;return ai.type="drop",ai.doRegisterAction=function(_aoi,_callback,_context){var node=_aoi.getDOMNode(),self=this;return node?($j(node).droppable({accept:function(_draggable){if("undefined"!=typeof _draggable.data("ddTypes")){for(var accepted=self._fetchAccepted(_callback.call(_context,"links",self,EGW_AO_EXEC_THIS)),ddTypes=_draggable.data("ddTypes"),i=0;i<ddTypes.length;i++)if(-1!=accepted.indexOf(ddTypes[i]))return!0;return!1}},drop:function(event,ui){var draggable=ui.draggable,ddTypes=draggable.data("ddTypes"),selected=draggable.data("selected"),links=_callback.call(_context,"links",self,EGW_AO_EXEC_THIS);for(var k in links){for(var accepted=links[k].actionObj.acceptedTypes,enabled=!1,i=0;i<ddTypes.length;i++)if(-1!=accepted.indexOf(ddTypes[i])){enabled=!0;break}!links[k].actionObj.allowOnMultiple&&selected.length>1&&(enabled=!1),enabled||(links[k].enabled=!1,links[k].visible=!links[k].actionObj.hideOnDisabled)}var cnt=0,lnk=null;for(var k in links)links[k].enabled&&links[k].visible&&(lnk=links[k],cnt+=1+links[k].actionObj.children.length,lnk.actionObj.ui=ui);if(1==cnt&&window.setTimeout(function(){lnk.actionObj.execute(selected,_context)},0),cnt>1){var popup=getPopupImplementation(),pos=popup._getPageXY(event.originalEvent);popup.auto_paste=!1,window.setTimeout(function(){popup.doExecuteImplementation(pos,selected,links,_context),popup.auto_paste=!0},0)}$j("body").css({cursor:"auto"}),_aoi.triggerEvent(EGW_AI_DRAG_OUT,{event:event,ui:ui})},over:function(event,ui){_aoi.triggerEvent(EGW_AI_DRAG_OVER,{event:event,ui:ui})},out:function(event,ui){_aoi.triggerEvent(EGW_AI_DRAG_OUT,{event:event,ui:ui})},tolerance:"pointer",hoverClass:"drop-hover",greedy:!0}),!0):!1},ai.doUnregisterAction=function(_aoi){var node=_aoi.getDOMNode();node&&$j(node).data("uiDroppable")&&$j(node).droppable("destroy")},ai._fetchAccepted=function(_links){var accepted=[];for(var k in _links)for(var i=0;i<_links[k].actionObj.acceptedTypes.length;i++){var type=_links[k].actionObj.acceptedTypes[i];-1==accepted.indexOf(type)&&accepted.push(type)}return accepted},ai.doExecuteImplementation=function(_context,_selected,_links){return"links"==_context?_links:void 0},ai}function dhtmlxTree_getNode(_tree,_itemId){var node=_tree._globalIdStorageFind(_itemId);return null!=node?$j("tr:first",node.htmlNode):void 0}function dhtmlxtreeItemAOI(_tree,_itemId){var aoi=new egwActionObjectInterface;return aoi.node=dhtmlxTree_getNode(_tree,_itemId),aoi.id=_itemId,aoi.doGetDOMNode=function(){return aoi.node},aoi.doTriggerEvent=function(_event){_event==EGW_AI_DRAG_OVER&&$j(this.node).addClass("draggedOver"),_event==EGW_AI_DRAG_OUT&&$j(this.node).removeClass("draggedOver")},aoi.doSetState=function(_state){_tree&&_tree.focusItem&&(egwBitIsSet(_state,EGW_AO_STATE_FOCUSED)&&_tree.focusItem(this.id),egwBitIsSet(_state,EGW_AO_STATE_SELECTED)&&_tree.selectItem(this.id,!1))},aoi}function dhtmlXMenuObject(baseId,skin){var main_self=this;if(this.addBaseIdAsContextZone=null,this.isDhtmlxMenuObject=!0,this.skin=null!=skin?skin:"undefined"!=typeof dhtmlx&&"string"==typeof dhtmlx.skin?dhtmlx.skin:"dhx_skyblue",this.imagePath="",this._isIE6=!1,_isIE&&(this._isIE6=null==window.XMLHttpRequest),null==baseId)this.base=document.body;else{var baseObj="string"==typeof baseId?document.getElementById(baseId):baseId;if(null!=baseObj){for(this.base=baseObj,this.base.id||(this.base.id=(new Date).valueOf());this.base.childNodes.length>0;)this.base.removeChild(this.base.childNodes[0]);this.base.className+=" dhtmlxMenu_"+this.skin+"_Middle dir_left",this.base._autoSkinUpdate=!0,this.base.oncontextmenu&&(this.base._oldContextMenuHandler=this.base.oncontextmenu),this.addBaseIdAsContextZone=this.base.id,this.base.onselectstart=function(e){return e=e||event,e.returnValue=!1,!1},this.base.oncontextmenu=function(e){return e=e||event,e.returnValue=!1,!1}}else this.base=document.body}if(this.topId="dhxWebMenuTopId",!this.extendedModule){for(var t=function(){alert(this.i18n.dhxmenuextalert)},extMethods=new Array("setItemEnabled","setItemDisabled","isItemEnabled","_changeItemState","getItemText","setItemText","loadFromHTML","hideItem","showItem","isItemHidden","_changeItemVisible","setUserData","getUserData","setOpenMode","setWebModeTimeout","enableDynamicLoading","_updateLoaderIcon","getItemImage","setItemImage","clearItemImage","setAutoShowMode","setAutoHideMode","setContextMenuHideAllMode","getContextMenuHideAllMode","setVisibleArea","setTooltip","getTooltip","setHotKey","getHotKey","setItemSelected","setTopText","setRTL","setAlign","setHref","clearHref","getCircuit","_clearAllSelectedSubItemsInPolygon","_checkArrowsState","_addUpArrow","_addDownArrow","_removeUpArrow","_removeDownArrow","_isArrowExists","_doScrollUp","_doScrollDown","_countPolygonItems","setOverflowHeight","_getRadioImgObj","_setRadioState","_radioOnClickHandler","getRadioChecked","setRadioChecked","addRadioButton","_getCheckboxState","_setCheckboxState","_readLevel","_updateCheckboxImage","_checkboxOnClickHandler","setCheckboxState","getCheckboxState","addCheckbox","serialize"),q=0;q<extMethods.length;q++)this[extMethods[q]]||(this[extMethods[q]]=t);extMethods=null}return this.fixedPosition=!1,this.menuSelected=-1,this.menuLastClicked=-1,this.idPrefix="",this.itemTagName="item",this.itemTextTagName="itemtext",this.userDataTagName="userdata",this.itemTipTagName="tooltip",this.itemHotKeyTagName="hotkey",this.itemHrefTagName="href",this.dirTopLevel="bottom",this.dirSubLevel="right",this.menuX1=null,this.menuX2=null,this.menuY1=null,this.menuY2=null,this.menuMode="web",this.menuTimeoutMsec=400,this.menuTimeoutHandler=null,this.autoOverflow=!1,this.idPull={},this.itemPull={},this.userData={},this.radio={},this._rtl=!1,this._align="left",this.menuTouched=!1,this.zIndInit=1200,this.zInd=this.zIndInit,this.zIndStep=50,this.menuModeTopLevelTimeout=!0,this.menuModeTopLevelTimeoutTime=200,this._topLevelBottomMargin=1,this._topLevelRightMargin=0,this._topLevelOffsetLeft=1,this._arrowFFFix=_isIE&&"BackCompat"==document.compatMode?0:-4,this.setSkin=function(skin){var oldSkin=this.skin;switch(this.skin=skin,this.skin){case"dhx_black":case"dhx_blue":case"dhx_skyblue":case"dhx_web":this._topLevelBottomMargin=2,this._topLevelRightMargin=1,this._topLevelOffsetLeft=1,this._arrowFFFix=_isIE&&"BackCompat"==document.compatMode?0:-4;break;case"dhx_web":this._arrowFFFix=0;break;case"dhx_terrace":this._topLevelBottomMargin=0,this._topLevelRightMargin=0,this._topLevelOffsetLeft=0,this._arrowFFFix=_isIE&&"BackCompat"==document.compatMode?0:-4}this.base._autoSkinUpdate&&(this.base.className=this.base.className.replace("dhtmlxMenu_"+oldSkin+"_Middle","")+" dhtmlxMenu_"+this.skin+"_Middle");for(var a in this.idPull)this.idPull[a].className=String(this.idPull[a].className).replace(oldSkin,this.skin)},this.setSkin(this.skin),this.dLoad=!1,this.dLoadUrl="",this.dLoadSign="?",this.loaderIcon=!1,this.limit=0,this._scrollUpTM=null,this._scrollUpTMTime=20,this._scrollUpTMStep=3,this._scrollDownTM=null,this._scrollDownTMTime=20,this._scrollDownTMStep=3,this.context=!1,this.contextZones={},this.contextMenuZoneId=!1,this.contextAutoShow=!0,this.contextAutoHide=!0,this.contextHideAllMode=!0,this._selectedSubItems=new Array,this._openedPolygons=new Array,this._addSubItemToSelected=function(item,polygon){for(var t=!0,q=0;q<this._selectedSubItems.length;q++)this._selectedSubItems[q][0]==item&&this._selectedSubItems[q][1]==polygon&&(t=!1);return 1==t&&this._selectedSubItems.push(new Array(item,polygon)),t},this._removeSubItemFromSelected=function(item,polygon){for(var m=new Array,t=!1,q=0;q<this._selectedSubItems.length;q++)this._selectedSubItems[q][0]==item&&this._selectedSubItems[q][1]==polygon?t=!0:m[m.length]=this._selectedSubItems[q];return 1==t&&(this._selectedSubItems=m),t},this._getSubItemToDeselectByPolygon=function(polygon){for(var m=new Array,q=0;q<this._selectedSubItems.length;q++)if(this._selectedSubItems[q][1]==polygon){m[m.length]=this._selectedSubItems[q][0],m=m.concat(this._getSubItemToDeselectByPolygon(this._selectedSubItems[q][0]));for(var t=!0,w=0;w<this._openedPolygons.length;w++)this._openedPolygons[w]==this._selectedSubItems[q][0]&&(t=!1);1==t&&(this._openedPolygons[this._openedPolygons.length]=this._selectedSubItems[q][0]),this._selectedSubItems[q][0]=-1,this._selectedSubItems[q][1]=-1}return m},this._hidePolygon=function(id){if(null!=this.idPull["polygon_"+id]){if("undefined"!=typeof this._menuEffect&&this._menuEffect!==!1)this._hidePolygonEffect("polygon_"+id);else{if("none"==this.idPull["polygon_"+id].style.display)return;this.idPull["polygon_"+id].style.display="none",null!=this.idPull["arrowup_"+id]&&(this.idPull["arrowup_"+id].style.display="none"),null!=this.idPull["arrowdown_"+id]&&(this.idPull["arrowdown_"+id].style.display="none"),this._updateItemComplexState(id,!0,!1),this._isIE6&&null!=this.idPull["polygon_"+id+"_ie6cover"]&&(this.idPull["polygon_"+id+"_ie6cover"].style.display="none")}id=String(id).replace(this.idPrefix,""),id==this.topId&&(id=null),this.callEvent("onHide",[id]),null!=id&&"dhx_terrace"==this.skin&&this.itemPull[this.idPrefix+id].parent==this.idPrefix+this.topId&&this._improveTerraceButton(this.idPrefix+id,!0)}},this._showPolygon=function(id,openType){var itemCount=this._countVisiblePolygonItems(id);if(0!=itemCount){var pId="polygon_"+id;if(null!=this.idPull[pId]&&null!=this.idPull[id]){if(this.menuModeTopLevelTimeout&&"web"==this.menuMode&&!this.context&&!this.idPull[id]._mouseOver&&openType==this.dirTopLevel)return;this.fixedPosition||this._autoDetectVisibleArea();var arrUpH=0,arrDownH=0,arrowUp=null,arrowDown=null;if(this.idPull[pId].style.visibility="hidden",this.idPull[pId].style.left="0px",this.idPull[pId].style.top="0px",this.idPull[pId].style.display="",this.idPull[pId].style.zIndex=this.zInd,this.autoOverflow)if(this.idPull[pId].firstChild.offsetHeight>this.menuY1+this.menuY2){var t0=Math.floor((this.menuY2-this.menuY1-35)/24);this.limit=t0}else this.limit=0,null!=this.idPull["arrowup_"+id]&&this._removeUpArrow(String(id).replace(this.idPrefix,"")),null!=this.idPull["arrowdown_"+id]&&this._removeDownArrow(String(id).replace(this.idPrefix,""));if(this.limit>0&&this.limit<itemCount&&(null==this.idPull["arrowup_"+id]&&this._addUpArrow(String(id).replace(this.idPrefix,"")),null==this.idPull["arrowdown_"+id]&&this._addDownArrow(String(id).replace(this.idPrefix,"")),arrowUp=this.idPull["arrowup_"+id],arrowUp.style.visibility="hidden",arrowUp.style.display="",arrowUp.style.zIndex=this.zInd,arrUpH=arrowUp.offsetHeight,arrowDown=this.idPull["arrowdown_"+id],arrowDown.style.visibility="hidden",arrowDown.style.display="",arrowDown.style.zIndex=this.zInd,arrDownH=arrowDown.offsetHeight),this.limit>0&&(this.limit<itemCount?(this.idPull[pId].style.height=24*this.limit+"px",this.idPull[pId].scrollTop=0):this.idPull[pId].style.height=""),this.zInd+=this.zIndStep,null!=this.itemPull[id]){"polygon_"+this.itemPull[id].parent}else if(this.context){this.idPull[this.idPrefix+this.topId]}var srcX=null!=this.idPull[id].tagName?getAbsoluteLeft(this.idPull[id]):this.idPull[id][0],srcY=null!=this.idPull[id].tagName?getAbsoluteTop(this.idPull[id]):this.idPull[id][1],srcW=null!=this.idPull[id].tagName?this.idPull[id].offsetWidth:0,srcH=null!=this.idPull[id].tagName?this.idPull[id].offsetHeight:0,x=0,y=0,w=this.idPull[pId].offsetWidth,h=this.idPull[pId].offsetHeight+arrUpH+arrDownH;if("bottom"==openType&&(x=this._rtl?srcX+(null!=srcW?srcW:0)-w:"right"==this._align?srcX+srcW-w:srcX-1+(openType==this.dirTopLevel?this._topLevelRightMargin:0),y=srcY-1+srcH+this._topLevelBottomMargin),"right"==openType&&(x=srcX+srcW-1,y=srcY+2),"left"==openType&&(x=srcX-this.idPull[pId].offsetWidth+2,y=srcY+2),"top"==openType&&(x=srcX-1,y=srcY-h+2),this.fixedPosition)var mx=65536,my=65536;else{var mx=null!=this.menuX2?this.menuX2:0,my=null!=this.menuY2?this.menuY2:0;0==mx&&(window.innerWidth?(mx=window.innerWidth,my=window.innerHeight):(mx=document.body.offsetWidth,my=document.body.scrollHeight))}if(x+w>mx&&!this._rtl&&(x=srcX-w+2),x<this.menuX1&&this._rtl&&(x=srcX+srcW-2),0>x&&(x=0),y+h>my&&null!=this.menuY2&&(y=Math.max(srcY+srcH-h+2,this._isVisibleArea?this.menuY1+2:2),this.context&&this.idPrefix+this.topId==id&&null!=arrowDown&&(y-=2),null==this.itemPull[id]||this.context||this.itemPull[id].parent==this.idPrefix+this.topId&&(y-=this.base.offsetHeight)),this.idPull[pId].style.left=x+"px",this.idPull[pId].style.top=y+arrUpH+"px","undefined"!=typeof this._menuEffect&&this._menuEffect!==!1)this._showPolygonEffect(pId);else if(this.idPull[pId].style.visibility="",this.limit>0&&this.limit<itemCount&&(arrowUp.style.left=x+"px",arrowUp.style.top=y+"px",arrowUp.style.width=w+this._arrowFFFix+"px",arrowUp.style.visibility="",arrowDown.style.left=x+"px",arrowDown.style.top=y+h-arrDownH+"px",arrowDown.style.width=w+this._arrowFFFix+"px",arrowDown.style.visibility="",this._checkArrowsState(id)),this._isIE6){var pIdIE6=pId+"_ie6cover";if(null==this.idPull[pIdIE6]){var ifr=document.createElement("IFRAME");ifr.className="dhtmlxMenu_IE6CoverFix_"+this.skin,ifr.frameBorder=0,ifr.setAttribute("src","javascript:false;"),document.body.insertBefore(ifr,document.body.firstChild),this.idPull[pIdIE6]=ifr}this.idPull[pIdIE6].style.left=x+"px",this.idPull[pIdIE6].style.top=y+"px",this.idPull[pIdIE6].style.width=w+"px",this.idPull[pIdIE6].style.height=h+"px",this.idPull[pIdIE6].style.zIndex=this.idPull[pId].style.zIndex-1,this.idPull[pIdIE6].style.display=""}id=String(id).replace(this.idPrefix,""),id==this.topId&&(id=null),this.callEvent("onShow",[id]),null!=id&&"dhx_terrace"==this.skin&&this.itemPull[this.idPrefix+id].parent==this.idPrefix+this.topId&&this._improveTerraceButton(this.idPrefix+id,!1)}}},this._redistribSubLevelSelection=function(id,parentId){for(;this._openedPolygons.length>0;)this._openedPolygons.pop();var i=this._getSubItemToDeselectByPolygon(parentId);this._removeSubItemFromSelected(-1,-1);for(var q=0;q<i.length;q++)null!=this.idPull[i[q]]&&i[q]!=id&&"enabled"==this.itemPull[i[q]].state&&(this.idPull[i[q]].className="sub_item");for(var q=0;q<this._openedPolygons.length;q++)this._openedPolygons[q]!=parentId&&this._hidePolygon(this._openedPolygons[q]);if("enabled"==this.itemPull[id].state){
if(this.idPull[id].className="sub_item_selected",this.itemPull[id].complex&&this.dLoad&&"no"==this.itemPull[id].loaded){1==this.loaderIcon&&this._updateLoaderIcon(id,!0);var xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window);this.itemPull[id].loaded="get",this.callEvent("onXLS",[]),xmlLoader.loadXML(this.dLoadUrl+this.dLoadSign+"action=loadMenu&parentId="+id.replace(this.idPrefix,"")+"&etc="+(new Date).getTime())}(this.itemPull[id].complex||this.dLoad&&"yes"==this.itemPull[id].loaded)&&this.itemPull[id].complex&&null!=this.idPull["polygon_"+id]&&(this._updateItemComplexState(id,!0,!0),this._showPolygon(id,this.dirSubLevel)),this._addSubItemToSelected(id,parentId),this.menuSelected=id}},this._doOnClick=function(id,type,casState){if(this.menuLastClicked=id,null!=this.itemPull[this.idPrefix+id].href_link&&"enabled"==this.itemPull[this.idPrefix+id].state){var form=document.createElement("FORM"),k=String(this.itemPull[this.idPrefix+id].href_link).split("?");if(form.action=k[0],null!=k[1])for(var p=String(k[1]).split("&"),q=0;q<p.length;q++){var j=String(p[q]).split("="),m=document.createElement("INPUT");m.type="hidden",m.name=j[0]||"",m.value=j[1]||"",form.appendChild(m)}return null!=this.itemPull[this.idPrefix+id].href_target&&(form.target=this.itemPull[this.idPrefix+id].href_target),form.style.display="none",document.body.appendChild(form),form.submit(),void(null!=form&&(document.body.removeChild(form),form=null))}if("c"!=type.charAt(0)&&"d"!=type.charAt(1)&&"s"!=type.charAt(2)){if(this.checkEvent("onClick"))this.callEvent("onClick",[id,this.contextMenuZoneId,casState]);else if("d"==type.charAt(1)||"win"==this.menuMode&&"t"==type.charAt(2))return;this.context&&this._isContextMenuVisible()&&this.contextAutoHide?this._hideContextMenu():this._clearAndHide&&this._clearAndHide()}},this._doOnTouchMenu=function(id){0==this.menuTouched&&(this.menuTouched=!0,this.checkEvent("onTouch")&&this.callEvent("onTouch",[id]))},this._searchMenuNode=function(node,menu){for(var m=new Array,q=0;q<menu.length;q++)if("object"==typeof menu[q]){5==menu[q].length&&"object"!=typeof menu[q][0]&&menu[q][0].replace(this.idPrefix,"")==node&&0==q&&(m=menu);var j=this._searchMenuNode(node,menu[q]);j.length>0&&(m=j)}return m},this._getMenuNodes=function(node){var m=new Array;for(var a in this.itemPull)this.itemPull[a].parent==node&&(m[m.length]=a);return m},this._genStr=function(w){for(var s="",z="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",q=0;w>q;q++)s+=z.charAt(Math.round(Math.random()*(z.length-1)));return s},this.getItemType=function(id){return id=this.idPrefix+id,null==this.itemPull[id]?null:this.itemPull[id].type},this.forEachItem=function(handler){for(var a in this.itemPull)handler(String(a).replace(this.idPrefix,""))},this._clearAndHide=function(){for(main_self.menuSelected=-1,main_self.menuLastClicked=-1;main_self._openedPolygons.length>0;)main_self._openedPolygons.pop();for(var q=0;q<main_self._selectedSubItems.length;q++){var id=main_self._selectedSubItems[q][0];null!=main_self.idPull[id]&&"enabled"==main_self.itemPull[id].state&&("sub_item_selected"==main_self.idPull[id].className&&(main_self.idPull[id].className="sub_item"),main_self.idPull[id].className=="dhtmlxMenu_"+main_self.skin+"_TopLevel_Item_Selected"&&(null!=main_self.itemPull[id].cssNormal?main_self.idPull[id].className=main_self.itemPull[id].cssNormal:main_self.idPull[id].className="dhtmlxMenu_"+main_self.skin+"_TopLevel_Item_Normal")),main_self._hidePolygon(id)}main_self.menuTouched=!1,main_self.context&&(main_self.contextHideAllMode?(main_self._hidePolygon(main_self.idPrefix+main_self.topId),main_self.zInd=main_self.zIndInit):main_self.zInd=main_self.zIndInit+main_self.zIndStep)},this._doOnLoad=function(){},this.loadXML=function(xmlFile,onLoadFunction){onLoadFunction&&(this._doOnLoad=function(){onLoadFunction()}),this.callEvent("onXLS",[]),this._xmlLoader.loadXML(xmlFile)},this.loadXMLString=function(xmlString,onLoadFunction){onLoadFunction&&(this._doOnLoad=function(){onLoadFunction()}),this._xmlLoader.loadXMLString(xmlString)},this._buildMenu=function(t,parentId){for(var u=0,q=0;q<t.childNodes.length;q++)if(t.childNodes[q].tagName==this.itemTagName){var r=t.childNodes[q],item={};item.id=this.idPrefix+(r.getAttribute("id")||this._genStr(24)),item.title=r.getAttribute("text")||"",item.imgen=r.getAttribute("img")||"",item.imgdis=r.getAttribute("imgdis")||"",item.tip="",item.hotkey="",null!=r.getAttribute("cssNormal")&&(item.cssNormal=r.getAttribute("cssNormal")),item.type=r.getAttribute("type")||"item","checkbox"==item.type&&(item.checked=null!=r.getAttribute("checked"),item.imgen="chbx_"+(item.checked?"1":"0"),item.imgdis=item.imgen),"radio"==item.type&&(item.checked=null!=r.getAttribute("checked"),item.imgen="rdbt_"+(item.checked?"1":"0"),item.imgdis=item.imgen,item.group=r.getAttribute("group")||this._genStr(24),null==this.radio[item.group]&&(this.radio[item.group]=new Array),this.radio[item.group][this.radio[item.group].length]=item.id),item.state=!(null==r.getAttribute("enabled")&&null==r.getAttribute("disabled")||"false"!=r.getAttribute("enabled")&&"true"!=r.getAttribute("disabled"))?"disabled":"enabled",item.parent=null!=parentId?parentId:this.idPrefix+this.topId,item.complex=this.dLoad?null!=r.getAttribute("complex"):this._buildMenu(r,item.id)>0,this.dLoad&&item.complex&&(item.loaded="no"),this.itemPull[item.id]=item;for(var w=0;w<r.childNodes.length;w++){var tagNm=r.childNodes[w].tagName;if(null!=tagNm&&(tagNm=tagNm.toLowerCase()),tagNm==this.userDataTagName){var d=r.childNodes[w];null!=d.getAttribute("name")&&(this.userData[item.id+"_"+d.getAttribute("name")]=null!=d.firstChild&&null!=d.firstChild.nodeValue?d.firstChild.nodeValue:"")}tagNm==this.itemTextTagName&&(item.title=r.childNodes[w].firstChild.nodeValue),tagNm==this.itemTipTagName&&(item.tip=r.childNodes[w].firstChild.nodeValue),tagNm==this.itemHotKeyTagName&&(item.hotkey=r.childNodes[w].firstChild.nodeValue),tagNm==this.itemHrefTagName&&"item"==item.type&&(item.href_link=r.childNodes[w].firstChild.nodeValue,null!=r.childNodes[w].getAttribute("target")&&(item.href_target=r.childNodes[w].getAttribute("target")))}u++}return u},this._xmlParser=function(){if(main_self.dLoad){var t=this.getXMLTopNode("menu");if(parentId=null!=t.getAttribute("parentId")?t.getAttribute("parentId"):null,null==parentId)main_self._buildMenu(t,null),main_self._initTopLevelMenu();else{if(main_self._buildMenu(t,main_self.idPrefix+parentId),main_self._addSubMenuPolygon(main_self.idPrefix+parentId,main_self.idPrefix+parentId),main_self.menuSelected==main_self.idPrefix+parentId){var pId=main_self.idPrefix+parentId,isTop=main_self.itemPull[main_self.idPrefix+parentId].parent==main_self.idPrefix+main_self.topId,level=isTop&&!main_self.context?main_self.dirTopLevel:main_self.dirSubLevel,isShow=!1;if(isTop&&main_self.menuModeTopLevelTimeout&&"web"==main_self.menuMode&&!main_self.context){var item=main_self.idPull[main_self.idPrefix+parentId];if(1==item._mouseOver){var delay=main_self.menuModeTopLevelTimeoutTime-((new Date).getTime()-item._dynLoadTM);delay>1&&(item._menuOpenTM=window.setTimeout(function(){main_self._showPolygon(pId,level)},delay),isShow=!0)}}isShow||main_self._showPolygon(pId,level)}main_self.itemPull[main_self.idPrefix+parentId].loaded="yes",1==main_self.loaderIcon&&main_self._updateLoaderIcon(main_self.idPrefix+parentId,!1)}this.destructor(),main_self.callEvent("onXLE",[])}else{var t=this.getXMLTopNode("menu");main_self._buildMenu(t,null),main_self.init(),main_self.callEvent("onXLE",[]),main_self._doOnLoad()}},this._xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window),this._showSubLevelItem=function(id,back){null!=document.getElementById("arrow_"+this.idPrefix+id)&&(document.getElementById("arrow_"+this.idPrefix+id).style.display=back?"none":""),null!=document.getElementById("image_"+this.idPrefix+id)&&(document.getElementById("image_"+this.idPrefix+id).style.display=back?"none":""),null!=document.getElementById(this.idPrefix+id)&&(document.getElementById(this.idPrefix+id).style.display=back?"":"none")},this._hideSubLevelItem=function(id){this._showSubLevelItem(id,!0)},this.idPrefix=this._genStr(12),this._bodyClick=function(e){e=e||event,2==e.button||_isOpera&&1==e.ctrlKey||(main_self.context?main_self.contextAutoHide&&(!_isOpera||main_self._isContextMenuVisible()&&_isOpera)&&main_self._hideContextMenu():main_self._clearAndHide&&main_self._clearAndHide())},this._bodyContext=function(e){e=e||event;var t=String((e.srcElement||e.target).className);if(-1==t.search("dhtmlxMenu")||-1==t.search("SubLevelArea")){for(var toHide=!0,testZone=e.target||e.srcElement;null!=testZone;)null!=testZone.id&&main_self.isContextZone(testZone.id)&&(toHide=!1),testZone==document.body&&(toHide=!1),testZone=testZone.parentNode;toHide&&main_self.hideContextMenu()}},"undefined"!=typeof window.addEventListener?(window.addEventListener("click",this._bodyClick,!1),window.addEventListener("contextmenu",this._bodyContext,!1)):(document.body.attachEvent("onclick",this._bodyClick),document.body.attachEvent("oncontextmenu",this._bodyContext)),this._UID=this._genStr(32),dhtmlxMenuObjectLiveInstances[this._UID]=this,dhtmlxEventable(this),this}function egwMenuImpl(_structure){this.dhtmlxmenu=new dhtmlXMenuObject,this.dhtmlxmenu.setSkin("egw"),this.dhtmlxmenu.renderAsContextMenu();var self=this;this.dhtmlxmenu.attachEvent("onClick",function(id){if(id){var elem=self.dhtmlxmenu.getUserData(id,"egw_menu");if(elem&&elem.onClick){elem.checkbox&&self.dhtmlxmenu.setContextMenuHideAllMode(!1);var res=elem.onClick(elem);if(elem.checkbox&&(res===!1||res===!0)){var checked=res;0!=elem.groupIndex?self.dhtmlxmenu.setRadioChecked(id,checked):self.dhtmlxmenu.setCheckboxState(id,checked)}}}}),this.dhtmlxmenu.attachEvent("onRadioClick",function(group,idChecked,idClicked,zoneId,casState){if(idClicked){var elem=self.dhtmlxmenu.getUserData(idClicked,"egw_menu");elem&&elem.set_checked(!0)}return!0}),this.dhtmlxmenu.attachEvent("onCheckboxClick",function(id,state,zoneId,casState){if(id){var elem=self.dhtmlxmenu.getUserData(id,"egw_menu");elem&&elem.set_checked(!state)}return!0}),this._translateStructure(_structure,this.dhtmlxmenu.topId,0)}!function(global,factory){"object"==typeof module&&"object"==typeof module.exports?module.exports=global.document?factory(global,!0):function(w){if(!w.document)throw new Error("jQuery requires a window with a document");return factory(w)}:factory(global)}("undefined"!=typeof window?window:this,function(window,noGlobal){function isArraylike(obj){var length=obj.length,type=jQuery.type(obj);return"function"===type||jQuery.isWindow(obj)?!1:1===obj.nodeType&&length?!0:"array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj}function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier))return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not});if(qualifier.nodeType)return jQuery.grep(elements,function(elem){return elem===qualifier!==not});if("string"==typeof qualifier){if(risSimple.test(qualifier))return jQuery.filter(qualifier,elements,not);qualifier=jQuery.filter(qualifier,elements)}return jQuery.grep(elements,function(elem){return jQuery.inArray(elem,qualifier)>=0!==not})}function sibling(cur,dir){do cur=cur[dir];while(cur&&1!==cur.nodeType);return cur}function createOptions(options){var object=optionsCache[options]={};return jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function detach(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1)):(document.detachEvent("onreadystatechange",completed),window.detachEvent("onload",completed))}function completed(){(document.addEventListener||"load"===event.type||"complete"===document.readyState)&&(detach(),jQuery.ready())}function dataAttr(elem,key,data){if(void 0===data&&1===elem.nodeType){var name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();if(data=elem.getAttribute(name),"string"==typeof data){try{data="true"===data?!0:"false"===data?!1:"null"===data?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data}catch(e){}jQuery.data(elem,key,data)}else data=void 0}return data}function isEmptyDataObject(obj){var name;for(name in obj)if(("data"!==name||!jQuery.isEmptyObject(obj[name]))&&"toJSON"!==name)return!1;return!0}function internalData(elem,name,data,pvt){if(jQuery.acceptData(elem)){var ret,thisCache,internalKey=jQuery.expando,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if(id&&cache[id]&&(pvt||cache[id].data)||void 0!==data||"string"!=typeof name)return id||(id=isNode?elem[internalKey]=deletedIds.pop()||jQuery.guid++:internalKey),cache[id]||(cache[id]=isNode?{}:{toJSON:jQuery.noop}),"object"!=typeof name&&"function"!=typeof name||(pvt?cache[id]=jQuery.extend(cache[id],name):cache[id].data=jQuery.extend(cache[id].data,name)),thisCache=cache[id],pvt||(thisCache.data||(thisCache.data={}),thisCache=thisCache.data),void 0!==data&&(thisCache[jQuery.camelCase(name)]=data),"string"==typeof name?(ret=thisCache[name],null==ret&&(ret=thisCache[jQuery.camelCase(name)])):ret=thisCache,ret}}function internalRemoveData(elem,name,pvt){if(jQuery.acceptData(elem)){var thisCache,i,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(cache[id]){if(name&&(thisCache=pvt?cache[id]:cache[id].data)){jQuery.isArray(name)?name=name.concat(jQuery.map(name,jQuery.camelCase)):name in thisCache?name=[name]:(name=jQuery.camelCase(name),name=name in thisCache?[name]:name.split(" ")),i=name.length;for(;i--;)delete thisCache[name[i]];if(pvt?!isEmptyDataObject(thisCache):!jQuery.isEmptyObject(thisCache))return}(pvt||(delete cache[id].data,isEmptyDataObject(cache[id])))&&(isNode?jQuery.cleanData([elem],!0):support.deleteExpando||cache!=cache.window?delete cache[id]:cache[id]=null)}}}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(err){}}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement)for(;list.length;)safeFrag.createElement(list.pop());return safeFrag}function getAll(context,tag){var elems,elem,i=0,found=typeof context.getElementsByTagName!==strundefined?context.getElementsByTagName(tag||"*"):typeof context.querySelectorAll!==strundefined?context.querySelectorAll(tag||"*"):void 0;if(!found)for(found=[],elems=context.childNodes||context;null!=(elem=elems[i]);i++)!tag||jQuery.nodeName(elem,tag)?found.push(elem):jQuery.merge(found,getAll(elem,tag));return void 0===tag||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],found):found}function fixDefaultChecked(elem){rcheckableType.test(elem.type)&&(elem.defaultChecked=elem.checked)}function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(11!==content.nodeType?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem}function disableScript(elem){return elem.type=(null!==jQuery.find.attr(elem,"type"))+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function setGlobalEval(elems,refElements){for(var elem,i=0;null!=(elem=elems[i]);i++)jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"))}function cloneCopyEvent(src,dest){if(1===dest.nodeType&&jQuery.hasData(src)){var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle,curData.events={};for(type in events)for(i=0,l=events[type].length;l>i;i++)jQuery.event.add(dest,type,events[type][i])}curData.data&&(curData.data=jQuery.extend({},curData.data))}}function fixCloneNodeIssues(src,dest){var nodeName,e,data;if(1===dest.nodeType){if(nodeName=dest.nodeName.toLowerCase(),!support.noCloneEvent&&dest[jQuery.expando]){data=jQuery._data(dest);for(e in data.events)jQuery.removeEvent(dest,e,data.handle);dest.removeAttribute(jQuery.expando)}"script"===nodeName&&dest.text!==src.text?(disableScript(dest).text=src.text,restoreScript(dest)):"object"===nodeName?(dest.parentNode&&(dest.outerHTML=src.outerHTML),support.html5Clone&&src.innerHTML&&!jQuery.trim(dest.innerHTML)&&(dest.innerHTML=src.innerHTML)):"input"===nodeName&&rcheckableType.test(src.type)?(dest.defaultChecked=dest.checked=src.checked,dest.value!==src.value&&(dest.value=src.value)):"option"===nodeName?dest.defaultSelected=dest.selected=src.defaultSelected:"input"!==nodeName&&"textarea"!==nodeName||(dest.defaultValue=src.defaultValue)}}function actualDisplay(name,doc){var style,elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=window.getDefaultComputedStyle&&(style=window.getDefaultComputedStyle(elem[0]))?style.display:jQuery.css(elem[0],"display");return elem.detach(),display}function defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];return display||(display=actualDisplay(nodeName,doc),"none"!==display&&display||(iframe=(iframe||jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement),doc=(iframe[0].contentWindow||iframe[0].contentDocument).document,doc.write(),doc.close(),display=actualDisplay(nodeName,doc),iframe.detach()),elemdisplay[nodeName]=display),display}function addGetHookIf(conditionFn,hookFn){return{get:function(){var condition=conditionFn();if(null!=condition)return condition?void delete this.get:(this.get=hookFn).apply(this,arguments)}}}function vendorPropName(style,name){if(name in style)return name;for(var capName=name.charAt(0).toUpperCase()+name.slice(1),origName=name,i=cssPrefixes.length;i--;)if(name=cssPrefixes[i]+capName,name in style)return name;return origName}function showHide(elements,show){for(var display,elem,hidden,values=[],index=0,length=elements.length;length>index;index++)elem=elements[index],elem.style&&(values[index]=jQuery._data(elem,"olddisplay"),display=elem.style.display,show?(values[index]||"none"!==display||(elem.style.display=""),""===elem.style.display&&isHidden(elem)&&(values[index]=jQuery._data(elem,"olddisplay",defaultDisplay(elem.nodeName)))):(hidden=isHidden(elem),(display&&"none"!==display||!hidden)&&jQuery._data(elem,"olddisplay",hidden?display:jQuery.css(elem,"display"))));for(index=0;length>index;index++)elem=elements[index],elem.style&&(show&&"none"!==elem.style.display&&""!==elem.style.display||(elem.style.display=show?values[index]||"":"none"));return elements}function setPositiveNumber(elem,value,subtract){var matches=rnumsplit.exec(value);return matches?Math.max(0,matches[1]-(subtract||0))+(matches[2]||"px"):value}function augmentWidthOrHeight(elem,name,extra,isBorderBox,styles){for(var i=extra===(isBorderBox?"border":"content")?4:"width"===name?1:0,val=0;4>i;i+=2)"margin"===extra&&(val+=jQuery.css(elem,extra+cssExpand[i],!0,styles)),isBorderBox?("content"===extra&&(val-=jQuery.css(elem,"padding"+cssExpand[i],!0,styles)),"margin"!==extra&&(val-=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles))):(val+=jQuery.css(elem,"padding"+cssExpand[i],!0,styles),"padding"!==extra&&(val+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles)));return val}function getWidthOrHeight(elem,name,extra){var valueIsBorderBox=!0,val="width"===name?elem.offsetWidth:elem.offsetHeight,styles=getStyles(elem),isBorderBox=support.boxSizing&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles);if(0>=val||null==val){if(val=curCSS(elem,name,styles),(0>val||null==val)&&(val=elem.style[name]),rnumnonpx.test(val))return val;valueIsBorderBox=isBorderBox&&(support.boxSizingReliable()||val===elem.style[name]),val=parseFloat(val)||0}return val+augmentWidthOrHeight(elem,name,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles)+"px"}function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}function createFxNow(){return setTimeout(function(){fxNow=void 0}),fxNow=jQuery.now()}function genFx(type,includeWidth){var which,attrs={height:type},i=0;for(includeWidth=includeWidth?1:0;4>i;i+=2-includeWidth)which=cssExpand[i],attrs["margin"+which]=attrs["padding"+which]=type;return includeWidth&&(attrs.opacity=attrs.width=type),attrs}function createTween(value,prop,animation){for(var tween,collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;length>index;index++)if(tween=collection[index].call(animation,prop,value))return tween}function defaultPrefilter(elem,props,opts){var prop,value,toggle,tween,hooks,oldfire,display,checkDisplay,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHidden(elem),dataShow=jQuery._data(elem,"fxshow");opts.queue||(hooks=jQuery._queueHooks(elem,"fx"),null==hooks.unqueued&&(hooks.unqueued=0,oldfire=hooks.empty.fire,hooks.empty.fire=function(){hooks.unqueued||oldfire()}),hooks.unqueued++,anim.always(function(){anim.always(function(){hooks.unqueued--,jQuery.queue(elem,"fx").length||hooks.empty.fire()})})),1===elem.nodeType&&("height"in props||"width"in props)&&(opts.overflow=[style.overflow,style.overflowX,style.overflowY],display=jQuery.css(elem,"display"),checkDisplay="none"===display?jQuery._data(elem,"olddisplay")||defaultDisplay(elem.nodeName):display,"inline"===checkDisplay&&"none"===jQuery.css(elem,"float")&&(support.inlineBlockNeedsLayout&&"inline"!==defaultDisplay(elem.nodeName)?style.zoom=1:style.display="inline-block")),opts.overflow&&(style.overflow="hidden",support.shrinkWrapBlocks()||anim.always(function(){style.overflow=opts.overflow[0],style.overflowX=opts.overflow[1],style.overflowY=opts.overflow[2]}));for(prop in props)if(value=props[prop],rfxtypes.exec(value)){if(delete props[prop],toggle=toggle||"toggle"===value,value===(hidden?"hide":"show")){if("show"!==value||!dataShow||void 0===dataShow[prop])continue;hidden=!0}orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}else display=void 0;if(jQuery.isEmptyObject(orig))"inline"===("none"===display?defaultDisplay(elem.nodeName):display)&&(style.display=display);else{dataShow?"hidden"in dataShow&&(hidden=dataShow.hidden):dataShow=jQuery._data(elem,"fxshow",{}),toggle&&(dataShow.hidden=!hidden),hidden?jQuery(elem).show():anim.done(function(){jQuery(elem).hide()}),anim.done(function(){var prop;jQuery._removeData(elem,"fxshow");for(prop in orig)jQuery.style(elem,prop,orig[prop])});for(prop in orig)tween=createTween(hidden?dataShow[prop]:0,prop,anim),prop in dataShow||(dataShow[prop]=tween.start,hidden&&(tween.end=tween.start,tween.start="width"===prop||"height"===prop?1:0))}}function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props)if(name=jQuery.camelCase(index),easing=specialEasing[name],value=props[index],jQuery.isArray(value)&&(easing=value[1],value=props[index]=value[0]),index!==name&&(props[name]=value,delete props[index]),hooks=jQuery.cssHooks[name],hooks&&"expand"in hooks){value=hooks.expand(value),delete props[name];for(index in value)index in props||(props[index]=value[index],specialEasing[index]=easing)}else specialEasing[name]=easing}function Animation(elem,properties,options){var result,stopped,index=0,length=animationPrefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem}),tick=function(){if(stopped)return!1;for(var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;length>index;index++)animation.tweens[index].run(percent);return deferred.notifyWith(elem,[animation,percent,remaining]),1>percent&&length?remaining:(deferred.resolveWith(elem,[animation]),!1)},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(!0,{specialEasing:{}},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);return animation.tweens.push(tween),tween},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped)return this;for(stopped=!0;length>index;index++)animation.tweens[index].run(1);return gotoEnd?deferred.resolveWith(elem,[animation,gotoEnd]):deferred.rejectWith(elem,[animation,gotoEnd]),this}}),props=animation.props;for(propFilter(props,animation.opts.specialEasing);length>index;index++)if(result=animationPrefilters[index].call(animation,elem,props,animation.opts))return result;return jQuery.map(props,createTween,animation),jQuery.isFunction(animation.opts.start)&&animation.opts.start.call(elem,animation),jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue})),animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always)}function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){"string"!=typeof dataTypeExpression&&(func=dataTypeExpression,dataTypeExpression="*");var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite)||[];if(jQuery.isFunction(func))for(;dataType=dataTypes[i++];)"+"===dataType.charAt(0)?(dataType=dataType.slice(1)||"*",(structure[dataType]=structure[dataType]||[]).unshift(func)):(structure[dataType]=structure[dataType]||[]).push(func)}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){function inspect(dataType){var selected;return inspected[dataType]=!0,jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);return"string"!=typeof dataTypeOrTransport||seekingTransport||inspected[dataTypeOrTransport]?seekingTransport?!(selected=dataTypeOrTransport):void 0:(options.dataTypes.unshift(dataTypeOrTransport),inspect(dataTypeOrTransport),!1)}),selected}var inspected={},seekingTransport=structure===transports;return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src)void 0!==src[key]&&((flatOptions[key]?target:deep||(deep={}))[key]=src[key]);return deep&&jQuery.extend(!0,target,deep),target}function ajaxHandleResponses(s,jqXHR,responses){for(var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;"*"===dataTypes[0];)dataTypes.shift(),void 0===ct&&(ct=s.mimeType||jqXHR.getResponseHeader("Content-Type"));if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}return finalDataType?(finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]):void 0}function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1])for(conv in s.converters)converters[conv.toLowerCase()]=s.converters[conv];for(current=dataTypes.shift();current;)if(s.responseFields[current]&&(jqXHR[s.responseFields[current]]=response),!prev&&isSuccess&&s.dataFilter&&(response=s.dataFilter(response,s.dataType)),prev=current,current=dataTypes.shift())if("*"===current)current=prev;else if("*"!==prev&&prev!==current){if(conv=converters[prev+" "+current]||converters["* "+current],!conv)for(conv2 in converters)if(tmp=conv2.split(" "),tmp[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){conv===!0?conv=converters[conv2]:converters[conv2]!==!0&&(current=tmp[0],dataTypes.unshift(tmp[1]));break}if(conv!==!0)if(conv&&s.throws)response=conv(response);else try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}return{state:"success",data:response}}function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj))jQuery.each(obj,function(i,v){traditional||rbracket.test(prefix)?add(prefix,v):buildParams(prefix+"["+("object"==typeof v?i:"")+"]",v,traditional,add)});else if(traditional||"object"!==jQuery.type(obj))add(prefix,obj);else for(name in obj)buildParams(prefix+"["+name+"]",obj[name],traditional,add)}function createStandardXHR(){try{return new window.XMLHttpRequest}catch(e){}}function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function getWindow(elem){return jQuery.isWindow(elem)?elem:9===elem.nodeType?elem.defaultView||elem.parentWindow:!1}var deletedIds=[],slice=deletedIds.slice,concat=deletedIds.concat,push=deletedIds.push,indexOf=deletedIds.indexOf,class2type={},toString=class2type.toString,hasOwn=class2type.hasOwnProperty,support={},version="1.11.2",jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase()};jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,selector:"",length:0,toArray:function(){return slice.call(this)},get:function(num){return null!=num?0>num?this[num+this.length]:this[num]:slice.call(this)},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret.context=this.context,ret},each:function(callback,args){return jQuery.each(this,callback,args)},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},slice:function(){return this.pushStack(slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var len=this.length,j=+i+(0>i?len:0);return this.pushStack(j>=0&&len>j?[this[j]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:push,sort:deletedIds.sort,splice:deletedIds.splice},jQuery.extend=jQuery.fn.extend=function(){var src,copyIsArray,copy,name,options,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=!1;for("boolean"==typeof target&&(deep=target,target=arguments[i]||{},i++),"object"==typeof target||jQuery.isFunction(target)||(target={}),i===length&&(target=this,i--);length>i;i++)if(null!=(options=arguments[i]))for(name in options)src=target[name],copy=options[name],target!==copy&&(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=jQuery.isArray(copy)))?(copyIsArray?(copyIsArray=!1,clone=src&&jQuery.isArray(src)?src:[]):clone=src&&jQuery.isPlainObject(src)?src:{},target[name]=jQuery.extend(deep,clone,copy)):void 0!==copy&&(target[name]=copy));return target},jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:!0,error:function(msg){throw new Error(msg)},noop:function(){},isFunction:function(obj){return"function"===jQuery.type(obj)},isArray:Array.isArray||function(obj){return"array"===jQuery.type(obj)},isWindow:function(obj){return null!=obj&&obj==obj.window},isNumeric:function(obj){return!jQuery.isArray(obj)&&obj-parseFloat(obj)+1>=0},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},isPlainObject:function(obj){var key;if(!obj||"object"!==jQuery.type(obj)||obj.nodeType||jQuery.isWindow(obj))return!1;try{if(obj.constructor&&!hasOwn.call(obj,"constructor")&&!hasOwn.call(obj.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(support.ownLast)for(key in obj)return hasOwn.call(obj,key);for(key in obj);return void 0===key||hasOwn.call(obj,key)},type:function(obj){return null==obj?obj+"":"object"==typeof obj||"function"==typeof obj?class2type[toString.call(obj)]||"object":typeof obj},globalEval:function(data){data&&jQuery.trim(data)&&(window.execScript||function(data){
window.eval.call(window,data)})(data)},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()},each:function(obj,callback,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray)for(;length>i&&(value=callback.apply(obj[i],args),value!==!1);i++);else for(i in obj)if(value=callback.apply(obj[i],args),value===!1)break}else if(isArray)for(;length>i&&(value=callback.call(obj[i],i,obj[i]),value!==!1);i++);else for(i in obj)if(value=callback.call(obj[i],i,obj[i]),value===!1)break;return obj},trim:function(text){return null==text?"":(text+"").replace(rtrim,"")},makeArray:function(arr,results){var ret=results||[];return null!=arr&&(isArraylike(Object(arr))?jQuery.merge(ret,"string"==typeof arr?[arr]:arr):push.call(ret,arr)),ret},inArray:function(elem,arr,i){var len;if(arr){if(indexOf)return indexOf.call(arr,elem,i);for(len=arr.length,i=i?0>i?Math.max(0,len+i):i:0;len>i;i++)if(i in arr&&arr[i]===elem)return i}return-1},merge:function(first,second){for(var len=+second.length,j=0,i=first.length;len>j;)first[i++]=second[j++];if(len!==len)for(;void 0!==second[j];)first[i++]=second[j++];return first.length=i,first},grep:function(elems,callback,invert){for(var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;length>i;i++)callbackInverse=!callback(elems[i],i),callbackInverse!==callbackExpect&&matches.push(elems[i]);return matches},map:function(elems,callback,arg){var value,i=0,length=elems.length,isArray=isArraylike(elems),ret=[];if(isArray)for(;length>i;i++)value=callback(elems[i],i,arg),null!=value&&ret.push(value);else for(i in elems)value=callback(elems[i],i,arg),null!=value&&ret.push(value);return concat.apply([],ret)},guid:1,proxy:function(fn,context){var args,proxy,tmp;return"string"==typeof context&&(tmp=fn[context],context=fn,fn=tmp),jQuery.isFunction(fn)?(args=slice.call(arguments,2),proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)))},proxy.guid=fn.guid=fn.guid||jQuery.guid++,proxy):void 0},now:function(){return+new Date},support:support}),jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase()});var Sizzle=function(window){function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document&&setDocument(context),context=context||document,results=results||[],nodeType=context.nodeType,"string"!=typeof selector||!selector||1!==nodeType&&9!==nodeType&&11!==nodeType)return results;if(!seed&&documentIsHTML){if(11!==nodeType&&(match=rquickExpr.exec(selector)))if(m=match[1]){if(9===nodeType){if(elem=context.getElementById(m),!elem||!elem.parentNode)return results;if(elem.id===m)return results.push(elem),results}else if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m)return results.push(elem),results}else{if(match[2])return push.apply(results,context.getElementsByTagName(selector)),results;if((m=match[3])&&support.getElementsByClassName)return push.apply(results,context.getElementsByClassName(m)),results}if(support.qsa&&(!rbuggyQSA||!rbuggyQSA.test(selector))){if(nid=old=expando,newContext=context,newSelector=1!==nodeType&&selector,1===nodeType&&"object"!==context.nodeName.toLowerCase()){for(groups=tokenize(selector),(old=context.getAttribute("id"))?nid=old.replace(rescape,"\\$&"):context.setAttribute("id",nid),nid="[id='"+nid+"'] ",i=groups.length;i--;)groups[i]=nid+toSelector(groups[i]);newContext=rsibling.test(selector)&&testContext(context.parentNode)||context,newSelector=groups.join(",")}if(newSelector)try{return push.apply(results,newContext.querySelectorAll(newSelector)),results}catch(qsaError){}finally{old||context.removeAttribute("id")}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function createCache(){function cache(key,value){return keys.push(key+" ")>Expr.cacheLength&&delete cache[keys.shift()],cache[key+" "]=value}var keys=[];return cache}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var div=document.createElement("div");try{return!!fn(div)}catch(e){return!1}finally{div.parentNode&&div.parentNode.removeChild(div),div=null}}function addHandle(attrs,handler){for(var arr=attrs.split("|"),i=attrs.length;i--;)Expr.attrHandle[arr[i]]=handler}function siblingCheck(a,b){var cur=b&&a,diff=cur&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function testContext(context){return context&&"undefined"!=typeof context.getElementsByTagName&&context}function setFilters(){}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";len>i;i++)selector+=tokens[i].value;return selector}function addCombinator(matcher,combinator,base){var dir=combinator.dir,checkNonElements=base&&"parentNode"===dir,doneName=done++;return combinator.first?function(elem,context,xml){for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements)return matcher(elem,context,xml)}:function(elem,context,xml){var oldCache,outerCache,newCache=[dirruns,doneName];if(xml){for(;elem=elem[dir];)if((1===elem.nodeType||checkNonElements)&&matcher(elem,context,xml))return!0}else for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements){if(outerCache=elem[expando]||(elem[expando]={}),(oldCache=outerCache[dir])&&oldCache[0]===dirruns&&oldCache[1]===doneName)return newCache[2]=oldCache[2];if(outerCache[dir]=newCache,newCache[2]=matcher(elem,context,xml))return!0}}}function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;len>i;i++)Sizzle(selector,contexts[i],results);return results}function condense(unmatched,map,filter,context,xml){for(var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=null!=map;len>i;i++)(elem=unmatched[i])&&(filter&&!filter(elem,context,xml)||(newUnmatched.push(elem),mapped&&map.push(i)));return newUnmatched}function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){return postFilter&&!postFilter[expando]&&(postFilter=setMatcher(postFilter)),postFinder&&!postFinder[expando]&&(postFinder=setMatcher(postFinder,postSelector)),markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=!preFilter||!seed&&selector?elems:condense(elems,preMap,preFilter,context,xml),matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher&&matcher(matcherIn,matcherOut,context,xml),postFilter)for(temp=condense(matcherOut,postMap),postFilter(temp,[],context,xml),i=temp.length;i--;)(elem=temp[i])&&(matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem));if(seed){if(postFinder||preFilter){if(postFinder){for(temp=[],i=matcherOut.length;i--;)(elem=matcherOut[i])&&temp.push(matcherIn[i]=elem);postFinder(null,matcherOut=[],temp,xml)}for(i=matcherOut.length;i--;)(elem=matcherOut[i])&&(temp=postFinder?indexOf(seed,elem):preMap[i])>-1&&(seed[temp]=!(results[temp]=elem))}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)})}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,!0),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){var ret=!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));return checkContext=null,ret}];len>i;i++)if(matcher=Expr.relative[tokens[i].type])matchers=[addCombinator(elementMatcher(matchers),matcher)];else{if(matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches),matcher[expando]){for(j=++i;len>j&&!Expr.relative[tokens[j].type];j++);return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:" "===tokens[i-2].type?"*":""})).replace(rtrim,"$1"),matcher,j>i&&matcherFromTokens(tokens.slice(i,j)),len>j&&matcherFromTokens(tokens=tokens.slice(j)),len>j&&toSelector(tokens))}matchers.push(matcher)}return elementMatcher(matchers)}function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",outermost),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1,len=elems.length;for(outermost&&(outermostContext=context!==document&&context);i!==len&&null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0;matcher=elementMatchers[j++];)if(matcher(elem,context,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date,preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function(a,b){return a===b&&(hasDuplicate=!0),0},MAX_NEGATIVE=1<<31,hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){for(var i=0,len=list.length;len>i;i++)if(list[i]===elem)return i;return-1},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",characterEncoding="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",identifier=characterEncoding.replace("w","w#"),attributes="\\["+whitespace+"*("+characterEncoding+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]",pseudos=":("+characterEncoding+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|.*)\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+characterEncoding+")"),CLASS:new RegExp("^\\.("+characterEncoding+")"),TAG:new RegExp("^("+characterEncoding.replace("w","w*")+")"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,rescape=/'|\\/g,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-65536;return high!==high||escapedWhitespace?escaped:0>high?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)},unloadHandler=function(){setDocument()};try{push.apply(arr=slice.call(preferredDoc.childNodes),preferredDoc.childNodes),arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els))}:function(target,els){for(var j=target.length,i=0;target[j++]=els[i++];);target.length=j-1}}}support=Sizzle.support={},isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?"HTML"!==documentElement.nodeName:!1},setDocument=Sizzle.setDocument=function(node){var hasCompare,parent,doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=doc.documentElement,parent=doc.defaultView,parent&&parent!==parent.top&&(parent.addEventListener?parent.addEventListener("unload",unloadHandler,!1):parent.attachEvent&&parent.attachEvent("onunload",unloadHandler)),documentIsHTML=!isXML(doc),support.attributes=assert(function(div){return div.className="i",!div.getAttribute("className")}),support.getElementsByTagName=assert(function(div){return div.appendChild(doc.createComment("")),!div.getElementsByTagName("*").length}),support.getElementsByClassName=rnative.test(doc.getElementsByClassName),support.getById=assert(function(div){return docElem.appendChild(div).id=expando,!doc.getElementsByName||!doc.getElementsByName(expando).length}),support.getById?(Expr.find.ID=function(id,context){if("undefined"!=typeof context.getElementById&&documentIsHTML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}}):(delete Expr.find.ID,Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node="undefined"!=typeof elem.getAttributeNode&&elem.getAttributeNode("id");return node&&node.value===attrId}}),Expr.find.TAG=support.getElementsByTagName?function(tag,context){return"undefined"!=typeof context.getElementsByTagName?context.getElementsByTagName(tag):support.qsa?context.querySelectorAll(tag):void 0}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.CLASS=support.getElementsByClassName&&function(className,context){return documentIsHTML?context.getElementsByClassName(className):void 0},rbuggyMatches=[],rbuggyQSA=[],(support.qsa=rnative.test(doc.querySelectorAll))&&(assert(function(div){docElem.appendChild(div).innerHTML="<a id='"+expando+"'></a><select id='"+expando+"-\f]' msallowcapture=''><option selected=''></option></select>",div.querySelectorAll("[msallowcapture^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")"),div.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")"),div.querySelectorAll("[id~="+expando+"-]").length||rbuggyQSA.push("~="),div.querySelectorAll(":checked").length||rbuggyQSA.push(":checked"),div.querySelectorAll("a#"+expando+"+*").length||rbuggyQSA.push(".#.+[+~]")}),assert(function(div){var input=doc.createElement("input");input.setAttribute("type","hidden"),div.appendChild(input).setAttribute("name","D"),div.querySelectorAll("[name=d]").length&&rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?="),div.querySelectorAll(":enabled").length||rbuggyQSA.push(":enabled",":disabled"),div.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")})),(support.matchesSelector=rnative.test(matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert(function(div){support.disconnectedMatch=matches.call(div,"div"),matches.call(div,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)}),rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|")),rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|")),hasCompare=rnative.test(docElem.compareDocumentPosition),contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=hasCompare?function(a,b){if(a===b)return hasDuplicate=!0,0;var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;return compare?compare:(compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&compare||!support.sortDetached&&b.compareDocumentPosition(a)===compare?a===doc||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)?-1:b===doc||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0:4&compare?-1:1)}:function(a,b){if(a===b)return hasDuplicate=!0,0;var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup)return a===doc?-1:b===doc?1:aup?-1:bup?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},doc):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),expr=expr.replace(rattributeQuotes,"='$1']"),support.matchesSelector&&documentIsHTML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr)))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){(elem.ownerDocument||elem)!==document&&setDocument(elem);var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):void 0;return void 0!==val?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;if(hasDuplicate=!support.detectDuplicates,sortInput=!support.sortStable&&results.slice(0),results.sort(sortOrder),hasDuplicate){for(;elem=results[i++];)elem===results[i]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return sortInput=null,results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i++];)ret+=getText(node);return ret},Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[3]?match[2]=match[4]||match[5]||"":unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return"*"===nodeNameSelector?function(){return!0}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test("string"==typeof elem.className&&elem.className||"undefined"!=typeof elem.getAttribute&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:operator?(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:"|="===operator?result===check||result.slice(0,check.length+1)===check+"-":!1):!0}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(outerCache=parent[expando]||(parent[expando]={}),cache=outerCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=cache[0]===dirruns&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns)diff=cache[1];else for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&((node[expando]||(node[expando]={}))[type]=[dirruns,diff]),node!==elem)););return diff-=last,diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)idx=indexOf(seed,matched[i]),seed[idx]=!(matches[idx]=matched[i])}):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))}):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),input[0]=null,!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return text=text.replace(runescape,funescape),function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))return elemLang=elemLang.toLowerCase(),elemLang===lang||0===elemLang.indexOf(lang+"-");while((elem=elem.parentNode)&&1===elem.nodeType);return!1}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:function(elem){return elem.disabled===!1},disabled:function(elem){return elem.disabled===!0},checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,elem.selected===!0},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeType<6)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||"text"===attr.toLowerCase())},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[0>argument?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){for(var i=0;length>i;i+=2)matchIndexes.push(i);return matchIndexes}),odd:createPositionalPseudo(function(matchIndexes,length){for(var i=1;length>i;i+=2)matchIndexes.push(i);return matchIndexes}),lt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=0>argument?argument+length:argument;--i>=0;)matchIndexes.push(i);return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=0>argument?argument+length:argument;++i<length;)matchIndexes.push(i);return matchIndexes})}},Expr.pseudos.nth=Expr.pseudos.eq;for(i in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})Expr.pseudos[i]=createInputPseudo(i);for(i in{submit:!0,reset:!0})Expr.pseudos[i]=createButtonPseudo(i);return setFilters.prototype=Expr.filters=Expr.pseudos,Expr.setFilters=new setFilters,tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached)return parseOnly?0:cached.slice(0);for(soFar=selector,groups=[],preFilters=Expr.preFilter;soFar;){matched&&!(match=rcomma.exec(soFar))||(match&&(soFar=soFar.slice(match[0].length)||soFar),groups.push(tokens=[])),matched=!1,(match=rcombinators.exec(soFar))&&(matched=match.shift(),tokens.push({value:matched,type:match[0].replace(rtrim," ")}),soFar=soFar.slice(matched.length));for(type in Expr.filter)!(match=matchExpr[type].exec(soFar))||preFilters[type]&&!(match=preFilters[type](match))||(matched=match.shift(),tokens.push({value:matched,type:type,matches:match}),soFar=soFar.slice(matched.length));if(!matched)break}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)},compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){for(match||(match=tokenize(selector)),i=match.length;i--;)cached=matcherFromTokens(match[i]),cached[expando]?setMatchers.push(cached):elementMatchers.push(cached);cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers)),cached.selector=selector}return cached},select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled="function"==typeof selector&&selector,match=!seed&&tokenize(selector=compiled.selector||selector);if(results=results||[],1===match.length){if(tokens=match[0]=match[0].slice(0),tokens.length>2&&"ID"===(token=tokens[0]).type&&support.getById&&9===context.nodeType&&documentIsHTML&&Expr.relative[tokens[1].type]){if(context=(Expr.find.ID(token.matches[0].replace(runescape,funescape),context)||[])[0],!context)return results;compiled&&(context=context.parentNode),selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){if(tokens.splice(i,1),selector=seed.length&&toSelector(tokens),!selector)return push.apply(results,seed),results;break}}return(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,rsibling.test(selector)&&testContext(context.parentNode)||context),results},support.sortStable=expando.split("").sort(sortOrder).join("")===expando,support.detectDuplicates=!!hasDuplicate,setDocument(),support.sortDetached=assert(function(div1){return 1&div1.compareDocumentPosition(document.createElement("div"))}),assert(function(div){return div.innerHTML="<a href='#'></a>","#"===div.firstChild.getAttribute("href")})||addHandle("type|href|height|width",function(elem,name,isXML){return isXML?void 0:elem.getAttribute(name,"type"===name.toLowerCase()?1:2)}),support.attributes&&assert(function(div){return div.innerHTML="<input/>",div.firstChild.setAttribute("value",""),""===div.firstChild.getAttribute("value")})||addHandle("value",function(elem,name,isXML){return isXML||"input"!==elem.nodeName.toLowerCase()?void 0:elem.defaultValue}),assert(function(div){return null==div.getAttribute("disabled")})||addHandle(booleans,function(elem,name,isXML){var val;return isXML?void 0:elem[name]===!0?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null}),Sizzle}(window);jQuery.find=Sizzle,jQuery.expr=Sizzle.selectors,jQuery.expr[":"]=jQuery.expr.pseudos,jQuery.unique=Sizzle.uniqueSort,jQuery.text=Sizzle.getText,jQuery.isXMLDoc=Sizzle.isXML,jQuery.contains=Sizzle.contains;var rneedsContext=jQuery.expr.match.needsContext,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,risSimple=/^.[^:#\[\.,]*$/;
jQuery.filter=function(expr,elems,not){var elem=elems[0];return not&&(expr=":not("+expr+")"),1===elems.length&&1===elem.nodeType?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return 1===elem.nodeType}))},jQuery.fn.extend({find:function(selector){var i,ret=[],self=this,len=self.length;if("string"!=typeof selector)return this.pushStack(jQuery(selector).filter(function(){for(i=0;len>i;i++)if(jQuery.contains(self[i],this))return!0}));for(i=0;len>i;i++)jQuery.find(selector,self[i],ret);return ret=this.pushStack(len>1?jQuery.unique(ret):ret),ret.selector=this.selector?this.selector+" "+selector:selector,ret},filter:function(selector){return this.pushStack(winnow(this,selector||[],!1))},not:function(selector){return this.pushStack(winnow(this,selector||[],!0))},is:function(selector){return!!winnow(this,"string"==typeof selector&&rneedsContext.test(selector)?jQuery(selector):selector||[],!1).length}});var rootjQuery,document=window.document,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,init=jQuery.fn.init=function(selector,context){var match,elem;if(!selector)return this;if("string"==typeof selector){if(match="<"===selector.charAt(0)&&">"===selector.charAt(selector.length-1)&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector),!match||!match[1]&&context)return!context||context.jquery?(context||rootjQuery).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)jQuery.isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}if(elem=document.getElementById(match[2]),elem&&elem.parentNode){if(elem.id!==match[2])return rootjQuery.find(selector);this.length=1,this[0]=elem}return this.context=document,this.selector=selector,this}return selector.nodeType?(this.context=this[0]=selector,this.length=1,this):jQuery.isFunction(selector)?"undefined"!=typeof rootjQuery.ready?rootjQuery.ready(selector):selector(jQuery):(void 0!==selector.selector&&(this.selector=selector.selector,this.context=selector.context),jQuery.makeArray(selector,this))};init.prototype=jQuery.fn,rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};jQuery.extend({dir:function(elem,dir,until){for(var matched=[],cur=elem[dir];cur&&9!==cur.nodeType&&(void 0===until||1!==cur.nodeType||!jQuery(cur).is(until));)1===cur.nodeType&&matched.push(cur),cur=cur[dir];return matched},sibling:function(n,elem){for(var r=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&r.push(n);return r}}),jQuery.fn.extend({has:function(target){var i,targets=jQuery(target,this),len=targets.length;return this.filter(function(){for(i=0;len>i;i++)if(jQuery.contains(this,targets[i]))return!0})},closest:function(selectors,context){for(var cur,i=0,l=this.length,matched=[],pos=rneedsContext.test(selectors)||"string"!=typeof selectors?jQuery(selectors,context||this.context):0;l>i;i++)for(cur=this[i];cur&&cur!==context;cur=cur.parentNode)if(cur.nodeType<11&&(pos?pos.index(cur)>-1:1===cur.nodeType&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break}return this.pushStack(matched.length>1?jQuery.unique(matched):matched)},index:function(elem){return elem?"string"==typeof elem?jQuery.inArray(this[0],jQuery(elem)):jQuery.inArray(elem.jquery?elem[0]:elem,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),jQuery(selector,context))))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?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 sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"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.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);return"Until"!==name.slice(-5)&&(selector=until),selector&&"string"==typeof selector&&(ret=jQuery.filter(selector,ret)),this.length>1&&(guaranteedUnique[name]||(ret=jQuery.unique(ret)),rparentsprev.test(name)&&(ret=ret.reverse())),this.pushStack(ret)}});var rnotwhite=/\S+/g,optionsCache={};jQuery.Callbacks=function(options){options="string"==typeof options?optionsCache[options]||createOptions(options):jQuery.extend({},options);var firing,memory,fired,firingLength,firingIndex,firingStart,list=[],stack=!options.once&&[],fire=function(data){for(memory=options.memory&&data,fired=!0,firingIndex=firingStart||0,firingStart=0,firingLength=list.length,firing=!0;list&&firingLength>firingIndex;firingIndex++)if(list[firingIndex].apply(data[0],data[1])===!1&&options.stopOnFalse){memory=!1;break}firing=!1,list&&(stack?stack.length&&fire(stack.shift()):memory?list=[]:self.disable())},self={add:function(){if(list){var start=list.length;!function add(args){jQuery.each(args,function(_,arg){var type=jQuery.type(arg);"function"===type?options.unique&&self.has(arg)||list.push(arg):arg&&arg.length&&"string"!==type&&add(arg)})}(arguments),firing?firingLength=list.length:memory&&(firingStart=start,fire(memory))}return this},remove:function(){return list&&jQuery.each(arguments,function(_,arg){for(var index;(index=jQuery.inArray(arg,list,index))>-1;)list.splice(index,1),firing&&(firingLength>=index&&firingLength--,firingIndex>=index&&firingIndex--)}),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:!(!list||!list.length)},empty:function(){return list=[],firingLength=0,this},disable:function(){return list=stack=memory=void 0,this},disabled:function(){return!list},lock:function(){return stack=void 0,memory||self.disable(),this},locked:function(){return!stack},fireWith:function(context,args){return!list||fired&&!stack||(args=args||[],args=[context,args.slice?args.slice():args],firing?stack.push(args):fire(args)),this},fire:function(){return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);returned&&jQuery.isFunction(returned.promise)?returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify):newDefer[tuple[0]+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments)})}),fns=null}).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return promise.pipe=promise.then,jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add,stateString&&list.add(function(){state=stateString},tuples[1^i][2].disable,tuples[2][2].lock),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?promise:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith}),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(subordinate){var progressValues,progressContexts,resolveContexts,i=0,resolveValues=slice.call(arguments),length=resolveValues.length,remaining=1!==length||subordinate&&jQuery.isFunction(subordinate.promise)?length:0,deferred=1===remaining?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this,values[i]=arguments.length>1?slice.call(arguments):value,values===progressValues?deferred.notifyWith(contexts,values):--remaining||deferred.resolveWith(contexts,values)}};if(length>1)for(progressValues=new Array(length),progressContexts=new Array(length),resolveContexts=new Array(length);length>i;i++)resolveValues[i]&&jQuery.isFunction(resolveValues[i].promise)?resolveValues[i].promise().done(updateFunc(i,resolveContexts,resolveValues)).fail(deferred.reject).progress(updateFunc(i,progressContexts,progressValues)):--remaining;return remaining||deferred.resolveWith(resolveContexts,resolveValues),deferred.promise()}});var readyList;jQuery.fn.ready=function(fn){return jQuery.ready.promise().done(fn),this},jQuery.extend({isReady:!1,readyWait:1,holdReady:function(hold){hold?jQuery.readyWait++:jQuery.ready(!0)},ready:function(wait){if(wait===!0?!--jQuery.readyWait:!jQuery.isReady){if(!document.body)return setTimeout(jQuery.ready);jQuery.isReady=!0,wait!==!0&&--jQuery.readyWait>0||(readyList.resolveWith(document,[jQuery]),jQuery.fn.triggerHandler&&(jQuery(document).triggerHandler("ready"),jQuery(document).off("ready")))}}}),jQuery.ready.promise=function(obj){if(!readyList)if(readyList=jQuery.Deferred(),"complete"===document.readyState)setTimeout(jQuery.ready);else if(document.addEventListener)document.addEventListener("DOMContentLoaded",completed,!1),window.addEventListener("load",completed,!1);else{document.attachEvent("onreadystatechange",completed),window.attachEvent("onload",completed);var top=!1;try{top=null==window.frameElement&&document.documentElement}catch(e){}top&&top.doScroll&&!function doScrollCheck(){if(!jQuery.isReady){try{top.doScroll("left")}catch(e){return setTimeout(doScrollCheck,50)}detach(),jQuery.ready()}}()}return readyList.promise(obj)};var i,strundefined="undefined";for(i in jQuery(support))break;support.ownLast="0"!==i,support.inlineBlockNeedsLayout=!1,jQuery(function(){var val,div,body,container;body=document.getElementsByTagName("body")[0],body&&body.style&&(div=document.createElement("div"),container=document.createElement("div"),container.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",body.appendChild(container).appendChild(div),typeof div.style.zoom!==strundefined&&(div.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",support.inlineBlockNeedsLayout=val=3===div.offsetWidth,val&&(body.style.zoom=1)),body.removeChild(container))}),function(){var div=document.createElement("div");if(null==support.deleteExpando){support.deleteExpando=!0;try{delete div.test}catch(e){support.deleteExpando=!1}}div=null}(),jQuery.acceptData=function(elem){var noData=jQuery.noData[(elem.nodeName+" ").toLowerCase()],nodeType=+elem.nodeType||1;return 1!==nodeType&&9!==nodeType?!1:!noData||noData!==!0&&elem.getAttribute("classid")===noData};var rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/([A-Z])/g;jQuery.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(elem){return elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando],!!elem&&!isEmptyDataObject(elem)},data:function(elem,name,data){return internalData(elem,name,data)},removeData:function(elem,name){return internalRemoveData(elem,name)},_data:function(elem,name,data){return internalData(elem,name,data,!0)},_removeData:function(elem,name){return internalRemoveData(elem,name,!0)}}),jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(void 0===key){if(this.length&&(data=jQuery.data(elem),1===elem.nodeType&&!jQuery._data(elem,"parsedAttrs"))){for(i=attrs.length;i--;)attrs[i]&&(name=attrs[i].name,0===name.indexOf("data-")&&(name=jQuery.camelCase(name.slice(5)),dataAttr(elem,name,data[name])));jQuery._data(elem,"parsedAttrs",!0)}return data}return"object"==typeof key?this.each(function(){jQuery.data(this,key)}):arguments.length>1?this.each(function(){jQuery.data(this,key,value)}):elem?dataAttr(elem,key,jQuery.data(elem,key)):void 0},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})}}),jQuery.extend({queue:function(elem,type,data){var queue;return elem?(type=(type||"fx")+"queue",queue=jQuery._data(elem,type),data&&(!queue||jQuery.isArray(data)?queue=jQuery._data(elem,type,jQuery.makeArray(data)):queue.push(data)),queue||[]):void 0},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};"inprogress"===fn&&(fn=queue.shift(),startLength--),fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!startLength&&hooks&&hooks.empty.fire()},_queueHooks:function(elem,type){var key=type+"queueHooks";return jQuery._data(elem,key)||jQuery._data(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){jQuery._removeData(elem,type+"queue"),jQuery._removeData(elem,key)})})}}),jQuery.fn.extend({queue:function(type,data){var setter=2;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length<setter?jQuery.queue(this[0],type):void 0===data?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type),"fx"===type&&"inprogress"!==queue[0]&&jQuery.dequeue(this,type)})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})},clearQueue:function(type){return this.queue(type||"fx",[])},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){--count||defer.resolveWith(elements,[elements])};for("string"!=typeof type&&(obj=type,type=void 0),type=type||"fx";i--;)tmp=jQuery._data(elements[i],type+"queueHooks"),tmp&&tmp.empty&&(count++,tmp.empty.add(resolve));return resolve(),defer.promise(obj)}});var pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,cssExpand=["Top","Right","Bottom","Left"],isHidden=function(elem,el){return elem=el||elem,"none"===jQuery.css(elem,"display")||!jQuery.contains(elem.ownerDocument,elem)},access=jQuery.access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,length=elems.length,bulk=null==key;if("object"===jQuery.type(key)){chainable=!0;for(i in key)jQuery.access(elems,fn,i,key[i],!0,emptyGet,raw)}else if(void 0!==value&&(chainable=!0,jQuery.isFunction(value)||(raw=!0),bulk&&(raw?(fn.call(elems,value),fn=null):(bulk=fn,fn=function(elem,key,value){return bulk.call(jQuery(elem),value)})),fn))for(;length>i;i++)fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));return chainable?elems:bulk?fn.call(elems):length?fn(elems[0],key):emptyGet},rcheckableType=/^(?:checkbox|radio)$/i;!function(){var input=document.createElement("input"),div=document.createElement("div"),fragment=document.createDocumentFragment();if(div.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",support.leadingWhitespace=3===div.firstChild.nodeType,support.tbody=!div.getElementsByTagName("tbody").length,support.htmlSerialize=!!div.getElementsByTagName("link").length,support.html5Clone="<:nav></:nav>"!==document.createElement("nav").cloneNode(!0).outerHTML,input.type="checkbox",input.checked=!0,fragment.appendChild(input),support.appendChecked=input.checked,div.innerHTML="<textarea>x</textarea>",support.noCloneChecked=!!div.cloneNode(!0).lastChild.defaultValue,fragment.appendChild(div),div.innerHTML="<input type='radio' checked='checked' name='t'/>",support.checkClone=div.cloneNode(!0).cloneNode(!0).lastChild.checked,support.noCloneEvent=!0,div.attachEvent&&(div.attachEvent("onclick",function(){support.noCloneEvent=!1}),div.cloneNode(!0).click()),null==support.deleteExpando){support.deleteExpando=!0;try{delete div.test}catch(e){support.deleteExpando=!1}}}(),function(){var i,eventName,div=document.createElement("div");for(i in{submit:!0,change:!0,focusin:!0})eventName="on"+i,(support[i+"Bubbles"]=eventName in window)||(div.setAttribute(eventName,"t"),support[i+"Bubbles"]=div.attributes[eventName].expando===!1);div=null}();var rformElems=/^(?:input|select|textarea)$/i,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;jQuery.event={global:{},add:function(elem,types,handler,data,selector){var tmp,events,t,handleObjIn,special,eventHandle,handleObj,handlers,type,namespaces,origType,elemData=jQuery._data(elem);if(elemData){for(handler.handler&&(handleObjIn=handler,handler=handleObjIn.handler,selector=handleObjIn.selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events={}),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return typeof jQuery===strundefined||e&&jQuery.event.triggered===e.type?void 0:jQuery.event.dispatch.apply(eventHandle.elem,arguments)},eventHandle.elem=elem),types=(types||"").match(rnotwhite)||[""],t=types.length;t--;)tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type&&(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,special=jQuery.event.special[type]||{},handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn),(handlers=events[type])||(handlers=events[type]=[],handlers.delegateCount=0,special.setup&&special.setup.call(elem,data,namespaces,eventHandle)!==!1||(elem.addEventListener?elem.addEventListener(type,eventHandle,!1):elem.attachEvent&&elem.attachEvent("on"+type,eventHandle))),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0);elem=null}},remove:function(elem,types,handler,selector,mappedTypes){var j,handleObj,tmp,origCount,t,events,special,handlers,type,namespaces,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem);if(elemData&&(events=elemData.events)){for(types=(types||"").match(rnotwhite)||[""],t=types.length;t--;)if(tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,handlers=events[type]||[],tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"),origCount=j=handlers.length;j--;)handleObj=handlers[j],!mappedTypes&&origType!==handleObj.origType||handler&&handler.guid!==handleObj.guid||tmp&&!tmp.test(handleObj.namespace)||selector&&selector!==handleObj.selector&&("**"!==selector||!handleObj.selector)||(handlers.splice(j,1),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&special.teardown.call(elem,namespaces,elemData.handle)!==!1||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&(delete elemData.handle,jQuery._removeData(elem,"events"))}},trigger:function(event,data,elem,onlyHandlers){var handle,ontype,cur,bubbleType,special,tmp,i,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>=0&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event),event.isTrigger=onlyHandlers?2:3,event.namespace=namespaces.join("."),event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=void 0,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||special.trigger.apply(elem,data)!==!1)){if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)event.type=i>1?bubbleType:special.bindType||type,handle=(jQuery._data(cur,"events")||{})[event.type]&&jQuery._data(cur,"handle"),handle&&handle.apply(cur,data),handle=ontype&&cur[ontype],handle&&handle.apply&&jQuery.acceptData(cur)&&(event.result=handle.apply(cur,data),event.result===!1&&event.preventDefault());if(event.type=type,!onlyHandlers&&!event.isDefaultPrevented()&&(!special._default||special._default.apply(eventPath.pop(),data)===!1)&&jQuery.acceptData(elem)&&ontype&&elem[type]&&!jQuery.isWindow(elem)){tmp=elem[ontype],tmp&&(elem[ontype]=null),jQuery.event.triggered=type;try{elem[type]()}catch(e){}jQuery.event.triggered=void 0,tmp&&(elem[ontype]=tmp)}return event.result}},dispatch:function(event){event=jQuery.event.fix(event);var i,ret,handleObj,matched,j,handlerQueue=[],args=slice.call(arguments),handlers=(jQuery._data(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};if(args[0]=event,event.delegateTarget=this,!special.preDispatch||special.preDispatch.call(this,event)!==!1){for(handlerQueue=jQuery.event.handlers.call(this,event,handlers),i=0;(matched=handlerQueue[i++])&&!event.isPropagationStopped();)for(event.currentTarget=matched.elem,j=0;(handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped();)event.namespace_re&&!event.namespace_re.test(handleObj.namespace)||(event.handleObj=handleObj,event.data=handleObj.data,ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args),void 0!==ret&&(event.result=ret)===!1&&(event.preventDefault(),event.stopPropagation()));return special.postDispatch&&special.postDispatch.call(this,event),event.result}},handlers:function(event,handlers){var sel,handleObj,matches,i,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(!event.button||"click"!==event.type))for(;cur!=this;cur=cur.parentNode||this)if(1===cur.nodeType&&(cur.disabled!==!0||"click"!==event.type)){for(matches=[],i=0;delegateCount>i;i++)handleObj=handlers[i],sel=handleObj.selector+" ",void 0===matches[sel]&&(matches[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>=0:jQuery.find(sel,this,null,[cur]).length),matches[sel]&&matches.push(handleObj);matches.length&&handlerQueue.push({elem:cur,handlers:matches})}return delegateCount<handlers.length&&handlerQueue.push({elem:this,handlers:handlers.slice(delegateCount)}),handlerQueue},fix:function(event){if(event[jQuery.expando])return event;var i,prop,copy,type=event.type,originalEvent=event,fixHook=this.fixHooks[type];for(fixHook||(this.fixHooks[type]=fixHook=rmouseEvent.test(type)?this.mouseHooks:rkeyEvent.test(type)?this.keyHooks:{}),copy=fixHook.props?this.props.concat(fixHook.props):this.props,event=new jQuery.Event(originalEvent),i=copy.length;i--;)prop=copy[i],event[prop]=originalEvent[prop];return event.target||(event.target=originalEvent.srcElement||document),3===event.target.nodeType&&(event.target=event.target.parentNode),event.metaKey=!!event.metaKey,fixHook.filter?fixHook.filter(event,originalEvent):event},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(event,original){return null==event.which&&(event.which=null!=original.charCode?original.charCode:original.keyCode),event}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(event,original){var body,eventDoc,doc,button=original.button,fromElement=original.fromElement;return null==event.pageX&&null!=original.clientX&&(eventDoc=event.target.ownerDocument||document,doc=eventDoc.documentElement,body=eventDoc.body,event.pageX=original.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0),event.pageY=original.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)),!event.relatedTarget&&fromElement&&(event.relatedTarget=fromElement===event.target?original.toElement:fromElement),event.which||void 0===button||(event.which=1&button?1:2&button?3:4&button?2:0),event}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==safeActiveElement()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===safeActiveElement()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return jQuery.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(event){return jQuery.nodeName(event.target,"a")}},beforeunload:{postDispatch:function(event){void 0!==event.result&&event.originalEvent&&(event.originalEvent.returnValue=event.result)}}},simulate:function(type,elem,event,bubble){var e=jQuery.extend(new jQuery.Event,event,{type:type,isSimulated:!0,originalEvent:{}});bubble?jQuery.event.trigger(e,null,elem):jQuery.event.dispatch.call(elem,e),e.isDefaultPrevented()&&event.preventDefault()}},jQuery.removeEvent=document.removeEventListener?function(elem,type,handle){elem.removeEventListener&&elem.removeEventListener(type,handle,!1)}:function(elem,type,handle){var name="on"+type;elem.detachEvent&&(typeof elem[name]===strundefined&&(elem[name]=null),elem.detachEvent(name,handle))},jQuery.Event=function(src,props){return this instanceof jQuery.Event?(src&&src.type?(this.originalEvent=src,this.type=src.type,this.isDefaultPrevented=src.defaultPrevented||void 0===src.defaultPrevented&&src.returnValue===!1?returnTrue:returnFalse):this.type=src,props&&jQuery.extend(this,props),this.timeStamp=src&&src.timeStamp||jQuery.now(),void(this[jQuery.expando]=!0)):new jQuery.Event(src,props)},jQuery.Event.prototype={isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;return related&&(related===target||jQuery.contains(target,related))||(event.type=handleObj.origType,ret=handleObj.handler.apply(this,arguments),event.type=fix),ret}}}),support.submitBubbles||(jQuery.event.special.submit={setup:function(){return jQuery.nodeName(this,"form")?!1:void jQuery.event.add(this,"click._submit keypress._submit",function(e){var elem=e.target,form=jQuery.nodeName(elem,"input")||jQuery.nodeName(elem,"button")?elem.form:void 0;form&&!jQuery._data(form,"submitBubbles")&&(jQuery.event.add(form,"submit._submit",function(event){event._submit_bubble=!0}),jQuery._data(form,"submitBubbles",!0))})},postDispatch:function(event){event._submit_bubble&&(delete event._submit_bubble,this.parentNode&&!event.isTrigger&&jQuery.event.simulate("submit",this.parentNode,event,!0))},teardown:function(){return jQuery.nodeName(this,"form")?!1:void jQuery.event.remove(this,"._submit")}}),support.changeBubbles||(jQuery.event.special.change={setup:function(){return rformElems.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(jQuery.event.add(this,"propertychange._change",function(event){"checked"===event.originalEvent.propertyName&&(this._just_changed=!0)}),jQuery.event.add(this,"click._change",function(event){this._just_changed&&!event.isTrigger&&(this._just_changed=!1),jQuery.event.simulate("change",this,event,!0)})),!1):void jQuery.event.add(this,"beforeactivate._change",function(e){var elem=e.target;rformElems.test(elem.nodeName)&&!jQuery._data(elem,"changeBubbles")&&(jQuery.event.add(elem,"change._change",function(event){!this.parentNode||event.isSimulated||event.isTrigger||jQuery.event.simulate("change",this.parentNode,event,!0)}),jQuery._data(elem,"changeBubbles",!0))})},handle:function(event){var elem=event.target;return this!==elem||event.isSimulated||event.isTrigger||"radio"!==elem.type&&"checkbox"!==elem.type?event.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return jQuery.event.remove(this,"._change"),!rformElems.test(this.nodeName)}}),support.focusinBubbles||jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event),!0)};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this,attaches=jQuery._data(doc,fix);attaches||doc.addEventListener(orig,handler,!0),jQuery._data(doc,fix,(attaches||0)+1)},teardown:function(){var doc=this.ownerDocument||this,attaches=jQuery._data(doc,fix)-1;attaches?jQuery._data(doc,fix,attaches):(doc.removeEventListener(orig,handler,!0),jQuery._removeData(doc,fix))}}}),jQuery.fn.extend({on:function(types,selector,data,fn,one){var type,origFn;if("object"==typeof types){"string"!=typeof selector&&(data=data||selector,selector=void 0);for(type in types)this.on(type,selector,data,types[type],one);return this}if(null==data&&null==fn?(fn=selector,data=selector=void 0):null==fn&&("string"==typeof selector?(fn=data,data=void 0):(fn=data,data=selector,selector=void 0)),fn===!1)fn=returnFalse;else if(!fn)return this;return 1===one&&(origFn=fn,fn=function(event){return jQuery().off(event),origFn.apply(this,arguments)},fn.guid=origFn.guid||(origFn.guid=jQuery.guid++)),this.each(function(){jQuery.event.add(this,types,fn,data,selector)})},one:function(types,selector,data,fn){return this.on(types,selector,data,fn,1)},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj)return handleObj=types.handleObj,jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler),this;if("object"==typeof types){for(type in types)this.off(type,selector,types[type]);return this}return selector!==!1&&"function"!=typeof selector||(fn=selector,selector=void 0),fn===!1&&(fn=returnFalse),this.each(function(){jQuery.event.remove(this,types,fn,selector)})},trigger:function(type,data){return this.each(function(){
jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){var elem=this[0];return elem?jQuery.event.trigger(type,data,elem,!0):void 0}});var nodeNames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlinejQuery=/ jQuery\d+="(?:null|\d+)"/g,rnoshimcache=new RegExp("<(?:"+nodeNames+")[\\s/>]","i"),rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnoInnerhtml=/<(?:script|style|link)/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptType=/^$|\/(?:java|ecma)script/i,rscriptTypeMasked=/^true\/(.*)/,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},safeFragment=createSafeFragment(document),fragmentDiv=safeFragment.appendChild(document.createElement("div"));wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td,jQuery.extend({clone:function(elem,dataAndEvents,deepDataAndEvents){var destElements,node,clone,i,srcElements,inPage=jQuery.contains(elem.ownerDocument,elem);if(support.html5Clone||jQuery.isXMLDoc(elem)||!rnoshimcache.test("<"+elem.nodeName+">")?clone=elem.cloneNode(!0):(fragmentDiv.innerHTML=elem.outerHTML,fragmentDiv.removeChild(clone=fragmentDiv.firstChild)),!(support.noCloneEvent&&support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),srcElements=getAll(elem),i=0;null!=(node=srcElements[i]);++i)destElements[i]&&fixCloneNodeIssues(node,destElements[i]);if(dataAndEvents)if(deepDataAndEvents)for(srcElements=srcElements||getAll(elem),destElements=destElements||getAll(clone),i=0;null!=(node=srcElements[i]);i++)cloneCopyEvent(node,destElements[i]);else cloneCopyEvent(elem,clone);return destElements=getAll(clone,"script"),destElements.length>0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),destElements=srcElements=node=null,clone},buildFragment:function(elems,context,scripts,selection){for(var j,elem,contains,tmp,tag,tbody,wrap,l=elems.length,safe=createSafeFragment(context),nodes=[],i=0;l>i;i++)if(elem=elems[i],elem||0===elem)if("object"===jQuery.type(elem))jQuery.merge(nodes,elem.nodeType?[elem]:elem);else if(rhtml.test(elem)){for(tmp=tmp||safe.appendChild(context.createElement("div")),tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,tmp.innerHTML=wrap[1]+elem.replace(rxhtmlTag,"<$1></$2>")+wrap[2],j=wrap[0];j--;)tmp=tmp.lastChild;if(!support.leadingWhitespace&&rleadingWhitespace.test(elem)&&nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0])),!support.tbody)for(elem="table"!==tag||rtbody.test(elem)?"<table>"!==wrap[1]||rtbody.test(elem)?0:tmp:tmp.firstChild,j=elem&&elem.childNodes.length;j--;)jQuery.nodeName(tbody=elem.childNodes[j],"tbody")&&!tbody.childNodes.length&&elem.removeChild(tbody);for(jQuery.merge(nodes,tmp.childNodes),tmp.textContent="";tmp.firstChild;)tmp.removeChild(tmp.firstChild);tmp=safe.lastChild}else nodes.push(context.createTextNode(elem));for(tmp&&safe.removeChild(tmp),support.appendChecked||jQuery.grep(getAll(nodes,"input"),fixDefaultChecked),i=0;elem=nodes[i++];)if((!selection||-1===jQuery.inArray(elem,selection))&&(contains=jQuery.contains(elem.ownerDocument,elem),tmp=getAll(safe.appendChild(elem),"script"),contains&&setGlobalEval(tmp),scripts))for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return tmp=null,safe},cleanData:function(elems,acceptData){for(var elem,type,id,data,i=0,internalKey=jQuery.expando,cache=jQuery.cache,deleteExpando=support.deleteExpando,special=jQuery.event.special;null!=(elem=elems[i]);i++)if((acceptData||jQuery.acceptData(elem))&&(id=elem[internalKey],data=id&&cache[id])){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);cache[id]&&(delete cache[id],deleteExpando?delete elem[internalKey]:typeof elem.removeAttribute!==strundefined?elem.removeAttribute(internalKey):elem[internalKey]=null,deletedIds.push(id))}}}),jQuery.fn.extend({text:function(value){return access(this,function(value){return void 0===value?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(value))},null,value,arguments.length)},append:function(){return this.domManip(arguments,function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var target=manipulationTarget(this,elem);target.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}})},before:function(){return this.domManip(arguments,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)})},remove:function(selector,keepData){for(var elem,elems=selector?jQuery.filter(selector,this):this,i=0;null!=(elem=elems[i]);i++)keepData||1!==elem.nodeType||jQuery.cleanData(getAll(elem)),elem.parentNode&&(keepData&&jQuery.contains(elem.ownerDocument,elem)&&setGlobalEval(getAll(elem,"script")),elem.parentNode.removeChild(elem));return this},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++){for(1===elem.nodeType&&jQuery.cleanData(getAll(elem,!1));elem.firstChild;)elem.removeChild(elem.firstChild);elem.options&&jQuery.nodeName(elem,"select")&&(elem.options.length=0)}return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null==dataAndEvents?!1:dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(void 0===value)return 1===elem.nodeType?elem.innerHTML.replace(rinlinejQuery,""):void 0;if("string"==typeof value&&!rnoInnerhtml.test(value)&&(support.htmlSerialize||!rnoshimcache.test(value))&&(support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1></$2>");try{for(;l>i;i++)elem=this[i]||{},1===elem.nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.innerHTML=value);elem=0}catch(e){}}elem&&this.empty().append(value)},null,value,arguments.length)},replaceWith:function(){var arg=arguments[0];return this.domManip(arguments,function(elem){arg=this.parentNode,jQuery.cleanData(getAll(this)),arg&&arg.replaceChild(elem,this)}),arg&&(arg.length||arg.nodeType)?this:this.remove()},detach:function(selector){return this.remove(selector,!0)},domManip:function(args,callback){args=concat.apply([],args);var first,node,hasScripts,scripts,doc,fragment,i=0,l=this.length,set=this,iNoClone=l-1,value=args[0],isFunction=jQuery.isFunction(value);if(isFunction||l>1&&"string"==typeof value&&!support.checkClone&&rchecked.test(value))return this.each(function(index){var self=set.eq(index);isFunction&&(args[0]=value.call(this,index,self.html())),self.domManip(args,callback)});if(l&&(fragment=jQuery.buildFragment(args,this[0].ownerDocument,!1,this),first=fragment.firstChild,1===fragment.childNodes.length&&(fragment=first),first)){for(scripts=jQuery.map(getAll(fragment,"script"),disableScript),hasScripts=scripts.length;l>i;i++)node=fragment,i!==iNoClone&&(node=jQuery.clone(node,!0,!0),hasScripts&&jQuery.merge(scripts,getAll(node,"script"))),callback.call(this[i],node,i);if(hasScripts)for(doc=scripts[scripts.length-1].ownerDocument,jQuery.map(scripts,restoreScript),i=0;hasScripts>i;i++)node=scripts[i],rscriptType.test(node.type||"")&&!jQuery._data(node,"globalEval")&&jQuery.contains(doc,node)&&(node.src?jQuery._evalUrl&&jQuery._evalUrl(node.src):jQuery.globalEval((node.text||node.textContent||node.innerHTML||"").replace(rcleanScript,"")));fragment=first=null}return this}}),jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){for(var elems,i=0,ret=[],insert=jQuery(selector),last=insert.length-1;last>=i;i++)elems=i===last?this:this.clone(!0),jQuery(insert[i])[original](elems),push.apply(ret,elems.get());return this.pushStack(ret)}});var iframe,elemdisplay={};!function(){var shrinkWrapBlocksVal;support.shrinkWrapBlocks=function(){if(null!=shrinkWrapBlocksVal)return shrinkWrapBlocksVal;shrinkWrapBlocksVal=!1;var div,body,container;return body=document.getElementsByTagName("body")[0],body&&body.style?(div=document.createElement("div"),container=document.createElement("div"),container.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",body.appendChild(container).appendChild(div),typeof div.style.zoom!==strundefined&&(div.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",div.appendChild(document.createElement("div")).style.width="5px",shrinkWrapBlocksVal=3!==div.offsetWidth),body.removeChild(container),shrinkWrapBlocksVal):void 0}}();var getStyles,curCSS,rmargin=/^margin/,rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i"),rposition=/^(top|right|bottom|left)$/;window.getComputedStyle?(getStyles=function(elem){return elem.ownerDocument.defaultView.opener?elem.ownerDocument.defaultView.getComputedStyle(elem,null):window.getComputedStyle(elem,null)},curCSS=function(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;return computed=computed||getStyles(elem),ret=computed?computed.getPropertyValue(name)||computed[name]:void 0,computed&&(""!==ret||jQuery.contains(elem.ownerDocument,elem)||(ret=jQuery.style(elem,name)),rnumnonpx.test(ret)&&rmargin.test(name)&&(width=style.width,minWidth=style.minWidth,maxWidth=style.maxWidth,style.minWidth=style.maxWidth=style.width=ret,ret=computed.width,style.width=width,style.minWidth=minWidth,style.maxWidth=maxWidth)),void 0===ret?ret:ret+""}):document.documentElement.currentStyle&&(getStyles=function(elem){return elem.currentStyle},curCSS=function(elem,name,computed){var left,rs,rsLeft,ret,style=elem.style;return computed=computed||getStyles(elem),ret=computed?computed[name]:void 0,null==ret&&style&&style[name]&&(ret=style[name]),rnumnonpx.test(ret)&&!rposition.test(name)&&(left=style.left,rs=elem.runtimeStyle,rsLeft=rs&&rs.left,rsLeft&&(rs.left=elem.currentStyle.left),style.left="fontSize"===name?"1em":ret,ret=style.pixelLeft+"px",style.left=left,rsLeft&&(rs.left=rsLeft)),void 0===ret?ret:ret+""||"auto"}),function(){function computeStyleTests(){var div,body,container,contents;body=document.getElementsByTagName("body")[0],body&&body.style&&(div=document.createElement("div"),container=document.createElement("div"),container.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",body.appendChild(container).appendChild(div),div.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",pixelPositionVal=boxSizingReliableVal=!1,reliableMarginRightVal=!0,window.getComputedStyle&&(pixelPositionVal="1%"!==(window.getComputedStyle(div,null)||{}).top,boxSizingReliableVal="4px"===(window.getComputedStyle(div,null)||{width:"4px"}).width,contents=div.appendChild(document.createElement("div")),contents.style.cssText=div.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",contents.style.marginRight=contents.style.width="0",div.style.width="1px",reliableMarginRightVal=!parseFloat((window.getComputedStyle(contents,null)||{}).marginRight),div.removeChild(contents)),div.innerHTML="<table><tr><td></td><td>t</td></tr></table>",contents=div.getElementsByTagName("td"),contents[0].style.cssText="margin:0;border:0;padding:0;display:none",reliableHiddenOffsetsVal=0===contents[0].offsetHeight,reliableHiddenOffsetsVal&&(contents[0].style.display="",contents[1].style.display="none",reliableHiddenOffsetsVal=0===contents[0].offsetHeight),body.removeChild(container))}var div,style,a,pixelPositionVal,boxSizingReliableVal,reliableHiddenOffsetsVal,reliableMarginRightVal;div=document.createElement("div"),div.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=div.getElementsByTagName("a")[0],style=a&&a.style,style&&(style.cssText="float:left;opacity:.5",support.opacity="0.5"===style.opacity,support.cssFloat=!!style.cssFloat,div.style.backgroundClip="content-box",div.cloneNode(!0).style.backgroundClip="",support.clearCloneStyle="content-box"===div.style.backgroundClip,support.boxSizing=""===style.boxSizing||""===style.MozBoxSizing||""===style.WebkitBoxSizing,jQuery.extend(support,{reliableHiddenOffsets:function(){return null==reliableHiddenOffsetsVal&&computeStyleTests(),reliableHiddenOffsetsVal},boxSizingReliable:function(){return null==boxSizingReliableVal&&computeStyleTests(),boxSizingReliableVal},pixelPosition:function(){return null==pixelPositionVal&&computeStyleTests(),pixelPositionVal},reliableMarginRight:function(){return null==reliableMarginRightVal&&computeStyleTests(),reliableMarginRightVal}}))}(),jQuery.swap=function(elem,options,callback,args){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];ret=callback.apply(elem,args||[]);for(name in options)elem.style[name]=old[name];return ret};var ralpha=/alpha\([^)]*\)/i,ropacity=/opacity\s*=\s*([^)]*)/,rdisplayswap=/^(none|table(?!-c[ea]).+)/,rnumsplit=new RegExp("^("+pnum+")(.*)$","i"),rrelNum=new RegExp("^([+-])=("+pnum+")","i"),cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"},cssPrefixes=["Webkit","O","Moz","ms"];jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;if(name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],void 0===value)return hooks&&"get"in hooks&&void 0!==(ret=hooks.get(elem,!1,extra))?ret:style[name];if(type=typeof value,"string"===type&&(ret=rrelNum.exec(value))&&(value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name)),type="number"),null!=value&&value===value&&("number"!==type||jQuery.cssNumber[origName]||(value+="px"),support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),!(hooks&&"set"in hooks&&void 0===(value=hooks.set(elem,value,extra)))))try{style[name]=value}catch(e){}}},css:function(elem,name,extra,styles){var num,val,hooks,origName=jQuery.camelCase(name);return name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],hooks&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),void 0===val&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),extra===!0||jQuery.isNumeric(num)?num||0:val):val}}),jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){return computed?rdisplayswap.test(jQuery.css(elem,"display"))&&0===elem.offsetWidth?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra)}):getWidthOrHeight(elem,name,extra):void 0},set:function(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,support.boxSizing&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles),styles):0)}}}),support.opacity||(jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":computed?"1":""},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNumeric(value)?"alpha(opacity="+100*value+")":"",filter=currentStyle&&currentStyle.filter||style.filter||"";style.zoom=1,(value>=1||""===value)&&""===jQuery.trim(filter.replace(ralpha,""))&&style.removeAttribute&&(style.removeAttribute("filter"),""===value||currentStyle&&!currentStyle.filter)||(style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity)}}),jQuery.cssHooks.marginRight=addGetHookIf(support.reliableMarginRight,function(elem,computed){return computed?jQuery.swap(elem,{display:"inline-block"},curCSS,[elem,"marginRight"]):void 0}),jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){for(var i=0,expanded={},parts="string"==typeof value?value.split(" "):[value];4>i;i++)expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];return expanded}},rmargin.test(prefix)||(jQuery.cssHooks[prefix+suffix].set=setPositiveNumber)}),jQuery.fn.extend({css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(jQuery.isArray(name)){for(styles=getStyles(elem),len=name.length;len>i;i++)map[name[i]]=jQuery.css(elem,name[i],!1,styles);return map}return void 0!==value?jQuery.style(elem,name,value):jQuery.css(elem,name)},name,value,arguments.length>1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){return"boolean"==typeof state?state?this.show():this.hide():this.each(function(){isHidden(this)?jQuery(this).show():jQuery(this).hide()})}}),jQuery.Tween=Tween,Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem,this.prop=prop,this.easing=easing||"swing",this.options=options,this.start=this.now=this.cur(),this.end=end,this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this)},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];return this.options.duration?this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration):this.pos=eased=percent,this.now=(this.end-this.start)*eased+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),hooks&&hooks.set?hooks.set(this):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(tween){var result;return null==tween.elem[tween.prop]||tween.elem.style&&null!=tween.elem.style[tween.prop]?(result=jQuery.css(tween.elem,tween.prop,""),result&&"auto"!==result?result:0):tween.elem[tween.prop]},set:function(tween){jQuery.fx.step[tween.prop]?jQuery.fx.step[tween.prop](tween):tween.elem.style&&(null!=tween.elem.style[jQuery.cssProps[tween.prop]]||jQuery.cssHooks[tween.prop])?jQuery.style(tween.elem,tween.prop,tween.now+tween.unit):tween.elem[tween.prop]=tween.now}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){tween.elem.nodeType&&tween.elem.parentNode&&(tween.elem[tween.prop]=tween.now)}},jQuery.easing={linear:function(p){return p},swing:function(p){return.5-Math.cos(p*Math.PI)/2}},jQuery.fx=Tween.prototype.init,jQuery.fx.step={};var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(prop,value){var tween=this.createTween(prop,value),target=tween.cur(),parts=rfxnum.exec(value),unit=parts&&parts[3]||(jQuery.cssNumber[prop]?"":"px"),start=(jQuery.cssNumber[prop]||"px"!==unit&&+target)&&rfxnum.exec(jQuery.css(tween.elem,prop)),scale=1,maxIterations=20;if(start&&start[3]!==unit){unit=unit||start[3],parts=parts||[],start=+target||1;do scale=scale||".5",start/=scale,jQuery.style(tween.elem,prop,start+unit);while(scale!==(scale=tween.cur()/target)&&1!==scale&&--maxIterations)}return parts&&(start=tween.start=+start||+target||0,tween.unit=unit,tween.end=parts[1]?start+(parts[1]+1)*parts[2]:+parts[2]),tween}]};jQuery.Animation=jQuery.extend(Animation,{tweener:function(props,callback){jQuery.isFunction(props)?(callback=props,props=["*"]):props=props.split(" ");for(var prop,index=0,length=props.length;length>index;index++)prop=props[index],tweeners[prop]=tweeners[prop]||[],tweeners[prop].unshift(callback)},prefilter:function(callback,prepend){prepend?animationPrefilters.unshift(callback):animationPrefilters.push(callback)}}),jQuery.speed=function(speed,easing,fn){var opt=speed&&"object"==typeof speed?jQuery.extend({},speed):{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};return opt.duration=jQuery.fx.off?0:"number"==typeof opt.duration?opt.duration:opt.duration in jQuery.fx.speeds?jQuery.fx.speeds[opt.duration]:jQuery.fx.speeds._default,null!=opt.queue&&opt.queue!==!0||(opt.queue="fx"),opt.old=opt.complete,opt.complete=function(){jQuery.isFunction(opt.old)&&opt.old.call(this),opt.queue&&jQuery.dequeue(this,opt.queue)},opt},jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHidden).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback)},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);(empty||jQuery._data(this,"finish"))&&anim.stop(!0)};return doAnimation.finish=doAnimation,empty||optall.queue===!1?this.each(doAnimation):this.queue(optall.queue,doAnimation)},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop,stop(gotoEnd)};return"string"!=typeof type&&(gotoEnd=clearQueue,clearQueue=type,type=void 0),clearQueue&&type!==!1&&this.queue(type||"fx",[]),this.each(function(){var dequeue=!0,index=null!=type&&type+"queueHooks",timers=jQuery.timers,data=jQuery._data(this);if(index)data[index]&&data[index].stop&&stopQueue(data[index]);else for(index in data)data[index]&&data[index].stop&&rrun.test(index)&&stopQueue(data[index]);for(index=timers.length;index--;)timers[index].elem!==this||null!=type&&timers[index].queue!==type||(timers[index].anim.stop(gotoEnd),dequeue=!1,timers.splice(index,1));!dequeue&&gotoEnd||jQuery.dequeue(this,type)})},finish:function(type){return type!==!1&&(type=type||"fx"),this.each(function(){var index,data=jQuery._data(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;for(data.finish=!0,jQuery.queue(this,type,[]),hooks&&hooks.stop&&hooks.stop.call(this,!0),index=timers.length;index--;)timers[index].elem===this&&timers[index].queue===type&&(timers[index].anim.stop(!0),timers.splice(index,1));for(index=0;length>index;index++)queue[index]&&queue[index].finish&&queue[index].finish.call(this);delete data.finish})}}),jQuery.each(["toggle","show","hide"],function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return null==speed||"boolean"==typeof speed?cssFn.apply(this,arguments):this.animate(genFx(name,!0),speed,easing,callback)}}),jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback)}}),jQuery.timers=[],jQuery.fx.tick=function(){var timer,timers=jQuery.timers,i=0;for(fxNow=jQuery.now();i<timers.length;i++)timer=timers[i],timer()||timers[i]!==timer||timers.splice(i--,1);timers.length||jQuery.fx.stop(),fxNow=void 0},jQuery.fx.timer=function(timer){jQuery.timers.push(timer),timer()?jQuery.fx.start():jQuery.timers.pop()},jQuery.fx.interval=13,jQuery.fx.start=function(){timerId||(timerId=setInterval(jQuery.fx.tick,jQuery.fx.interval))},jQuery.fx.stop=function(){clearInterval(timerId),timerId=null},jQuery.fx.speeds={slow:600,fast:200,_default:400},jQuery.fn.delay=function(time,type){return time=jQuery.fx?jQuery.fx.speeds[time]||time:time,type=type||"fx",this.queue(type,function(next,hooks){var timeout=setTimeout(next,time);hooks.stop=function(){clearTimeout(timeout)}})},function(){var input,div,select,a,opt;div=document.createElement("div"),div.setAttribute("className","t"),div.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=div.getElementsByTagName("a")[0],select=document.createElement("select"),opt=select.appendChild(document.createElement("option")),input=div.getElementsByTagName("input")[0],a.style.cssText="top:1px",support.getSetAttribute="t"!==div.className,support.style=/top/.test(a.getAttribute("style")),support.hrefNormalized="/a"===a.getAttribute("href"),support.checkOn=!!input.value,support.optSelected=opt.selected,support.enctype=!!document.createElement("form").enctype,select.disabled=!0,support.optDisabled=!opt.disabled,input=document.createElement("input"),input.setAttribute("value",""),support.input=""===input.getAttribute("value"),input.value="t",input.setAttribute("type","radio"),support.radioValue="t"===input.value}();var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,isFunction,elem=this[0];{if(arguments.length)return isFunction=jQuery.isFunction(value),this.each(function(i){var val;1===this.nodeType&&(val=isFunction?value.call(this,i,jQuery(this).val()):value,null==val?val="":"number"==typeof val?val+="":jQuery.isArray(val)&&(val=jQuery.map(val,function(value){return null==value?"":value+""})),hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()],hooks&&"set"in hooks&&void 0!==hooks.set(this,val,"value")||(this.value=val))});if(elem)return hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()],hooks&&"get"in hooks&&void 0!==(ret=hooks.get(elem,"value"))?ret:(ret=elem.value,"string"==typeof ret?ret.replace(rreturn,""):null==ret?"":ret)}}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return null!=val?val:jQuery.trim(jQuery.text(elem))}},select:{get:function(elem){for(var value,option,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type||0>index,values=one?null:[],max=one?index+1:options.length,i=0>index?max:one?index:0;max>i;i++)if(option=options[i],(option.selected||i===index)&&(support.optDisabled?!option.disabled:null===option.getAttribute("disabled"))&&(!option.parentNode.disabled||!jQuery.nodeName(option.parentNode,"optgroup"))){if(value=jQuery(option).val(),one)return value;values.push(value)}return values},set:function(elem,value){for(var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;i--;)if(option=options[i],jQuery.inArray(jQuery.valHooks.option.get(option),values)>=0)try{option.selected=optionSet=!0}catch(_){option.scrollHeight}else option.selected=!1;return optionSet||(elem.selectedIndex=-1),options}}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){return jQuery.isArray(value)?elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0:void 0}},support.checkOn||(jQuery.valHooks[this].get=function(elem){return null===elem.getAttribute("value")?"on":elem.value})});var nodeHook,boolHook,attrHandle=jQuery.expr.attrHandle,ruseDefault=/^(?:checked|selected)$/i,getSetAttribute=support.getSetAttribute,getSetInput=support.input;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})}}),jQuery.extend({attr:function(elem,name,value){var hooks,ret,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return typeof elem.getAttribute===strundefined?jQuery.prop(elem,name,value):(1===nType&&jQuery.isXMLDoc(elem)||(name=name.toLowerCase(),hooks=jQuery.attrHooks[name]||(jQuery.expr.match.bool.test(name)?boolHook:nodeHook)),void 0===value?hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:(ret=jQuery.find.attr(elem,name),null==ret?void 0:ret):null!==value?hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:(elem.setAttribute(name,value+""),value):void jQuery.removeAttr(elem,name))},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(rnotwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)propName=jQuery.propFix[name]||name,jQuery.expr.match.bool.test(name)?getSetInput&&getSetAttribute||!ruseDefault.test(name)?elem[propName]=!1:elem[jQuery.camelCase("default-"+name)]=elem[propName]=!1:jQuery.attr(elem,name,""),elem.removeAttribute(getSetAttribute?name:propName)},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&"radio"===value&&jQuery.nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}}}),boolHook={set:function(elem,value,name){return value===!1?jQuery.removeAttr(elem,name):getSetInput&&getSetAttribute||!ruseDefault.test(name)?elem.setAttribute(!getSetAttribute&&jQuery.propFix[name]||name,name):elem[jQuery.camelCase("default-"+name)]=elem[name]=!0,name}},jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=getSetInput&&getSetAttribute||!ruseDefault.test(name)?function(elem,name,isXML){var ret,handle;return isXML||(handle=attrHandle[name],attrHandle[name]=ret,ret=null!=getter(elem,name,isXML)?name.toLowerCase():null,attrHandle[name]=handle),ret}:function(elem,name,isXML){return isXML?void 0:elem[jQuery.camelCase("default-"+name)]?name.toLowerCase():null}}),getSetInput&&getSetAttribute||(jQuery.attrHooks.value={set:function(elem,value,name){return jQuery.nodeName(elem,"input")?void(elem.defaultValue=value):nodeHook&&nodeHook.set(elem,value,name)}}),getSetAttribute||(nodeHook={set:function(elem,value,name){var ret=elem.getAttributeNode(name);return ret||elem.setAttributeNode(ret=elem.ownerDocument.createAttribute(name)),ret.value=value+="","value"===name||value===elem.getAttribute(name)?value:void 0}},attrHandle.id=attrHandle.name=attrHandle.coords=function(elem,name,isXML){var ret;return isXML?void 0:(ret=elem.getAttributeNode(name))&&""!==ret.value?ret.value:null},jQuery.valHooks.button={get:function(elem,name){var ret=elem.getAttributeNode(name);return ret&&ret.specified?ret.value:void 0},set:nodeHook.set},jQuery.attrHooks.contenteditable={set:function(elem,value,name){nodeHook.set(elem,""===value?!1:value,name)}},jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]={set:function(elem,value){return""===value?(elem.setAttribute(name,"auto"),value):void 0}}})),support.style||(jQuery.attrHooks.style={get:function(elem){return elem.style.cssText||void 0},set:function(elem,value){return elem.style.cssText=value+""}});var rfocusable=/^(?:input|select|textarea|button|object)$/i,rclickable=/^(?:a|area)$/i;
jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return name=jQuery.propFix[name]||name,this.each(function(){try{this[name]=void 0,delete this[name]}catch(e){}})}}),jQuery.extend({propFix:{for:"htmlFor",class:"className"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),void 0!==value?hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1}}}}),support.hrefNormalized||jQuery.each(["href","src"],function(i,name){jQuery.propHooks[name]={get:function(elem){return elem.getAttribute(name,4)}}}),support.optSelected||(jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;return parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex),null}}),jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this}),support.enctype||(jQuery.propFix.enctype="encoding");var rclass=/[\t\r\n\f]/g;jQuery.fn.extend({addClass:function(value){var classes,elem,cur,clazz,j,finalValue,i=0,len=this.length,proceed="string"==typeof value&&value;if(jQuery.isFunction(value))return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className))});if(proceed)for(classes=(value||"").match(rnotwhite)||[];len>i;i++)if(elem=this[i],cur=1===elem.nodeType&&(elem.className?(" "+elem.className+" ").replace(rclass," "):" ")){for(j=0;clazz=classes[j++];)cur.indexOf(" "+clazz+" ")<0&&(cur+=clazz+" ");finalValue=jQuery.trim(cur),elem.className!==finalValue&&(elem.className=finalValue)}return this},removeClass:function(value){var classes,elem,cur,clazz,j,finalValue,i=0,len=this.length,proceed=0===arguments.length||"string"==typeof value&&value;if(jQuery.isFunction(value))return this.each(function(j){jQuery(this).removeClass(value.call(this,j,this.className))});if(proceed)for(classes=(value||"").match(rnotwhite)||[];len>i;i++)if(elem=this[i],cur=1===elem.nodeType&&(elem.className?(" "+elem.className+" ").replace(rclass," "):"")){for(j=0;clazz=classes[j++];)for(;cur.indexOf(" "+clazz+" ")>=0;)cur=cur.replace(" "+clazz+" "," ");finalValue=value?jQuery.trim(cur):"",elem.className!==finalValue&&(elem.className=finalValue)}return this},toggleClass:function(value,stateVal){var type=typeof value;return"boolean"==typeof stateVal&&"string"===type?stateVal?this.addClass(value):this.removeClass(value):jQuery.isFunction(value)?this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal)}):this.each(function(){if("string"===type)for(var className,i=0,self=jQuery(this),classNames=value.match(rnotwhite)||[];className=classNames[i++];)self.hasClass(className)?self.removeClass(className):self.addClass(className);else type!==strundefined&&"boolean"!==type||(this.className&&jQuery._data(this,"__className__",this.className),this.className=this.className||value===!1?"":jQuery._data(this,"__className__")||"")})},hasClass:function(selector){for(var className=" "+selector+" ",i=0,l=this.length;l>i;i++)if(1===this[i].nodeType&&(" "+this[i].className+" ").replace(rclass," ").indexOf(className)>=0)return!0;return!1}}),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 contextmenu".split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}}),jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)},bind:function(types,data,fn){return this.on(types,null,data,fn)},unbind:function(types,fn){return this.off(types,null,fn)},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn)},undelegate:function(selector,types,fn){return 1===arguments.length?this.off(selector,"**"):this.off(types,selector||"**",fn)}});var nonce=jQuery.now(),rquery=/\?/,rvalidtokens=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;jQuery.parseJSON=function(data){if(window.JSON&&window.JSON.parse)return window.JSON.parse(data+"");var requireNonComma,depth=null,str=jQuery.trim(data+"");return str&&!jQuery.trim(str.replace(rvalidtokens,function(token,comma,open,close){return requireNonComma&&comma&&(depth=0),0===depth?token:(requireNonComma=open||comma,depth+=!close-!open,"")}))?Function("return "+str)():jQuery.error("Invalid JSON: "+data)},jQuery.parseXML=function(data){var xml,tmp;if(!data||"string"!=typeof data)return null;try{window.DOMParser?(tmp=new DOMParser,xml=tmp.parseFromString(data,"text/xml")):(xml=new ActiveXObject("Microsoft.XMLDOM"),xml.async="false",xml.loadXML(data))}catch(e){xml=void 0}return xml&&xml.documentElement&&!xml.getElementsByTagName("parsererror").length||jQuery.error("Invalid XML: "+data),xml};var ajaxLocParts,ajaxLocation,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href}catch(e){ajaxLocation=document.createElement("a"),ajaxLocation.href="",ajaxLocation=ajaxLocation.href}ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[],jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;2!==state&&(state=2,timeoutTimer&&clearTimeout(timeoutTimer),transport=void 0,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,isSuccess=status>=200&&300>status||304===status,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),response=ajaxConvert(s,response,jqXHR,isSuccess),isSuccess?(s.ifModified&&(modified=jqXHR.getResponseHeader("Last-Modified"),modified&&(jQuery.lastModified[cacheURL]=modified),modified=jqXHR.getResponseHeader("etag"),modified&&(jQuery.etag[cacheURL]=modified)),204===status||"HEAD"===s.type?statusText="nocontent":304===status?statusText="notmodified":(statusText=response.state,success=response.data,error=response.error,isSuccess=!error)):(error=statusText,!status&&statusText||(statusText="error",0>status&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=void 0,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}"object"==typeof url&&(options=url,url=void 0),options=options||{};var parts,i,cacheURL,responseHeadersString,timeoutTimer,fireGlobals,transport,responseHeaders,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(2===state){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()]=match[2];match=responseHeaders[key.toLowerCase()]}return null==match?null:match},getAllResponseHeaders:function(){return 2===state?responseHeadersString:null},setRequestHeader:function(name,value){var lname=name.toLowerCase();return state||(name=requestHeadersNames[lname]=requestHeadersNames[lname]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return state||(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(2>state)for(code in map)statusCode[code]=[statusCode[code],map[code]];else jqXHR.always(map[jqXHR.status]);return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR).complete=completeDeferred.add,jqXHR.success=jqXHR.done,jqXHR.error=jqXHR.fail,s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(rnotwhite)||[""],null==s.crossDomain&&(parts=rurl.exec(s.url.toLowerCase()),s.crossDomain=!(!parts||parts[1]===ajaxLocParts[1]&&parts[2]===ajaxLocParts[2]&&(parts[3]||("http:"===parts[1]?"80":"443"))===(ajaxLocParts[3]||("http:"===ajaxLocParts[1]?"80":"443")))),s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),2===state)return jqXHR;fireGlobals=jQuery.event&&s.global,fireGlobals&&0===jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url,s.hasContent||(s.data&&(cacheURL=s.url+=(rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),s.cache===!1&&(s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+nonce++):cacheURL+(rquery.test(cacheURL)?"&":"?")+"_="+nonce++)),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&s.contentType!==!1||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===!1||2===state))return jqXHR.abort();strAbort="abort";for(i in{success:1,error:1,complete:1})jqXHR[i](s[i]);if(transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),s.async&&s.timeout>0&&(timeoutTimer=setTimeout(function(){jqXHR.abort("timeout")},s.timeout));try{state=1,transport.send(requestHeaders,done)}catch(e){if(!(2>state))throw e;done(-1,e)}}else done(-1,"No Transport");return jqXHR},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,void 0,callback,"script")}}),jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){return jQuery.isFunction(data)&&(type=type||callback,callback=data,data=void 0),jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback})}}),jQuery._evalUrl=function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},jQuery.fn.extend({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(!0);this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map(function(){for(var elem=this;elem.firstChild&&1===elem.firstChild.nodeType;)elem=elem.firstChild;return elem}).append(this)}return this},wrapInner:function(html){return jQuery.isFunction(html)?this.each(function(i){jQuery(this).wrapInner(html.call(this,i))}):this.each(function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)})},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html)})},unwrap:function(){return this.parent().each(function(){jQuery.nodeName(this,"body")||jQuery(this).replaceWith(this.childNodes)}).end()}}),jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0||!support.reliableHiddenOffsets()&&"none"===(elem.style&&elem.style.display||jQuery.css(elem,"display"))},jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)};var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():null==value?"":value,s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)};if(void 0===traditional&&(traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional),jQuery.isArray(a)||a.jquery&&!jQuery.isPlainObject(a))jQuery.each(a,function(){add(this.name,this.value)});else for(prefix in a)buildParams(prefix,a[prefix],traditional,add);return s.join("&").replace(r20,"+")},jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return null==val?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}}),jQuery.ajaxSettings.xhr=void 0!==window.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&createStandardXHR()||createActiveXHR()}:createStandardXHR;var xhrId=0,xhrCallbacks={},xhrSupported=jQuery.ajaxSettings.xhr();window.attachEvent&&window.attachEvent("onunload",function(){for(var key in xhrCallbacks)xhrCallbacks[key](void 0,!0)}),support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,xhrSupported=support.ajax=!!xhrSupported,xhrSupported&&jQuery.ajaxTransport(function(options){if(!options.crossDomain||support.cors){var callback;return{send:function(headers,complete){var i,xhr=options.xhr(),id=++xhrId;if(xhr.open(options.type,options.url,options.async,options.username,options.password),options.xhrFields)for(i in options.xhrFields)xhr[i]=options.xhrFields[i];options.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(options.mimeType),options.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest");for(i in headers)void 0!==headers[i]&&xhr.setRequestHeader(i,headers[i]+"");xhr.send(options.hasContent&&options.data||null),callback=function(_,isAbort){var status,statusText,responses;if(callback&&(isAbort||4===xhr.readyState))if(delete xhrCallbacks[id],callback=void 0,xhr.onreadystatechange=jQuery.noop,isAbort)4!==xhr.readyState&&xhr.abort();else{responses={},status=xhr.status,"string"==typeof xhr.responseText&&(responses.text=xhr.responseText);try{statusText=xhr.statusText}catch(e){statusText=""}status||!options.isLocal||options.crossDomain?1223===status&&(status=204):status=responses.text?200:404}responses&&complete(status,statusText,responses,xhr.getAllResponseHeaders())},options.async?4===xhr.readyState?setTimeout(callback):xhr.onreadystatechange=xhrCallbacks[id]=callback:callback()},abort:function(){callback&&callback(void 0,!0)}}}}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(text){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",function(s){void 0===s.cache&&(s.cache=!1),s.crossDomain&&(s.type="GET",s.global=!1)}),jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,head=document.head||jQuery("head")[0]||document.documentElement;return{send:function(_,callback){script=document.createElement("script"),script.async=!0,s.scriptCharset&&(script.charset=s.scriptCharset),script.src=s.url,script.onload=script.onreadystatechange=function(_,isAbort){(isAbort||!script.readyState||/loaded|complete/.test(script.readyState))&&(script.onload=script.onreadystatechange=null,script.parentNode&&script.parentNode.removeChild(script),script=null,isAbort||callback(200,"success"))},head.insertBefore(script,head.firstChild)},abort:function(){script&&script.onload(void 0,!0)}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+nonce++;return this[callback]=!0,callback}}),jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==!1&&(rjsonp.test(s.url)?"url":"string"==typeof s.data&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");return jsonProp||"jsonp"===s.dataTypes[0]?(callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,jsonProp?s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName):s.jsonp!==!1&&(s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName),s.converters["script json"]=function(){return responseContainer||jQuery.error(callbackName+" was not called"),responseContainer[0]},s.dataTypes[0]="json",overwritten=window[callbackName],window[callbackName]=function(){responseContainer=arguments},jqXHR.always(function(){window[callbackName]=overwritten,s[callbackName]&&(s.jsonpCallback=originalSettings.jsonpCallback,oldCallbacks.push(callbackName)),responseContainer&&jQuery.isFunction(overwritten)&&overwritten(responseContainer[0]),responseContainer=overwritten=void 0}),"script"):void 0}),jQuery.parseHTML=function(data,context,keepScripts){if(!data||"string"!=typeof data)return null;"boolean"==typeof context&&(keepScripts=context,context=!1),context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];return parsed?[context.createElement(parsed[1])]:(parsed=jQuery.buildFragment([data],context,scripts),scripts&&scripts.length&&jQuery(scripts).remove(),jQuery.merge([],parsed.childNodes))};var _load=jQuery.fn.load;jQuery.fn.load=function(url,params,callback){if("string"!=typeof url&&_load)return _load.apply(this,arguments);var selector,response,type,self=this,off=url.indexOf(" ");return off>=0&&(selector=jQuery.trim(url.slice(off,url.length)),url=url.slice(0,off)),jQuery.isFunction(params)?(callback=params,params=void 0):params&&"object"==typeof params&&(type="POST"),self.length>0&&jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments,self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR])}),this},jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}}),jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length};var docElem=window.document.documentElement;jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};"static"===position&&(elem.style.position="relative"),curOffset=curElem.offset(),curCSSTop=jQuery.css(elem,"top"),curCSSLeft=jQuery.css(elem,"left"),calculatePosition=("absolute"===position||"fixed"===position)&&jQuery.inArray("auto",[curCSSTop,curCSSLeft])>-1,calculatePosition?(curPosition=curElem.position(),curTop=curPosition.top,curLeft=curPosition.left):(curTop=parseFloat(curCSSTop)||0,curLeft=parseFloat(curCSSLeft)||0),jQuery.isFunction(options)&&(options=options.call(elem,i,curOffset)),null!=options.top&&(props.top=options.top-curOffset.top+curTop),null!=options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(elem,props):curElem.css(props)}},jQuery.fn.extend({offset:function(options){if(arguments.length)return void 0===options?this:this.each(function(i){jQuery.offset.setOffset(this,options,i)});var docElem,win,box={top:0,left:0},elem=this[0],doc=elem&&elem.ownerDocument;if(doc)return docElem=doc.documentElement,jQuery.contains(docElem,elem)?(typeof elem.getBoundingClientRect!==strundefined&&(box=elem.getBoundingClientRect()),win=getWindow(doc),{top:box.top+(win.pageYOffset||docElem.scrollTop)-(docElem.clientTop||0),left:box.left+(win.pageXOffset||docElem.scrollLeft)-(docElem.clientLeft||0)}):box},position:function(){if(this[0]){var offsetParent,offset,parentOffset={top:0,left:0},elem=this[0];return"fixed"===jQuery.css(elem,"position")?offset=elem.getBoundingClientRect():(offsetParent=this.offsetParent(),offset=this.offset(),jQuery.nodeName(offsetParent[0],"html")||(parentOffset=offsetParent.offset()),parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",!0),parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",!0)),{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var offsetParent=this.offsetParent||docElem;offsetParent&&!jQuery.nodeName(offsetParent,"html")&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return offsetParent||docElem})}}),jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top=/Y/.test(prop);jQuery.fn[method]=function(val){return access(this,function(elem,method,val){var win=getWindow(elem);return void 0===val?win?prop in win?win[prop]:win.document.documentElement[method]:elem[method]:void(win?win.scrollTo(top?jQuery(win).scrollLeft():val,top?val:jQuery(win).scrollTop()):elem[method]=val)},method,val,arguments.length,null)}}),jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,function(elem,computed){return computed?(computed=curCSS(elem,prop),rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed):void 0})}),jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||"boolean"!=typeof margin),extra=defaultExtra||(margin===!0||value===!0?"margin":"border");return access(this,function(elem,type,value){var doc;return jQuery.isWindow(elem)?elem.document.documentElement["client"+name]:9===elem.nodeType?(doc=elem.documentElement,Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])):void 0===value?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:void 0,chainable,null)}})}),jQuery.fn.size=function(){return this.length},jQuery.fn.andSelf=jQuery.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return jQuery});var _jQuery=window.jQuery,_$=window.$;return jQuery.noConflict=function(deep){return window.$===jQuery&&(window.$=_$),deep&&window.jQuery===jQuery&&(window.jQuery=_jQuery),jQuery},typeof noGlobal===strundefined&&(window.jQuery=window.$j=jQuery),jQuery}),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):factory(jQuery)}(function($){function focusable(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();return"area"===nodeName?(map=element.parentNode,mapName=map.name,element.href&&mapName&&"map"===map.nodeName.toLowerCase()?(img=$("img[usemap='#"+mapName+"']")[0],!!img&&visible(img)):!1):(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"===nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element)}function visible(element){return $.expr.filters.visible(element)&&!$(element).parents().addBack().filter(function(){return"hidden"===$.css(this,"visibility")}).length}function datepicker_getZindex(elem){for(var position,value;elem.length&&elem[0]!==document;){if(position=elem.css("position"),("absolute"===position||"relative"===position||"fixed"===position)&&(value=parseInt(elem.css("zIndex"),10),!isNaN(value)&&0!==value))return value;elem=elem.parent()}return 0}function Datepicker(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.regional.en=$.extend(!0,{},this.regional[""]),this.regional["en-US"]=$.extend(!0,{},this.regional.en),this.dpDiv=datepicker_bindHover($("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function datepicker_bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.delegate(selector,"mouseout",function(){$(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&$(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&$(this).removeClass("ui-datepicker-next-hover")}).delegate(selector,"mouseover",datepicker_handleMouseover)}function datepicker_handleMouseover(){$.datepicker._isDisabledDatepicker(datepicker_instActive.inline?datepicker_instActive.dpDiv.parent()[0]:datepicker_instActive.input[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&$(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&$(this).addClass("ui-datepicker-next-hover"))}function datepicker_extendRemove(target,props){$.extend(target,props);for(var name in props)null==props[name]&&(target[name]=props[name]);return target}function spinner_modifier(fn){return function(){var previous=this.element.val();fn.apply(this,arguments),this._refresh(),previous!==this.element.val()&&this._trigger("change")}}$.ui=$.ui||{},$.extend($.ui,{version:"1.11.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),$.fn.extend({scrollParent:function(includeHidden){var position=this.css("position"),excludeStaticParent="absolute"===position,overflowRegex=includeHidden?/(auto|scroll|hidden)/:/(auto|scroll)/,scrollParent=this.parents().filter(function(){var parent=$(this);return excludeStaticParent&&"static"===parent.css("position")?!1:overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+parent.css("overflow-x"))}).eq(0);return"fixed"!==position&&scrollParent.length?scrollParent:$(this[0].ownerDocument||document)},uniqueId:function(){var uuid=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++uuid)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&$(this).removeAttr("id")})}}),$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName)}}):function(elem,i,match){return!!$.data(elem,match[3])},focusable:function(element){return focusable(element,!isNaN($.attr(element,"tabindex")))},tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element,!isTabIndexNaN)}}),$("<a>").outerWidth(1).jquery||$.each(["Width","Height"],function(i,name){function reduce(elem,size,border,margin){return $.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0,border&&(size-=parseFloat($.css(elem,"border"+this+"Width"))||0),margin&&(size-=parseFloat($.css(elem,"margin"+this))||0)}),size}var side="Width"===name?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};$.fn["inner"+name]=function(size){return void 0===size?orig["inner"+name].call(this):this.each(function(){$(this).css(type,reduce(this,size)+"px")})},$.fn["outer"+name]=function(size,margin){return"number"!=typeof size?orig["outer"+name].call(this,size):this.each(function(){$(this).css(type,reduce(this,size,!0,margin)+"px")})}}),$.fn.addBack||($.fn.addBack=function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}),$("<a>").data("a-b","a").removeData("a-b").data("a-b")&&($.fn.removeData=function(removeData){return function(key){return arguments.length?removeData.call(this,$.camelCase(key)):removeData.call(this)};
}($.fn.removeData)),$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),$.fn.extend({focus:function(orig){return function(delay,fn){return"number"==typeof delay?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus(),fn&&fn.call(elem)},delay)}):orig.apply(this,arguments)}}($.fn.focus),disableSelection:function(){var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(eventType+".ui-disableSelection",function(event){event.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(zIndex){if(void 0!==zIndex)return this.css("zIndex",zIndex);if(this.length)for(var position,value,elem=$(this[0]);elem.length&&elem[0]!==document;){if(position=elem.css("position"),("absolute"===position||"relative"===position||"fixed"===position)&&(value=parseInt(elem.css("zIndex"),10),!isNaN(value)&&0!==value))return value;elem=elem.parent()}return 0}}),$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set)proto.plugins[i]=proto.plugins[i]||[],proto.plugins[i].push([option,set[i]])},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(set&&(allowDisconnected||instance.element[0].parentNode&&11!==instance.element[0].parentNode.nodeType))for(i=0;i<set.length;i++)instance.options[set[i][0]]&&set[i][1].apply(instance.element,args)}};var widget_uuid=0,widget_slice=Array.prototype.slice;$.cleanData=function(orig){return function(elems){var events,elem,i;for(i=0;null!=(elem=elems[i]);i++)try{events=$._data(elem,"events"),events&&events.remove&&$(elem).triggerHandler("remove")}catch(e){}orig(elems)}}($.cleanData),$.widget=function(name,base,prototype){var fullName,existingConstructor,constructor,basePrototype,proxiedPrototype={},namespace=name.split(".")[0];return name=name.split(".")[1],fullName=namespace+"-"+name,prototype||(prototype=base,base=$.Widget),$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName)},$[namespace]=$[namespace]||{},existingConstructor=$[namespace][name],constructor=$[namespace][name]=function(options,element){return this._createWidget?void(arguments.length&&this._createWidget(options,element)):new constructor(options,element)},$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]}),basePrototype=new base,basePrototype.options=$.widget.extend({},basePrototype.options),$.each(prototype,function(prop,value){return $.isFunction(value)?void(proxiedPrototype[prop]=function(){var _super=function(){return base.prototype[prop].apply(this,arguments)},_superApply=function(args){return base.prototype[prop].apply(this,args)};return function(){var returnValue,__super=this._super,__superApply=this._superApply;return this._super=_super,this._superApply=_superApply,returnValue=value.apply(this,arguments),this._super=__super,this._superApply=__superApply,returnValue}}()):void(proxiedPrototype[prop]=value)}),constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?basePrototype.widgetEventPrefix||name:name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName}),existingConstructor?($.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto)}),delete existingConstructor._childConstructors):base._childConstructors.push(constructor),$.widget.bridge(name,constructor),constructor},$.widget.extend=function(target){for(var key,value,input=widget_slice.call(arguments,1),inputIndex=0,inputLength=input.length;inputLength>inputIndex;inputIndex++)for(key in input[inputIndex])value=input[inputIndex][key],input[inputIndex].hasOwnProperty(key)&&void 0!==value&&($.isPlainObject(value)?target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value):target[key]=value);return target},$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall="string"==typeof options,args=widget_slice.call(arguments,1),returnValue=this;return options=!isMethodCall&&args.length?$.widget.extend.apply(null,[options].concat(args)):options,isMethodCall?this.each(function(){var methodValue,instance=$.data(this,fullName);return"instance"===options?(returnValue=instance,!1):instance?$.isFunction(instance[options])&&"_"!==options.charAt(0)?(methodValue=instance[options].apply(instance,args),methodValue!==instance&&void 0!==methodValue?(returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue,!1):void 0):$.error("no such method '"+options+"' for "+name+" widget instance"):$.error("cannot call methods on "+name+" prior to initialization; attempted to call method '"+options+"'")}):this.each(function(){var instance=$.data(this,fullName);instance?(instance.option(options||{}),instance._init&&instance._init()):$.data(this,fullName,new object(options,this))}),returnValue}},$.Widget=function(){},$.Widget._childConstructors=[],$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0],this.element=$(element),this.uuid=widget_uuid++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=$(),this.hoverable=$(),this.focusable=$(),element!==this&&($.data(element,this.widgetFullName,this),this._on(!0,this.element,{remove:function(event){event.target===element&&this.destroy()}}),this.document=$(element.style?element.ownerDocument:element.document||element),this.window=$(this.document[0].defaultView||this.document[0].parentWindow)),this.options=$.widget.extend({},this.options,this._getCreateOptions(),options),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:$.noop,widget:function(){return this.element},option:function(key,value){var parts,curOption,i,options=key;if(0===arguments.length)return $.widget.extend({},this.options);if("string"==typeof key)if(options={},parts=key.split("."),key=parts.shift(),parts.length){for(curOption=options[key]=$.widget.extend({},this.options[key]),i=0;i<parts.length-1;i++)curOption[parts[i]]=curOption[parts[i]]||{},curOption=curOption[parts[i]];if(key=parts.pop(),1===arguments.length)return void 0===curOption[key]?null:curOption[key];curOption[key]=value}else{if(1===arguments.length)return void 0===this.options[key]?null:this.options[key];options[key]=value}return this._setOptions(options),this},_setOptions:function(options){var key;for(key in options)this._setOption(key,options[key]);return this},_setOption:function(key,value){return this.options[key]=value,"disabled"===key&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!value),value&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(suppressDisabledCheck,element,handlers){var delegateElement,instance=this;"boolean"!=typeof suppressDisabledCheck&&(handlers=element,element=suppressDisabledCheck,suppressDisabledCheck=!1),handlers?(element=delegateElement=$(element),this.bindings=this.bindings.add(element)):(handlers=element,element=this.element,delegateElement=this.widget()),$.each(handlers,function(event,handler){function handlerProxy(){return suppressDisabledCheck||instance.options.disabled!==!0&&!$(this).hasClass("ui-state-disabled")?("string"==typeof handler?instance[handler]:handler).apply(instance,arguments):void 0}"string"!=typeof handler&&(handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++);var match=event.match(/^([\w:-]*)\s*(.*)$/),eventName=match[1]+instance.eventNamespace,selector=match[2];selector?delegateElement.delegate(selector,eventName,handlerProxy):element.bind(eventName,handlerProxy)})},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,element.unbind(eventName).undelegate(eventName),this.bindings=$(this.bindings.not(element).get()),this.focusable=$(this.focusable.not(element).get()),this.hoverable=$(this.hoverable.not(element).get())},_delay:function(handler,delay){function handlerProxy(){return("string"==typeof handler?instance[handler]:handler).apply(instance,arguments)}var instance=this;return setTimeout(handlerProxy,delay||0)},_hoverable:function(element){this.hoverable=this.hoverable.add(element),this._on(element,{mouseenter:function(event){$(event.currentTarget).addClass("ui-state-hover")},mouseleave:function(event){$(event.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(element){this.focusable=this.focusable.add(element),this._on(element,{focusin:function(event){$(event.currentTarget).addClass("ui-state-focus")},focusout:function(event){$(event.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(type,event,data){var prop,orig,callback=this.options[type];if(data=data||{},event=$.Event(event),event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase(),event.target=this.element[0],orig=event.originalEvent)for(prop in orig)prop in event||(event[prop]=orig[prop]);return this.element.trigger(event,data),!($.isFunction(callback)&&callback.apply(this.element[0],[event].concat(data))===!1||event.isDefaultPrevented())}},$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){"string"==typeof options&&(options={effect:options});var hasOptions,effectName=options?options===!0||"number"==typeof options?defaultEffect:options.effect||defaultEffect:method;options=options||{},"number"==typeof options&&(options={duration:options}),hasOptions=!$.isEmptyObject(options),options.complete=callback,options.delay&&element.delay(options.delay),hasOptions&&$.effects&&$.effects.effect[effectName]?element[method](options):effectName!==method&&element[effectName]?element[effectName](options.duration,options.easing,callback):element.queue(function(next){$(this)[method](),callback&&callback.call(element[0]),next()})}});var mouseHandled=($.widget,!1);$(document).mouseup(function(){mouseHandled=!1});$.widget("ui.mouse",{version:"1.11.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.bind("mousedown."+this.widgetName,function(event){return that._mouseDown(event)}).bind("click."+this.widgetName,function(event){return!0===$.data(event.target,that.widgetName+".preventClickEvent")?($.removeData(event.target,that.widgetName+".preventClickEvent"),event.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(event){if(!mouseHandled){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(event),this._mouseDownEvent=event;var that=this,btnIsLeft=1===event.which,elIsCancel="string"==typeof this.options.cancel&&event.target.nodeName?$(event.target).closest(this.options.cancel).length:!1;return btnIsLeft&&!elIsCancel&&this._mouseCapture(event)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(event)&&this._mouseDelayMet(event)&&(this._mouseStarted=this._mouseStart(event)!==!1,!this._mouseStarted)?(event.preventDefault(),!0):(!0===$.data(event.target,this.widgetName+".preventClickEvent")&&$.removeData(event.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(event){return that._mouseMove(event)},this._mouseUpDelegate=function(event){return that._mouseUp(event)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),event.preventDefault(),mouseHandled=!0,!0)):!0}},_mouseMove:function(event){if(this._mouseMoved){if($.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button)return this._mouseUp(event);if(!event.which)return this._mouseUp(event)}return(event.which||event.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(event),event.preventDefault()):(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,event)!==!1,this._mouseStarted?this._mouseDrag(event):this._mouseUp(event)),!this._mouseStarted)},_mouseUp:function(event){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,event.target===this._mouseDownEvent.target&&$.data(event.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(event)),mouseHandled=!1,!1},_mouseDistanceMet:function(event){return Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});!function(){function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)]}function parseCss(element,property){return parseInt($.css(element,property),10)||0}function getDimensions(elem){var raw=elem[0];return 9===raw.nodeType?{width:elem.width(),height:elem.height(),offset:{top:0,left:0}}:$.isWindow(raw)?{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}}:raw.preventDefault?{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}}:{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()}}$.ui=$.ui||{};var cachedScrollbarWidth,supportsOffsetFractions,max=Math.max,abs=Math.abs,round=Math.round,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;$.position={scrollbarWidth:function(){if(void 0!==cachedScrollbarWidth)return cachedScrollbarWidth;var w1,w2,div=$("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),innerDiv=div.children()[0];return $("body").append(div),w1=innerDiv.offsetWidth,div.css("overflow","scroll"),w2=innerDiv.offsetWidth,w1===w2&&(w2=div[0].clientWidth),div.remove(),cachedScrollbarWidth=w1-w2},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX="scroll"===overflowX||"auto"===overflowX&&within.width<within.element[0].scrollWidth,hasOverflowY="scroll"===overflowY||"auto"===overflowY&&within.height<within.element[0].scrollHeight;return{width:hasOverflowY?$.position.scrollbarWidth():0,height:hasOverflowX?$.position.scrollbarWidth():0}},getWithinInfo:function(element){var withinElement=$(element||window),isWindow=$.isWindow(withinElement[0]),isDocument=!!withinElement[0]&&9===withinElement[0].nodeType;return{element:withinElement,isWindow:isWindow,isDocument:isDocument,offset:withinElement.offset()||{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:isWindow||isDocument?withinElement.width():withinElement.outerWidth(),height:isWindow||isDocument?withinElement.height():withinElement.outerHeight()}}},$.fn.position=function(options){if(!options||!options.of)return _position.apply(this,arguments);options=$.extend({},options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,target=$(options.of),within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),collision=(options.collision||"flip").split(" "),offsets={};return dimensions=getDimensions(target),target[0].preventDefault&&(options.at="left top"),targetWidth=dimensions.width,targetHeight=dimensions.height,targetOffset=dimensions.offset,basePosition=$.extend({},targetOffset),$.each(["my","at"],function(){var horizontalOffset,verticalOffset,pos=(options[this]||"").split(" ");1===pos.length&&(pos=rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?["center"].concat(pos):["center","center"]),pos[0]=rhorizontal.test(pos[0])?pos[0]:"center",pos[1]=rvertical.test(pos[1])?pos[1]:"center",horizontalOffset=roffset.exec(pos[0]),verticalOffset=roffset.exec(pos[1]),offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0],options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[0]]}),1===collision.length&&(collision[1]=collision[0]),"right"===options.at[0]?basePosition.left+=targetWidth:"center"===options.at[0]&&(basePosition.left+=targetWidth/2),"bottom"===options.at[1]?basePosition.top+=targetHeight:"center"===options.at[1]&&(basePosition.top+=targetHeight/2),atOffset=getOffsets(offsets.at,targetWidth,targetHeight),basePosition.left+=atOffset[0],basePosition.top+=atOffset[1],this.each(function(){var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+scrollInfo.height,position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());"right"===options.my[0]?position.left-=elemWidth:"center"===options.my[0]&&(position.left-=elemWidth/2),"bottom"===options.my[1]?position.top-=elemHeight:"center"===options.my[1]&&(position.top-=elemHeight/2),position.left+=myOffset[0],position.top+=myOffset[1],supportsOffsetFractions||(position.left=round(position.left),position.top=round(position.top)),collisionPosition={marginLeft:marginLeft,marginTop:marginTop},$.each(["left","top"],function(i,dir){$.ui.position[collision[i]]&&$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],my:options.my,at:options.at,within:within,elem:elem})}),options.using&&(using=function(props){var left=targetOffset.left-position.left,right=left+targetWidth-elemWidth,top=targetOffset.top-position.top,bottom=top+targetHeight-elemHeight,feedback={target:{element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},horizontal:0>right?"left":left>0?"right":"center",vertical:0>bottom?"top":top>0?"bottom":"middle"};elemWidth>targetWidth&&abs(left+right)<targetWidth&&(feedback.horizontal="center"),elemHeight>targetHeight&&abs(top+bottom)<targetHeight&&(feedback.vertical="middle"),max(abs(left),abs(right))>max(abs(top),abs(bottom))?feedback.important="horizontal":feedback.important="vertical",options.using.call(this,props,feedback)}),elem.offset($.extend(position,{using:using}))})},$.ui.position={fit:{left:function(position,data){var newOverRight,within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset;data.collisionWidth>outerWidth?overLeft>0&&0>=overRight?(newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset,position.left+=overLeft-newOverRight):overRight>0&&0>=overLeft?position.left=withinOffset:overLeft>overRight?position.left=withinOffset+outerWidth-data.collisionWidth:position.left=withinOffset:overLeft>0?position.left+=overLeft:overRight>0?position.left-=overRight:position.left=max(position.left-collisionPosLeft,position.left)},top:function(position,data){var newOverBottom,within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset;data.collisionHeight>outerHeight?overTop>0&&0>=overBottom?(newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset,position.top+=overTop-newOverBottom):overBottom>0&&0>=overTop?position.top=withinOffset:overTop>overBottom?position.top=withinOffset+outerHeight-data.collisionHeight:position.top=withinOffset:overTop>0?position.top+=overTop:overBottom>0?position.top-=overBottom:position.top=max(position.top-collisionPosTop,position.top)}},flip:{left:function(position,data){var newOverRight,newOverLeft,within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset="left"===data.my[0]?-data.elemWidth:"right"===data.my[0]?data.elemWidth:0,atOffset="left"===data.at[0]?data.targetWidth:"right"===data.at[0]?-data.targetWidth:0,offset=-2*data.offset[0];0>overLeft?(newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset,(0>newOverRight||newOverRight<abs(overLeft))&&(position.left+=myOffset+atOffset+offset)):overRight>0&&(newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft,(newOverLeft>0||abs(newOverLeft)<overRight)&&(position.left+=myOffset+atOffset+offset))},top:function(position,data){var newOverTop,newOverBottom,within=data.within,withinOffset=within.offset.top+within.scrollTop,outerHeight=within.height,offsetTop=within.isWindow?within.scrollTop:within.offset.top,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=collisionPosTop-offsetTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop,top="top"===data.my[1],myOffset=top?-data.elemHeight:"bottom"===data.my[1]?data.elemHeight:0,atOffset="top"===data.at[1]?data.targetHeight:"bottom"===data.at[1]?-data.targetHeight:0,offset=-2*data.offset[1];0>overTop?(newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset,position.top+myOffset+atOffset+offset>overTop&&(0>newOverBottom||newOverBottom<abs(overTop))&&(position.top+=myOffset+atOffset+offset)):overBottom>0&&(newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop,position.top+myOffset+atOffset+offset>overBottom&&(newOverTop>0||abs(newOverTop)<overBottom)&&(position.top+=myOffset+atOffset+offset))}},flipfit:{left:function(){$.ui.position.flip.left.apply(this,arguments),$.ui.position.fit.left.apply(this,arguments)},top:function(){$.ui.position.flip.top.apply(this,arguments),$.ui.position.fit.top.apply(this,arguments)}}},function(){var testElement,testElementParent,testElementStyle,offsetLeft,i,body=document.getElementsByTagName("body")[0],div=document.createElement("div");testElement=document.createElement(body?"div":"body"),testElementStyle={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},body&&$.extend(testElementStyle,{position:"absolute",left:"-1000px",top:"-1000px"});for(i in testElementStyle)testElement.style[i]=testElementStyle[i];testElement.appendChild(div),testElementParent=body||document.documentElement,testElementParent.insertBefore(testElement,testElementParent.firstChild),div.style.cssText="position: absolute; left: 10.7432222px;",offsetLeft=$(div).offset().left,supportsOffsetFractions=offsetLeft>10&&11>offsetLeft,testElement.innerHTML="",testElementParent.removeChild(testElement)}()}();$.ui.position,$.widget("ui.accordion",{version:"1.11.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var options=this.options;this.prevShow=this.prevHide=$(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),options.collapsible||options.active!==!1&&null!=options.active||(options.active=0),this._processPanels(),options.active<0&&(options.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():$()}},_createIcons:function(){var icons=this.options.icons;icons&&($("<span>").addClass("ui-accordion-header-icon ui-icon "+icons.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(icons.header).addClass(icons.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var contents;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),contents=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&contents.css("height","")},_setOption:function(key,value){return"active"===key?void this._activate(value):("event"===key&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(value)),this._super(key,value),"collapsible"!==key||value||this.options.active!==!1||this._activate(0),"icons"===key&&(this._destroyIcons(),value&&this._createIcons()),void("disabled"===key&&(this.element.toggleClass("ui-state-disabled",!!value).attr("aria-disabled",value),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!value))))},_keydown:function(event){if(!event.altKey&&!event.ctrlKey){var keyCode=$.ui.keyCode,length=this.headers.length,currentIndex=this.headers.index(event.target),toFocus=!1;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._eventHandler(event);break;case keyCode.HOME:toFocus=this.headers[0];break;case keyCode.END:toFocus=this.headers[length-1]}toFocus&&($(event.target).attr("tabIndex",-1),$(toFocus).attr("tabIndex",0),toFocus.focus(),event.preventDefault())}},_panelKeyDown:function(event){event.keyCode===$.ui.keyCode.UP&&event.ctrlKey&&$(event.currentTarget).prev().focus()},refresh:function(){var options=this.options;this._processPanels(),options.active===!1&&options.collapsible===!0||!this.headers.length?(options.active=!1,this.active=$()):options.active===!1?this._activate(0):this.active.length&&!$.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(options.active=!1,this.active=$()):this._activate(Math.max(0,options.active-1)):options.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var prevHeaders=this.headers,prevPanels=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),prevPanels&&(this._off(prevHeaders.not(this.headers)),this._off(prevPanels.not(this.panels)))},_refresh:function(){var maxHeight,options=this.options,heightStyle=options.heightStyle,parent=this.element.parent();this.active=this._findActive(options.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var header=$(this),headerId=header.uniqueId().attr("id"),panel=header.next(),panelId=panel.uniqueId().attr("id");header.attr("aria-controls",panelId),panel.attr("aria-labelledby",headerId)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(options.event),"fill"===heightStyle?(maxHeight=parent.height(),this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");"absolute"!==position&&"fixed"!==position&&(maxHeight-=elem.outerHeight(!0))}),this.headers.each(function(){maxHeight-=$(this).outerHeight(!0)}),this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-$(this).innerHeight()+$(this).height()))}).css("overflow","auto")):"auto"===heightStyle&&(maxHeight=0,this.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).css("height","").height())}).height(maxHeight))},_activate:function(index){var active=this._findActive(index)[0];active!==this.active[0]&&(active=active||this.active[0],this._eventHandler({target:active,currentTarget:active,preventDefault:$.noop}))},_findActive:function(selector){return"number"==typeof selector?this.headers.eq(selector):$()},_setupEvents:function(event){var events={keydown:"_keydown"};event&&$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,events),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(event){var options=this.options,active=this.active,clicked=$(event.currentTarget),clickedIsActive=clicked[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():clicked.next(),toHide=active.next(),eventData={oldHeader:active,oldPanel:toHide,newHeader:collapsing?$():clicked,newPanel:toShow};event.preventDefault(),clickedIsActive&&!options.collapsible||this._trigger("beforeActivate",event,eventData)===!1||(options.active=collapsing?!1:this.headers.index(clicked),this.active=clickedIsActive?$():clicked,
this._toggle(eventData),active.removeClass("ui-accordion-header-active ui-state-active"),options.icons&&active.children(".ui-accordion-header-icon").removeClass(options.icons.activeHeader).addClass(options.icons.header),clickedIsActive||(clicked.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),options.icons&&clicked.children(".ui-accordion-header-icon").removeClass(options.icons.header).addClass(options.icons.activeHeader),clicked.next().addClass("ui-accordion-content-active")))},_toggle:function(data){var toShow=data.newPanel,toHide=this.prevShow.length?this.prevShow:data.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=toShow,this.prevHide=toHide,this.options.animate?this._animate(toShow,toHide,data):(toHide.hide(),toShow.show(),this._toggleComplete(data)),toHide.attr({"aria-hidden":"true"}),toHide.prev().attr("aria-selected","false"),toShow.length&&toHide.length?toHide.prev().attr({tabIndex:-1,"aria-expanded":"false"}):toShow.length&&this.headers.filter(function(){return 0===$(this).attr("tabIndex")}).attr("tabIndex",-1),toShow.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(toShow,toHide,data){var total,easing,duration,that=this,adjust=0,down=toShow.length&&(!toHide.length||toShow.index()<toHide.index()),animate=this.options.animate||{},options=down&&animate.down||animate,complete=function(){that._toggleComplete(data)};return"number"==typeof options&&(duration=options),"string"==typeof options&&(easing=options),easing=easing||options.easing||animate.easing,duration=duration||options.duration||animate.duration,toHide.length?toShow.length?(total=toShow.show().outerHeight(),toHide.animate(this.hideProps,{duration:duration,easing:easing,step:function(now,fx){fx.now=Math.round(now)}}),void toShow.hide().animate(this.showProps,{duration:duration,easing:easing,complete:complete,step:function(now,fx){fx.now=Math.round(now),"height"!==fx.prop?adjust+=fx.now:"content"!==that.options.heightStyle&&(fx.now=Math.round(total-toHide.outerHeight()-adjust),adjust=0)}})):toHide.animate(this.hideProps,duration,easing,complete):toShow.animate(this.showProps,duration,easing,complete)},_toggleComplete:function(data){var toHide=data.oldPanel;toHide.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),toHide.length&&(toHide.parent()[0].className=toHide.parent()[0].className),this._trigger("activate",null,data)}}),$.widget("ui.menu",{version:"1.11.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(event){event.preventDefault()},"click .ui-menu-item":function(event){var target=$(event.target);!this.mouseHandled&&target.not(".ui-state-disabled").length&&(this.select(event),event.isPropagationStopped()||(this.mouseHandled=!0),target.has(".ui-menu").length?this.expand(event):!this.element.is(":focus")&&$(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(event){if(!this.previousFilter){var target=$(event.currentTarget);target.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(event,target)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(event,keepActiveItem){var item=this.active||this.element.find(this.options.items).eq(0);keepActiveItem||this.focus(event,item)},blur:function(event){this._delay(function(){$.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(event)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(event){this._closeOnDocumentClick(event)&&this.collapseAll(event),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var elem=$(this);elem.data("ui-menu-submenu-carat")&&elem.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(event){var match,prev,character,skip,preventDefault=!0;switch(event.keyCode){case $.ui.keyCode.PAGE_UP:this.previousPage(event);break;case $.ui.keyCode.PAGE_DOWN:this.nextPage(event);break;case $.ui.keyCode.HOME:this._move("first","first",event);break;case $.ui.keyCode.END:this._move("last","last",event);break;case $.ui.keyCode.UP:this.previous(event);break;case $.ui.keyCode.DOWN:this.next(event);break;case $.ui.keyCode.LEFT:this.collapse(event);break;case $.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(event);break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:this._activate(event);break;case $.ui.keyCode.ESCAPE:this.collapse(event);break;default:preventDefault=!1,prev=this.previousFilter||"",character=String.fromCharCode(event.keyCode),skip=!1,clearTimeout(this.filterTimer),character===prev?skip=!0:character=prev+character,match=this._filterMenuItems(character),match=skip&&-1!==match.index(this.active.next())?this.active.nextAll(".ui-menu-item"):match,match.length||(character=String.fromCharCode(event.keyCode),match=this._filterMenuItems(character)),match.length?(this.focus(event,match),this.previousFilter=character,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}preventDefault&&event.preventDefault()},_activate:function(event){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(event):this.select(event))},refresh:function(){var menus,items,that=this,icon=this.options.icons.submenu,submenus=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),submenus.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var menu=$(this),item=menu.parent(),submenuCarat=$("<span>").addClass("ui-menu-icon ui-icon "+icon).data("ui-menu-submenu-carat",!0);item.attr("aria-haspopup","true").prepend(submenuCarat),menu.attr("aria-labelledby",item.attr("id"))}),menus=submenus.add(this.element),items=menus.find(this.options.items),items.not(".ui-menu-item").each(function(){var item=$(this);that._isDivider(item)&&item.addClass("ui-widget-content ui-menu-divider")}),items.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),items.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!$.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(key,value){"icons"===key&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(value.submenu),"disabled"===key&&this.element.toggleClass("ui-state-disabled",!!value).attr("aria-disabled",value),this._super(key,value)},focus:function(event,item){var nested,focused;this.blur(event,event&&"focus"===event.type),this._scrollIntoView(item),this.active=item.first(),focused=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",focused.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),event&&"keydown"===event.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),nested=item.children(".ui-menu"),nested.length&&event&&/^mouse/.test(event.type)&&this._startOpening(nested),this.activeMenu=item.parent(),this._trigger("focus",event,{item:item})},_scrollIntoView:function(item){var borderTop,paddingTop,offset,scroll,elementHeight,itemHeight;this._hasScroll()&&(borderTop=parseFloat($.css(this.activeMenu[0],"borderTopWidth"))||0,paddingTop=parseFloat($.css(this.activeMenu[0],"paddingTop"))||0,offset=item.offset().top-this.activeMenu.offset().top-borderTop-paddingTop,scroll=this.activeMenu.scrollTop(),elementHeight=this.activeMenu.height(),itemHeight=item.outerHeight(),0>offset?this.activeMenu.scrollTop(scroll+offset):offset+itemHeight>elementHeight&&this.activeMenu.scrollTop(scroll+offset-elementHeight+itemHeight))},blur:function(event,fromFocus){fromFocus||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",event,{item:this.active}))},_startOpening:function(submenu){clearTimeout(this.timer),"true"===submenu.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(submenu)},this.delay))},_open:function(submenu){var position=$.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden","true"),submenu.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(position)},collapseAll:function(event,all){clearTimeout(this.timer),this.timer=this._delay(function(){var currentMenu=all?this.element:$(event&&event.target).closest(this.element.find(".ui-menu"));currentMenu.length||(currentMenu=this.element),this._close(currentMenu),this.blur(event),this.activeMenu=currentMenu},this.delay)},_close:function(startMenu){startMenu||(startMenu=this.active?this.active.parent():this.element),startMenu.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(event){return!$(event.target).closest(".ui-menu").length},_isDivider:function(item){return!/[^\-\u2014\u2013\s]/.test(item.text())},collapse:function(event){var newItem=this.active&&this.active.parent().closest(".ui-menu-item",this.element);newItem&&newItem.length&&(this._close(),this.focus(event,newItem))},expand:function(event){var newItem=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();newItem&&newItem.length&&(this._open(newItem.parent()),this._delay(function(){this.focus(event,newItem)}))},next:function(event){this._move("next","first",event)},previous:function(event){this._move("prev","last",event)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(direction,filter,event){var next;this.active&&(next="first"===direction||"last"===direction?this.active["first"===direction?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[direction+"All"](".ui-menu-item").eq(0)),next&&next.length&&this.active||(next=this.activeMenu.find(this.options.items)[filter]()),this.focus(event,next)},nextPage:function(event){var item,base,height;return this.active?void(this.isLastItem()||(this._hasScroll()?(base=this.active.offset().top,height=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return item=$(this),item.offset().top-base-height<0}),this.focus(event,item)):this.focus(event,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))):void this.next(event)},previousPage:function(event){var item,base,height;return this.active?void(this.isFirstItem()||(this._hasScroll()?(base=this.active.offset().top,height=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return item=$(this),item.offset().top-base+height>0}),this.focus(event,item)):this.focus(event,this.activeMenu.find(this.options.items).first()))):void this.next(event)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(event){this.active=this.active||$(event.target).closest(".ui-menu-item");var ui={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(event,!0),this._trigger("select",event,ui)},_filterMenuItems:function(character){var escapedCharacter=character.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),regex=new RegExp("^"+escapedCharacter,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return regex.test($.trim($(this).text()))})}});$.widget("ui.autocomplete",{version:"1.11.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var suppressKeyPress,suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),isTextarea="textarea"===nodeName,isInput="input"===nodeName;this.isMultiLine=isTextarea?!0:isInput?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[isTextarea||isInput?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(event){if(this.element.prop("readOnly"))return suppressKeyPress=!0,suppressInput=!0,void(suppressKeyPressRepeat=!0);suppressKeyPress=!1,suppressInput=!1,suppressKeyPressRepeat=!1;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:suppressKeyPress=!0,this._move("previousPage",event);break;case keyCode.PAGE_DOWN:suppressKeyPress=!0,this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=!0,this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=!0,this._keyEvent("next",event);break;case keyCode.ENTER:this.menu.active&&(suppressKeyPress=!0,event.preventDefault(),this.menu.select(event));break;case keyCode.TAB:this.menu.active&&this.menu.select(event);break;case keyCode.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(event),event.preventDefault());break;default:suppressKeyPressRepeat=!0,this._searchTimeout(event)}},keypress:function(event){if(suppressKeyPress)return suppressKeyPress=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||event.preventDefault());if(!suppressKeyPressRepeat){var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move("nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:this._keyEvent("next",event)}}},input:function(event){return suppressInput?(suppressInput=!1,void event.preventDefault()):void this._searchTimeout(event)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(event){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(event),void this._change(event))}}),this._initSource(),this.menu=$("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(event){event.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var menuElement=this.menu.element[0];$(event.target).closest(".ui-menu-item").length||this._delay(function(){var that=this;this.document.one("mousedown",function(event){event.target===that.element[0]||event.target===menuElement||$.contains(menuElement,event.target)||that.close()})})},menufocus:function(event,ui){var label,item;return this.isNewMenu&&(this.isNewMenu=!1,event.originalEvent&&/^mouse/.test(event.originalEvent.type))?(this.menu.blur(),void this.document.one("mousemove",function(){$(event.target).trigger(event.originalEvent)})):(item=ui.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",event,{item:item})&&event.originalEvent&&/^key/.test(event.originalEvent.type)&&this._value(item.value),label=ui.item.attr("aria-label")||item.value,void(label&&$.trim(label).length&&(this.liveRegion.children().hide(),$("<div>").text(label).appendTo(this.liveRegion))))},menuselect:function(event,ui){var item=ui.item.data("ui-autocomplete-item"),previous=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=previous,this._delay(function(){this.previous=previous,this.selectedItem=item})),!1!==this._trigger("select",event,{item:item})&&this._value(item.value),this.term=this._value(),this.close(event),this.selectedItem=item}}),this.liveRegion=$("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(key,value){this._super(key,value),"source"===key&&this._initSource(),"appendTo"===key&&this.menu.element.appendTo(this._appendTo()),"disabled"===key&&value&&this.xhr&&this.xhr.abort()},_appendTo:function(){var element=this.options.appendTo;return element&&(element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0)),element&&element[0]||(element=this.element.closest(".ui-front")),element.length||(element=this.document[0].body),element},_initSource:function(){var array,url,that=this;$.isArray(this.options.source)?(array=this.options.source,this.source=function(request,response){response($.ui.autocomplete.filter(array,request.term))}):"string"==typeof this.options.source?(url=this.options.source,this.source=function(request,response){that.xhr&&that.xhr.abort(),that.xhr=$.ajax({url:url,data:request,dataType:"json",success:function(data){response(data)},error:function(){response([])}})}):this.source=this.options.source},_searchTimeout:function(event){clearTimeout(this.searching),this.searching=this._delay(function(){var equalValues=this.term===this._value(),menuVisible=this.menu.element.is(":visible"),modifierKey=event.altKey||event.ctrlKey||event.metaKey||event.shiftKey;equalValues&&(!equalValues||menuVisible||modifierKey)||(this.selectedItem=null,this.search(null,event))},this.options.delay)},search:function(value,event){return value=null!=value?value:this._value(),this.term=this._value(),value.length<this.options.minLength?this.close(event):this._trigger("search",event)!==!1?this._search(value):void 0},_search:function(value){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:value},this._response())},_response:function(){var index=++this.requestIndex;return $.proxy(function(content){index===this.requestIndex&&this.__response(content),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(content){content&&(content=this._normalize(content)),this._trigger("response",null,{content:content}),!this.options.disabled&&content&&content.length&&!this.cancelSearch?(this._suggest(content),this._trigger("open")):this._close()},close:function(event){this.cancelSearch=!0,this._close(event)},_close:function(event){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",event))},_change:function(event){this.previous!==this._value()&&this._trigger("change",event,{item:this.selectedItem})},_normalize:function(items){return items.length&&items[0].label&&items[0].value?items:$.map(items,function(item){return"string"==typeof item?{label:item,value:item}:$.extend({},item,{label:item.label||item.value,value:item.value||item.label})})},_suggest:function(items){var ul=this.menu.element.empty();this._renderMenu(ul,items),this.isNewMenu=!0,this.menu.refresh(),ul.show(),this._resizeMenu(),ul.position($.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var ul=this.menu.element;ul.outerWidth(Math.max(ul.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(ul,items){var that=this;$.each(items,function(index,item){that._renderItemData(ul,item)})},_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-autocomplete-item",item)},_renderItem:function(ul,item){return $("<li>").text(item.label).appendTo(ul)},_move:function(direction,event){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(direction)||this.menu.isLastItem()&&/^next/.test(direction)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[direction](event):void this.search(null,event)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(keyEvent,event){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(keyEvent,event),event.preventDefault())}}),$.extend($.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i");return $.grep(array,function(value){return matcher.test(value.label||value.value||value)})}}),$.widget("ui.autocomplete",$.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(amount){return amount+(amount>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(content){var message;this._superApply(arguments),this.options.disabled||this.cancelSearch||(message=content&&content.length?this.options.messages.results(content.length):this.options.messages.noResults,this.liveRegion.children().hide(),$("<div>").text(message).appendTo(this.liveRegion))}});var lastActive,baseClasses=($.ui.autocomplete,"ui-button ui-widget ui-state-default ui-corner-all"),typeClasses="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",formResetHandler=function(){var form=$(this);setTimeout(function(){form.find(":ui-button").button("refresh")},1)},radioGroup=function(radio){var name=radio.name,form=radio.form,radios=$([]);return name&&(name=name.replace(/'/g,"\\'"),radios=form?$(form).find("[name='"+name+"'][type=radio]"):$("[name='"+name+"'][type=radio]",radio.ownerDocument).filter(function(){return!this.form})),radios};$.widget("ui.button",{version:"1.11.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,formResetHandler),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var that=this,options=this.options,toggleButton="checkbox"===this.type||"radio"===this.type,activeClass=toggleButton?"":"ui-state-active";null===options.label&&(options.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(baseClasses).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){options.disabled||this===lastActive&&$(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){options.disabled||$(this).removeClass(activeClass)}).bind("click"+this.eventNamespace,function(event){options.disabled&&(event.preventDefault(),event.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),toggleButton&&this.element.bind("change"+this.eventNamespace,function(){that.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return options.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(options.disabled)return!1;$(this).addClass("ui-state-active"),that.buttonElement.attr("aria-pressed","true");var radio=that.element[0];radioGroup(radio).not(radio).map(function(){return $(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return options.disabled?!1:($(this).addClass("ui-state-active"),lastActive=this,void that.document.one("mouseup",function(){lastActive=null}))}).bind("mouseup"+this.eventNamespace,function(){return options.disabled?!1:void $(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(event){return options.disabled?!1:void(event.keyCode!==$.ui.keyCode.SPACE&&event.keyCode!==$.ui.keyCode.ENTER||$(this).addClass("ui-state-active"))}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){$(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(event){event.keyCode===$.ui.keyCode.SPACE&&$(this).click()})),this._setOption("disabled",options.disabled),this._resetButton()},_determineButtonType:function(){var ancestor,labelSelector,checked;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button","checkbox"===this.type||"radio"===this.type?(ancestor=this.element.parents().last(),labelSelector="label[for='"+this.element.attr("id")+"']",this.buttonElement=ancestor.find(labelSelector),this.buttonElement.length||(ancestor=ancestor.length?ancestor.siblings():this.element.siblings(),this.buttonElement=ancestor.filter(labelSelector),this.buttonElement.length||(this.buttonElement=ancestor.find(labelSelector))),this.element.addClass("ui-helper-hidden-accessible"),checked=this.element.is(":checked"),checked&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",checked)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(baseClasses+" ui-state-active "+typeClasses).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(key,value){return this._super(key,value),"disabled"===key?(this.widget().toggleClass("ui-state-disabled",!!value),this.element.prop("disabled",!!value),void(value&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")))):void this._resetButton()},refresh:function(){var isDisabled=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");isDisabled!==this.options.disabled&&this._setOption("disabled",isDisabled),"radio"===this.type?radioGroup(this.element[0]).each(function(){$(this).is(":checked")?$(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):$(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return void(this.options.label&&this.element.val(this.options.label));var buttonElement=this.buttonElement.removeClass(typeClasses),buttonText=$("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(buttonElement.empty()).text(),icons=this.options.icons,multipleIcons=icons.primary&&icons.secondary,buttonClasses=[];icons.primary||icons.secondary?(this.options.text&&buttonClasses.push("ui-button-text-icon"+(multipleIcons?"s":icons.primary?"-primary":"-secondary")),icons.primary&&buttonElement.prepend("<span class='ui-button-icon-primary ui-icon "+icons.primary+"'></span>"),icons.secondary&&buttonElement.append("<span class='ui-button-icon-secondary ui-icon "+icons.secondary+"'></span>"),this.options.text||(buttonClasses.push(multipleIcons?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||buttonElement.attr("title",$.trim(buttonText)))):buttonClasses.push("ui-button-text-only"),buttonElement.addClass(buttonClasses.join(" "))}}),$.widget("ui.buttonset",{version:"1.11.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(key,value){"disabled"===key&&this.buttons.button("option",key,value),this._super(key,value)},refresh:function(){var rtl="rtl"===this.element.css("direction"),allButtons=this.element.find(this.options.items),existingButtons=allButtons.filter(":ui-button");allButtons.not(":ui-button").button(),existingButtons.button("refresh"),this.buttons=allButtons.map(function(){return $(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(rtl?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(rtl?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return $(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}});$.ui.button;$.extend($.ui,{datepicker:{version:"1.11.2"}});var datepicker_instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(settings){return datepicker_extendRemove(this._defaults,settings||{}),this},_attachDatepicker:function(target,settings){var nodeName,inline,inst;nodeName=target.nodeName.toLowerCase(),inline="div"===nodeName||"span"===nodeName,target.id||(this.uuid+=1,target.id="dp"+this.uuid),inst=this._newInst($(target),inline),inst.settings=$.extend({},settings||{}),"input"===nodeName?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:inline?datepicker_bindHover($("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]),inst.trigger=$([]),input.hasClass(this.markerClassName)||(this._attachments(input,inst),input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(inst),$.data(target,"datepicker",inst),inst.settings.disabled&&this._disableDatepicker(target))},_attachments:function(input,inst){var showOn,buttonText,buttonImage,appendText=this._get(inst,"appendText"),isRTL=this._get(inst,"isRTL");inst.append&&inst.append.remove(),appendText&&(inst.append=$("<span class='"+this._appendClass+"'>"+appendText+"</span>"),input[isRTL?"before":"after"](inst.append)),
input.unbind("focus",this._showDatepicker),inst.trigger&&inst.trigger.remove(),showOn=this._get(inst,"showOn"),"focus"!==showOn&&"both"!==showOn||input.focus(this._showDatepicker),"button"!==showOn&&"both"!==showOn||(buttonText=this._get(inst,"buttonText"),buttonImage=this._get(inst,"buttonImage"),inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$("<button type='button'></button>").addClass(this._triggerClass).html(buttonImage?$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText}):buttonText)),input[isRTL?"before":"after"](inst.trigger),inst.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput===input[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!==input[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(input[0])):$.datepicker._showDatepicker(input[0]),!1}))},_autoSize:function(inst){if(this._get(inst,"autoSize")&&!inst.inline){var findMax,max,maxI,i,date=new Date(2009,11,20),dateFormat=this._get(inst,"dateFormat");dateFormat.match(/[DM]/)&&(findMax=function(names){for(max=0,maxI=0,i=0;i<names.length;i++)names[i].length>max&&(max=names[i].length,maxI=i);return maxI},date.setMonth(findMax(this._get(inst,dateFormat.match(/MM/)?"monthNames":"monthNamesShort"))),date.setDate(findMax(this._get(inst,dateFormat.match(/DD/)?"dayNames":"dayNamesShort"))+20-date.getDay())),inst.input.attr("size",this._formatDate(inst,date).length)}},_inlineDatepicker:function(target,inst){var divSpan=$(target);divSpan.hasClass(this.markerClassName)||(divSpan.addClass(this.markerClassName).append(inst.dpDiv),$.data(target,"datepicker",inst),this._setDate(inst,this._getDefaultDate(inst),!0),this._updateDatepicker(inst),this._updateAlternate(inst),inst.settings.disabled&&this._disableDatepicker(target),inst.dpDiv.css("display","block"))},_dialogDatepicker:function(input,date,onSelect,settings,pos){var id,browserWidth,browserHeight,scrollX,scrollY,inst=this._dialogInst;return inst||(this.uuid+=1,id="dp"+this.uuid,this._dialogInput=$("<input type='text' id='"+id+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),inst=this._dialogInst=this._newInst(this._dialogInput,!1),inst.settings={},$.data(this._dialogInput[0],"datepicker",inst)),datepicker_extendRemove(inst.settings,settings||{}),date=date&&date.constructor===Date?this._formatDate(inst,date):date,this._dialogInput.val(date),this._pos=pos?pos.length?pos:[pos.pageX,pos.pageY]:null,this._pos||(browserWidth=document.documentElement.clientWidth,browserHeight=document.documentElement.clientHeight,scrollX=document.documentElement.scrollLeft||document.body.scrollLeft,scrollY=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[browserWidth/2-100+scrollX,browserHeight/2-150+scrollY]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),inst.settings.onSelect=onSelect,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],"datepicker",inst),this},_destroyDatepicker:function(target){var nodeName,$target=$(target),inst=$.data(target,"datepicker");$target.hasClass(this.markerClassName)&&(nodeName=target.nodeName.toLowerCase(),$.removeData(target,"datepicker"),"input"===nodeName?(inst.append.remove(),inst.trigger.remove(),$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!==nodeName&&"span"!==nodeName||$target.removeClass(this.markerClassName).empty())},_enableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,"datepicker");$target.hasClass(this.markerClassName)&&(nodeName=target.nodeName.toLowerCase(),"input"===nodeName?(target.disabled=!1,inst.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==nodeName&&"span"!==nodeName||(inline=$target.children("."+this._inlineClass),inline.children().removeClass("ui-state-disabled"),inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=$.map(this._disabledInputs,function(value){return value===target?null:value}))},_disableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,"datepicker");$target.hasClass(this.markerClassName)&&(nodeName=target.nodeName.toLowerCase(),"input"===nodeName?(target.disabled=!0,inst.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==nodeName&&"span"!==nodeName||(inline=$target.children("."+this._inlineClass),inline.children().addClass("ui-state-disabled"),inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=$.map(this._disabledInputs,function(value){return value===target?null:value}),this._disabledInputs[this._disabledInputs.length]=target)},_isDisabledDatepicker:function(target){if(!target)return!1;for(var i=0;i<this._disabledInputs.length;i++)if(this._disabledInputs[i]===target)return!0;return!1},_getInst:function(target){try{return $.data(target,"datepicker")}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var settings,date,minDate,maxDate,inst=this._getInst(target);return 2===arguments.length&&"string"==typeof name?"defaults"===name?$.extend({},$.datepicker._defaults):inst?"all"===name?$.extend({},inst.settings):this._get(inst,name):null:(settings=name||{},"string"==typeof name&&(settings={},settings[name]=value),void(inst&&(this._curInst===inst&&this._hideDatepicker(),date=this._getDateDatepicker(target,!0),minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),datepicker_extendRemove(inst.settings,settings),null!==minDate&&void 0!==settings.dateFormat&&void 0===settings.minDate&&(inst.settings.minDate=this._formatDate(inst,minDate)),null!==maxDate&&void 0!==settings.dateFormat&&void 0===settings.maxDate&&(inst.settings.maxDate=this._formatDate(inst,maxDate)),"disabled"in settings&&(settings.disabled?this._disableDatepicker(target):this._enableDatepicker(target)),this._attachments($(target),inst),this._autoSize(inst),this._setDate(inst,date),this._updateAlternate(inst),this._updateDatepicker(inst))))},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);inst&&this._updateDatepicker(inst)},_setDateDatepicker:function(target,date){var inst=this._getInst(target);inst&&(this._setDate(inst,date),this._updateDatepicker(inst),this._updateAlternate(inst))},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);return inst&&!inst.inline&&this._setDateFromField(inst,noDefault),inst?this._getDate(inst):null},_doKeyDown:function(event){var onSelect,dateStr,sel,inst=$.datepicker._getInst(event.target),handled=!0,isRTL=inst.dpDiv.is(".ui-datepicker-rtl");if(inst._keyEvent=!0,$.datepicker._datepickerShowing)switch(event.keyCode){case 9:$.datepicker._hideDatepicker(),handled=!1;break;case 13:return sel=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",inst.dpDiv),sel[0]&&$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]),onSelect=$.datepicker._get(inst,"onSelect"),onSelect?(dateStr=$.datepicker._formatDate(inst),onSelect.apply(inst.input?inst.input[0]:null,[dateStr,inst])):$.datepicker._hideDatepicker(),!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(event.target,event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths"),"M");break;case 35:(event.ctrlKey||event.metaKey)&&$.datepicker._clearDate(event.target),handled=event.ctrlKey||event.metaKey;break;case 36:(event.ctrlKey||event.metaKey)&&$.datepicker._gotoToday(event.target),handled=event.ctrlKey||event.metaKey;break;case 37:(event.ctrlKey||event.metaKey)&&$.datepicker._adjustDate(event.target,isRTL?1:-1,"D"),handled=event.ctrlKey||event.metaKey,event.originalEvent.altKey&&$.datepicker._adjustDate(event.target,event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths"),"M");break;case 38:(event.ctrlKey||event.metaKey)&&$.datepicker._adjustDate(event.target,-7,"D"),handled=event.ctrlKey||event.metaKey;break;case 39:(event.ctrlKey||event.metaKey)&&$.datepicker._adjustDate(event.target,isRTL?-1:1,"D"),handled=event.ctrlKey||event.metaKey,event.originalEvent.altKey&&$.datepicker._adjustDate(event.target,event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths"),"M");break;case 40:(event.ctrlKey||event.metaKey)&&$.datepicker._adjustDate(event.target,7,"D"),handled=event.ctrlKey||event.metaKey;break;default:handled=!1}else 36===event.keyCode&&event.ctrlKey?$.datepicker._showDatepicker(this):handled=!1;handled&&(event.preventDefault(),event.stopPropagation())},_doKeyPress:function(event){var chars,chr,inst=$.datepicker._getInst(event.target);return $.datepicker._get(inst,"constrainInput")?(chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat")),chr=String.fromCharCode(null==event.charCode?event.keyCode:event.charCode),event.ctrlKey||event.metaKey||" ">chr||!chars||chars.indexOf(chr)>-1):void 0},_doKeyUp:function(event){var date,inst=$.datepicker._getInst(event.target);if(inst.input.val()!==inst.lastVal)try{date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),inst.input?inst.input.val():null,$.datepicker._getFormatConfig(inst)),date&&($.datepicker._setDateFromField(inst),$.datepicker._updateAlternate(inst),$.datepicker._updateDatepicker(inst))}catch(err){}return!0},_showDatepicker:function(input){if(input=input.target||input,"input"!==input.nodeName.toLowerCase()&&(input=$("input",input.parentNode)[0]),!$.datepicker._isDisabledDatepicker(input)&&$.datepicker._lastInput!==input){var inst,beforeShow,beforeShowSettings,isFixed,offset,showAnim,duration;inst=$.datepicker._getInst(input),$.datepicker._curInst&&$.datepicker._curInst!==inst&&($.datepicker._curInst.dpDiv.stop(!0,!0),inst&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0])),beforeShow=$.datepicker._get(inst,"beforeShow"),beforeShowSettings=beforeShow?beforeShow.apply(input,[input,inst]):{},beforeShowSettings!==!1&&(datepicker_extendRemove(inst.settings,beforeShowSettings),inst.lastVal=null,$.datepicker._lastInput=input,$.datepicker._setDateFromField(inst),$.datepicker._inDialog&&(input.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(input),$.datepicker._pos[1]+=input.offsetHeight),isFixed=!1,$(input).parents().each(function(){return isFixed|="fixed"===$(this).css("position"),!isFixed}),offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]},$.datepicker._pos=null,inst.dpDiv.empty(),inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(inst),offset=$.datepicker._checkOffset(inst,offset,isFixed),inst.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":isFixed?"fixed":"absolute",display:"none",left:offset.left+"px",top:offset.top+"px"}),inst.inline||(showAnim=$.datepicker._get(inst,"showAnim"),duration=$.datepicker._get(inst,"duration"),inst.dpDiv.css("z-index",datepicker_getZindex($(input))+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects.effect[showAnim]?inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration):inst.dpDiv[showAnim||"show"](showAnim?duration:null),$.datepicker._shouldFocusInput(inst)&&inst.input.focus(),$.datepicker._curInst=inst))}},_updateDatepicker:function(inst){this.maxRows=4,datepicker_instActive=inst,inst.dpDiv.empty().append(this._generateHTML(inst)),this._attachHandlers(inst);var origyearshtml,numMonths=this._getNumberOfMonths(inst),cols=numMonths[1],width=17,activeCell=inst.dpDiv.find("."+this._dayOverClass+" a");activeCell.length>0&&datepicker_handleMouseover.apply(activeCell.get(0)),inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),cols>1&&inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",width*cols+"em"),inst.dpDiv[(1!==numMonths[0]||1!==numMonths[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),inst===$.datepicker._curInst&&$.datepicker._datepickerShowing&&$.datepicker._shouldFocusInput(inst)&&inst.input.focus(),inst.yearshtml&&(origyearshtml=inst.yearshtml,setTimeout(function(){origyearshtml===inst.yearshtml&&inst.yearshtml&&inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml),origyearshtml=inst.yearshtml=null},0))},_shouldFocusInput:function(inst){return inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&!inst.input.is(":focus")},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth(),dpHeight=inst.dpDiv.outerHeight(),inputWidth=inst.input?inst.input.outerWidth():0,inputHeight=inst.input?inst.input.outerHeight():0,viewWidth=document.documentElement.clientWidth+(isFixed?0:$(document).scrollLeft()),viewHeight=document.documentElement.clientHeight+(isFixed?0:$(document).scrollTop());return offset.left-=this._get(inst,"isRTL")?dpWidth-inputWidth:0,offset.left-=isFixed&&offset.left===inst.input.offset().left?$(document).scrollLeft():0,offset.top-=isFixed&&offset.top===inst.input.offset().top+inputHeight?$(document).scrollTop():0,offset.left-=Math.min(offset.left,offset.left+dpWidth>viewWidth&&viewWidth>dpWidth?Math.abs(offset.left+dpWidth-viewWidth):0),offset.top-=Math.min(offset.top,offset.top+dpHeight>viewHeight&&viewHeight>dpHeight?Math.abs(dpHeight+inputHeight):0),offset},_findPos:function(obj){for(var position,inst=this._getInst(obj),isRTL=this._get(inst,"isRTL");obj&&("hidden"===obj.type||1!==obj.nodeType||$.expr.filters.hidden(obj));)obj=obj[isRTL?"previousSibling":"nextSibling"];return position=$(obj).offset(),[position.left,position.top]},_hideDatepicker:function(input){var showAnim,duration,postProcess,onClose,inst=this._curInst;!inst||input&&inst!==$.data(input,"datepicker")||this._datepickerShowing&&(showAnim=this._get(inst,"showAnim"),duration=this._get(inst,"duration"),postProcess=function(){$.datepicker._tidyDialog(inst)},$.effects&&($.effects.effect[showAnim]||$.effects[showAnim])?inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess):inst.dpDiv["slideDown"===showAnim?"slideUp":"fadeIn"===showAnim?"fadeOut":"hide"](showAnim?duration:null,postProcess),showAnim||postProcess(),this._datepickerShowing=!1,onClose=this._get(inst,"onClose"),onClose&&onClose.apply(inst.input?inst.input[0]:null,[inst.input?inst.input.val():"",inst]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if($.datepicker._curInst){var $target=$(event.target),inst=$.datepicker._getInst($target[0]);($target[0].id===$.datepicker._mainDivId||0!==$target.parents("#"+$.datepicker._mainDivId).length||$target.hasClass($.datepicker.markerClassName)||$target.closest("."+$.datepicker._triggerClass).length||!$.datepicker._datepickerShowing||$.datepicker._inDialog&&$.blockUI)&&(!$target.hasClass($.datepicker.markerClassName)||$.datepicker._curInst===inst)||$.datepicker._hideDatepicker()}},_adjustDate:function(id,offset,period){var target=$(id),inst=this._getInst(target[0]);this._isDisabledDatepicker(target[0])||(this._adjustInstDate(inst,offset+("M"===period?this._get(inst,"showCurrentAtPos"):0),period),this._updateDatepicker(inst))},_gotoToday:function(id){var date,target=$(id),inst=this._getInst(target[0]);this._get(inst,"gotoCurrent")&&inst.currentDay?(inst.selectedDay=inst.currentDay,inst.drawMonth=inst.selectedMonth=inst.currentMonth,inst.drawYear=inst.selectedYear=inst.currentYear):(date=new Date,inst.selectedDay=date.getDate(),inst.drawMonth=inst.selectedMonth=date.getMonth(),inst.drawYear=inst.selectedYear=date.getFullYear()),this._notifyChange(inst),this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id),inst=this._getInst(target[0]);inst["selected"+("M"===period?"Month":"Year")]=inst["draw"+("M"===period?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10),this._notifyChange(inst),this._adjustDate(target)},_selectDay:function(id,month,year,td){var inst,target=$(id);$(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])||(inst=this._getInst(target[0]),inst.selectedDay=inst.currentDay=$("a",td).html(),inst.selectedMonth=inst.currentMonth=month,inst.selectedYear=inst.currentYear=year,this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear)))},_clearDate:function(id){var target=$(id);this._selectDate(target,"")},_selectDate:function(id,dateStr){var onSelect,target=$(id),inst=this._getInst(target[0]);dateStr=null!=dateStr?dateStr:this._formatDate(inst),inst.input&&inst.input.val(dateStr),this._updateAlternate(inst),onSelect=this._get(inst,"onSelect"),onSelect?onSelect.apply(inst.input?inst.input[0]:null,[dateStr,inst]):inst.input&&inst.input.trigger("change"),inst.inline?this._updateDatepicker(inst):(this._hideDatepicker(),this._lastInput=inst.input[0],"object"!=typeof inst.input[0]&&inst.input.focus(),this._lastInput=null)},_updateAlternate:function(inst){var altFormat,date,dateStr,altField=this._get(inst,"altField");altField&&(altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat"),date=this._getDate(inst),dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst)),$(altField).each(function(){$(this).val(dateStr)}))},noWeekends:function(date){var day=date.getDay();return[day>0&&6>day,""]},iso8601Week:function(date){var time,checkDate=new Date(date.getTime());return checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7)),time=checkDate.getTime(),checkDate.setMonth(0),checkDate.setDate(1),Math.floor(Math.round((time-checkDate)/864e5)/7)+1},parseDate:function(format,value,settings){if(null==format||null==value)throw"Invalid arguments";if(value="object"==typeof value?value.toString():value+"",""===value)return null;var iFormat,dim,extra,date,iValue=0,shortYearCutoffTemp=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff,shortYearCutoff="string"!=typeof shortYearCutoffTemp?shortYearCutoffTemp:(new Date).getFullYear()%100+parseInt(shortYearCutoffTemp,10),dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,year=-1,month=-1,day=-1,doy=-1,literal=!1,lookAhead=function(match){var matches=iFormat+1<format.length&&format.charAt(iFormat+1)===match;return matches&&iFormat++,matches},getNumber=function(match){var isDoubled=lookAhead(match),size="@"===match?14:"!"===match?20:"y"===match&&isDoubled?4:"o"===match?3:2,minSize="y"===match?size:1,digits=new RegExp("^\\d{"+minSize+","+size+"}"),num=value.substring(iValue).match(digits);if(!num)throw"Missing number at position "+iValue;return iValue+=num[0].length,parseInt(num[0],10)},getName=function(match,shortNames,longNames){var index=-1,names=$.map(lookAhead(match)?longNames:shortNames,function(v,k){return[[k,v]]}).sort(function(a,b){return-(a[1].length-b[1].length)});if($.each(names,function(i,pair){var name=pair[1];return value.substr(iValue,name.length).toLowerCase()===name.toLowerCase()?(index=pair[0],iValue+=name.length,!1):void 0}),-1!==index)return index+1;throw"Unknown name at position "+iValue},checkLiteral=function(){if(value.charAt(iValue)!==format.charAt(iFormat))throw"Unexpected literal at position "+iValue;iValue++};for(iFormat=0;iFormat<format.length;iFormat++)if(literal)"'"!==format.charAt(iFormat)||lookAhead("'")?checkLiteral():literal=!1;else switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":date=new Date(getNumber("@")),year=date.getFullYear(),month=date.getMonth()+1,day=date.getDate();break;case"!":date=new Date((getNumber("!")-this._ticksTo1970)/1e4),year=date.getFullYear(),month=date.getMonth()+1,day=date.getDate();break;case"'":lookAhead("'")?checkLiteral():literal=!0;break;default:checkLiteral()}if(iValue<value.length&&(extra=value.substr(iValue),!/^\s+/.test(extra)))throw"Extra/unparsed characters found in date: "+extra;if(-1===year?year=(new Date).getFullYear():100>year&&(year+=(new Date).getFullYear()-(new Date).getFullYear()%100+(shortYearCutoff>=year?0:-100)),doy>-1)for(month=1,day=doy;;){if(dim=this._getDaysInMonth(year,month-1),dim>=day)break;month++,day-=dim}if(date=this._daylightSavingAdjust(new Date(year,month-1,day)),date.getFullYear()!==year||date.getMonth()+1!==month||date.getDate()!==day)throw"Invalid date";return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(format,date,settings){if(!date)return"";var iFormat,dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,lookAhead=function(match){var matches=iFormat+1<format.length&&format.charAt(iFormat+1)===match;return matches&&iFormat++,matches},formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match))for(;num.length<len;)num="0"+num;return num},formatName=function(match,value,shortNames,longNames){return lookAhead(match)?longNames[value]:shortNames[value]},output="",literal=!1;if(date)for(iFormat=0;iFormat<format.length;iFormat++)if(literal)"'"!==format.charAt(iFormat)||lookAhead("'")?output+=format.charAt(iFormat):literal=!1;else switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0).getTime())/864e5),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100;break;case"@":output+=date.getTime();break;case"!":output+=1e4*date.getTime()+this._ticksTo1970;break;case"'":lookAhead("'")?output+="'":literal=!0;break;default:output+=format.charAt(iFormat)}return output},_possibleChars:function(format){var iFormat,chars="",literal=!1,lookAhead=function(match){var matches=iFormat+1<format.length&&format.charAt(iFormat+1)===match;return matches&&iFormat++,matches};for(iFormat=0;iFormat<format.length;iFormat++)if(literal)"'"!==format.charAt(iFormat)||lookAhead("'")?chars+=format.charAt(iFormat):literal=!1;else switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":lookAhead("'")?chars+="'":literal=!0;break;default:chars+=format.charAt(iFormat)}return chars},_get:function(inst,name){return void 0!==inst.settings[name]?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst,noDefault){if(inst.input.val()!==inst.lastVal){var dateFormat=this._get(inst,"dateFormat"),dates=inst.lastVal=inst.input?inst.input.val():null,defaultDate=this._getDefaultDate(inst),date=defaultDate,settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){dates=noDefault?"":dates}inst.selectedDay=date.getDate(),inst.drawMonth=inst.selectedMonth=date.getMonth(),inst.drawYear=inst.selectedYear=date.getFullYear(),inst.currentDay=dates?date.getDate():0,inst.currentMonth=dates?date.getMonth():0,inst.currentYear=dates?date.getFullYear():0,this._adjustInstDate(inst)}},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),new Date))},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date;return date.setDate(date.getDate()+offset),date},offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst))}catch(e){}for(var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date,year=date.getFullYear(),month=date.getMonth(),day=date.getDate(),pattern=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,matches=pattern.exec(offset);matches;){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=7*parseInt(matches[1],10);break;case"m":case"M":month+=parseInt(matches[1],10),day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10),day=Math.min(day,$.datepicker._getDaysInMonth(year,month))}matches=pattern.exec(offset)}return new Date(year,month,day)},newDate=null==date||""===date?defaultDate:"string"==typeof date?offsetString(date):"number"==typeof date?isNaN(date)?defaultDate:offsetNumeric(date):new Date(date.getTime());return newDate=newDate&&"Invalid Date"===newDate.toString()?defaultDate:newDate,newDate&&(newDate.setHours(0),newDate.setMinutes(0),newDate.setSeconds(0),newDate.setMilliseconds(0)),this._daylightSavingAdjust(newDate)},_daylightSavingAdjust:function(date){return date?(date.setHours(date.getHours()>12?date.getHours()+2:0),date):null},_setDate:function(inst,date,noChange){var clear=!date,origMonth=inst.selectedMonth,origYear=inst.selectedYear,newDate=this._restrictMinMax(inst,this._determineDate(inst,date,new Date));inst.selectedDay=inst.currentDay=newDate.getDate(),inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth(),inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear(),origMonth===inst.selectedMonth&&origYear===inst.selectedYear||noChange||this._notifyChange(inst),this._adjustInstDate(inst),inst.input&&inst.input.val(clear?"":this._formatDate(inst))},_getDate:function(inst){var startDate=!inst.currentYear||inst.input&&""===inst.input.val()?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));return startDate},_attachHandlers:function(inst){var stepMonths=this._get(inst,"stepMonths"),id="#"+inst.id.replace(/\\\\/g,"\\");inst.dpDiv.find("[data-handler]").map(function(){var handler={prev:function(){$.datepicker._adjustDate(id,-stepMonths,"M")},next:function(){$.datepicker._adjustDate(id,+stepMonths,"M")},hide:function(){$.datepicker._hideDatepicker()},today:function(){$.datepicker._gotoToday(id)},selectDay:function(){return $.datepicker._selectDay(id,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return $.datepicker._selectMonthYear(id,this,"M"),!1},selectYear:function(){return $.datepicker._selectMonthYear(id,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),handler[this.getAttribute("data-handler")])})},_generateHTML:function(inst){var maxDraw,prevText,prev,nextText,next,currentText,gotoDate,controls,buttonPanel,firstDay,showWeek,dayNames,dayNamesMin,monthNames,monthNamesShort,beforeShowDay,showOtherMonths,selectOtherMonths,defaultDate,html,dow,row,group,col,selectedDate,cornerClass,calender,thead,day,daysInMonth,leadDays,curRows,numRows,printDate,dRow,tbody,daySettings,otherMonth,unselectable,tempDate=new Date,today=this._daylightSavingAdjust(new Date(tempDate.getFullYear(),tempDate.getMonth(),tempDate.getDate())),isRTL=this._get(inst,"isRTL"),showButtonPanel=this._get(inst,"showButtonPanel"),hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext"),navigationAsDateFormat=this._get(inst,"navigationAsDateFormat"),numMonths=this._getNumberOfMonths(inst),showCurrentAtPos=this._get(inst,"showCurrentAtPos"),stepMonths=this._get(inst,"stepMonths"),isMultiMonth=1!==numMonths[0]||1!==numMonths[1],currentDate=this._daylightSavingAdjust(inst.currentDay?new Date(inst.currentYear,inst.currentMonth,inst.currentDay):new Date(9999,9,9)),minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),drawMonth=inst.drawMonth-showCurrentAtPos,drawYear=inst.drawYear;if(0>drawMonth&&(drawMonth+=12,drawYear--),maxDate)for(maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[0]*numMonths[1]+1,maxDate.getDate())),maxDraw=minDate&&minDate>maxDraw?minDate:maxDraw;this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw;)drawMonth--,0>drawMonth&&(drawMonth=11,drawYear--);for(inst.drawMonth=drawMonth,inst.drawYear=drawYear,prevText=this._get(inst,"prevText"),prevText=navigationAsDateFormat?this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)):prevText,prev=this._canAdjustMonth(inst,-1,drawYear,drawMonth)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+prevText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")+"'>"+prevText+"</span></a>":hideIfNoPrevNext?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+prevText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")+"'>"+prevText+"</span></a>",nextText=this._get(inst,"nextText"),nextText=navigationAsDateFormat?this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)):nextText,next=this._canAdjustMonth(inst,1,drawYear,drawMonth)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+nextText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")+"'>"+nextText+"</span></a>":hideIfNoPrevNext?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+nextText+"'><span class='ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")+"'>"+nextText+"</span></a>",currentText=this._get(inst,"currentText"),gotoDate=this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today,currentText=navigationAsDateFormat?this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)):currentText,controls=inst.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(inst,"closeText")+"</button>",buttonPanel=showButtonPanel?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"",firstDay=parseInt(this._get(inst,"firstDay"),10),firstDay=isNaN(firstDay)?0:firstDay,showWeek=this._get(inst,"showWeek"),dayNames=this._get(inst,"dayNames"),
dayNamesMin=this._get(inst,"dayNamesMin"),monthNames=this._get(inst,"monthNames"),monthNamesShort=this._get(inst,"monthNamesShort"),beforeShowDay=this._get(inst,"beforeShowDay"),showOtherMonths=this._get(inst,"showOtherMonths"),selectOtherMonths=this._get(inst,"selectOtherMonths"),defaultDate=this._getDefaultDate(inst),html="",row=0;row<numMonths[0];row++){for(group="",this.maxRows=4,col=0;col<numMonths[1];col++){if(selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay)),cornerClass=" ui-corner-all",calender="",isMultiMonth){if(calender+="<div class='ui-datepicker-group",numMonths[1]>1)switch(col){case 0:calender+=" ui-datepicker-group-first",cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+=" ui-datepicker-group-last",cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle",cornerClass=""}calender+="'>"}for(calender+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+cornerClass+"'>"+(/all|left/.test(cornerClass)&&0===row?isRTL?next:prev:"")+(/all|right/.test(cornerClass)&&0===row?isRTL?prev:next:"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+"</div><table class='ui-datepicker-calendar'><thead><tr>",thead=showWeek?"<th class='ui-datepicker-week-col'>"+this._get(inst,"weekHeader")+"</th>":"",dow=0;7>dow;dow++)day=(dow+firstDay)%7,thead+="<th scope='col'"+((dow+firstDay+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+dayNames[day]+"'>"+dayNamesMin[day]+"</span></th>";for(calender+=thead+"</tr></thead><tbody>",daysInMonth=this._getDaysInMonth(drawYear,drawMonth),drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth&&(inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)),leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7,curRows=Math.ceil((leadDays+daysInMonth)/7),numRows=isMultiMonth&&this.maxRows>curRows?this.maxRows:curRows,this.maxRows=numRows,printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays)),dRow=0;numRows>dRow;dRow++){for(calender+="<tr>",tbody=showWeek?"<td class='ui-datepicker-week-col'>"+this._get(inst,"calculateWeek")(printDate)+"</td>":"",dow=0;7>dow;dow++)daySettings=beforeShowDay?beforeShowDay.apply(inst.input?inst.input[0]:null,[printDate]):[!0,""],otherMonth=printDate.getMonth()!==drawMonth,unselectable=otherMonth&&!selectOtherMonths||!daySettings[0]||minDate&&minDate>printDate||maxDate&&printDate>maxDate,tbody+="<td class='"+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+(printDate.getTime()===selectedDate.getTime()&&drawMonth===inst.selectedMonth&&inst._keyEvent||defaultDate.getTime()===printDate.getTime()&&defaultDate.getTime()===selectedDate.getTime()?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()===currentDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()===today.getTime()?" ui-datepicker-today":""))+"'"+(otherMonth&&!showOtherMonths||!daySettings[2]?"":" title='"+daySettings[2].replace(/'/g,"&#39;")+"'")+(unselectable?"":" data-handler='selectDay' data-event='click' data-month='"+printDate.getMonth()+"' data-year='"+printDate.getFullYear()+"'")+">"+(otherMonth&&!showOtherMonths?"&#xa0;":unselectable?"<span class='ui-state-default'>"+printDate.getDate()+"</span>":"<a class='ui-state-default"+(printDate.getTime()===today.getTime()?" ui-state-highlight":"")+(printDate.getTime()===currentDate.getTime()?" ui-state-active":"")+(otherMonth?" ui-priority-secondary":"")+"' href='#'>"+printDate.getDate()+"</a>")+"</td>",printDate.setDate(printDate.getDate()+1),printDate=this._daylightSavingAdjust(printDate);calender+=tbody+"</tr>"}drawMonth++,drawMonth>11&&(drawMonth=0,drawYear++),calender+="</tbody></table>"+(isMultiMonth?"</div>"+(numMonths[0]>0&&col===numMonths[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),group+=calender}html+=group}return html+=buttonPanel,inst._keyEvent=!1,html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var inMinYear,inMaxYear,month,years,thisYear,determineYear,year,endYear,changeMonth=this._get(inst,"changeMonth"),changeYear=this._get(inst,"changeYear"),showMonthAfterYear=this._get(inst,"showMonthAfterYear"),html="<div class='ui-datepicker-title'>",monthHtml="";if(secondary||!changeMonth)monthHtml+="<span class='ui-datepicker-month'>"+monthNames[drawMonth]+"</span>";else{for(inMinYear=minDate&&minDate.getFullYear()===drawYear,inMaxYear=maxDate&&maxDate.getFullYear()===drawYear,monthHtml+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",month=0;12>month;month++)(!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())&&(monthHtml+="<option value='"+month+"'"+(month===drawMonth?" selected='selected'":"")+">"+monthNamesShort[month]+"</option>");monthHtml+="</select>"}if(showMonthAfterYear||(html+=monthHtml+(!secondary&&changeMonth&&changeYear?"":"&#xa0;")),!inst.yearshtml)if(inst.yearshtml="",secondary||!changeYear)html+="<span class='ui-datepicker-year'>"+drawYear+"</span>";else{for(years=this._get(inst,"yearRange").split(":"),thisYear=(new Date).getFullYear(),determineYear=function(value){var year=value.match(/c[+\-].*/)?drawYear+parseInt(value.substring(1),10):value.match(/[+\-].*/)?thisYear+parseInt(value,10):parseInt(value,10);return isNaN(year)?thisYear:year},year=determineYear(years[0]),endYear=Math.max(year,determineYear(years[1]||"")),year=minDate?Math.max(year,minDate.getFullYear()):year,endYear=maxDate?Math.min(endYear,maxDate.getFullYear()):endYear,inst.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";endYear>=year;year++)inst.yearshtml+="<option value='"+year+"'"+(year===drawYear?" selected='selected'":"")+">"+year+"</option>";inst.yearshtml+="</select>",html+=inst.yearshtml,inst.yearshtml=null}return html+=this._get(inst,"yearSuffix"),showMonthAfterYear&&(html+=(!secondary&&changeMonth&&changeYear?"":"&#xa0;")+monthHtml),html+="</div>"},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+("Y"===period?offset:0),month=inst.drawMonth+("M"===period?offset:0),day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+("D"===period?offset:0),date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate(),inst.drawMonth=inst.selectedMonth=date.getMonth(),inst.drawYear=inst.selectedYear=date.getFullYear(),"M"!==period&&"Y"!==period||this._notifyChange(inst)},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),newDate=minDate&&minDate>date?minDate:date;return maxDate&&newDate>maxDate?maxDate:newDate},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");onChange&&onChange.apply(inst.input?inst.input[0]:null,[inst.selectedYear,inst.selectedMonth+1,inst])},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return null==numMonths?[1,1]:"number"==typeof numMonths?[1,numMonths]:numMonths},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null)},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst),date=this._daylightSavingAdjust(new Date(curYear,curMonth+(0>offset?offset:numMonths[0]*numMonths[1]),1));return 0>offset&&date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth())),this._isInRange(inst,date)},_isInRange:function(inst,date){var yearSplit,currentYear,minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),minYear=null,maxYear=null,years=this._get(inst,"yearRange");return years&&(yearSplit=years.split(":"),currentYear=(new Date).getFullYear(),minYear=parseInt(yearSplit[0],10),maxYear=parseInt(yearSplit[1],10),yearSplit[0].match(/[+\-].*/)&&(minYear+=currentYear),yearSplit[1].match(/[+\-].*/)&&(maxYear+=currentYear)),(!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime())&&(!minYear||date.getFullYear()>=minYear)&&(!maxYear||date.getFullYear()<=maxYear)},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");return shortYearCutoff="string"!=typeof shortYearCutoff?shortYearCutoff:(new Date).getFullYear()%100+parseInt(shortYearCutoff,10),{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){day||(inst.currentDay=inst.selectedDay,inst.currentMonth=inst.selectedMonth,inst.currentYear=inst.selectedYear);var date=day?"object"==typeof day?day:this._daylightSavingAdjust(new Date(year,month,day)):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}}),$.fn.datepicker=function(options){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick),$.datepicker.initialized=!0),0===$("#"+$.datepicker._mainDivId).length&&$("body").append($.datepicker.dpDiv);var otherArgs=Array.prototype.slice.call(arguments,1);return"string"!=typeof options||"isDisabled"!==options&&"getDate"!==options&&"widget"!==options?"option"===options&&2===arguments.length&&"string"==typeof arguments[1]?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs)):this.each(function(){"string"==typeof options?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)}):$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.11.2";$.datepicker;$.widget("ui.draggable",$.ui.mouse,{version:"1.11.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(key,value){this._super(key,value),"handle"===key&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(event){var o=this.options;return this._blurActiveElement(event),this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(event),this.handle?(this._blockFrames(o.iframeFix===!0?"iframe":o.iframeFix),!0):!1)},_blockFrames:function(selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $("<div>").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(event){var document=this.document[0];if(this.handleElement.is(event.target))try{document.activeElement&&"body"!==document.activeElement.nodeName.toLowerCase()&&$(document.activeElement).blur()}catch(error){}},_mouseStart:function(event){var o=this.options;return this.helper=this._createHelper(event),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),$.ui.ddmanager&&($.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===$(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(event),this.originalPosition=this.position=this._generatePosition(event,!1),this.originalPageX=event.pageX,this.originalPageY=event.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this._setContainment(),this._trigger("start",event)===!1?(this._clear(),!1):(this._cacheHelperProportions(),$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event),this._normalizeRightBottom(),this._mouseDrag(event,!0),$.ui.ddmanager&&$.ui.ddmanager.dragStart(this,event),!0)},_refreshOffsets:function(event){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:event.pageX-this.offset.left,top:event.pageY-this.offset.top}},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(event,!0),this.positionAbs=this._convertPositionTo("absolute"),!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===!1)return this._mouseUp({}),!1;this.position=ui.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",$.ui.ddmanager&&$.ui.ddmanager.drag(this,event),!1},_mouseStop:function(event){var that=this,dropped=!1;return $.ui.ddmanager&&!this.options.dropBehaviour&&(dropped=$.ui.ddmanager.drop(this,event)),this.dropped&&(dropped=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!dropped||"valid"===this.options.revert&&dropped||this.options.revert===!0||$.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped)?$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){that._trigger("stop",event)!==!1&&that._clear()}):this._trigger("stop",event)!==!1&&this._clear(),!1},_mouseUp:function(event){return this._unblockFrames(),$.ui.ddmanager&&$.ui.ddmanager.dragStop(this,event),this.handleElement.is(event.target)&&this.element.focus(),$.ui.mouse.prototype._mouseUp.call(this,event)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(event){return this.options.handle?!!$(event.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(event){var o=this.options,helperIsFunction=$.isFunction(o.helper),helper=helperIsFunction?$(o.helper.apply(this.element[0],[event])):"clone"===o.helper?this.element.clone().removeAttr("id"):this.element;return helper.parents("body").length||helper.appendTo("parent"===o.appendTo?this.element[0].parentNode:o.appendTo),helperIsFunction&&helper[0]===this.element[0]&&this._setPositionRelative(),helper[0]===this.element[0]||/(fixed|absolute)/.test(helper.css("position"))||helper.css("position","absolute"),helper},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(obj){"string"==typeof obj&&(obj=obj.split(" ")),$.isArray(obj)&&(obj={left:+obj[0],top:+obj[1]||0}),"left"in obj&&(this.offset.click.left=obj.left+this.margins.left),"right"in obj&&(this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left),"top"in obj&&(this.offset.click.top=obj.top+this.margins.top),"bottom"in obj&&(this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top)},_isRootNode:function(element){return/(html|body)/i.test(element.tagName)||element===this.document[0]},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])&&(po.left+=this.scrollParent.scrollLeft(),po.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(po={top:0,left:0}),{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+(scrollIsRootNode?0:this.scrollParent.scrollTop()),left:p.left-(parseInt(this.helper.css("left"),10)||0)+(scrollIsRootNode?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var isUserScrollable,c,ce,o=this.options,document=this.document[0];return this.relativeContainer=null,o.containment?"window"===o.containment?void(this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===o.containment?void(this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):o.containment.constructor===Array?void(this.containment=o.containment):("parent"===o.containment&&(o.containment=this.helper[0].parentNode),c=$(o.containment),ce=c[0],void(ce&&(isUserScrollable=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c))):void(this.containment=null)},_convertPositionTo:function(d,pos){pos||(pos=this.position);var mod="absolute"===d?1:-1,scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-("fixed"===this.cssPosition?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top)*mod,left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-("fixed"===this.cssPosition?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)*mod}},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,scrollIsRootNode=this._isRootNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;return scrollIsRootNode&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),constrainPosition&&(this.containment&&(this.relativeContainer?(co=this.relativeContainer.offset(),containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top]):containment=this.containment,event.pageX-this.offset.click.left<containment[0]&&(pageX=containment[0]+this.offset.click.left),event.pageY-this.offset.click.top<containment[1]&&(pageY=containment[1]+this.offset.click.top),event.pageX-this.offset.click.left>containment[2]&&(pageX=containment[2]+this.offset.click.left),event.pageY-this.offset.click.top>containment[3]&&(pageY=containment[3]+this.offset.click.top)),o.grid&&(top=o.grid[1]?this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,pageY=containment?top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3]?top:top-this.offset.click.top>=containment[1]?top-o.grid[1]:top+o.grid[1]:top,left=o.grid[0]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,pageX=containment?left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2]?left:left-this.offset.click.left>=containment[0]?left-o.grid[0]:left+o.grid[0]:left),"y"===o.axis&&(pageX=this.originalPageX),"x"===o.axis&&(pageY=this.originalPageY)),{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(type,event,ui){return ui=ui||this._uiHash(),$.ui.plugin.call(this,type,[event,ui,this],!0),/^(drag|start|stop)/.test(type)&&(this.positionAbs=this._convertPositionTo("absolute"),ui.offset=this.positionAbs),$.Widget.prototype._trigger.call(this,type,event,ui)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.sortables=[],$(draggable.options.connectToSortable).each(function(){var sortable=$(this).sortable("instance");sortable&&!sortable.options.disabled&&(draggable.sortables.push(sortable),sortable.refreshPositions(),sortable._trigger("activate",event,uiSortable))})},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.cancelHelperRemoval=!1,$.each(draggable.sortables,function(){var sortable=this;sortable.isOver?(sortable.isOver=0,draggable.cancelHelperRemoval=!0,sortable.cancelHelperRemoval=!1,sortable._storedCSS={position:sortable.placeholder.css("position"),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")},sortable._mouseStop(event),sortable.options.helper=sortable.options._helper):(sortable.cancelHelperRemoval=!0,sortable._trigger("deactivate",event,uiSortable))})},drag:function(event,ui,draggable){$.each(draggable.sortables,function(){var innermostIntersecting=!1,sortable=this;sortable.positionAbs=draggable.positionAbs,sortable.helperProportions=draggable.helperProportions,sortable.offset.click=draggable.offset.click,sortable._intersectsWith(sortable.containerCache)&&(innermostIntersecting=!0,$.each(draggable.sortables,function(){return this.positionAbs=draggable.positionAbs,this.helperProportions=draggable.helperProportions,this.offset.click=draggable.offset.click,this!==sortable&&this._intersectsWith(this.containerCache)&&$.contains(sortable.element[0],this.element[0])&&(innermostIntersecting=!1),innermostIntersecting})),innermostIntersecting?(sortable.isOver||(sortable.isOver=1,sortable.currentItem=ui.helper.appendTo(sortable.element).data("ui-sortable-item",!0),sortable.options._helper=sortable.options.helper,sortable.options.helper=function(){return ui.helper[0]},event.target=sortable.currentItem[0],sortable._mouseCapture(event,!0),sortable._mouseStart(event,!0,!0),sortable.offset.click.top=draggable.offset.click.top,sortable.offset.click.left=draggable.offset.click.left,sortable.offset.parent.left-=draggable.offset.parent.left-sortable.offset.parent.left,sortable.offset.parent.top-=draggable.offset.parent.top-sortable.offset.parent.top,draggable._trigger("toSortable",event),draggable.dropped=sortable.element,$.each(draggable.sortables,function(){this.refreshPositions()}),draggable.currentItem=draggable.element,sortable.fromOutside=draggable),sortable.currentItem&&(sortable._mouseDrag(event),ui.position=sortable.position)):sortable.isOver&&(sortable.isOver=0,sortable.cancelHelperRemoval=!0,sortable.options._revert=sortable.options.revert,sortable.options.revert=!1,sortable._trigger("out",event,sortable._uiHash(sortable)),sortable._mouseStop(event,!0),sortable.options.revert=sortable.options._revert,sortable.options.helper=sortable.options._helper,sortable.placeholder&&sortable.placeholder.remove(),draggable._refreshOffsets(event),ui.position=draggable._generatePosition(event,!0),draggable._trigger("fromSortable",event),draggable.dropped=!1,$.each(draggable.sortables,function(){this.refreshPositions()}))})}}),$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),o=instance.options;t.css("cursor")&&(o._cursor=t.css("cursor")),t.css("cursor",o.cursor)},stop:function(event,ui,instance){var o=instance.options;o._cursor&&$("body").css("cursor",o._cursor)}}),$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;t.css("opacity")&&(o._opacity=t.css("opacity")),t.css("opacity",o.opacity)},stop:function(event,ui,instance){var o=instance.options;o._opacity&&$(ui.helper).css("opacity",o._opacity)}}),$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(event,ui,i){var o=i.options,scrolled=!1,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];scrollParent!==document&&"HTML"!==scrollParent.tagName?(o.axis&&"x"===o.axis||(i.overflowOffset.top+scrollParent.offsetHeight-event.pageY<o.scrollSensitivity?scrollParent.scrollTop=scrolled=scrollParent.scrollTop+o.scrollSpeed:event.pageY-i.overflowOffset.top<o.scrollSensitivity&&(scrollParent.scrollTop=scrolled=scrollParent.scrollTop-o.scrollSpeed)),o.axis&&"y"===o.axis||(i.overflowOffset.left+scrollParent.offsetWidth-event.pageX<o.scrollSensitivity?scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft+o.scrollSpeed:event.pageX-i.overflowOffset.left<o.scrollSensitivity&&(scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft-o.scrollSpeed))):(o.axis&&"x"===o.axis||(event.pageY-$(document).scrollTop()<o.scrollSensitivity?scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed):$(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity&&(scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed))),o.axis&&"y"===o.axis||(event.pageX-$(document).scrollLeft()<o.scrollSensitivity?scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed):$(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity&&(scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)))),scrolled!==!1&&$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(i,event)}}),$.ui.plugin.add("draggable","snap",{start:function(event,ui,i){var o=i.options;i.snapElements=[],$(o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each(function(){var $t=$(this),$o=$t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left})})},drag:function(event,ui,inst){var ts,bs,ls,rs,l,r,t,b,i,first,o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;i>=0;i--)l=inst.snapElements[i].left-inst.margins.left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top-inst.margins.top,b=t+inst.snapElements[i].height,l-d>x2||x1>r+d||t-d>y2||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)?(inst.snapElements[i].snapping&&inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=!1):("inner"!==o.snapMode&&(ts=Math.abs(t-y2)<=d,bs=Math.abs(b-y1)<=d,ls=Math.abs(l-x2)<=d,rs=Math.abs(r-x1)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left)),first=ts||bs||ls||rs,"outer"!==o.snapMode&&(ts=Math.abs(t-y1)<=d,bs=Math.abs(b-y2)<=d,ls=Math.abs(l-x1)<=d,rs=Math.abs(r-x2)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left)),!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)&&inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=ts||bs||ls||rs||first)}}),$.ui.plugin.add("draggable","stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0)});group.length&&(min=parseInt($(group[0]).css("zIndex"),10)||0,$(group).each(function(i){$(this).css("zIndex",min+i)}),this.css("zIndex",min+group.length))}}),$.ui.plugin.add("draggable","zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;t.css("zIndex")&&(o._zIndex=t.css("zIndex")),t.css("zIndex",o.zIndex)},stop:function(event,ui,instance){var o=instance.options;o._zIndex&&$(ui.helper).css("zIndex",o._zIndex)}});$.ui.draggable;$.widget("ui.resizable",$.ui.mouse,{version:"1.11.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(value){return parseInt(value,10)||0;
},_isNumber:function(value){return!isNaN(parseInt(value,10))},_hasScroll:function(el,a){if("hidden"===$(el).css("overflow"))return!1;var scroll=a&&"left"===a?"scrollLeft":"scrollTop",has=!1;return el[scroll]>0?!0:(el[scroll]=1,has=el[scroll]>0,el[scroll]=0,has)},_create:function(){var n,i,handle,axis,hname,that=this,o=this.options;if(this.element.addClass("ui-resizable"),$.extend(this,{_aspectRatio:!!o.aspectRatio,aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=o.handles||($(".ui-resizable-handle",this.element).length?{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"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;i<n.length;i++)handle=$.trim(n[i]),hname="ui-resizable-"+handle,axis=$("<div class='ui-resizable-handle "+hname+"'></div>"),axis.css({zIndex:o.zIndex}),"se"===handle&&axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[handle]=".ui-resizable-"+handle,this.element.append(axis);this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=this.element.children(this.handles[i]).first().show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(axis=$(this.handles[i],this.element),padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth(),padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),target.css(padPos,padWrapper),this._proportionallyResize()),$(this.handles[i]).length},this._renderAxis(this.element),this._handles=$(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){that.resizing||(this.className&&(axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),that.axis=axis&&axis[1]?axis[1]:"se")}),o.autoHide&&(this._handles.hide(),$(this.element).addClass("ui-resizable-autohide").mouseenter(function(){o.disabled||($(this).removeClass("ui-resizable-autohide"),that._handles.show())}).mouseleave(function(){o.disabled||that.resizing||($(this).addClass("ui-resizable-autohide"),that._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var wrapper,_destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(_destroy(this.element),wrapper=this.element,this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper),wrapper.remove()),this.originalElement.css("resize",this.originalResizeStyle),_destroy(this.originalElement),this},_mouseCapture:function(event){var i,handle,capture=!1;for(i in this.handles)handle=$(this.handles[i])[0],(handle===event.target||$.contains(handle,event.target))&&(capture=!0);return!this.options.disabled&&capture},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,el=this.element;return this.resizing=!0,this._renderProxy(),curleft=this._num(this.helper.css("left")),curtop=this._num(this.helper.css("top")),o.containment&&(curleft+=$(o.containment).scrollLeft()||0,curtop+=$(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:curleft,top:curtop},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()},this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()},this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()},this.originalPosition={left:curleft,top:curtop},this.originalMousePosition={left:event.pageX,top:event.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,cursor=$(".ui-resizable-"+this.axis).css("cursor"),$("body").css("cursor","auto"===cursor?this.axis+"-resize":cursor),el.addClass("ui-resizable-resizing"),this._propagate("start",event),!0},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition,a=this.axis,dx=event.pageX-smp.left||0,dy=event.pageY-smp.top||0,trigger=this._change[a];return this._updatePrevProperties(),trigger?(data=trigger.apply(this,[event,dx,dy]),this._updateVirtualBoundaries(event.shiftKey),(this._aspectRatio||event.shiftKey)&&(data=this._updateRatio(data,event)),data=this._respectSize(data,event),this._updateCache(data),this._propagate("resize",event),props=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),$.isEmptyObject(props)||(this._updatePrevProperties(),this._trigger("resize",event,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(event){this.resizing=!1;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;return this._helper&&(pr=this._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName),soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,s={width:that.helper.width()-soffsetw,height:that.helper.height()-soffseth},left=parseInt(that.element.css("left"),10)+(that.position.left-that.originalPosition.left)||null,top=parseInt(that.element.css("top"),10)+(that.position.top-that.originalPosition.top)||null,o.animate||this.element.css($.extend(s,{top:top,left:left})),that.helper.height(that.size.height),that.helper.width(that.size.width),this._helper&&!o.animate&&this._proportionallyResize()),$("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",event),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var props={};return this.position.top!==this.prevPosition.top&&(props.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(props.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(props.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(props.height=this.size.height+"px"),this.helper.css(props),props},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||forceAspectRatio)&&(pMinWidth=b.minHeight*this.aspectRatio,pMinHeight=b.minWidth/this.aspectRatio,pMaxWidth=b.maxHeight*this.aspectRatio,pMaxHeight=b.maxWidth/this.aspectRatio,pMinWidth>b.minWidth&&(b.minWidth=pMinWidth),pMinHeight>b.minHeight&&(b.minHeight=pMinHeight),pMaxWidth<b.maxWidth&&(b.maxWidth=pMaxWidth),pMaxHeight<b.maxHeight&&(b.maxHeight=pMaxHeight)),this._vBoundaries=b},_updateCache:function(data){this.offset=this.helper.offset(),this._isNumber(data.left)&&(this.position.left=data.left),this._isNumber(data.top)&&(this.position.top=data.top),this._isNumber(data.height)&&(this.size.height=data.height),this._isNumber(data.width)&&(this.size.width=data.width)},_updateRatio:function(data){var cpos=this.position,csize=this.size,a=this.axis;return this._isNumber(data.height)?data.width=data.height*this.aspectRatio:this._isNumber(data.width)&&(data.height=data.width/this.aspectRatio),"sw"===a&&(data.left=cpos.left+(csize.width-data.width),data.top=null),"nw"===a&&(data.top=cpos.top+(csize.height-data.height),data.left=cpos.left+(csize.width-data.width)),data},_respectSize:function(data){var o=this._vBoundaries,a=this.axis,ismaxw=this._isNumber(data.width)&&o.maxWidth&&o.maxWidth<data.width,ismaxh=this._isNumber(data.height)&&o.maxHeight&&o.maxHeight<data.height,isminw=this._isNumber(data.width)&&o.minWidth&&o.minWidth>data.width,isminh=this._isNumber(data.height)&&o.minHeight&&o.minHeight>data.height,dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);return isminw&&(data.width=o.minWidth),isminh&&(data.height=o.minHeight),ismaxw&&(data.width=o.maxWidth),ismaxh&&(data.height=o.maxHeight),isminw&&cw&&(data.left=dw-o.minWidth),ismaxw&&cw&&(data.left=dw-o.maxWidth),isminh&&ch&&(data.top=dh-o.minHeight),ismaxh&&ch&&(data.top=dh-o.maxHeight),data.width||data.height||data.left||!data.top?data.width||data.height||data.top||!data.left||(data.left=null):data.top=null,data},_getPaddingPlusBorderDimensions:function(element){for(var i=0,widths=[],borders=[element.css("borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css("borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css("paddingBottom"),element.css("paddingLeft")];4>i;i++)widths[i]=parseInt(borders[i],10)||0,widths[i]+=parseInt(paddings[i],10)||0;return{height:widths[0]+widths[2],width:widths[1]+widths[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var prel,i=0,element=this.helper||this.element;i<this._proportionallyResizeElements.length;i++)prel=this._proportionallyResizeElements[i],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(prel)),prel.css({height:element.height()-this.outerDimensions.height||0,width:element.width()-this.outerDimensions.width||0})},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset(),this._helper?(this.helper=this.helper||$("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++o.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(event,dx){return{width:this.originalSize.width+dx}},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx}},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy}},s:function(event,dx,dy){return{height:this.originalSize.height+dy}},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]),"resize"!==n&&this._trigger(n,event,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:that.size.width-soffsetw,height:that.size.height-soffseth},left=parseInt(that.element.css("left"),10)+(that.position.left-that.originalPosition.left)||null,top=parseInt(that.element.css("top"),10)+(that.position.top-that.originalPosition.top)||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(that.element.css("width"),10),height:parseInt(that.element.css("height"),10),top:parseInt(that.element.css("top"),10),left:parseInt(that.element.css("left"),10)};pr&&pr.length&&$(pr[0]).css({width:data.width,height:data.height}),that._updateCache(data),that._propagate("resize",event)}})}}),$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,oc=o.containment,ce=oc instanceof $?oc.get(0):/parent/.test(oc)?el.parent().get(0):oc;ce&&(that.containerElement=$(ce),/document/.test(oc)||oc===document?(that.containerOffset={left:0,top:0},that.containerPosition={left:0,top:0},that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight}):(element=$(ce),p=[],$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(element.css("padding"+name))}),that.containerOffset=element.offset(),that.containerPosition=element.position(),that.containerSize={height:element.innerHeight()-p[3],width:element.innerWidth()-p[1]},co=that.containerOffset,ch=that.containerSize.height,cw=that.containerSize.width,width=that._hasScroll(ce,"left")?ce.scrollWidth:cw,height=that._hasScroll(ce)?ce.scrollHeight:ch,that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height}))},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,continueResize=!0;ce[0]!==document&&/static/.test(ce.css("position"))&&(cop=co),cp.left<(that._helper?co.left:0)&&(that.size.width=that.size.width+(that._helper?that.position.left-co.left:that.position.left-cop.left),pRatio&&(that.size.height=that.size.width/that.aspectRatio,continueResize=!1),that.position.left=o.helper?co.left:0),cp.top<(that._helper?co.top:0)&&(that.size.height=that.size.height+(that._helper?that.position.top-co.top:that.position.top),pRatio&&(that.size.width=that.size.height*that.aspectRatio,continueResize=!1),that.position.top=that._helper?co.top:0),isParent=that.containerElement.get(0)===that.element.parent().get(0),isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position")),isParent&&isOffsetRelative?(that.offset.left=that.parentData.left+that.position.left,that.offset.top=that.parentData.top+that.position.top):(that.offset.left=that.element.offset().left,that.offset.top=that.element.offset().top),woset=Math.abs(that.sizeDiff.width+(that._helper?that.offset.left-cop.left:that.offset.left-co.left)),hoset=Math.abs(that.sizeDiff.height+(that._helper?that.offset.top-cop.top:that.offset.top-co.top)),woset+that.size.width>=that.parentData.width&&(that.size.width=that.parentData.width-woset,pRatio&&(that.size.height=that.size.width/that.aspectRatio,continueResize=!1)),hoset+that.size.height>=that.parentData.height&&(that.size.height=that.parentData.height-hoset,pRatio&&(that.size.width=that.size.height*that.aspectRatio,continueResize=!1)),continueResize||(that.position.left=that.prevPosition.left,that.position.top=that.prevPosition.top,that.size.width=that.prevSize.width,that.size.height=that.prevSize.height)},stop:function(){var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;that._helper&&!o.animate&&/relative/.test(ce.css("position"))&&$(this).css({left:ho.left-cop.left-co.left,width:w,height:h}),that._helper&&!o.animate&&/static/.test(ce.css("position"))&&$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}}),$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options,_store=function(exp){$(exp).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseInt(el.width(),10),height:parseInt(el.height(),10),left:parseInt(el.css("left"),10),top:parseInt(el.css("top"),10)})})};"object"!=typeof o.alsoResize||o.alsoResize.parentNode?_store(o.alsoResize):o.alsoResize.length?(o.alsoResize=o.alsoResize[0],_store(o.alsoResize)):$.each(o.alsoResize,function(exp){_store(exp)})},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:that.size.height-os.height||0,width:that.size.width-os.width||0,top:that.position.top-op.top||0,left:that.position.left-op.left||0},_alsoResize=function(exp,c){$(exp).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=c&&c.length?c:el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);sum&&sum>=0&&(style[prop]=sum||null)}),el.css(style)})};"object"!=typeof o.alsoResize||o.alsoResize.nodeType?_alsoResize(o.alsoResize):$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c)})},stop:function(){$(this).removeData("resizable-alsoresize")}}),$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),o=that.options,cs=that.size;that.ghost=that.originalElement.clone(),that.ghost.css({opacity:.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof o.ghost?o.ghost:""),that.ghost.appendTo(that.helper)},resize:function(){var that=$(this).resizable("instance");that.ghost&&that.ghost.css({position:"relative",height:that.size.height,width:that.size.width})},stop:function(){var that=$(this).resizable("instance");that.ghost&&that.helper&&that.helper.get(0).removeChild(that.ghost.get(0))}}),$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable("instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid="number"==typeof o.grid?[o.grid,o.grid]:o.grid,gridX=grid[0]||1,gridY=grid[1]||1,ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&o.maxWidth<newWidth,isMaxHeight=o.maxHeight&&o.maxHeight<newHeight,isMinWidth=o.minWidth&&o.minWidth>newWidth,isMinHeight=o.minHeight&&o.minHeight>newHeight;o.grid=grid,isMinWidth&&(newWidth+=gridX),isMinHeight&&(newHeight+=gridY),isMaxWidth&&(newWidth-=gridX),isMaxHeight&&(newHeight-=gridY),/^(se|s|e)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight):/^(ne)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight,that.position.top=op.top-oy):/^(sw)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight,that.position.left=op.left-ox):((0>=newHeight-gridY||0>=newWidth-gridX)&&(outerDimensions=that._getPaddingPlusBorderDimensions(this)),newHeight-gridY>0?(that.size.height=newHeight,that.position.top=op.top-oy):(newHeight=gridY-outerDimensions.height,that.size.height=newHeight,that.position.top=op.top+os.height-newHeight),newWidth-gridX>0?(that.size.width=newWidth,that.position.left=op.left-ox):(newWidth=gridY-outerDimensions.height,that.size.width=newWidth,that.position.left=op.left+os.width-newWidth))}});$.ui.resizable,$.widget("ui.dialog",{version:"1.11.2",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;0>topOffset&&$(this).css("top",pos.top-topOffset)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&$.fn.draggable&&this._makeDraggable(),this.options.resizable&&$.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var element=this.options.appendTo;return element&&(element.jquery||element.nodeType)?$(element):this.document.find(element||"body").eq(0)},_destroy:function(){var next,originalPosition=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),next=originalPosition.parent.children().eq(originalPosition.index),next.length&&next[0]!==this.element[0]?next.before(this.element):originalPosition.parent.append(this.element)},widget:function(){return this.uiDialog},disable:$.noop,enable:$.noop,close:function(event){var activeElement,that=this;if(this._isOpen&&this._trigger("beforeClose",event)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{activeElement=this.document[0].activeElement,activeElement&&"body"!==activeElement.nodeName.toLowerCase()&&$(activeElement).blur()}catch(error){}this._hide(this.uiDialog,this.options.hide,function(){that._trigger("close",event)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(event,silent){var moved=!1,zIndicies=this.uiDialog.siblings(".ui-front:visible").map(function(){return+$(this).css("z-index")}).get(),zIndexMax=Math.max.apply(null,zIndicies);return zIndexMax>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",zIndexMax+1),moved=!0),moved&&!silent&&this._trigger("focus",event),moved},open:function(){var that=this;return this._isOpen?void(this._moveToTop()&&this._focusTabbable()):(this._isOpen=!0,this.opener=$(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){that._focusTabbable(),that._trigger("focus")}),this._makeFocusTarget(),void this._trigger("open"))},_focusTabbable:function(){var hasFocus=this._focusedElement;hasFocus||(hasFocus=this.element.find("[autofocus]")),hasFocus.length||(hasFocus=this.element.find(":tabbable")),hasFocus.length||(hasFocus=this.uiDialogButtonPane.find(":tabbable")),hasFocus.length||(hasFocus=this.uiDialogTitlebarClose.filter(":tabbable")),hasFocus.length||(hasFocus=this.uiDialog),hasFocus.eq(0).focus()},_keepFocus:function(event){function checkFocus(){var activeElement=this.document[0].activeElement,isActive=this.uiDialog[0]===activeElement||$.contains(this.uiDialog[0],activeElement);isActive||this._focusTabbable()}event.preventDefault(),checkFocus.call(this),this._delay(checkFocus)},_createWrapper:function(){this.uiDialog=$("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(event){if(this.options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE)return event.preventDefault(),void this.close(event);if(event.keyCode===$.ui.keyCode.TAB&&!event.isDefaultPrevented()){var tabbables=this.uiDialog.find(":tabbable"),first=tabbables.filter(":first"),last=tabbables.filter(":last");event.target!==last[0]&&event.target!==this.uiDialog[0]||event.shiftKey?event.target!==first[0]&&event.target!==this.uiDialog[0]||!event.shiftKey||(this._delay(function(){last.focus()}),event.preventDefault()):(this._delay(function(){first.focus()}),event.preventDefault())}},mousedown:function(event){this._moveToTop(event)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var uiDialogTitle;this.uiDialogTitlebar=$("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(event){$(event.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=$("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(event){event.preventDefault(),this.close(event)}}),uiDialogTitle=$("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(uiDialogTitle),this.uiDialog.attr({"aria-labelledby":uiDialogTitle.attr("id")})},_title:function(title){this.options.title||title.html("&#160;"),title.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=$("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=$("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var that=this,buttons=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),$.isEmptyObject(buttons)||$.isArray(buttons)&&!buttons.length?void this.uiDialog.removeClass("ui-dialog-buttons"):($.each(buttons,function(name,props){var click,buttonOptions;props=$.isFunction(props)?{click:props,text:name}:props,props=$.extend({type:"button"},props),click=props.click,props.click=function(){click.apply(that.element[0],arguments)},buttonOptions={icons:props.icons,text:props.showText},delete props.icons,delete props.showText,$("<button></button>",props).button(buttonOptions).appendTo(that.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),void this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){function filteredUi(ui){return{position:ui.position,offset:ui.offset}}var that=this,options=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){$(this).addClass("ui-dialog-dragging"),that._blockFrames(),that._trigger("dragStart",event,filteredUi(ui))},drag:function(event,ui){that._trigger("drag",event,filteredUi(ui))},stop:function(event,ui){var left=ui.offset.left-that.document.scrollLeft(),top=ui.offset.top-that.document.scrollTop();options.position={my:"left top",at:"left"+(left>=0?"+":"")+left+" top"+(top>=0?"+":"")+top,of:that.window},$(this).removeClass("ui-dialog-dragging"),that._unblockFrames(),that._trigger("dragStop",event,filteredUi(ui))}})},_makeResizable:function(){function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size}}var that=this,options=this.options,handles=options.resizable,position=this.uiDialog.css("position"),resizeHandles="string"==typeof handles?handles:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:this._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing"),that._blockFrames(),that._trigger("resizeStart",event,filteredUi(ui))},resize:function(event,ui){that._trigger("resize",event,filteredUi(ui))},stop:function(event,ui){var offset=that.uiDialog.offset(),left=offset.left-that.document.scrollLeft(),top=offset.top-that.document.scrollTop();options.height=that.uiDialog.height(),options.width=that.uiDialog.width(),options.position={my:"left top",at:"left"+(left>=0?"+":"")+left+" top"+(top>=0?"+":"")+top,of:that.window},$(this).removeClass("ui-dialog-resizing"),that._unblockFrames(),that._trigger("resizeStop",event,filteredUi(ui))}}).css("position",position)},_trackFocus:function(){this._on(this.widget(),{focusin:function(event){this._makeFocusTarget(),this._focusedElement=$(event.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var instances=this._trackingInstances(),exists=$.inArray(this,instances);-1!==exists&&instances.splice(exists,1)},_trackingInstances:function(){var instances=this.document.data("ui-dialog-instances");return instances||(instances=[],this.document.data("ui-dialog-instances",instances)),instances},_minHeight:function(){var options=this.options;return"auto"===options.height?options.minHeight:Math.min(options.minHeight,options.height)},_position:function(){var isVisible=this.uiDialog.is(":visible");isVisible||this.uiDialog.show(),this.uiDialog.position(this.options.position),isVisible||this.uiDialog.hide()},_setOptions:function(options){var that=this,resize=!1,resizableOptions={};$.each(options,function(key,value){that._setOption(key,value),key in that.sizeRelatedOptions&&(resize=!0),key in that.resizableRelatedOptions&&(resizableOptions[key]=value)}),resize&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",resizableOptions)},_setOption:function(key,value){var isDraggable,isResizable,uiDialog=this.uiDialog;"dialogClass"===key&&uiDialog.removeClass(this.options.dialogClass).addClass(value),"disabled"!==key&&(this._super(key,value),"appendTo"===key&&this.uiDialog.appendTo(this._appendTo()),"buttons"===key&&this._createButtons(),"closeText"===key&&this.uiDialogTitlebarClose.button({label:""+value}),"draggable"===key&&(isDraggable=uiDialog.is(":data(ui-draggable)"),isDraggable&&!value&&uiDialog.draggable("destroy"),!isDraggable&&value&&this._makeDraggable()),"position"===key&&this._position(),"resizable"===key&&(isResizable=uiDialog.is(":data(ui-resizable)"),
isResizable&&!value&&uiDialog.resizable("destroy"),isResizable&&"string"==typeof value&&uiDialog.resizable("option","handles",value),isResizable||value===!1||this._makeResizable()),"title"===key&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var nonContentHeight,minContentHeight,maxContentHeight,options=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),options.minWidth>options.width&&(options.width=options.minWidth),nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).outerHeight(),minContentHeight=Math.max(0,options.minHeight-nonContentHeight),maxContentHeight="number"==typeof options.maxHeight?Math.max(0,options.maxHeight-nonContentHeight):"none","auto"===options.height?this.element.css({minHeight:minContentHeight,maxHeight:maxContentHeight,height:"auto"}):this.element.height(Math.max(0,options.height-nonContentHeight)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var iframe=$(this);return $("<div>").css({position:"absolute",width:iframe.outerWidth(),height:iframe.outerHeight()}).appendTo(iframe.parent()).offset(iframe.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(event){return $(event.target).closest(".ui-dialog").length?!0:!!$(event.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var isOpening=!0;this._delay(function(){isOpening=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(event){isOpening||this._allowInteraction(event)||(event.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=$("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var overlays=this.document.data("ui-dialog-overlays")-1;overlays?this.document.data("ui-dialog-overlays",overlays):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}});$.widget("ui.droppable",{version:"1.11.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,o=this.options,accept=o.accept;this.isover=!1,this.isout=!0,this.accept=$.isFunction(accept)?accept:function(d){return d.is(accept)},this.proportions=function(){return arguments.length?void(proportions=arguments[0]):proportions?proportions:proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(o.scope),o.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(scope){$.ui.ddmanager.droppables[scope]=$.ui.ddmanager.droppables[scope]||[],$.ui.ddmanager.droppables[scope].push(this)},_splice:function(drop){for(var i=0;i<drop.length;i++)drop[i]===this&&drop.splice(i,1)},_destroy:function(){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(key,value){if("accept"===key)this.accept=$.isFunction(value)?value:function(d){return d.is(value)};else if("scope"===key){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop),this._addToManager(value)}this._super(key,value)},_activate:function(event){var draggable=$.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),draggable&&this._trigger("activate",event,this.ui(draggable))},_deactivate:function(event){var draggable=$.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),draggable&&this._trigger("deactivate",event,this.ui(draggable))},_over:function(event){var draggable=$.ui.ddmanager.current;draggable&&(draggable.currentItem||draggable.element)[0]!==this.element[0]&&this.accept.call(this.element[0],draggable.currentItem||draggable.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",event,this.ui(draggable)))},_out:function(event){var draggable=$.ui.ddmanager.current;draggable&&(draggable.currentItem||draggable.element)[0]!==this.element[0]&&this.accept.call(this.element[0],draggable.currentItem||draggable.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",event,this.ui(draggable)))},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current,childrenIntersection=!1;return draggable&&(draggable.currentItem||draggable.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var inst=$(this).droppable("instance");return inst.options.greedy&&!inst.options.disabled&&inst.options.scope===draggable.options.scope&&inst.accept.call(inst.element[0],draggable.currentItem||draggable.element)&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance,event)?(childrenIntersection=!0,!1):void 0}),childrenIntersection?!1:this.accept.call(this.element[0],draggable.currentItem||draggable.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",event,this.ui(draggable)),this.element):!1):!1},ui:function(c){return{draggable:c.currentItem||c.element,helper:c.helper,position:c.position,offset:c.positionAbs}}}),$.ui.intersect=function(){function isOverAxis(x,reference,size){return x>=reference&&reference+size>x}return function(draggable,droppable,toleranceMode,event){if(!droppable.offset)return!1;var x1=(draggable.positionAbs||draggable.position.absolute).left+draggable.margins.left,y1=(draggable.positionAbs||draggable.position.absolute).top+draggable.margins.top,x2=x1+draggable.helperProportions.width,y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){case"fit":return x1>=l&&r>=x2&&y1>=t&&b>=y2;case"intersect":return l<x1+draggable.helperProportions.width/2&&x2-draggable.helperProportions.width/2<r&&t<y1+draggable.helperProportions.height/2&&y2-draggable.helperProportions.height/2<b;case"pointer":return isOverAxis(event.pageY,t,droppable.proportions().height)&&isOverAxis(event.pageX,l,droppable.proportions().width);case"touch":return(y1>=t&&b>=y1||y2>=t&&b>=y2||t>y1&&y2>b)&&(x1>=l&&r>=x1||x2>=l&&r>=x2||l>x1&&x2>r);default:return!1}}}(),$.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i<m.length;i++)if(!(m[i].options.disabled||t&&!m[i].accept.call(m[i].element[0],t.currentItem||t.element))){for(j=0;j<list.length;j++)if(list[j]===m[i].element[0]){m[i].proportions().height=0;continue droppablesLoop}m[i].visible="none"!==m[i].element.css("display"),m[i].visible&&("mousedown"===type&&m[i]._activate.call(m[i],event),m[i].offset=m[i].element.offset(),m[i].proportions({width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight}))}},drop:function(draggable,event){var dropped=!1;return $.each(($.ui.ddmanager.droppables[draggable.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance,event)&&(dropped=this._drop.call(this,event)||dropped),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],draggable.currentItem||draggable.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,event)))}),dropped},dragStart:function(draggable,event){draggable.element.parentsUntil("body").bind("scroll.droppable",function(){draggable.options.refreshPositions||$.ui.ddmanager.prepareOffsets(draggable,event)})},drag:function(draggable,event){draggable.options.refreshPositions&&$.ui.ddmanager.prepareOffsets(draggable,event),$.each($.ui.ddmanager.droppables[draggable.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var parentInstance,scope,parent,intersects=$.ui.intersect(draggable,this,this.options.tolerance,event),c=!intersects&&this.isover?"isout":intersects&&!this.isover?"isover":null;c&&(this.options.greedy&&(scope=this.options.scope,parent=this.element.parents(":data(ui-droppable)").filter(function(){return $(this).droppable("instance").options.scope===scope}),parent.length&&(parentInstance=$(parent[0]).droppable("instance"),parentInstance.greedyChild="isover"===c)),parentInstance&&"isover"===c&&(parentInstance.isover=!1,parentInstance.isout=!0,parentInstance._out.call(parentInstance,event)),this[c]=!0,this["isout"===c?"isover":"isout"]=!1,this["isover"===c?"_over":"_out"].call(this,event),parentInstance&&"isout"===c&&(parentInstance.isout=!1,parentInstance.isover=!0,parentInstance._over.call(parentInstance,event)))}})},dragStop:function(draggable,event){draggable.element.parentsUntil("body").unbind("scroll.droppable"),draggable.options.refreshPositions||$.ui.ddmanager.prepareOffsets(draggable,event)}};var dataSpace=($.ui.droppable,"ui-effects-"),jQuery=$;$.effects={effect:{}},function(jQuery,undefined){function clamp(value,prop,allowEmpty){var type=propTypes[prop.type]||{};return null==value?allowEmpty||!prop.def?null:prop.def:(value=type.floor?~~value:parseFloat(value),isNaN(value)?prop.def:type.mod?(value+type.mod)%type.mod:0>value?0:type.max<value?type.max:value)}function stringParse(string){var inst=color(),rgba=inst._rgba=[];return string=string.toLowerCase(),each(stringParsers,function(i,parser){var parsed,match=parser.re.exec(string),values=match&&parser.parse(match),spaceName=parser.space||"rgba";return values?(parsed=inst[spaceName](values),inst[spaces[spaceName].cache]=parsed[spaces[spaceName].cache],rgba=inst._rgba=parsed._rgba,!1):void 0}),rgba.length?("0,0,0,0"===rgba.join()&&jQuery.extend(rgba,colors.transparent),inst):colors[string]}function hue2rgb(p,q,h){return h=(h+1)%1,1>6*h?p+(q-p)*h*6:1>2*h?q:2>3*h?p+(q-p)*(2/3-h)*6:p}var colors,stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",rplusequals=/^([\-+])=\s*(\d+\.?\d*)/,stringParsers=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1],execResult[2],execResult[3],execResult[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[2.55*execResult[1],2.55*execResult[2],2.55*execResult[3],execResult[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(execResult){return[parseInt(execResult[1]+execResult[1],16),parseInt(execResult[2]+execResult[2],16),parseInt(execResult[3]+execResult[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(execResult){return[execResult[1],execResult[2]/100,execResult[3]/100,execResult[4]]}}],color=jQuery.Color=function(color,green,blue,alpha){return new jQuery.Color.fn.parse(color,green,blue,alpha)},spaces={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},propTypes={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},support=color.support={},supportElem=jQuery("<p>")[0],each=jQuery.each;supportElem.style.cssText="background-color:rgba(1,1,1,.5)",support.rgba=supportElem.style.backgroundColor.indexOf("rgba")>-1,each(spaces,function(spaceName,space){space.cache="_"+spaceName,space.props.alpha={idx:3,type:"percent",def:1}}),color.fn=jQuery.extend(color.prototype,{parse:function(red,green,blue,alpha){if(red===undefined)return this._rgba=[null,null,null,null],this;(red.jquery||red.nodeType)&&(red=jQuery(red).css(green),green=undefined);var inst=this,type=jQuery.type(red),rgba=this._rgba=[];return green!==undefined&&(red=[red,green,blue,alpha],type="array"),"string"===type?this.parse(stringParse(red)||colors._default):"array"===type?(each(spaces.rgba.props,function(key,prop){rgba[prop.idx]=clamp(red[prop.idx],prop)}),this):"object"===type?(red instanceof color?each(spaces,function(spaceName,space){red[space.cache]&&(inst[space.cache]=red[space.cache].slice())}):each(spaces,function(spaceName,space){var cache=space.cache;each(space.props,function(key,prop){if(!inst[cache]&&space.to){if("alpha"===key||null==red[key])return;inst[cache]=space.to(inst._rgba)}inst[cache][prop.idx]=clamp(red[key],prop,!0)}),inst[cache]&&jQuery.inArray(null,inst[cache].slice(0,3))<0&&(inst[cache][3]=1,space.from&&(inst._rgba=space.from(inst[cache])))}),this):void 0},is:function(compare){var is=color(compare),same=!0,inst=this;return each(spaces,function(_,space){var localCache,isCache=is[space.cache];return isCache&&(localCache=inst[space.cache]||space.to&&space.to(inst._rgba)||[],each(space.props,function(_,prop){return null!=isCache[prop.idx]?same=isCache[prop.idx]===localCache[prop.idx]:void 0})),same}),same},_space:function(){var used=[],inst=this;return each(spaces,function(spaceName,space){inst[space.cache]&&used.push(spaceName)}),used.pop()},transition:function(other,distance){var end=color(other),spaceName=end._space(),space=spaces[spaceName],startColor=0===this.alpha()?color("transparent"):this,start=startColor[space.cache]||space.to(startColor._rgba),result=start.slice();return end=end[space.cache],each(space.props,function(key,prop){var index=prop.idx,startValue=start[index],endValue=end[index],type=propTypes[prop.type]||{};null!==endValue&&(null===startValue?result[index]=endValue:(type.mod&&(endValue-startValue>type.mod/2?startValue+=type.mod:startValue-endValue>type.mod/2&&(startValue-=type.mod)),result[index]=clamp((endValue-startValue)*distance+startValue,prop)))}),this[spaceName](result)},blend:function(opaque){if(1===this._rgba[3])return this;var rgb=this._rgba.slice(),a=rgb.pop(),blend=color(opaque)._rgba;return color(jQuery.map(rgb,function(v,i){return(1-a)*blend[i]+a*v}))},toRgbaString:function(){var prefix="rgba(",rgba=jQuery.map(this._rgba,function(v,i){return null==v?i>2?1:0:v});return 1===rgba[3]&&(rgba.pop(),prefix="rgb("),prefix+rgba.join()+")"},toHslaString:function(){var prefix="hsla(",hsla=jQuery.map(this.hsla(),function(v,i){return null==v&&(v=i>2?1:0),i&&3>i&&(v=Math.round(100*v)+"%"),v});return 1===hsla[3]&&(hsla.pop(),prefix="hsl("),prefix+hsla.join()+")"},toHexString:function(includeAlpha){var rgba=this._rgba.slice(),alpha=rgba.pop();return includeAlpha&&rgba.push(~~(255*alpha)),"#"+jQuery.map(rgba,function(v){return v=(v||0).toString(16),1===v.length?"0"+v:v}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),color.fn.parse.prototype=color.fn,spaces.hsla.to=function(rgba){if(null==rgba[0]||null==rgba[1]||null==rgba[2])return[null,null,null,rgba[3]];var h,s,r=rgba[0]/255,g=rgba[1]/255,b=rgba[2]/255,a=rgba[3],max=Math.max(r,g,b),min=Math.min(r,g,b),diff=max-min,add=max+min,l=.5*add;return h=min===max?0:r===max?60*(g-b)/diff+360:g===max?60*(b-r)/diff+120:60*(r-g)/diff+240,s=0===diff?0:.5>=l?diff/add:diff/(2-add),[Math.round(h)%360,s,l,null==a?1:a]},spaces.hsla.from=function(hsla){if(null==hsla[0]||null==hsla[1]||null==hsla[2])return[null,null,null,hsla[3]];var h=hsla[0]/360,s=hsla[1],l=hsla[2],a=hsla[3],q=.5>=l?l*(1+s):l+s-l*s,p=2*l-q;return[Math.round(255*hue2rgb(p,q,h+1/3)),Math.round(255*hue2rgb(p,q,h)),Math.round(255*hue2rgb(p,q,h-1/3)),a]},each(spaces,function(spaceName,space){var props=space.props,cache=space.cache,to=space.to,from=space.from;color.fn[spaceName]=function(value){if(to&&!this[cache]&&(this[cache]=to(this._rgba)),value===undefined)return this[cache].slice();var ret,type=jQuery.type(value),arr="array"===type||"object"===type?value:arguments,local=this[cache].slice();return each(props,function(key,prop){var val=arr["object"===type?key:prop.idx];null==val&&(val=local[prop.idx]),local[prop.idx]=clamp(val,prop)}),from?(ret=color(from(local)),ret[cache]=local,ret):color(local)},each(props,function(key,prop){color.fn[key]||(color.fn[key]=function(value){var match,vtype=jQuery.type(value),fn="alpha"===key?this._hsla?"hsla":"rgba":spaceName,local=this[fn](),cur=local[prop.idx];return"undefined"===vtype?cur:("function"===vtype&&(value=value.call(this,cur),vtype=jQuery.type(value)),null==value&&prop.empty?this:("string"===vtype&&(match=rplusequals.exec(value),match&&(value=cur+parseFloat(match[2])*("+"===match[1]?1:-1))),local[prop.idx]=value,this[fn](local)))})})}),color.hook=function(hook){var hooks=hook.split(" ");each(hooks,function(i,hook){jQuery.cssHooks[hook]={set:function(elem,value){var parsed,curElem,backgroundColor="";if("transparent"!==value&&("string"!==jQuery.type(value)||(parsed=stringParse(value)))){if(value=color(parsed||value),!support.rgba&&1!==value._rgba[3]){for(curElem="backgroundColor"===hook?elem.parentNode:elem;(""===backgroundColor||"transparent"===backgroundColor)&&curElem&&curElem.style;)try{backgroundColor=jQuery.css(curElem,"backgroundColor"),curElem=curElem.parentNode}catch(e){}value=value.blend(backgroundColor&&"transparent"!==backgroundColor?backgroundColor:"_default")}value=value.toRgbaString()}try{elem.style[hook]=value}catch(e){}}},jQuery.fx.step[hook]=function(fx){fx.colorInit||(fx.start=color(fx.elem,hook),fx.end=color(fx.end),fx.colorInit=!0),jQuery.cssHooks[hook].set(fx.elem,fx.start.transition(fx.end,fx.pos))}})},color.hook(stepHooks),jQuery.cssHooks.borderColor={expand:function(value){var expanded={};return each(["Top","Right","Bottom","Left"],function(i,part){expanded["border"+part+"Color"]=value}),expanded}},colors=jQuery.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function getElementStyles(elem){var key,len,style=elem.ownerDocument.defaultView?elem.ownerDocument.defaultView.getComputedStyle(elem,null):elem.currentStyle,styles={};if(style&&style.length&&style[0]&&style[style[0]])for(len=style.length;len--;)key=style[len],"string"==typeof style[key]&&(styles[$.camelCase(key)]=style[key]);else for(key in style)"string"==typeof style[key]&&(styles[key]=style[key]);return styles}function styleDifference(oldStyle,newStyle){var name,value,diff={};for(name in newStyle)value=newStyle[name],oldStyle[name]!==value&&(shorthandStyles[name]||!$.fx.step[name]&&isNaN(parseFloat(value))||(diff[name]=value));return diff}var classAnimationActions=["add","remove","toggle"],shorthandStyles={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};$.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(_,prop){$.fx.step[prop]=function(fx){("none"!==fx.end&&!fx.setAttr||1===fx.pos&&!fx.setAttr)&&(jQuery.style(fx.elem,prop,fx.end),fx.setAttr=!0)}}),$.fn.addBack||($.fn.addBack=function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}),$.effects.animateClass=function(value,duration,easing,callback){var o=$.speed(duration,easing,callback);return this.queue(function(){var applyClassChange,animated=$(this),baseClass=animated.attr("class")||"",allAnimations=o.children?animated.find("*").addBack():animated;allAnimations=allAnimations.map(function(){var el=$(this);return{el:el,start:getElementStyles(this)}}),applyClassChange=function(){$.each(classAnimationActions,function(i,action){value[action]&&animated[action+"Class"](value[action])})},applyClassChange(),allAnimations=allAnimations.map(function(){return this.end=getElementStyles(this.el[0]),this.diff=styleDifference(this.start,this.end),this}),animated.attr("class",baseClass),allAnimations=allAnimations.map(function(){var styleInfo=this,dfd=$.Deferred(),opts=$.extend({},o,{queue:!1,complete:function(){dfd.resolve(styleInfo)}});return this.el.animate(this.diff,opts),dfd.promise()}),$.when.apply($,allAnimations.get()).done(function(){applyClassChange(),$.each(arguments,function(){var el=this.el;$.each(this.diff,function(key){el.css(key,"")})}),o.complete.call(animated[0])})})},$.fn.extend({addClass:function(orig){return function(classNames,speed,easing,callback){return speed?$.effects.animateClass.call(this,{add:classNames},speed,easing,callback):orig.apply(this,arguments)}}($.fn.addClass),removeClass:function(orig){return function(classNames,speed,easing,callback){return arguments.length>1?$.effects.animateClass.call(this,{remove:classNames},speed,easing,callback):orig.apply(this,arguments)}}($.fn.removeClass),toggleClass:function(orig){return function(classNames,force,speed,easing,callback){return"boolean"==typeof force||void 0===force?speed?$.effects.animateClass.call(this,force?{add:classNames}:{remove:classNames},speed,easing,callback):orig.apply(this,arguments):$.effects.animateClass.call(this,{toggle:classNames},force,speed,easing)}}($.fn.toggleClass),switchClass:function(remove,add,speed,easing,callback){return $.effects.animateClass.call(this,{add:add,remove:remove},speed,easing,callback)}})}(),function(){function _normalizeArguments(effect,options,speed,callback){return $.isPlainObject(effect)&&(options=effect,effect=effect.effect),effect={effect:effect},null==options&&(options={}),$.isFunction(options)&&(callback=options,speed=null,options={}),("number"==typeof options||$.fx.speeds[options])&&(callback=speed,speed=options,options={}),$.isFunction(speed)&&(callback=speed,speed=null),options&&$.extend(effect,options),speed=speed||options.duration,effect.duration=$.fx.off?0:"number"==typeof speed?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default,effect.complete=callback||options.complete,effect}function standardAnimationOption(option){return!option||"number"==typeof option||$.fx.speeds[option]?!0:"string"!=typeof option||$.effects.effect[option]?$.isFunction(option)?!0:"object"==typeof option&&!option.effect:!0}$.extend($.effects,{version:"1.11.2",save:function(element,set){for(var i=0;i<set.length;i++)null!==set[i]&&element.data(dataSpace+set[i],element[0].style[set[i]])},restore:function(element,set){var val,i;for(i=0;i<set.length;i++)null!==set[i]&&(val=element.data(dataSpace+set[i]),void 0===val&&(val=""),element.css(set[i],val))},setMode:function(el,mode){return"toggle"===mode&&(mode=el.is(":hidden")?"show":"hide"),mode},getBaseline:function(origin,original){var y,x;switch(origin[0]){case"top":y=0;break;case"middle":y=.5;break;case"bottom":y=1;break;default:y=origin[0]/original.height}switch(origin[1]){case"left":x=0;break;case"center":x=.5;break;case"right":x=1;break;default:x=origin[1]/original.width}return{x:x,y:y}},createWrapper:function(element){if(element.parent().is(".ui-effects-wrapper"))return element.parent();var props={width:element.outerWidth(!0),height:element.outerHeight(!0),float:element.css("float")},wrapper=$("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),size={width:element.width(),height:element.height()},active=document.activeElement;try{active.id}catch(e){active=document.body}return element.wrap(wrapper),(element[0]===active||$.contains(element[0],active))&&$(active).focus(),wrapper=element.parent(),"static"===element.css("position")?(wrapper.css({position:"relative"}),element.css({position:"relative"})):($.extend(props,{position:element.css("position"),zIndex:element.css("z-index")}),$.each(["top","left","bottom","right"],function(i,pos){props[pos]=element.css(pos),isNaN(parseInt(props[pos],10))&&(props[pos]="auto")}),element.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),element.css(size),wrapper.css(props).show()},removeWrapper:function(element){var active=document.activeElement;return element.parent().is(".ui-effects-wrapper")&&(element.parent().replaceWith(element),(element[0]===active||$.contains(element[0],active))&&$(active).focus()),element},setTransition:function(element,list,factor,value){return value=value||{},$.each(list,function(i,x){var unit=element.cssUnit(x);unit[0]>0&&(value[x]=unit[0]*factor+unit[1])}),value}}),$.fn.extend({effect:function(){function run(next){function done(){$.isFunction(complete)&&complete.call(elem[0]),$.isFunction(next)&&next()}var elem=$(this),complete=args.complete,mode=args.mode;(elem.is(":hidden")?"hide"===mode:"show"===mode)?(elem[mode](),done()):effectMethod.call(elem[0],args,done)}var args=_normalizeArguments.apply(this,arguments),mode=args.mode,queue=args.queue,effectMethod=$.effects.effect[args.effect];return $.fx.off||!effectMethod?mode?this[mode](args.duration,args.complete):this.each(function(){args.complete&&args.complete.call(this)}):queue===!1?this.each(run):this.queue(queue||"fx",run)},show:function(orig){return function(option){if(standardAnimationOption(option))return orig.apply(this,arguments);var args=_normalizeArguments.apply(this,arguments);return args.mode="show",this.effect.call(this,args)}}($.fn.show),hide:function(orig){return function(option){if(standardAnimationOption(option))return orig.apply(this,arguments);var args=_normalizeArguments.apply(this,arguments);return args.mode="hide",this.effect.call(this,args)}}($.fn.hide),toggle:function(orig){return function(option){if(standardAnimationOption(option)||"boolean"==typeof option)return orig.apply(this,arguments);var args=_normalizeArguments.apply(this,arguments);return args.mode="toggle",this.effect.call(this,args)}}($.fn.toggle),cssUnit:function(key){var style=this.css(key),val=[];return $.each(["em","px","%","pt"],function(i,unit){style.indexOf(unit)>0&&(val=[parseFloat(style),unit])}),val}})}(),function(){var baseEasings={};$.each(["Quad","Cubic","Quart","Quint","Expo"],function(i,name){baseEasings[name]=function(p){return Math.pow(p,i+2)}}),$.extend(baseEasings,{Sine:function(p){return 1-Math.cos(p*Math.PI/2)},Circ:function(p){return 1-Math.sqrt(1-p*p)},Elastic:function(p){return 0===p||1===p?p:-Math.pow(2,8*(p-1))*Math.sin((80*(p-1)-7.5)*Math.PI/15)},Back:function(p){return p*p*(3*p-2)},Bounce:function(p){for(var pow2,bounce=4;p<((pow2=Math.pow(2,--bounce))-1)/11;);return 1/Math.pow(4,3-bounce)-7.5625*Math.pow((3*pow2-2)/22-p,2)}}),$.each(baseEasings,function(name,easeIn){$.easing["easeIn"+name]=easeIn,$.easing["easeOut"+name]=function(p){return 1-easeIn(1-p)},$.easing["easeInOut"+name]=function(p){return.5>p?easeIn(2*p)/2:1-easeIn(-2*p+2)/2}})}();$.effects,$.effects.effect.blind=function(o,done){var wrapper,distance,margin,el=$(this),rvertical=/up|down|vertical/,rpositivemotion=/up|left|vertical|horizontal/,props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"hide"),direction=o.direction||"up",vertical=rvertical.test(direction),ref=vertical?"height":"width",ref2=vertical?"top":"left",motion=rpositivemotion.test(direction),animation={},show="show"===mode;el.parent().is(".ui-effects-wrapper")?$.effects.save(el.parent(),props):$.effects.save(el,props),el.show(),wrapper=$.effects.createWrapper(el).css({overflow:"hidden"}),distance=wrapper[ref](),margin=parseFloat(wrapper.css(ref2))||0,animation[ref]=show?distance:0,motion||(el.css(vertical?"bottom":"right",0).css(vertical?"top":"left","auto").css({position:"absolute"}),animation[ref2]=show?margin:distance+margin),show&&(wrapper.css(ref,0),motion||wrapper.css(ref2,margin+distance)),wrapper.animate(animation,{duration:o.duration,easing:o.easing,queue:!1,complete:function(){"hide"===mode&&el.hide(),$.effects.restore(el,props),$.effects.removeWrapper(el),done()}})},$.effects.effect.bounce=function(o,done){var i,upAnim,downAnim,el=$(this),props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"effect"),hide="hide"===mode,show="show"===mode,direction=o.direction||"up",distance=o.distance,times=o.times||5,anims=2*times+(show||hide?1:0),speed=o.duration/anims,easing=o.easing,ref="up"===direction||"down"===direction?"top":"left",motion="up"===direction||"left"===direction,queue=el.queue(),queuelen=queue.length;for((show||hide)&&props.push("opacity"),$.effects.save(el,props),el.show(),$.effects.createWrapper(el),distance||(distance=el["top"===ref?"outerHeight":"outerWidth"]()/3),show&&(downAnim={opacity:1},downAnim[ref]=0,el.css("opacity",0).css(ref,motion?2*-distance:2*distance).animate(downAnim,speed,easing)),hide&&(distance/=Math.pow(2,times-1)),downAnim={},downAnim[ref]=0,i=0;times>i;i++)upAnim={},upAnim[ref]=(motion?"-=":"+=")+distance,el.animate(upAnim,speed,easing).animate(downAnim,speed,easing),distance=hide?2*distance:distance/2;hide&&(upAnim={opacity:0},upAnim[ref]=(motion?"-=":"+=")+distance,el.animate(upAnim,speed,easing)),el.queue(function(){hide&&el.hide(),$.effects.restore(el,props),$.effects.removeWrapper(el),done()}),queuelen>1&&queue.splice.apply(queue,[1,0].concat(queue.splice(queuelen,anims+1))),el.dequeue()},$.effects.effect.clip=function(o,done){var wrapper,animate,distance,el=$(this),props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"hide"),show="show"===mode,direction=o.direction||"vertical",vert="vertical"===direction,size=vert?"height":"width",position=vert?"top":"left",animation={};$.effects.save(el,props),el.show(),wrapper=$.effects.createWrapper(el).css({overflow:"hidden"}),animate="IMG"===el[0].tagName?wrapper:el,distance=animate[size](),show&&(animate.css(size,0),animate.css(position,distance/2)),animation[size]=show?distance:0,animation[position]=show?0:distance/2,animate.animate(animation,{queue:!1,duration:o.duration,easing:o.easing,complete:function(){show||el.hide(),$.effects.restore(el,props),$.effects.removeWrapper(el),done()}})},$.effects.effect.drop=function(o,done){var distance,el=$(this),props=["position","top","bottom","left","right","opacity","height","width"],mode=$.effects.setMode(el,o.mode||"hide"),show="show"===mode,direction=o.direction||"left",ref="up"===direction||"down"===direction?"top":"left",motion="up"===direction||"left"===direction?"pos":"neg",animation={opacity:show?1:0};$.effects.save(el,props),el.show(),$.effects.createWrapper(el),distance=o.distance||el["top"===ref?"outerHeight":"outerWidth"](!0)/2,show&&el.css("opacity",0).css(ref,"pos"===motion?-distance:distance),animation[ref]=(show?"pos"===motion?"+=":"-=":"pos"===motion?"-=":"+=")+distance,el.animate(animation,{queue:!1,duration:o.duration,easing:o.easing,complete:function(){"hide"===mode&&el.hide(),$.effects.restore(el,props),$.effects.removeWrapper(el),done()}})},$.effects.effect.explode=function(o,done){function childComplete(){pieces.push(this),pieces.length===rows*cells&&animComplete()}function animComplete(){el.css({visibility:"visible"}),$(pieces).remove(),show||el.hide(),done()}var i,j,left,top,mx,my,rows=o.pieces?Math.round(Math.sqrt(o.pieces)):3,cells=rows,el=$(this),mode=$.effects.setMode(el,o.mode||"hide"),show="show"===mode,offset=el.show().css("visibility","hidden").offset(),width=Math.ceil(el.outerWidth()/cells),height=Math.ceil(el.outerHeight()/rows),pieces=[];for(i=0;rows>i;i++)for(top=offset.top+i*height,
my=i-(rows-1)/2,j=0;cells>j;j++)left=offset.left+j*width,mx=j-(cells-1)/2,el.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*width,top:-i*height}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:width,height:height,left:left+(show?mx*width:0),top:top+(show?my*height:0),opacity:show?0:1}).animate({left:left+(show?0:mx*width),top:top+(show?0:my*height),opacity:show?1:0},o.duration||500,o.easing,childComplete)},$.effects.effect.fade=function(o,done){var el=$(this),mode=$.effects.setMode(el,o.mode||"toggle");el.animate({opacity:mode},{queue:!1,duration:o.duration,easing:o.easing,complete:done})},$.effects.effect.fold=function(o,done){var wrapper,distance,el=$(this),props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"hide"),show="show"===mode,hide="hide"===mode,size=o.size||15,percent=/([0-9]+)%/.exec(size),horizFirst=!!o.horizFirst,widthFirst=show!==horizFirst,ref=widthFirst?["width","height"]:["height","width"],duration=o.duration/2,animation1={},animation2={};$.effects.save(el,props),el.show(),wrapper=$.effects.createWrapper(el).css({overflow:"hidden"}),distance=widthFirst?[wrapper.width(),wrapper.height()]:[wrapper.height(),wrapper.width()],percent&&(size=parseInt(percent[1],10)/100*distance[hide?0:1]),show&&wrapper.css(horizFirst?{height:0,width:size}:{height:size,width:0}),animation1[ref[0]]=show?distance[0]:size,animation2[ref[1]]=show?distance[1]:0,wrapper.animate(animation1,duration,o.easing).animate(animation2,duration,o.easing,function(){hide&&el.hide(),$.effects.restore(el,props),$.effects.removeWrapper(el),done()})},$.effects.effect.highlight=function(o,done){var elem=$(this),props=["backgroundImage","backgroundColor","opacity"],mode=$.effects.setMode(elem,o.mode||"show"),animation={backgroundColor:elem.css("backgroundColor")};"hide"===mode&&(animation.opacity=0),$.effects.save(elem,props),elem.show().css({backgroundImage:"none",backgroundColor:o.color||"#ffff99"}).animate(animation,{queue:!1,duration:o.duration,easing:o.easing,complete:function(){"hide"===mode&&elem.hide(),$.effects.restore(elem,props),done()}})},$.effects.effect.size=function(o,done){var original,baseline,factor,el=$(this),props0=["position","top","bottom","left","right","width","height","overflow","opacity"],props1=["position","top","bottom","left","right","overflow","opacity"],props2=["width","height","overflow"],cProps=["fontSize"],vProps=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],hProps=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],mode=$.effects.setMode(el,o.mode||"effect"),restore=o.restore||"effect"!==mode,scale=o.scale||"both",origin=o.origin||["middle","center"],position=el.css("position"),props=restore?props0:props1,zero={height:0,width:0,outerHeight:0,outerWidth:0};"show"===mode&&el.show(),original={height:el.height(),width:el.width(),outerHeight:el.outerHeight(),outerWidth:el.outerWidth()},"toggle"===o.mode&&"show"===mode?(el.from=o.to||zero,el.to=o.from||original):(el.from=o.from||("show"===mode?zero:original),el.to=o.to||("hide"===mode?zero:original)),factor={from:{y:el.from.height/original.height,x:el.from.width/original.width},to:{y:el.to.height/original.height,x:el.to.width/original.width}},"box"!==scale&&"both"!==scale||(factor.from.y!==factor.to.y&&(props=props.concat(vProps),el.from=$.effects.setTransition(el,vProps,factor.from.y,el.from),el.to=$.effects.setTransition(el,vProps,factor.to.y,el.to)),factor.from.x!==factor.to.x&&(props=props.concat(hProps),el.from=$.effects.setTransition(el,hProps,factor.from.x,el.from),el.to=$.effects.setTransition(el,hProps,factor.to.x,el.to))),"content"!==scale&&"both"!==scale||factor.from.y!==factor.to.y&&(props=props.concat(cProps).concat(props2),el.from=$.effects.setTransition(el,cProps,factor.from.y,el.from),el.to=$.effects.setTransition(el,cProps,factor.to.y,el.to)),$.effects.save(el,props),el.show(),$.effects.createWrapper(el),el.css("overflow","hidden").css(el.from),origin&&(baseline=$.effects.getBaseline(origin,original),el.from.top=(original.outerHeight-el.outerHeight())*baseline.y,el.from.left=(original.outerWidth-el.outerWidth())*baseline.x,el.to.top=(original.outerHeight-el.to.outerHeight)*baseline.y,el.to.left=(original.outerWidth-el.to.outerWidth)*baseline.x),el.css(el.from),"content"!==scale&&"both"!==scale||(vProps=vProps.concat(["marginTop","marginBottom"]).concat(cProps),hProps=hProps.concat(["marginLeft","marginRight"]),props2=props0.concat(vProps).concat(hProps),el.find("*[width]").each(function(){var child=$(this),c_original={height:child.height(),width:child.width(),outerHeight:child.outerHeight(),outerWidth:child.outerWidth()};restore&&$.effects.save(child,props2),child.from={height:c_original.height*factor.from.y,width:c_original.width*factor.from.x,outerHeight:c_original.outerHeight*factor.from.y,outerWidth:c_original.outerWidth*factor.from.x},child.to={height:c_original.height*factor.to.y,width:c_original.width*factor.to.x,outerHeight:c_original.height*factor.to.y,outerWidth:c_original.width*factor.to.x},factor.from.y!==factor.to.y&&(child.from=$.effects.setTransition(child,vProps,factor.from.y,child.from),child.to=$.effects.setTransition(child,vProps,factor.to.y,child.to)),factor.from.x!==factor.to.x&&(child.from=$.effects.setTransition(child,hProps,factor.from.x,child.from),child.to=$.effects.setTransition(child,hProps,factor.to.x,child.to)),child.css(child.from),child.animate(child.to,o.duration,o.easing,function(){restore&&$.effects.restore(child,props2)})})),el.animate(el.to,{queue:!1,duration:o.duration,easing:o.easing,complete:function(){0===el.to.opacity&&el.css("opacity",el.from.opacity),"hide"===mode&&el.hide(),$.effects.restore(el,props),restore||("static"===position?el.css({position:"relative",top:el.to.top,left:el.to.left}):$.each(["top","left"],function(idx,pos){el.css(pos,function(_,str){var val=parseInt(str,10),toRef=idx?el.to.left:el.to.top;return"auto"===str?toRef+"px":val+toRef+"px"})})),$.effects.removeWrapper(el),done()}})},$.effects.effect.scale=function(o,done){var el=$(this),options=$.extend(!0,{},o),mode=$.effects.setMode(el,o.mode||"effect"),percent=parseInt(o.percent,10)||(0===parseInt(o.percent,10)?0:"hide"===mode?0:100),direction=o.direction||"both",origin=o.origin,original={height:el.height(),width:el.width(),outerHeight:el.outerHeight(),outerWidth:el.outerWidth()},factor={y:"horizontal"!==direction?percent/100:1,x:"vertical"!==direction?percent/100:1};options.effect="size",options.queue=!1,options.complete=done,"effect"!==mode&&(options.origin=origin||["middle","center"],options.restore=!0),options.from=o.from||("show"===mode?{height:0,width:0,outerHeight:0,outerWidth:0}:original),options.to={height:original.height*factor.y,width:original.width*factor.x,outerHeight:original.outerHeight*factor.y,outerWidth:original.outerWidth*factor.x},options.fade&&("show"===mode&&(options.from.opacity=0,options.to.opacity=1),"hide"===mode&&(options.from.opacity=1,options.to.opacity=0)),el.effect(options)},$.effects.effect.puff=function(o,done){var elem=$(this),mode=$.effects.setMode(elem,o.mode||"hide"),hide="hide"===mode,percent=parseInt(o.percent,10)||150,factor=percent/100,original={height:elem.height(),width:elem.width(),outerHeight:elem.outerHeight(),outerWidth:elem.outerWidth()};$.extend(o,{effect:"scale",queue:!1,fade:!0,mode:mode,complete:done,percent:hide?percent:100,from:hide?original:{height:original.height*factor,width:original.width*factor,outerHeight:original.outerHeight*factor,outerWidth:original.outerWidth*factor}}),elem.effect(o)},$.effects.effect.pulsate=function(o,done){var i,elem=$(this),mode=$.effects.setMode(elem,o.mode||"show"),show="show"===mode,hide="hide"===mode,showhide=show||"hide"===mode,anims=2*(o.times||5)+(showhide?1:0),duration=o.duration/anims,animateTo=0,queue=elem.queue(),queuelen=queue.length;for(!show&&elem.is(":visible")||(elem.css("opacity",0).show(),animateTo=1),i=1;anims>i;i++)elem.animate({opacity:animateTo},duration,o.easing),animateTo=1-animateTo;elem.animate({opacity:animateTo},duration,o.easing),elem.queue(function(){hide&&elem.hide(),done()}),queuelen>1&&queue.splice.apply(queue,[1,0].concat(queue.splice(queuelen,anims+1))),elem.dequeue()},$.effects.effect.shake=function(o,done){var i,el=$(this),props=["position","top","bottom","left","right","height","width"],mode=$.effects.setMode(el,o.mode||"effect"),direction=o.direction||"left",distance=o.distance||20,times=o.times||3,anims=2*times+1,speed=Math.round(o.duration/anims),ref="up"===direction||"down"===direction?"top":"left",positiveMotion="up"===direction||"left"===direction,animation={},animation1={},animation2={},queue=el.queue(),queuelen=queue.length;for($.effects.save(el,props),el.show(),$.effects.createWrapper(el),animation[ref]=(positiveMotion?"-=":"+=")+distance,animation1[ref]=(positiveMotion?"+=":"-=")+2*distance,animation2[ref]=(positiveMotion?"-=":"+=")+2*distance,el.animate(animation,speed,o.easing),i=1;times>i;i++)el.animate(animation1,speed,o.easing).animate(animation2,speed,o.easing);el.animate(animation1,speed,o.easing).animate(animation,speed/2,o.easing).queue(function(){"hide"===mode&&el.hide(),$.effects.restore(el,props),$.effects.removeWrapper(el),done()}),queuelen>1&&queue.splice.apply(queue,[1,0].concat(queue.splice(queuelen,anims+1))),el.dequeue()},$.effects.effect.slide=function(o,done){var distance,el=$(this),props=["position","top","bottom","left","right","width","height"],mode=$.effects.setMode(el,o.mode||"show"),show="show"===mode,direction=o.direction||"left",ref="up"===direction||"down"===direction?"top":"left",positiveMotion="up"===direction||"left"===direction,animation={};$.effects.save(el,props),el.show(),distance=o.distance||el["top"===ref?"outerHeight":"outerWidth"](!0),$.effects.createWrapper(el).css({overflow:"hidden"}),show&&el.css(ref,positiveMotion?isNaN(distance)?"-"+distance:-distance:distance),animation[ref]=(show?positiveMotion?"+=":"-=":positiveMotion?"-=":"+=")+distance,el.animate(animation,{queue:!1,duration:o.duration,easing:o.easing,complete:function(){"hide"===mode&&el.hide(),$.effects.restore(el,props),$.effects.removeWrapper(el),done()}})},$.effects.effect.transfer=function(o,done){var elem=$(this),target=$(o.to),targetFixed="fixed"===target.css("position"),body=$("body"),fixTop=targetFixed?body.scrollTop():0,fixLeft=targetFixed?body.scrollLeft():0,endPosition=target.offset(),animation={top:endPosition.top-fixTop,left:endPosition.left-fixLeft,height:target.innerHeight(),width:target.innerWidth()},startPosition=elem.offset(),transfer=$("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(o.className).css({top:startPosition.top-fixTop,left:startPosition.left-fixLeft,height:elem.innerHeight(),width:elem.innerWidth(),position:targetFixed?"fixed":"absolute"}).animate(animation,o.duration,o.easing,function(){transfer.remove(),done()})},$.widget("ui.progressbar",{version:"1.11.2",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=$("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(newValue){return void 0===newValue?this.options.value:(this.options.value=this._constrainedValue(newValue),void this._refreshValue())},_constrainedValue:function(newValue){return void 0===newValue&&(newValue=this.options.value),this.indeterminate=newValue===!1,"number"!=typeof newValue&&(newValue=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,newValue))},_setOptions:function(options){var value=options.value;delete options.value,this._super(options),this.options.value=this._constrainedValue(value),this._refreshValue()},_setOption:function(key,value){"max"===key&&(value=Math.max(this.min,value)),"disabled"===key&&this.element.toggleClass("ui-state-disabled",!!value).attr("aria-disabled",value),this._super(key,value)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var value=this.options.value,percentage=this._percentage();this.valueDiv.toggle(this.indeterminate||value>this.min).toggleClass("ui-corner-right",value===this.options.max).width(percentage.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=$("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":value}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==value&&(this.oldValue=value,this._trigger("change")),value===this.options.max&&this._trigger("complete")}}),$.widget("ui.selectable",$.ui.mouse,{version:"1.11.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var selectees,that=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){selectees=$(that.options.filter,that.element[0]),selectees.addClass("ui-selectee"),selectees.each(function(){var $this=$(this),pos=$this.offset();$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:!1,selected:$this.hasClass("ui-selected"),selecting:$this.hasClass("ui-selecting"),unselecting:$this.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=selectees.addClass("ui-selectee"),this._mouseInit(),this.helper=$("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(event){var that=this,options=this.options;this.opos=[event.pageX,event.pageY],this.options.disabled||(this.selectees=$(options.filter,this.element[0]),this._trigger("start",event),$(options.appendTo).append(this.helper),this.helper.css({left:event.pageX,top:event.pageY,width:0,height:0}),options.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=!0,event.metaKey||event.ctrlKey||(selectee.$element.removeClass("ui-selected"),selectee.selected=!1,selectee.$element.addClass("ui-unselecting"),selectee.unselecting=!0,that._trigger("unselecting",event,{unselecting:selectee.element}))}),$(event.target).parents().addBack().each(function(){var doSelect,selectee=$.data(this,"selectable-item");return selectee?(doSelect=!event.metaKey&&!event.ctrlKey||!selectee.$element.hasClass("ui-selected"),selectee.$element.removeClass(doSelect?"ui-unselecting":"ui-selected").addClass(doSelect?"ui-selecting":"ui-unselecting"),selectee.unselecting=!doSelect,selectee.selecting=doSelect,selectee.selected=doSelect,doSelect?that._trigger("selecting",event,{selecting:selectee.element}):that._trigger("unselecting",event,{unselecting:selectee.element}),!1):void 0}))},_mouseDrag:function(event){if(this.dragged=!0,!this.options.disabled){var tmp,that=this,options=this.options,x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;return x1>x2&&(tmp=x2,x2=x1,x1=tmp),y1>y2&&(tmp=y2,y2=y1,y1=tmp),this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1}),this.selectees.each(function(){var selectee=$.data(this,"selectable-item"),hit=!1;selectee&&selectee.element!==that.element[0]&&("touch"===options.tolerance?hit=!(selectee.left>x2||selectee.right<x1||selectee.top>y2||selectee.bottom<y1):"fit"===options.tolerance&&(hit=selectee.left>x1&&selectee.right<x2&&selectee.top>y1&&selectee.bottom<y2),hit?(selectee.selected&&(selectee.$element.removeClass("ui-selected"),selectee.selected=!1),selectee.unselecting&&(selectee.$element.removeClass("ui-unselecting"),selectee.unselecting=!1),selectee.selecting||(selectee.$element.addClass("ui-selecting"),selectee.selecting=!0,that._trigger("selecting",event,{selecting:selectee.element}))):(selectee.selecting&&((event.metaKey||event.ctrlKey)&&selectee.startselected?(selectee.$element.removeClass("ui-selecting"),selectee.selecting=!1,selectee.$element.addClass("ui-selected"),selectee.selected=!0):(selectee.$element.removeClass("ui-selecting"),selectee.selecting=!1,selectee.startselected&&(selectee.$element.addClass("ui-unselecting"),selectee.unselecting=!0),that._trigger("unselecting",event,{unselecting:selectee.element}))),selectee.selected&&(event.metaKey||event.ctrlKey||selectee.startselected||(selectee.$element.removeClass("ui-selected"),selectee.selected=!1,selectee.$element.addClass("ui-unselecting"),selectee.unselecting=!0,that._trigger("unselecting",event,{unselecting:selectee.element})))))}),!1}},_mouseStop:function(event){var that=this;return this.dragged=!1,$(".ui-unselecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass("ui-unselecting"),selectee.unselecting=!1,selectee.startselected=!1,that._trigger("unselected",event,{unselected:selectee.element})}),$(".ui-selecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass("ui-selecting").addClass("ui-selected"),selectee.selecting=!1,selectee.selected=!0,selectee.startselected=!0,that._trigger("selected",event,{selected:selectee.element})}),this._trigger("stop",event),this.helper.remove(),!1}}),$.widget("ui.selectmenu",{version:"1.11.2",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var selectmenuId=this.element.uniqueId().attr("id");this.ids={element:selectmenuId,button:selectmenuId+"-button",menu:selectmenuId+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var that=this,tabindex=this.element.attr("tabindex");this.label=$("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(event){this.button.focus(),event.preventDefault()}}),this.element.hide(),this.button=$("<span>",{class:"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:tabindex||this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),$("<span>",{class:"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=$("<span>",{class:"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){that.menuItems||that._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var that=this;this.menu=$("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=$("<div>",{class:"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(event,ui){event.preventDefault(),that._setSelection(),that._select(ui.item.data("ui-selectmenu-item"),event)},focus:function(event,ui){var item=ui.item.data("ui-selectmenu-item");null!=that.focusIndex&&item.index!==that.focusIndex&&(that._trigger("focus",event,{item:item}),that.isOpen||that._select(item,event)),that.focusIndex=item.index,that.button.attr("aria-activedescendant",that.menuItems.eq(item.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var item,options=this.element.find("option");options.length&&(this._parseOptions(options),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),item=this._getSelectedItem(),this.menuInstance.focus(null,item),this._setAria(item.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(event){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",event))},_position:function(){this.menuWrap.position($.extend({of:this.button},this.options.position))},close:function(event){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",event))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(ul,items){var that=this,currentOptgroup="";$.each(items,function(index,item){item.optgroup!==currentOptgroup&&($("<li>",{class:"ui-selectmenu-optgroup ui-menu-divider"+(item.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:item.optgroup}).appendTo(ul),currentOptgroup=item.optgroup),that._renderItemData(ul,item)})},_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-selectmenu-item",item)},_renderItem:function(ul,item){var li=$("<li>");return item.disabled&&li.addClass("ui-state-disabled"),this._setText(li,item.label),li.appendTo(ul)},_setText:function(element,value){value?element.text(value):element.html("&#160;")},_move:function(direction,event){var item,next,filter=".ui-menu-item";this.isOpen?item=this.menuItems.eq(this.focusIndex):(item=this.menuItems.eq(this.element[0].selectedIndex),filter+=":not(.ui-state-disabled)"),next="first"===direction||"last"===direction?item["first"===direction?"prevAll":"nextAll"](filter).eq(-1):item[direction+"All"](filter).eq(0),next.length&&this.menuInstance.focus(event,next)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(event){this[this.isOpen?"close":"open"](event)},_setSelection:function(){var selection;this.range&&(window.getSelection?(selection=window.getSelection(),selection.removeAllRanges(),selection.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(event){this.isOpen&&($(event.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(event))}},_buttonEvents:{mousedown:function(){var selection;window.getSelection?(selection=window.getSelection(),selection.rangeCount&&(this.range=selection.getRangeAt(0))):this.range=document.selection.createRange()},click:function(event){this._setSelection(),this._toggle(event)},keydown:function(event){var preventDefault=!0;switch(event.keyCode){case $.ui.keyCode.TAB:case $.ui.keyCode.ESCAPE:this.close(event),preventDefault=!1;break;case $.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(event);break;case $.ui.keyCode.UP:event.altKey?this._toggle(event):this._move("prev",event);break;case $.ui.keyCode.DOWN:event.altKey?this._toggle(event):this._move("next",event);break;case $.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(event):this._toggle(event);break;case $.ui.keyCode.LEFT:this._move("prev",event);break;case $.ui.keyCode.RIGHT:this._move("next",event);break;case $.ui.keyCode.HOME:case $.ui.keyCode.PAGE_UP:this._move("first",event);break;case $.ui.keyCode.END:case $.ui.keyCode.PAGE_DOWN:this._move("last",event);break;default:this.menu.trigger(event),preventDefault=!1}preventDefault&&event.preventDefault()}},_selectFocusedItem:function(event){var item=this.menuItems.eq(this.focusIndex);item.hasClass("ui-state-disabled")||this._select(item.data("ui-selectmenu-item"),event)},_select:function(item,event){var oldIndex=this.element[0].selectedIndex;this.element[0].selectedIndex=item.index,this._setText(this.buttonText,item.label),this._setAria(item),this._trigger("select",event,{item:item}),item.index!==oldIndex&&this._trigger("change",event,{item:item}),this.close(event)},_setAria:function(item){var id=this.menuItems.eq(item.index).attr("id");this.button.attr({"aria-labelledby":id,"aria-activedescendant":id}),this.menu.attr("aria-activedescendant",id)},_setOption:function(key,value){"icons"===key&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(value.button),this._super(key,value),"appendTo"===key&&this.menuWrap.appendTo(this._appendTo()),"disabled"===key&&(this.menuInstance.option("disabled",value),this.button.toggleClass("ui-state-disabled",value).attr("aria-disabled",value),this.element.prop("disabled",value),value?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===key&&this._resizeButton()},_appendTo:function(){var element=this.options.appendTo;return element&&(element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0)),element&&element[0]||(element=this.element.closest(".ui-front")),element.length||(element=this.document[0].body),element},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var width=this.options.width;width||(width=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(width)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(options){var data=[];options.each(function(index,item){var option=$(item),optgroup=option.parent("optgroup");data.push({element:option,index:index,value:option.attr("value"),label:option.text(),optgroup:optgroup.attr("label")||"",disabled:optgroup.prop("disabled")||option.prop("disabled")})}),this.items=data},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),$.widget("ui.slider",$.ui.mouse,{version:"1.11.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var i,handleCount,options=this.options,existingHandles=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),handle="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",handles=[];for(handleCount=options.values&&options.values.length||1,existingHandles.length>handleCount&&(existingHandles.slice(handleCount).remove(),existingHandles=existingHandles.slice(0,handleCount)),i=existingHandles.length;handleCount>i;i++)handles.push(handle);this.handles=existingHandles.add($(handles.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(i){$(this).data("ui-slider-handle-index",i)})},_createRange:function(){var options=this.options,classes="";options.range?(options.range===!0&&(options.values?options.values.length&&2!==options.values.length?options.values=[options.values[0],options.values[0]]:$.isArray(options.values)&&(options.values=options.values.slice(0)):options.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=$("<div></div>").appendTo(this.element),classes="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(classes+("min"===options.range||"max"===options.range?" ui-slider-range-"+options.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(event){var position,normValue,distance,closestHandle,index,allowed,offset,mouseOverHandle,that=this,o=this.options;return o.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position),distance=this._valueMax()-this._valueMin()+1,this.handles.each(function(i){var thisDistance=Math.abs(normValue-that.values(i));(distance>thisDistance||distance===thisDistance&&(i===that._lastChangedValue||that.values(i)===o.min))&&(distance=thisDistance,closestHandle=$(this),index=i)}),allowed=this._start(event,index),allowed===!1?!1:(this._mouseSliding=!0,this._handleIndex=index,closestHandle.addClass("ui-state-active").focus(),offset=closestHandle.offset(),mouseOverHandle=!$(event.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-closestHandle.width()/2,top:event.pageY-offset.top-closestHandle.height()/2-(parseInt(closestHandle.css("borderTopWidth"),10)||0)-(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+(parseInt(closestHandle.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(event,index,normValue),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);return this._slide(event,this._handleIndex,normValue),!1},_mouseStop:function(event){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(event,this._handleIndex),this._change(event,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;return"horizontal"===this.orientation?(pixelTotal=this.elementSize.width,pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(pixelTotal=this.elementSize.height,pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),percentMouse=pixelMouse/pixelTotal,percentMouse>1&&(percentMouse=1),0>percentMouse&&(percentMouse=0),"vertical"===this.orientation&&(percentMouse=1-percentMouse),valueTotal=this._valueMax()-this._valueMin(),
valueMouse=this._valueMin()+percentMouse*valueTotal,this._trimAlignValue(valueMouse)},_start:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};return this.options.values&&this.options.values.length&&(uiHash.value=this.values(index),uiHash.values=this.values()),this._trigger("start",event,uiHash)},_slide:function(event,index,newVal){var otherVal,newValues,allowed;this.options.values&&this.options.values.length?(otherVal=this.values(index?0:1),2===this.options.values.length&&this.options.range===!0&&(0===index&&newVal>otherVal||1===index&&otherVal>newVal)&&(newVal=otherVal),newVal!==this.values(index)&&(newValues=this.values(),newValues[index]=newVal,allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal,values:newValues}),otherVal=this.values(index?0:1),allowed!==!1&&this.values(index,newVal))):newVal!==this.value()&&(allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal}),allowed!==!1&&this.value(newVal))},_stop:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};this.options.values&&this.options.values.length&&(uiHash.value=this.values(index),uiHash.values=this.values()),this._trigger("stop",event,uiHash)},_change:function(event,index){if(!this._keySliding&&!this._mouseSliding){var uiHash={handle:this.handles[index],value:this.value()};this.options.values&&this.options.values.length&&(uiHash.value=this.values(index),uiHash.values=this.values()),this._lastChangedValue=index,this._trigger("change",event,uiHash)}},value:function(newValue){return arguments.length?(this.options.value=this._trimAlignValue(newValue),this._refreshValue(),void this._change(null,0)):this._value()},values:function(index,newValue){var vals,newValues,i;if(arguments.length>1)return this.options.values[index]=this._trimAlignValue(newValue),this._refreshValue(),void this._change(null,index);if(!arguments.length)return this._values();if(!$.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(index):this.value();for(vals=this.options.values,newValues=arguments[0],i=0;i<vals.length;i+=1)vals[i]=this._trimAlignValue(newValues[i]),this._change(null,i);this._refreshValue()},_setOption:function(key,value){var i,valsLength=0;switch("range"===key&&this.options.range===!0&&("min"===value?(this.options.value=this._values(0),this.options.values=null):"max"===value&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),$.isArray(this.options.values)&&(valsLength=this.options.values.length),"disabled"===key&&this.element.toggleClass("ui-state-disabled",!!value),this._super(key,value),key){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===value?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=0;valsLength>i;i+=1)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var val=this.options.value;return val=this._trimAlignValue(val)},_values:function(index){var val,vals,i;if(arguments.length)return val=this.options.values[index],val=this._trimAlignValue(val);if(this.options.values&&this.options.values.length){for(vals=this.options.values.slice(),i=0;i<vals.length;i+=1)vals[i]=this._trimAlignValue(vals[i]);return vals}return[]},_trimAlignValue:function(val){if(val<=this._valueMin())return this._valueMin();if(val>=this._valueMax())return this._valueMax();var step=this.options.step>0?this.options.step:1,valModStep=(val-this._valueMin())%step,alignValue=val-valModStep;return 2*Math.abs(valModStep)>=step&&(alignValue+=valModStep>0?step:-step),parseFloat(alignValue.toFixed(5))},_calculateNewMax:function(){var remainder=(this.options.max-this._valueMin())%this.options.step;this.max=this.options.max-remainder},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var lastValPercent,valPercent,value,valueMin,valueMax,oRange=this.options.range,o=this.options,that=this,animate=this._animateOff?!1:o.animate,_set={};this.options.values&&this.options.values.length?this.handles.each(function(i){valPercent=(that.values(i)-that._valueMin())/(that._valueMax()-that._valueMin())*100,_set["horizontal"===that.orientation?"left":"bottom"]=valPercent+"%",$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate),that.options.range===!0&&("horizontal"===that.orientation?(0===i&&that.range.stop(1,1)[animate?"animate":"css"]({left:valPercent+"%"},o.animate),1===i&&that.range[animate?"animate":"css"]({width:valPercent-lastValPercent+"%"},{queue:!1,duration:o.animate})):(0===i&&that.range.stop(1,1)[animate?"animate":"css"]({bottom:valPercent+"%"},o.animate),1===i&&that.range[animate?"animate":"css"]({height:valPercent-lastValPercent+"%"},{queue:!1,duration:o.animate}))),lastValPercent=valPercent}):(value=this.value(),valueMin=this._valueMin(),valueMax=this._valueMax(),valPercent=valueMax!==valueMin?(value-valueMin)/(valueMax-valueMin)*100:0,_set["horizontal"===this.orientation?"left":"bottom"]=valPercent+"%",this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate),"min"===oRange&&"horizontal"===this.orientation&&this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate),"max"===oRange&&"horizontal"===this.orientation&&this.range[animate?"animate":"css"]({width:100-valPercent+"%"},{queue:!1,duration:o.animate}),"min"===oRange&&"vertical"===this.orientation&&this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate),"max"===oRange&&"vertical"===this.orientation&&this.range[animate?"animate":"css"]({height:100-valPercent+"%"},{queue:!1,duration:o.animate}))},_handleEvents:{keydown:function(event){var allowed,curVal,newVal,step,index=$(event.target).data("ui-slider-handle-index");switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(event.preventDefault(),!this._keySliding&&(this._keySliding=!0,$(event.target).addClass("ui-state-active"),allowed=this._start(event,index),allowed===!1))return}switch(step=this.options.step,curVal=newVal=this.options.values&&this.options.values.length?this.values(index):this.value(),event.keyCode){case $.ui.keyCode.HOME:newVal=this._valueMin();break;case $.ui.keyCode.END:newVal=this._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=this._trimAlignValue(curVal+(this._valueMax()-this._valueMin())/this.numPages);break;case $.ui.keyCode.PAGE_DOWN:newVal=this._trimAlignValue(curVal-(this._valueMax()-this._valueMin())/this.numPages);break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal===this._valueMax())return;newVal=this._trimAlignValue(curVal+step);break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal===this._valueMin())return;newVal=this._trimAlignValue(curVal-step)}this._slide(event,index,newVal)},keyup:function(event){var index=$(event.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(event,index),this._change(event,index),$(event.target).removeClass("ui-state-active"))}}}),$.widget("ui.sortable",$.ui.mouse,{version:"1.11.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(x,reference,size){return x>=reference&&reference+size>x},_isFloating:function(item){return/left|right/.test(item.css("float"))||/inline|table-cell/.test(item.css("display"))},_create:function(){var o=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===o.axis||this._isFloating(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(key,value){this._super(key,value),"handle"===key&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),$.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--)this.items[i].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=!1,that=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(event),$(event.target).parents().each(function(){return $.data(this,that.widgetName+"-item")===that?(currentItem=$(this),!1):void 0}),$.data(event.target,that.widgetName+"-item")===that&&(currentItem=$(event.target)),currentItem&&(!this.options.handle||overrideHandle||($(this.options.handle,currentItem).find("*").addBack().each(function(){this===event.target&&(validHandle=!0)}),validHandle))?(this.currentItem=currentItem,this._removeCurrentsFromItems(),!0):!1)},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(event),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(event),this.originalPageX=event.pageX,this.originalPageY=event.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(body=this.document.find("body"),this.storedCursor=body.css("cursor"),body.css("cursor",o.cursor),this.storedStylesheet=$("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(body)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",event,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!noActivation)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",event,this._uiHash(this));return $.ui.ddmanager&&($.ui.ddmanager.current=this),$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(event),!0},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options,scrolled=!1;for(this.position=this._generatePosition(event),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-event.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed:event.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-event.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed:event.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(event.pageY-$(document).scrollTop()<o.scrollSensitivity?scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed):$(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity&&(scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)),event.pageX-$(document).scrollLeft()<o.scrollSensitivity?scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed):$(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity&&(scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed))),scrolled!==!1&&$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(item=this.items[i],itemElement=item.item[0],intersection=this._intersectsWithPointer(item),intersection&&item.instance===this.currentContainer&&itemElement!==this.currentItem[0]&&this.placeholder[1===intersection?"next":"prev"]()[0]!==itemElement&&!$.contains(this.placeholder[0],itemElement)&&("semi-dynamic"===this.options.type?!$.contains(this.element[0],itemElement):!0)){if(this.direction=1===intersection?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(item))break;this._rearrange(event,item),this._trigger("change",event,this._uiHash());break}return this._contactContainers(event),$.ui.ddmanager&&$.ui.ddmanager.drag(this,event),this._trigger("sort",event,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(event,noPropagation){if(event){if($.ui.ddmanager&&!this.options.dropBehaviour&&$.ui.ddmanager.drop(this,event),this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};axis&&"x"!==axis||(animation.left=cur.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),axis&&"y"!==axis||(animation.top=cur.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event)})}else this._clear(event,noPropagation);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("deactivate",null,this._uiHash(this)),this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",null,this._uiHash(this)),this.containers[i].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),$.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?$(this.domPosition.prev).after(this.currentItem):$(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];return o=o||{},$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||/(.+)[\-=_](.+)/);res&&str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]))}),!str.length&&o.key&&str.push(o.key+"="),str.join("&")},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];return o=o||{},items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"")}),ret},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight="x"===this.options.axis||y1+dyClick>t&&b>y1+dyClick,isOverElementWidth="y"===this.options.axis||x1+dxClick>l&&r>x1+dxClick,isOverElement=isOverElementHeight&&isOverElementWidth;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"]?isOverElement:l<x1+this.helperProportions.width/2&&x2-this.helperProportions.width/2<r&&t<y1+this.helperProportions.height/2&&y2-this.helperProportions.height/2<b},_intersectsWithPointer:function(item){var isOverElementHeight="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();return isOverElement?this.floating?horizontalDirection&&"right"===horizontalDirection||"down"===verticalDirection?2:1:verticalDirection&&("down"===verticalDirection?2:1):!1},_intersectsWithSides:function(item){var isOverBottomHalf=this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+item.height/2,item.height),isOverRightHalf=this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+item.width/2,item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();return this.floating&&horizontalDirection?"right"===horizontalDirection&&isOverRightHalf||"left"===horizontalDirection&&!isOverRightHalf:verticalDirection&&("down"===verticalDirection&&isOverBottomHalf||"up"===verticalDirection&&!isOverBottomHalf)},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return 0!==delta&&(delta>0?"down":"up")},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return 0!==delta&&(delta>0?"right":"left")},refresh:function(event){return this._refreshItems(event),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith},_getItemsAsjQuery:function(connected){function addItems(){items.push(this)}var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected)for(i=connectWith.length-1;i>=0;i--)for(cur=$(connectWith[i]),j=cur.length-1;j>=0;j--)inst=$.data(cur[j],this.widgetFullName),inst&&inst!==this&&!inst.options.disabled&&queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst]);for(queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=queries.length-1;i>=0;i--)queries[i][0].each(addItems);return $(items)},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j<list.length;j++)if(list[j]===item.item[0])return!1;return!0})},_refreshItems:function(event){this.items=[],this.containers=[this];var i,j,cur,inst,targetData,_queries,item,queriesLength,items=this.items,queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]],connectWith=this._connectWith();if(connectWith&&this.ready)for(i=connectWith.length-1;i>=0;i--)for(cur=$(connectWith[i]),j=cur.length-1;j>=0;j--)inst=$.data(cur[j],this.widgetFullName),inst&&inst!==this&&!inst.options.disabled&&(queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]),this.containers.push(inst));for(i=queries.length-1;i>=0;i--)for(targetData=queries[i][1],_queries=queries[i][0],j=0,queriesLength=_queries.length;queriesLength>j;j++)item=$(_queries[j]),item.data(this.widgetName+"-item",targetData),items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0})},refreshPositions:function(fast){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,item,t,p;for(i=this.items.length-1;i>=0;i--)item=this.items[i],item.instance!==this.currentContainer&&this.currentContainer&&item.item[0]!==this.currentItem[0]||(t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item,fast||(item.width=t.outerWidth(),item.height=t.outerHeight()),p=t.offset(),item.left=p.left,item.top=p.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)p=this.containers[i].element.offset(),this.containers[i].containerCache.left=p.left,this.containers[i].containerCache.top=p.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(that){that=that||this;var className,o=that.options;o.placeholder&&o.placeholder.constructor!==String||(className=o.placeholder,o.placeholder={element:function(){var nodeName=that.currentItem[0].nodeName.toLowerCase(),element=$("<"+nodeName+">",that.document[0]).addClass(className||that.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===nodeName?that.currentItem.children().each(function(){$("<td>&#160;</td>",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(element)}):"img"===nodeName&&element.attr("src",that.currentItem.attr("src")),className||element.css("visibility","hidden"),element},update:function(container,p){className&&!o.forcePlaceholderSize||(p.height()||p.height(that.currentItem.innerHeight()-parseInt(that.currentItem.css("paddingTop")||0,10)-parseInt(that.currentItem.css("paddingBottom")||0,10)),p.width()||p.width(that.currentItem.innerWidth()-parseInt(that.currentItem.css("paddingLeft")||0,10)-parseInt(that.currentItem.css("paddingRight")||0,10)))}}),that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem)),that.currentItem.after(that.placeholder),o.placeholder.update(that,that.placeholder)},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,cur,nearBottom,floating,axis,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;i>=0;i--)if(!$.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0]))continue;innermostContainer=this.containers[i],innermostIndex=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",event,this._uiHash(this)),this.containers[i].containerCache.over=0);if(innermostContainer)if(1===this.containers.length)this.containers[innermostIndex].containerCache.over||(this.containers[innermostIndex]._trigger("over",event,this._uiHash(this)),this.containers[innermostIndex].containerCache.over=1);else{for(dist=1e4,itemWithLeastDistance=null,floating=innermostContainer.floating||this._isFloating(this.currentItem),posProperty=floating?"left":"top",sizeProperty=floating?"width":"height",axis=floating?"clientX":"clientY",j=this.items.length-1;j>=0;j--)$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])&&this.items[j].item[0]!==this.currentItem[0]&&(cur=this.items[j].item.offset()[posProperty],nearBottom=!1,event[axis]-cur>this.items[j][sizeProperty]/2&&(nearBottom=!0),Math.abs(event[axis]-cur)<dist&&(dist=Math.abs(event[axis]-cur),itemWithLeastDistance=this.items[j],this.direction=nearBottom?"up":"down"));if(!itemWithLeastDistance&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[innermostIndex])return void(this.currentContainer.containerCache.over||(this.containers[innermostIndex]._trigger("over",event,this._uiHash()),this.currentContainer.containerCache.over=1));itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,!0):this._rearrange(event,null,this.containers[innermostIndex].element,!0),this._trigger("change",event,this._uiHash()),this.containers[innermostIndex]._trigger("change",event,this._uiHash(this)),this.currentContainer=this.containers[innermostIndex],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[innermostIndex]._trigger("over",event,this._uiHash(this)),this.containers[innermostIndex].containerCache.over=1}},_createHelper:function(event){var o=this.options,helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):"clone"===o.helper?this.currentItem.clone():this.currentItem;return helper.parents("body").length||$("parent"!==o.appendTo?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]),helper[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),helper[0].style.width&&!o.forceHelperSize||helper.width(this.currentItem.width()),helper[0].style.height&&!o.forceHelperSize||helper.height(this.currentItem.height()),helper},_adjustOffsetFromHelper:function(obj){"string"==typeof obj&&(obj=obj.split(" ")),$.isArray(obj)&&(obj={left:+obj[0],top:+obj[1]||0}),"left"in obj&&(this.offset.click.left=obj.left+this.margins.left),"right"in obj&&(this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left),"top"in obj&&(this.offset.click.top=obj.top+this.margins.top),"bottom"in obj&&(this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])&&(po.left+=this.scrollParent.scrollLeft(),po.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&$.ui.ie)&&(po={top:0,left:0}),{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var ce,co,over,o=this.options;"parent"===o.containment&&(o.containment=this.helper[0].parentNode),"document"!==o.containment&&"window"!==o.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$("document"===o.containment?document:window).width()-this.helperProportions.width-this.margins.left,($("document"===o.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(o.containment)||(ce=$(o.containment)[0],co=$(o.containment).offset(),over="hidden"!==$(ce).css("overflow"),this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(d,pos){pos||(pos=this.position);var mod="absolute"===d?1:-1,scroll="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,scrollIsRootNode=/(html|body)/i.test(scroll[0].tagName);return{top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():scrollIsRootNode?0:scroll.scrollTop())*mod,left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod}},_generatePosition:function(event){var top,left,o=this.options,pageX=event.pageX,pageY=event.pageY,scroll="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,scrollIsRootNode=/(html|body)/i.test(scroll[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(event.pageX-this.offset.click.left<this.containment[0]&&(pageX=this.containment[0]+this.offset.click.left),event.pageY-this.offset.click.top<this.containment[1]&&(pageY=this.containment[1]+this.offset.click.top),event.pageX-this.offset.click.left>this.containment[2]&&(pageX=this.containment[2]+this.offset.click.left),event.pageY-this.offset.click.top>this.containment[3]&&(pageY=this.containment[3]+this.offset.click.top)),o.grid&&(top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1],pageY=this.containment?top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3]?top:top-this.offset.click.top>=this.containment[1]?top-o.grid[1]:top+o.grid[1]:top,left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0],pageX=this.containment?left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2]?left:left-this.offset.click.left>=this.containment[0]?left-o.grid[0]:left+o.grid[0]:left)),{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():scrollIsRootNode?0:scroll.scrollTop()),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())
}},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?i.item[0]:i.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){counter===this.counter&&this.refreshPositions(!hardRefresh)})},_clear:function(event,noPropagation){function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance))}}this.reverting=!1;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!noPropagation&&delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||noPropagation||delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash())}),this!==this.currentContainer&&(noPropagation||(delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash())}),delayedTriggers.push(function(c){return function(event){c._trigger("receive",event,this._uiHash(this))}}.call(this,this.currentContainer)),delayedTriggers.push(function(c){return function(event){c._trigger("update",event,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)noPropagation||delayedTriggers.push(delayEvent("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(delayedTriggers.push(delayEvent("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,noPropagation||this._trigger("beforeStop",event,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!noPropagation){for(i=0;i<delayedTriggers.length;i++)delayedTriggers[i].call(this,event);this._trigger("stop",event,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){$.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(_inst){var inst=_inst||this;return{helper:inst.helper,placeholder:inst.placeholder||$([]),position:inst.position,originalPosition:inst.originalPosition,offset:inst.positionAbs,item:inst.currentItem,sender:_inst?_inst.element:null}}}),$.widget("ui.spinner",{version:"1.11.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var options={},element=this.element;return $.each(["min","max","step"],function(i,option){var value=element.attr(option);void 0!==value&&value.length&&(options[option]=value)}),options},_events:{keydown:function(event){this._start(event)&&this._keydown(event)&&event.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(event){return this.cancelBlur?void delete this.cancelBlur:(this._stop(),this._refresh(),void(this.previous!==this.element.val()&&this._trigger("change",event)))},mousewheel:function(event,delta){if(delta){if(!this.spinning&&!this._start(event))return!1;this._spin((delta>0?1:-1)*this.options.step,event),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(event)},100),event.preventDefault()}},"mousedown .ui-spinner-button":function(event){function checkFocus(){var isActive=this.element[0]===this.document[0].activeElement;isActive||(this.element.focus(),this.previous=previous,this._delay(function(){this.previous=previous}))}var previous;previous=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),event.preventDefault(),checkFocus.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,checkFocus.call(this)}),this._start(event)!==!1&&this._repeat(null,$(event.currentTarget).hasClass("ui-spinner-up")?1:-1,event)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(event){return $(event.currentTarget).hasClass("ui-state-active")?this._start(event)===!1?!1:void this._repeat(null,$(event.currentTarget).hasClass("ui-spinner-up")?1:-1,event):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var uiSpinner=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=uiSpinner.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*uiSpinner.height())&&uiSpinner.height()>0&&uiSpinner.height(uiSpinner.height()),this.options.disabled&&this.disable()},_keydown:function(event){var options=this.options,keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.UP:return this._repeat(null,1,event),!0;case keyCode.DOWN:return this._repeat(null,-1,event),!0;case keyCode.PAGE_UP:return this._repeat(null,options.page,event),!0;case keyCode.PAGE_DOWN:return this._repeat(null,-options.page,event),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>&#9660;</span></a>"},_start:function(event){return this.spinning||this._trigger("start",event)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(i,steps,event){i=i||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,steps,event)},i),this._spin(steps*this.options.step,event)},_spin:function(step,event){var value=this.value()||0;this.counter||(this.counter=1),value=this._adjustValue(value+step*this._increment(this.counter)),this.spinning&&this._trigger("spin",event,{value:value})===!1||(this._value(value),this.counter++)},_increment:function(i){var incremental=this.options.incremental;return incremental?$.isFunction(incremental)?incremental(i):Math.floor(i*i*i/5e4-i*i/500+17*i/200+1):1},_precision:function(){var precision=this._precisionOf(this.options.step);return null!==this.options.min&&(precision=Math.max(precision,this._precisionOf(this.options.min))),precision},_precisionOf:function(num){var str=num.toString(),decimal=str.indexOf(".");return-1===decimal?0:str.length-decimal-1},_adjustValue:function(value){var base,aboveMin,options=this.options;return base=null!==options.min?options.min:0,aboveMin=value-base,aboveMin=Math.round(aboveMin/options.step)*options.step,value=base+aboveMin,value=parseFloat(value.toFixed(this._precision())),null!==options.max&&value>options.max?options.max:null!==options.min&&value<options.min?options.min:value},_stop:function(event){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",event))},_setOption:function(key,value){if("culture"===key||"numberFormat"===key){var prevValue=this._parse(this.element.val());return this.options[key]=value,void this.element.val(this._format(prevValue))}"max"!==key&&"min"!==key&&"step"!==key||"string"==typeof value&&(value=this._parse(value)),"icons"===key&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(value.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(value.down)),this._super(key,value),"disabled"===key&&(this.widget().toggleClass("ui-state-disabled",!!value),this.element.prop("disabled",!!value),this.buttons.button(value?"disable":"enable"))},_setOptions:spinner_modifier(function(options){this._super(options)}),_parse:function(val){return"string"==typeof val&&""!==val&&(val=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(val,10,this.options.culture):+val),""===val||isNaN(val)?null:val},_format:function(value){return""===value?"":window.Globalize&&this.options.numberFormat?Globalize.format(value,this.options.numberFormat,this.options.culture):value},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var value=this.value();return null===value?!1:value===this._adjustValue(value)},_value:function(value,allowAny){var parsed;""!==value&&(parsed=this._parse(value),null!==parsed&&(allowAny||(parsed=this._adjustValue(parsed)),value=this._format(parsed))),this.element.val(value),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:spinner_modifier(function(steps){this._stepUp(steps)}),_stepUp:function(steps){this._start()&&(this._spin((steps||1)*this.options.step),this._stop())},stepDown:spinner_modifier(function(steps){this._stepDown(steps)}),_stepDown:function(steps){this._start()&&(this._spin((steps||1)*-this.options.step),this._stop())},pageUp:spinner_modifier(function(pages){this._stepUp((pages||1)*this.options.page)}),pageDown:spinner_modifier(function(pages){this._stepDown((pages||1)*this.options.page)}),value:function(newVal){return arguments.length?void spinner_modifier(this._value).call(this,newVal):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),$.widget("ui.tabs",{version:"1.11.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var rhash=/#.*$/;return function(anchor){var anchorUrl,locationUrl;anchor=anchor.cloneNode(!1),anchorUrl=anchor.href.replace(rhash,""),locationUrl=location.href.replace(rhash,"");try{anchorUrl=decodeURIComponent(anchorUrl)}catch(error){}try{locationUrl=decodeURIComponent(locationUrl)}catch(error){}return anchor.hash.length>1&&anchorUrl===locationUrl}}(),_create:function(){var that=this,options=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",options.collapsible),this._processTabs(),options.active=this._initialActive(),$.isArray(options.disabled)&&(options.disabled=$.unique(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"),function(li){return that.tabs.index(li)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(options.active):this.active=$(),this._refresh(),this.active.length&&this.load(options.active)},_initialActive:function(){var active=this.options.active,collapsible=this.options.collapsible,locationHash=location.hash.substring(1);return null===active&&(locationHash&&this.tabs.each(function(i,tab){return $(tab).attr("aria-controls")===locationHash?(active=i,!1):void 0}),null===active&&(active=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==active&&-1!==active||(active=this.tabs.length?0:!1)),active!==!1&&(active=this.tabs.index(this.tabs.eq(active)),-1===active&&(active=collapsible?!1:0)),!collapsible&&active===!1&&this.anchors.length&&(active=0),active},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):$()}},_tabKeydown:function(event){var focusedTab=$(this.document[0].activeElement).closest("li"),selectedIndex=this.tabs.index(focusedTab),goingForward=!0;if(!this._handlePageNav(event)){switch(event.keyCode){case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:selectedIndex++;break;case $.ui.keyCode.UP:case $.ui.keyCode.LEFT:goingForward=!1,selectedIndex--;break;case $.ui.keyCode.END:selectedIndex=this.anchors.length-1;break;case $.ui.keyCode.HOME:selectedIndex=0;break;case $.ui.keyCode.SPACE:return event.preventDefault(),clearTimeout(this.activating),void this._activate(selectedIndex);case $.ui.keyCode.ENTER:return event.preventDefault(),clearTimeout(this.activating),void this._activate(selectedIndex===this.options.active?!1:selectedIndex);default:return}event.preventDefault(),clearTimeout(this.activating),selectedIndex=this._focusNextTab(selectedIndex,goingForward),event.ctrlKey||(focusedTab.attr("aria-selected","false"),this.tabs.eq(selectedIndex).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",selectedIndex)},this.delay))}},_panelKeydown:function(event){this._handlePageNav(event)||event.ctrlKey&&event.keyCode===$.ui.keyCode.UP&&(event.preventDefault(),this.active.focus())},_handlePageNav:function(event){return event.altKey&&event.keyCode===$.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):event.altKey&&event.keyCode===$.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(index,goingForward){function constrain(){return index>lastTabIndex&&(index=0),0>index&&(index=lastTabIndex),index}for(var lastTabIndex=this.tabs.length-1;-1!==$.inArray(constrain(),this.options.disabled);)index=goingForward?index+1:index-1;return index},_focusNextTab:function(index,goingForward){return index=this._findNextTab(index,goingForward),this.tabs.eq(index).focus(),index},_setOption:function(key,value){return"active"===key?void this._activate(value):"disabled"===key?void this._setupDisabled(value):(this._super(key,value),"collapsible"===key&&(this.element.toggleClass("ui-tabs-collapsible",value),value||this.options.active!==!1||this._activate(0)),"event"===key&&this._setupEvents(value),void("heightStyle"===key&&this._setupHeightStyle(value)))},_sanitizeSelector:function(hash){return hash?hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var options=this.options,lis=this.tablist.children(":has(a[href])");options.disabled=$.map(lis.filter(".ui-state-disabled"),function(tab){return lis.index(tab)}),this._processTabs(),options.active!==!1&&this.anchors.length?this.active.length&&!$.contains(this.tablist[0],this.active[0])?this.tabs.length===options.disabled.length?(options.active=!1,this.active=$()):this._activate(this._findNextTab(Math.max(0,options.active-1),!1)):options.active=this.tabs.index(this.active):(options.active=!1,this.active=$()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var that=this,prevTabs=this.tabs,prevAnchors=this.anchors,prevPanels=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(event){$(this).is(".ui-state-disabled")&&event.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){$(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return $("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=$(),this.anchors.each(function(i,anchor){var selector,panel,panelId,anchorId=$(anchor).uniqueId().attr("id"),tab=$(anchor).closest("li"),originalAriaControls=tab.attr("aria-controls");that._isLocal(anchor)?(selector=anchor.hash,panelId=selector.substring(1),panel=that.element.find(that._sanitizeSelector(selector))):(panelId=tab.attr("aria-controls")||$({}).uniqueId()[0].id,selector="#"+panelId,panel=that.element.find(selector),panel.length||(panel=that._createPanel(panelId),panel.insertAfter(that.panels[i-1]||that.tablist)),panel.attr("aria-live","polite")),panel.length&&(that.panels=that.panels.add(panel)),originalAriaControls&&tab.data("ui-tabs-aria-controls",originalAriaControls),tab.attr({"aria-controls":panelId,"aria-labelledby":anchorId}),panel.attr("aria-labelledby",anchorId)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),prevTabs&&(this._off(prevTabs.not(this.tabs)),this._off(prevAnchors.not(this.anchors)),this._off(prevPanels.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(id){return $("<div>").attr("id",id).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(disabled){$.isArray(disabled)&&(disabled.length?disabled.length===this.anchors.length&&(disabled=!0):disabled=!1);for(var li,i=0;li=this.tabs[i];i++)disabled===!0||-1!==$.inArray(i,disabled)?$(li).addClass("ui-state-disabled").attr("aria-disabled","true"):$(li).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=disabled},_setupEvents:function(event){var events={};event&&$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(event){event.preventDefault()}}),this._on(this.anchors,events),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(heightStyle){var maxHeight,parent=this.element.parent();"fill"===heightStyle?(maxHeight=parent.height(),maxHeight-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");"absolute"!==position&&"fixed"!==position&&(maxHeight-=elem.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){maxHeight-=$(this).outerHeight(!0)}),this.panels.each(function(){$(this).height(Math.max(0,maxHeight-$(this).innerHeight()+$(this).height()))}).css("overflow","auto")):"auto"===heightStyle&&(maxHeight=0,this.panels.each(function(){maxHeight=Math.max(maxHeight,$(this).height("").height())}).height(maxHeight))},_eventHandler:function(event){var options=this.options,active=this.active,anchor=$(event.currentTarget),tab=anchor.closest("li"),clickedIsActive=tab[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():this._getPanelForTab(tab),toHide=active.length?this._getPanelForTab(active):$(),eventData={oldTab:active,oldPanel:toHide,newTab:collapsing?$():tab,newPanel:toShow};event.preventDefault(),tab.hasClass("ui-state-disabled")||tab.hasClass("ui-tabs-loading")||this.running||clickedIsActive&&!options.collapsible||this._trigger("beforeActivate",event,eventData)===!1||(options.active=collapsing?!1:this.tabs.index(tab),this.active=clickedIsActive?$():tab,this.xhr&&this.xhr.abort(),toHide.length||toShow.length||$.error("jQuery UI Tabs: Mismatching fragment identifier."),toShow.length&&this.load(this.tabs.index(tab),event),this._toggle(event,eventData))},_toggle:function(event,eventData){function complete(){that.running=!1,that._trigger("activate",event,eventData)}function show(){eventData.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),toShow.length&&that.options.show?that._show(toShow,that.options.show,complete):(toShow.show(),complete())}var that=this,toShow=eventData.newPanel,toHide=eventData.oldPanel;this.running=!0,toHide.length&&this.options.hide?this._hide(toHide,this.options.hide,function(){eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),show()}):(eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),toHide.hide(),show()),toHide.attr("aria-hidden","true"),eventData.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),toShow.length&&toHide.length?eventData.oldTab.attr("tabIndex",-1):toShow.length&&this.tabs.filter(function(){return 0===$(this).attr("tabIndex")}).attr("tabIndex",-1),toShow.attr("aria-hidden","false"),eventData.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(index){var anchor,active=this._findActive(index);active[0]!==this.active[0]&&(active.length||(active=this.active),anchor=active.find(".ui-tabs-anchor")[0],this._eventHandler({target:anchor,currentTarget:anchor,preventDefault:$.noop}))},_findActive:function(index){return index===!1?$():this.tabs.eq(index)},_getIndex:function(index){return"string"==typeof index&&(index=this.anchors.index(this.anchors.filter("[href$='"+index+"']"))),index},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){$.data(this,"ui-tabs-destroy")?$(this).remove():$(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var li=$(this),prev=li.data("ui-tabs-aria-controls");prev?li.attr("aria-controls",prev).removeData("ui-tabs-aria-controls"):li.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(index){var disabled=this.options.disabled;disabled!==!1&&(void 0===index?disabled=!1:(index=this._getIndex(index),disabled=$.isArray(disabled)?$.map(disabled,function(num){return num!==index?num:null}):$.map(this.tabs,function(li,num){return num!==index?num:null})),this._setupDisabled(disabled))},disable:function(index){var disabled=this.options.disabled;if(disabled!==!0){if(void 0===index)disabled=!0;else{if(index=this._getIndex(index),-1!==$.inArray(index,disabled))return;disabled=$.isArray(disabled)?$.merge([index],disabled).sort():[index]}this._setupDisabled(disabled)}},load:function(index,event){index=this._getIndex(index);var that=this,tab=this.tabs.eq(index),anchor=tab.find(".ui-tabs-anchor"),panel=this._getPanelForTab(tab),eventData={tab:tab,panel:panel};this._isLocal(anchor[0])||(this.xhr=$.ajax(this._ajaxSettings(anchor,event,eventData)),this.xhr&&"canceled"!==this.xhr.statusText&&(tab.addClass("ui-tabs-loading"),panel.attr("aria-busy","true"),this.xhr.success(function(response){setTimeout(function(){panel.html(response),that._trigger("load",event,eventData)},1)}).complete(function(jqXHR,status){setTimeout(function(){"abort"===status&&that.panels.stop(!1,!0),tab.removeClass("ui-tabs-loading"),panel.removeAttr("aria-busy"),jqXHR===that.xhr&&delete that.xhr},1)})))},_ajaxSettings:function(anchor,event,eventData){var that=this;return{url:anchor.attr("href"),beforeSend:function(jqXHR,settings){return that._trigger("beforeLoad",event,$.extend({jqXHR:jqXHR,ajaxSettings:settings},eventData))}}},_getPanelForTab:function(tab){var id=$(tab).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+id))}}),$.widget("ui.tooltip",{version:"1.11.2",options:{content:function(){var title=$(this).attr("title")||"";return $("<a>").text(title).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(elem,id){var describedby=(elem.attr("aria-describedby")||"").split(/\s+/);describedby.push(id),elem.data("ui-tooltip-id",id).attr("aria-describedby",$.trim(describedby.join(" ")))},_removeDescribedBy:function(elem){var id=elem.data("ui-tooltip-id"),describedby=(elem.attr("aria-describedby")||"").split(/\s+/),index=$.inArray(id,describedby);-1!==index&&describedby.splice(index,1),elem.removeData("ui-tooltip-id"),describedby=$.trim(describedby.join(" ")),describedby?elem.attr("aria-describedby",describedby):elem.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=$("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(key,value){var that=this;return"disabled"===key?(this[value?"_disable":"_enable"](),void(this.options[key]=value)):(this._super(key,value),void("content"===key&&$.each(this.tooltips,function(id,tooltipData){that._updateContent(tooltipData.element)})))},_disable:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur");event.target=event.currentTarget=tooltipData.element[0],that.close(event,!0)}),this.element.find(this.options.items).addBack().each(function(){var element=$(this);element.is("[title]")&&element.data("ui-tooltip-title",element.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var element=$(this);element.data("ui-tooltip-title")&&element.attr("title",element.data("ui-tooltip-title"))})},open:function(event){var that=this,target=$(event?event.target:this.element).closest(this.options.items);target.length&&!target.data("ui-tooltip-id")&&(target.attr("title")&&target.data("ui-tooltip-title",target.attr("title")),target.data("ui-tooltip-open",!0),event&&"mouseover"===event.type&&target.parents().each(function(){var blurEvent,parent=$(this);parent.data("ui-tooltip-open")&&(blurEvent=$.Event("blur"),blurEvent.target=blurEvent.currentTarget=this,that.close(blurEvent,!0)),parent.attr("title")&&(parent.uniqueId(),that.parents[this.id]={element:this,title:parent.attr("title")},parent.attr("title",""))}),this._updateContent(target,event))},_updateContent:function(target,event){var content,contentOption=this.options.content,that=this,eventType=event?event.type:null;return"string"==typeof contentOption?this._open(event,target,contentOption):(content=contentOption.call(target[0],function(response){target.data("ui-tooltip-open")&&that._delay(function(){event&&(event.type=eventType),this._open(event,target,response)})}),void(content&&this._open(event,target,content)))},_open:function(event,target,content){function position(event){positionOption.of=event,tooltip.is(":hidden")||tooltip.position(positionOption)}var tooltipData,tooltip,events,delayedShow,a11yContent,positionOption=$.extend({},this.options.position);if(content){if(tooltipData=this._find(target))return void tooltipData.tooltip.find(".ui-tooltip-content").html(content);target.is("[title]")&&(event&&"mouseover"===event.type?target.attr("title",""):target.removeAttr("title")),tooltipData=this._tooltip(target),tooltip=tooltipData.tooltip,this._addDescribedBy(target,tooltip.attr("id")),tooltip.find(".ui-tooltip-content").html(content),this.liveRegion.children().hide(),content.clone?(a11yContent=content.clone(),a11yContent.removeAttr("id").find("[id]").removeAttr("id")):a11yContent=content,$("<div>").html(a11yContent).appendTo(this.liveRegion),this.options.track&&event&&/^mouse/.test(event.type)?(this._on(this.document,{mousemove:position}),position(event)):tooltip.position($.extend({of:target},this.options.position)),tooltip.hide(),this._show(tooltip,this.options.show),this.options.show&&this.options.show.delay&&(delayedShow=this.delayedShow=setInterval(function(){tooltip.is(":visible")&&(position(positionOption.of),clearInterval(delayedShow))},$.fx.interval)),this._trigger("open",event,{tooltip:tooltip}),events={keyup:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){var fakeEvent=$.Event(event);fakeEvent.currentTarget=target[0],this.close(fakeEvent,!0)}}},target[0]!==this.element[0]&&(events.remove=function(){this._removeTooltip(tooltip)}),event&&"mouseover"!==event.type||(events.mouseleave="close"),event&&"focusin"!==event.type||(events.focusout="close"),this._on(!0,target,events)}},close:function(event){var tooltip,that=this,target=$(event?event.currentTarget:this.element),tooltipData=this._find(target);tooltipData&&(tooltip=tooltipData.tooltip,tooltipData.closing||(clearInterval(this.delayedShow),target.data("ui-tooltip-title")&&!target.attr("title")&&target.attr("title",target.data("ui-tooltip-title")),this._removeDescribedBy(target),tooltipData.hiding=!0,tooltip.stop(!0),this._hide(tooltip,this.options.hide,function(){that._removeTooltip($(this))}),target.removeData("ui-tooltip-open"),this._off(target,"mouseleave focusout keyup"),target[0]!==this.element[0]&&this._off(target,"remove"),this._off(this.document,"mousemove"),event&&"mouseleave"===event.type&&$.each(this.parents,function(id,parent){$(parent.element).attr("title",parent.title),delete that.parents[id]}),tooltipData.closing=!0,this._trigger("close",event,{tooltip:tooltip}),tooltipData.hiding||(tooltipData.closing=!1)))},_tooltip:function(element){var tooltip=$("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),id=tooltip.uniqueId().attr("id");return $("<div>").addClass("ui-tooltip-content").appendTo(tooltip),tooltip.appendTo(this.document[0].body),this.tooltips[id]={element:element,tooltip:tooltip}},_find:function(target){var id=target.data("ui-tooltip-id");return id?this.tooltips[id]:null},_removeTooltip:function(tooltip){tooltip.remove(),delete this.tooltips[tooltip.attr("id")]},_destroy:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur"),element=tooltipData.element;event.target=event.currentTarget=element[0],that.close(event,!0),$("#"+id).remove(),element.data("ui-tooltip-title")&&(element.attr("title")||element.attr("title",element.data("ui-tooltip-title")),element.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}),document.all?(-1!=navigator.userAgent.toLowerCase().indexOf("msie 5")?is_ie5=!0:is_ie5=!1,is_ie=!0,is_moz1_6=!1,is_mozilla=!1,is_ns4=!1):document.getElementById?(navigator.userAgent.toLowerCase().match("mozilla.*rv[:]1.6.*gecko")?is_moz1_6=!0:is_moz1_6=!1,is_ie=!1,is_ie5=!1,is_mozilla=!0,is_ns4=!1):document.layers&&(is_ie=!1,is_ie5=!1,is_moz1_6=!1,is_mozilla=!1,is_ns4=!0),"undefined"==typeof window.console&&(window.console={log:function(){},warn:function(){},error:function(){},
info:function(){}}),egw_seperateJavaScript=function(_html){for(var html=_html.html,in_pos=html.search(/<script/im),out_pos=html.search(/<\/script>/im);in_pos>-1&&out_pos>-1;){var js_str=html.substring(in_pos,out_pos+9);_html.js+=js_str,html=html.substring(0,in_pos)+html.substring(out_pos+9);var in_pos=html.search(/<script/im),out_pos=html.search(/<\/script>/im)}_html.html=html},window.egw_getFramework=function(){return"undefined"!=typeof window.framework?framework:"undefined"!=typeof window.parent.egw_getFramework&&window!=window.parent?window.parent.egw_getFramework():null},window.register_app_refresh=function(appname,refresh_func){var framework=window.egw_getFramework();null!=framework&&"function"==typeof framework.register_app_refresh?framework.register_app_refresh(appname,refresh_func):("function"!=typeof window.app_refresh&&(window.app_refresh=function(_msg,appname,_id,_type){window.app_refresh.registry[appname]&&window.app_refresh.registry[appname].call(this,_msg,appname,_id,_type)},window.app_refresh.registry={},window.app_refresh.registered=function(appname){return"function"==typeof window.app_refresh.registry[appname]}),window.app_refresh.registry[appname]=refresh_func)},$j(function(){$j(document).on("click",".uiaccountselection_trigger",function(){var selectBox=document.getElementById(this.id.replace(/(_multiple|_popup)$/,""));if(selectBox){var link=selectBox.getAttribute("data-popup-link");selectBox.multiple||this.id.match(/_popup$/)?window.open(link,"uiaccountsel","width=600,height=420,toolbar=no,scrollbars=yes,resizable=yes"):(selectBox.size=4,selectBox.multiple=!0,""==selectBox.options[0].value&&(selectBox.options[0]=null),$j(selectBox).hasClass("groupmembers")||$j(selectBox).hasClass("selectbox")?(this.style.display="none",selectBox.style.width="100%"):(this.src=egw.image("search"),this.title=egw.lang("Search accounts")))}}),$j(document).on("change","select.uiaccountselection",function(e){if("popup"==this.value){var link=this.getAttribute("data-popup-link");window.open(link,"uiaccountsel","width=600,height=420,toolbar=no,scrollbars=yes,resizable=yes"),e.preventDefault()}})});var egw_json_files={};$j(document).ready(function(){$j("script, link").each(function(){var file=!1;$j(this).attr("src")?file=$j(this).attr("src"):$j(this).attr("href")&&(file=$j(this).attr("href")),file&&(egw_json_files[file]=!0)})});var _egw_json_plugins=[];egw_json_request.prototype.setAppObject=function(_app){this.app=_app},egw_json_request.prototype._assembleAjaxUrl=function(_menuaction){var webserver_url=egw_topWindow().egw_webserverUrl;if("undefined"==typeof webserver_url)throw"Internal JS error, top window not found, webserver url could not be retrieved.";return webserver_url+"/json.php?menuaction="+_menuaction},egw_json_request.prototype.sendRequest=function(_async,_callback,_sender){egw.debug("warn","egw_json_request is deprecated\nUse egw.json(menuaction, parameters [,callback, context, async, sender]).sendRequest() instead."),this.sender=_sender,"undefined"!=typeof _callback&&(this.callback=_callback);var is_async=!0;"undefined"!=typeof _async&&(is_async=_async);var request_obj={json_data:egw.jsonEncode({request:{parameters:this.parameters}})};this.request=$j.ajax({url:this.url,async:is_async,context:this,data:request_obj,dataType:"json",type:"POST",success:this.handleResponse,error:function(_xmlhttp,_err){window.console.error("Ajax request to "+this.url+" failed: "+_err)}})},egw_json_request.prototype.abort=function(){this.request.abort()},egw_json_request.prototype.alertFunc=function(_message,_details){alert(_message),_details&&_egw_json_debug_log(_message,_details)},egw_json_request.prototype.jsonError=function(_msg,_e){var msg="EGW JSON Error: "+_msg;_egw_json_debug_log(msg,_e),this.alertHandler(msg)},egw_json_request.prototype.handleResponse=function(data,textStatus,XMLHttpRequest){if(this.handleResponseDone=!1,data&&data.response){var hasResponse=!1;if(egw&&egw().includeJS){for(var js_files=[],i=data.response.length-1;i>0;--i){var res=data.response[i];"js"==res.type&&"string"==typeof res.data&&(js_files.unshift(res.data),this.loadedJSFiles[res.data]=!1,data.response.splice(i,1))}js_files.length>0&&egw().includeJS(js_files,function(){for(var i=0;i<js_files.length;i++)this.loadedJSFiles[js_files[i]]=!0;this.checkLoadFinish()},this)}for(var i=0;i<data.response.length;i++)try{var res=data.response[i];switch(data.response[i].type){case"alert":if("undefined"==typeof res.data.message||"undefined"==typeof res.data.details)throw"Invalid parameters";this.alertHandler(res.data.message,res.data.details),hasResponse=!0;break;case"assign":if("undefined"==typeof res.data.id||"undefined"==typeof res.data.key||"undefined"==typeof res.data.value)throw"Invalid parameters";var obj=document.getElementById(res.data.id);obj&&(obj[res.data.key]=res.data.value,"innerHTML"==res.data.key&&egw_insertJS(res.data.value),hasResponse=!0);break;case"data":this.callback&&(this.callback.call(this.sender,res.data),hasResponse=!0);break;case"script":if("string"!=typeof res.data)throw"Invalid parameters";try{var func=new Function(res.data);func.call(window)}catch(e){e.code=res.data,_egw_json_debug_log(e)}hasResponse=!0;break;case"apply":if("string"==typeof res.data.func&&"function"==typeof window[res.data.func]){try{window[res.data.func].apply(window,res.data.parms)}catch(e){_egw_json_debug_log(e,{Function:res.data.func,Parameters:res.data.parms})}hasResponse=!0}else{if("string"!=typeof res.data.func||"app."!=res.data.func.substr(0,4)||!window.app)throw"Invalid parameters";var parts=res.data.func.split(".");if(3==parts.length&&"undefined"==typeof window.app[parts[1]]&&"function"==typeof window.app.classes[parts[1]]&&(window.app[parts[1]]=new window.app.classes[parts[1]]),3==parts.length&&"object"==typeof window.app[parts[1]]&&"function"==typeof window.app[parts[1]][parts[2]])try{this.context=window.app[parts[1]][parts[2]].apply(window.app[parts[1]],res.data.parms)}catch(e){_egw_json_debug_log(e,{Function:res.data.func,Parameters:res.data.parms})}hasResponse=!0}break;case"jquery":if("string"!=typeof res.data.select||"string"!=typeof res.data.func)throw"Invalid parameters";try{var jQueryObject=$j(res.data.select,this.context);jQueryObject[res.data.func].apply(jQueryObject,res.data.parms)}catch(e){_egw_json_debug_log(e,{Function:res.data.func,Parameters:res.data.parms})}hasResponse=!0;break;case"redirect":if("string"!=typeof res.data.url||"boolean"!=typeof res.data.global||"string"!=typeof res.data.app)throw"Invalid parameters";res.data.global|=res.data.url.indexOf("?cd=10")>0,res.data.global?egw_topWindow().location.href=res.data.url:egw_appWindowOpen(res.data.app,res.data.url),hasResponse=!0;break;case"css":if("string"!=typeof res.data)throw"Invalid parameters";if(!egw_json_files[res.data]){egw_json_files[res.data]=!0;var headID=document.getElementsByTagName("head")[0],cssnode=document.createElement("link");cssnode.type="text/css",cssnode.rel="stylesheet",cssnode.href=res.data,headID.appendChild(cssnode)}hasResponse=!0;break;case"js":if("string"!=typeof res.data)throw"Invalid parameters";if(!egw_json_files[res.data]){egw_json_files[res.data]=!0;var headID=document.getElementsByTagName("head")[0],scriptnode=document.createElement("script");scriptnode.type="text/javascript",scriptnode.src=res.data,scriptnode._originalSrc=res.data,headID.appendChild(scriptnode),this.loadedJSFiles[res.data]=!1,"undefined"!=typeof console&&"undefined"!=typeof console.log&&console.log("Requested JS file '%s' from server",res.data);var self=this;scriptnode.onload=function(e){var file=e.target._originalSrc;"undefined"!=typeof console&&"undefined"!=typeof console.log&&console.log("Retrieved JS file '%s' from server",file),self.loadedJSFiles[file]=!0,self.checkLoadFinish()},"undefined"!=typeof scriptnode.readyState&&("complete"!=scriptnode.readyState&&"loaded"!=scriptnode.readyState?scriptnode.onreadystatechange=function(){var node=window.event.srcElement;if("complete"==node.readyState||"loaded"==node.readyState){var file=node._originalSrc;"undefined"!=typeof console&&"undefined"!=typeof console.log&&console.log("Retrieved JS file '%s' from server",[file]),self.loadedJSFiles[file]=!0,self.checkLoadFinish()}}:this.loadedJSFiles[res.data]=!0)}hasResponse=!0;break;case"error":if("string"!=typeof res.data)throw"Invalid parameters";this.jsonError(res.data),hasResponse=!0}hasResponse|=_egw_json_plugin_handle(data.response[i].type,res,this.context)}catch(e){this.jsonError("Internal JSON handler error",e)}!hasResponse&&this.callback&&data.response[i]&&this.callback.call(this.sender,data.response[i].data),this.handleResponseDone=!0,this.checkLoadFinish()}},egw_json_request.prototype.checkLoadFinish=function(){var complete=!0;for(var key in this.loadedJSFiles)complete=complete&&this.loadedJSFiles[key];complete&&this.onLoadFinish&&this.handleResponseDone&&this.onLoadFinish.call(this.sender)},_xajax_doXMLHTTP=function(_async,_menuaction,_arguments){egw.debug("warn","Function %s is deprecated",arguments.callee.name);for(var paramarray=new Array,i=1;i<_arguments.length;i++)paramarray[paramarray.length]=_arguments[i];var request=new egw_json_request(_menuaction,paramarray);return request.sendRequest(_async),request},xajax_doXMLHTTP=function(_menuaction){return _xajax_doXMLHTTP(!0,_menuaction,arguments)},xajax_doXMLHTTPsync=function(_menuaction){return _xajax_doXMLHTTP(!1,_menuaction,arguments)},window.xajax={getFormValues:function(_form){return egw_json_getFormValues(_form)}},function(){"use strict";function cloneObject(_obj){var result={};for(var key in _obj)result[key]=_obj[key];return result}function mergeObjects(_to,_from){for(var key in _from)_to[key]=_from[key]}function deleteWhere(_arr,_cond){for(var i=_arr.length-1;i>=0;i--)_cond(_arr[i])&&_arr.splice(i,1)}function getAppModules(_egw,_modules,_moduleInstances,_app){if("undefined"==typeof _moduleInstances.app[_app]){var modInsts={};_moduleInstances.app[_app]=modInsts;for(var key in _modules){var mod=_modules[key];mod.flags===_egw.MODULE_APP_LOCAL&&"undefined"==typeof modInsts[key]&&(modInsts[key]=mod.code.call(_egw,_app,window))}}return _moduleInstances.app[_app]}function getExistingWndModules(_moduleInstances,_window){for(var i=0;i<_moduleInstances.wnd.length;i++)if(_moduleInstances.wnd[i].window===_window)return _moduleInstances.wnd[i].modules;return null}function getWndModules(_egw,_modules,_moduleInstances,_instances,_window){var mods=getExistingWndModules(_moduleInstances,_window);if(mods)return mods;mods={},_moduleInstances.wnd.push({window:_window,modules:mods});var fnct=function(){cleanupEgwInstances(_instances,_moduleInstances,function(_w){return _w.window===_window})};_window.attachEvent?_window.attachEvent("onbeforeunload",fnct):_window.addEventListener("beforeunload",fnct,!1);for(var key in _modules){var mod=_modules[key];mod.flags===_egw.MODULE_WND_LOCAL&&"undefined"==typeof mods[key]&&(mods[key]=mod.code.call(_egw,null,_window))}return mods}function createEgwInstance(_egw,_modules,_moduleInstances,_list,_instances,_app,_window){var instance=cloneObject(_egw);if(_window=_window?_window:null,_app=_app?_app:null,instance.appName=_app,instance.window=_window,_list.push({instance:instance,window:_window,app:_app}),_app){var appModules=getAppModules(_egw,_modules,_moduleInstances,_app);for(var key in appModules)mergeObjects(instance,appModules[key])}if(_window){var wndModules=getWndModules(_egw,_modules,_moduleInstances,_instances,_window);for(var key in wndModules)mergeObjects(instance,wndModules[key])}return instance}function getEgwInstance(_egw,_modules,_moduleInstances,_instances,_app,_window){var hash=_app?_app:"~global~";if(_window=_window?_window:null,"undefined"==typeof _instances[hash])return _instances[hash]=[],createEgwInstance(_egw,_modules,_moduleInstances,_instances[hash],_instances,_app,_window);for(var i=0;i<_instances[hash].length;i++)if(_instances[hash][i].window===_window)return _instances[hash][i].instance;return createEgwInstance(_egw,_modules,_moduleInstances,_instances[hash],_instances,_app,_window)}function cleanupEgwInstances(_instances,_moduleInstances,_cond){for(var key in _instances)deleteWhere(_instances[key],_cond),0===_instances[key].length&&delete _instances[key];deleteWhere(_moduleInstances.wnd,_cond)}function mergeGlobalModule(_module,_code,_instances,_moduleInstances){var globalExtension=_code.call(egw,null,window);_moduleInstances.glo[_module]=globalExtension;for(var key in _instances)for(var i=0;i<_instances[key].length;i++)mergeObjects(_instances[key][i].instance,globalExtension)}function mergeAppLocalModule(_module,_code,_instances,_moduleInstances){var globalExtension=_code.call(egw,null,window);_moduleInstances.glo[_module]=globalExtension;for(var i=0;i<_instances["~global~"].length;i++)mergeObjects(_instances["~global~"][i].instance,globalExtension);for(var key in _moduleInstances.app){var appExtension=_code.call(egw,key,window);_moduleInstances.app[key][_module]=appExtension;for(var i=0;i<_instances[key].length;i++)mergeObjects(_instances[key][i].instance,appExtension)}}function mergeWndLocalModule(_module,_code,_instances,_moduleInstances){for(var i=0;i<_moduleInstances.wnd.length;i++){var wnd=_moduleInstances.wnd[i].window,wndExtension=_code.call(egw,null,wnd);_moduleInstances.wnd[i].modules[_module]=wndExtension;for(var key in _instances)for(var j=0;j<_instances[key].length;j++)_instances[key][j].window===wnd&&mergeObjects(_instances[key][j].instance,wndExtension)}}if("undefined"!=typeof window.egw&&window.egw.prefsOnly){var prefs=window.egw;delete prefs.prefsOnly;var modules={},moduleInstances={app:{},wnd:[],glo:{}},instances={};window.setInterval(function(){cleanupEgwInstances(instances,moduleInstances,function(w){try{return w.window&&w.window.closed}catch(e){return!0}})},1e4);var egw=function(){var _app=null,_window=window;switch(arguments.length){case 0:return instances["~global~"][0].instance;case 1:"string"==typeof arguments[0]?_app=arguments[0]:"object"==typeof arguments[0]&&(_window=arguments[0]);break;case 2:_app=arguments[0],_window=arguments[1];break;default:throw"Invalid count of parameters"}return getEgwInstance(egw,modules,moduleInstances,instances,_app,_window)},globalEgw={MODULE_GLOBAL:0,MODULE_APP_LOCAL:1,MODULE_WND_LOCAL:2,appName:null,window:window,getAppName:function(){return this.appName?this.appName:"etemplate"},extend:function(_module,_flags,_code){if("undefined"==typeof modules[_module])switch(modules[_module]={code:_code,flags:_flags,name:_module},_flags){case egw.MODULE_GLOBAL:mergeGlobalModule(_module,_code,instances,moduleInstances);break;case egw.MODULE_APP_LOCAL:mergeAppLocalModule(_module,_code,instances,moduleInstances);break;case egw.MODULE_WND_LOCAL:mergeWndLocalModule(_module,_code,instances,moduleInstances)}},module:function(_module,_for){if("undefined"!=typeof modules[_module]){if(!_for)return moduleInstances.glo[_module];if("string"==typeof _for&&"undefined"!=typeof moduleInstances.app[_for]){var mods=moduleInstances.app[_for];if("undefined"==typeof mods[_module]){var mod=modules[_module];mods[_module]=mod.code.call(this,_app,window)}return mods[_module]}if("object"==typeof _for){var mods=getExistingWndModules(moduleInstances,_for);if(null!=mods&&"undefined"!=typeof mods[_module])return mods[_module];if(null==mods&&(mods={}),"undefined"==typeof mods[_module]){var mod=modules[_module];mods[_module]=mod.code.call(this,null,_for)}return mods[_module]}}return null},constant:function(_module,_name,_value,_window){for(var i=0;i<moduleInstances.wnd.length;i++)_window&&_window!==moduleInstances.wnd[i].window||(moduleInstances.wnd[i].modules[_module][_name]=_value);for(var key in instances)for(var i=0;i<instances[key].length;i++)_window&&_window!==instances[key][i].window||(instances[key][i].instance[_name]=_value)},dumpModules:function(){return modules},dumpInstances:function(){return{instances:instances,moduleInstances:moduleInstances}}};mergeObjects(egw,globalEgw),mergeObjects(egw,prefs),moduleInstances.wnd.push({window:window,modules:[]}),instances["~global~"]=[{window:window,instance:egw,app:null}],this.egw=egw}}.call(window),egw.extend("debug",egw.MODULE_GLOBAL,function(_app,_wnd){"use strict";function log_on_client(_level,_args,_stack){if(!window.localStorage)return!1;switch(_level){case"warn":if(2>LOCAL_LOG_LEVEL)return null;case"info":if(3>LOCAL_LOG_LEVEL)return null;case"log":if(4>LOCAL_LOG_LEVEL)return null;default:if(!LOCAL_LOG_LEVEL)return null}var data={time:(new Date).getTime(),level:_level,args:_args};if("navigation"!=_level)if(_stack)data.stack=_stack;else try{throw new Error}catch(error){data.stack=error.stack}"undefined"==typeof window.localStorage[LASTLOG]&&(window.localStorage[LASTLOG]=0),window.localStorage[LASTLOG]>MAX_LOGS&&clear_client_log();try{window.localStorage[LOG_PREFIX+window.localStorage[LASTLOG]]=JSON.stringify(data),window.localStorage[LASTLOG]=(1+parseInt(window.localStorage[LASTLOG]))%MAX_LOGS}catch(e){switch(e.name){case"QuotaExceededError":case"NS_ERROR_DOM_QUOTA_REACHED":clear_client_log();break;default:for(var i=0;i<data.args.length;++i)try{JSON.stringify(data.args[i])}catch(e){if(data.args[i]instanceof Class){data.args[i]=jQuery.extend({},data.args[i]),delete data.args[i]._parent,delete data.args[i]._children;try{JSON.stringify(data.args[i]);continue}catch(e){}}data.args[i]="** removed, circular reference **"}}try{window.localStorage[LOG_PREFIX+window.localStorage[LASTLOG]]=JSON.stringify(data),window.localStorage[LASTLOG]=(1+parseInt(window.localStorage[LASTLOG]))%MAX_LOGS}catch(e){}}}function get_client_log(){var logs=[];if(window.localStorage&&"undefined"!=typeof window.localStorage[LASTLOG])for(var lastlog=parseInt(window.localStorage[LASTLOG]),i=lastlog;lastlog+MAX_LOGS>i;++i){var log=window.localStorage[LOG_PREFIX+i%MAX_LOGS];if("undefined"!=typeof log)try{logs.push(JSON.parse(log))}catch(e){}}return logs}function clear_client_log(){if(jQuery("#topmenu_info_error").remove(),!window.localStorage)return!1;var max=MAX_LOGS;window.localStorage[LASTLOG]>MAX_LOGS&&(max=1e3);for(var i=0;max>i;++i)"undefined"!=typeof window.localStorage[LOG_PREFIX+i]&&delete window.localStorage[LOG_PREFIX+i];return delete window.localStorage[LASTLOG],!0}function format_message(log){var row=document.createElement("tr");row.setAttribute("class",log.level);var timestamp=row.insertCell(-1);timestamp.appendChild(document.createTextNode(new Date(log.time))),timestamp.setAttribute("class","timestamp");var level=row.insertCell(-1);level.appendChild(document.createTextNode(log.level)),level.setAttribute("class","level");for(var message=row.insertCell(-1),i=0;i<log.args.length;i++){var arg=document.createElement("p");arg.appendChild(document.createTextNode("string"==typeof log.args[i]?log.args[i]:JSON.stringify(log.args[i]))),message.appendChild(arg)}var stack=row.insertCell(-1);return stack.appendChild(document.createTextNode(log.stack||"")),stack.setAttribute("class","stack"),row}function raise_error(){var icon=jQuery("#topmenu_info_error");if(!icon.length){var icon=jQuery(egw(_wnd).image_element(egw.image("dialog_error")));icon.addClass("topmenu_info_item").attr("id","topmenu_info_error"),icon.on("click",egw(_wnd).show_log),jQuery("#egw_fw_topmenu_info_items,#topmenu_info").append(icon)}}var DEBUGLEVEL=3,LOCAL_LOG_LEVEL=0,MAX_LOGS=200,LASTLOG="lastLog",LOG_PREFIX="log_";return LOCAL_LOG_LEVEL&&jQuery(_wnd).on("error",function(e){var event="object"==typeof e.originalEvent?e.originalEvent:e;if(navigator.userAgent.match(/Trident/i)&&"undefined"==typeof event.name&&"[object ErrorEvent]"==Object.prototype.toString.call(event)&&1==event.lineno&&-1!=event.filename.indexOf("/index.php"))return!1;if(log_on_client("error",[event.message],"undefined"!=typeof event.stack?event.stack:null),raise_error(),"object"==typeof event.error)throw event.error;throw event.message}),{debug_level:function(){return DEBUGLEVEL},debug:function(_level){if("undefined"!=typeof _wnd.console){for(var args=[],i=1;i<arguments.length;i++)args.push(arguments[i]);if(DEBUGLEVEL>=5&&"undefined"!=typeof(new Error).stack){var stack=(new Error).stack;args.push(stack)}"log"==_level&&DEBUGLEVEL>=4&&"function"==typeof _wnd.console.log&&_wnd.console.log.apply(_wnd.console,args),"info"==_level&&DEBUGLEVEL>=3&&"function"==typeof _wnd.console.info&&_wnd.console.info.apply(_wnd.console,args),"warn"==_level&&DEBUGLEVEL>=2&&"function"==typeof _wnd.console.warn&&_wnd.console.warn.apply(_wnd.console,args),"error"==_level&&DEBUGLEVEL>=1&&"function"==typeof _wnd.console.error&&_wnd.console.error.apply(_wnd.console,args)}LOCAL_LOG_LEVEL&&"error"==_level&&raise_error(args),"undefined"!=typeof stack&&args.pop(),log_on_client(_level,args)},show_log:function(){for(var table=document.createElement("table"),body=document.createElement("tbody"),client_log=get_client_log(),i=0;i<client_log.length;i++)body.appendChild(format_message(client_log[i]));table.appendChild(body);var wrapper=document.createElement("div");if(wrapper.setAttribute("class","client_error_log"),wrapper.appendChild(table),window.jQuery&&window.jQuery.ui.dialog){var $wrapper=$j(wrapper);$j("tr",$wrapper).addClass("hidden").on("click",function(){$j(this).toggleClass("hidden",{}),$j(this).find(".stack").children().toggleClass("ui-icon ui-icon-circle-plus")}),$j("td",$wrapper).wrapInner("<div/>").filter(".stack").children().addClass("ui-icon ui-icon-circle-plus"),$wrapper.dialog({title:egw.lang("Error log"),buttons:[{text:egw.lang("OK"),click:function(){$j(this).dialog("close")}},{text:egw.lang("clear"),click:function(){clear_client_log(),$j(this).empty()}}],width:800,height:400}),$wrapper[0].scrollTop=$wrapper[0].scrollHeight}_wnd.console&&_wnd.console.log(get_client_log())}}}),egw.extend("preferences",egw.MODULE_GLOBAL,function(){"use strict";var prefs={};return{set_preferences:function(_data,_app,_need_clone){"undefined"==typeof _app?prefs=_need_clone?jQuery.extend(!0,{},_data):_data:prefs[_app]=jQuery.extend(!0,{},_data)},preference:function(_name,_app,_callback,_context){if("undefined"==typeof _app&&(_app="common"),"undefined"==typeof prefs[_app]){var request=this.json("home.egw_framework.ajax_get_preference.template",[_app],_callback,_context);if(request.sendRequest("function"==typeof _callback,"GET"),"undefined"==typeof prefs[_app]&&(prefs[_app]={}),"function"==typeof _callback)return!1}return"*"==_name?"object"==typeof prefs[_app]?jQuery.extend({},prefs[_app]):prefs[_app]:"object"==typeof prefs[_app][_name]&&null!==prefs[_app][_name]?jQuery.extend({},prefs[_app][_name]):prefs[_app][_name]},set_preference:function(_app,_name,_val,_callback){"undefined"!=typeof prefs[_app]&&prefs[_app][_name]===_val||(this.jsonq("home.egw_framework.ajax_set_preference.template",[_app,_name,_val],_callback),"undefined"!=typeof prefs[_app]&&(void 0===_val||""===_val||null===_val?delete prefs[_app][_name]:prefs[_app][_name]=_val))},show_preferences:function(name,apps){var current_app=this.app_name(),query={current_app:current_app};if($j.isArray(apps)&&-1==$j.inArray(current_app,apps)&&"prefs"!=name&&"acl"!=name||!$j.isArray(apps)&&("undefined"==typeof apps[current_app]||!apps[current_app]))egw_message(egw.lang("Not supported by current application!"),"warning");else{var url="/index.php";switch(name){case"prefs":query.menuaction="preferences.preferences_settings.index",-1!=$j.inArray(current_app,apps)&&(query.appname=current_app),egw.open_link(egw.link(url,query),"_blank","900x450");break;case"acl":query.menuaction="preferences.preferences_acl.index",-1!=$j.inArray(current_app,apps)&&(query.acl_app=current_app),egw.open_link(egw.link(url,query),"_blank","900x450");break;case"cats":if("object"==typeof apps[current_app])for(var key in apps[current_app])query[key]=encodeURIComponent(apps[current_app][key]);else query.menuaction="preferences.preferences_categories_ui.index",query.cats_app=current_app;egw.link_handler(egw.link(url,query),current_app)}}}}}),egw.extend("utils",egw.MODULE_GLOBAL,function(){"use strict";function json_escape_string(input){for(var len=input.length,res="",i=0;len>i;i++)switch(input.charAt(i)){case'"':res+='\\"';break;case"\n":res+="\\n";break;case"\r":res+="\\r";break;case"\\":res+="\\\\";break;case"/":res+="\\/";break;case"\b":res+="\\b";break;case"\f":res+="\\f";break;case" ":res+="\\t";break;default:res+=input.charAt(i)}return res}function json_encode_simple(input){switch(input.constructor){case String:return'"'+json_escape_string(input)+'"';case Number:return input.toString();case Boolean:return input?"true":"false";default:return null}}function json_encode(input){if(null==input||!input&&0==input.length)return"null";var simple_res=json_encode_simple(input);if(null!=simple_res)return simple_res;switch(input.constructor){case Array:var buf=[];for(var k in input)isNaN(k)||buf.push(json_encode(input[k]));return"["+buf.join(",")+"]";case Object:var buf=[];for(var k in input)buf.push(json_encode_simple(k)+":"+json_encode(input[k]));return"{"+buf.join(",")+"}";default:switch(typeof input){case"array":var buf=[];for(var k in input)isNaN(k)||buf.push(json_encode(input[k]));return"["+buf.join(",")+"]";case"object":var buf=[];for(var k in input)buf.push(json_encode_simple(k)+":"+json_encode(input[k]));return"{"+buf.join(",")+"}"}return"null"}}var uid_counter=0,utils={ajaxUrl:function(_menuaction){return this.webserverUrl+"/json.php?menuaction="+_menuaction},elemWindow:function(_elem){var res=_elem.ownerDocument.parentNode||_elem.ownerDocument.defaultView;return res},uid:function(){return(uid_counter++).toString(16)},decodePath:function(_path){return decodeURIComponent(_path)},encodePath:function(_path){for(var components=_path.split("/"),n=0;n<components.length;n++)components[n]=this.encodePathComponent(components[n]);return components.join("/")},encodePathComponent:function(_comp){return _comp.replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/\//g,"")},getHiddenDimensions:function(element,boolOuter){var $item=$j(element),props={position:"absolute",visibility:"hidden",display:"block"},dim={w:0,h:0,left:0,top:0},$hiddenParents=$item.parents().andSelf().not(":visible"),oldProps=[];return $hiddenParents.each(function(){var old={};for(var name in props)old[name]=this.style[name];$j(this).show(),oldProps.push(old)}),dim.w=boolOuter===!0?$item.outerWidth():$item.width(),dim.h=boolOuter===!0?$item.outerHeight():$item.height(),dim.top=$item.offset().top,dim.left=$item.offset().left,$hiddenParents.each(function(i){var old=oldProps[i];for(var name in props)this.style[name]=old[name]}),dim},storeWindow:function(appname,popup){if(popup.name&&!(["_blank"].indexOf(popup.name)>=0)){var _target_app=appname||this.appName||egw_appName||"common",open_windows=JSON.parse(this.getSessionItem(_target_app,"windows"))||{};open_windows[popup.name]=Date.now(),this.setSessionItem(_target_app,"windows",JSON.stringify(open_windows))}},getOpenWindows:function(appname,regex){var open_windows=JSON.parse(this.getSessionItem(appname,"windows"))||{};if("undefined"==typeof regex)return open_windows;var list=[],now=Date.now();for(var i in open_windows)now-open_windows[i]>5e3?egw.windowClosed(appname,i):i.match(regex)&&list.push(i);return list},windowClosed:function(appname,closed){var closed_name="string"==typeof closed?closed:closed.name,closed_window="string"==typeof closed?null:closed;window.setTimeout(function(){if(null==closed_window||closed_window.closed){var open_windows=JSON.parse(egw().getSessionItem(appname,"windows"))||{};delete open_windows[closed_name],egw.setSessionItem(appname,"windows",JSON.stringify(open_windows))}},100)}};return"undefined"!=typeof window.JSON&&"undefined"!=typeof window.JSON.stringify?utils.jsonEncode=JSON.stringify:utils.jsonEncode=json_encode,utils}),egw.extend("ready",egw.MODULE_WND_LOCAL,function(_app,_wnd){"use strict";function doReadyWaitFor(){if(!isReady){var uid=egw.uid();return readyPending[uid]=!0,readyPendingCnt++,readyProgressChange(),uid}return this.debug("warning","ready has already been called!"),null}function doReadyDone(_token){"undefined"!=typeof readyPending[_token]&&(delete readyPending[_token],readyPendingCnt--,readyDoneCnt++,readyProgressChange(),testCallReady())}function readyProgressChange(){for(var i=0;i<registeredProgress.length;i++)registeredProgress[i].callback.call(registeredProgress[i].context,readyDoneCnt,readyPendingCnt);egw.debug("log","Ready events, processed %s/%s",readyDoneCnt,readyPendingCnt+readyDoneCnt)}function readyEventHandler(){doReadyDone("readyEvent")}function testCallReady(){if(1>=readyPendingCnt&&!isReady){if(1===readyPendingCnt&&!readyPending.readyEvent)return;for(var isReady=0===readyPendingCnt,i=registeredCallbacks.length-1;i>=0;i--)(registeredCallbacks[i].before||0===readyPendingCnt)&&(registeredCallbacks[i].callback.call(registeredCallbacks[i].context),registeredCallbacks.splice(i,1))}}var egw=this,registeredCallbacks=[],registeredProgress=[],readyPending={readyEvent:!0},readyPendingCnt=1,readyDoneCnt=0,isReady=!1;return _wnd.document.addEventListener?(_wnd.document.addEventListener("DOMContentLoaded",readyEventHandler,!1),_wnd.addEventListener("load",readyEventHandler,!1)):_wnd.document.attachEvent&&(_wnd.document.attachEvent("onreadystatechange",readyEventHandler),_wnd.attachEvent("onload",readyEventHandler)),{readyWaitFor:function(){return doReadyWaitFor()},readyDone:function(_token){doReadyDone(_token)},ready:function(_callback,_context,_beforeDOMContentLoaded){isReady?setTimeout(function(){_callback.call(_context)},1):registeredCallbacks.push({callback:_callback,context:_context?_context:null,before:!!_beforeDOMContentLoaded})},readyProgress:function(_callback,_context){isReady?this.debug("warning","ready has already been called!"):registeredProgress.unshift({callback:_callback,context:_context?_context:null})},isReady:function(){return isReady}}}),egw.extend("files",egw.MODULE_WND_LOCAL,function(_app,_wnd){"use strict";function removeTS(_src){return _src.replace(/[?&][0-9]+&?/,"?").replace(/\?$/,"")}function files_from_bundles(_srcs){var files=[];"string"==typeof _srcs&&(_srcs=[_srcs]);for(var n=0;n<_srcs.length;++n){var file=_srcs[n];files.push(file.replace(min_js_regexp,".js"));var contains=file.match(bundle2files_regexp);if(contains&&contains.length>1)for(var bundle=contains[1].split(","),i=0;i<bundle.length;++i)files.push(bundle[i].replace(min_js_regexp,".js"))}return files}function strip_egw_url(_urls){var egw_url=egw.webserverUrl;"/"!=egw_url.charAt(egw_url.length-1)&&(egw_url+="/");for(var i=0;i<_urls.length;++i){var file=_urls[i],need_full_url="/"==egw_url[0]&&"http"==file.substr(0,4)?window.location.protocol+"//"+window.location.host:"",parts=file.split(need_full_url+egw_url);parts.length>1&&(parts.shift(),_urls[i]=parts.join(need_full_url+egw_url))}return _urls}for(var egw=this,bundle2files_regexp=/phpgwapi\/inc\/min\/\?b=[^&]+&f=([^&]+)/,min_js_regexp=/\.min\.js$/,files=[],tags=jQuery("script",_wnd.document),i=0;i<tags.length;++i)files.push(removeTS(tags[i].src));tags=jQuery('link[type="text/css"]',_wnd.document);for(var i=0;i<tags.length;++i)files.push(removeTS(tags[i].href));return files=strip_egw_url(files),files=files_from_bundles(files),{includeJS:function(_jsFiles,_callback,_context,_prefix){if("string"==typeof _jsFiles&&(_jsFiles=[_jsFiles]),_prefix)for(var i=0;i<_jsFiles.length;++i)"/"==_jsFiles[i].charAt(0)&&(_jsFiles[i]=_jsFiles[i].substr(1));else _jsFiles=strip_egw_url(_jsFiles),_prefix=egw.webserverUrl;"/"!=_prefix.charAt(_prefix.length-1)&&(_prefix+="/");for(var i=0;i<_jsFiles.length;++i){var file=_jsFiles[i];this.included(file,!0)&&(_jsFiles.splice(i,1),i--)}return _jsFiles.length?void(egw_LAB||$LAB.setOptions({AlwaysPreserveOrder:!0,BasePath:_prefix})).script(_jsFiles).wait(function(){_callback.call(_context)}):void egw_LAB.wait(function(){_callback.call(_context)})},included:function(_file,_add_if_not){var file=removeTS(_file).replace(min_js_regexp,".js"),not_inc=-1==files.indexOf(file);return not_inc&&_add_if_not&&(files=files.concat(files_from_bundles(file))),!not_inc},includeCSS:function(_cssFiles){"string"==typeof _cssFiles&&(_cssFiles=[_cssFiles]),
_cssFiles=strip_egw_url(_cssFiles);for(var n=0;n<_cssFiles.length;++n){var file=_cssFiles[n];if(!this.included(file,!0)){var cssnode=_wnd.document.createElement("link");cssnode.type="text/css",cssnode.rel="stylesheet",cssnode.href=egw.webserverUrl+"/"+file;var head=_wnd.document.getElementsByTagName("head")[0];head.appendChild(cssnode)}}}}}),egw.extend("lang",egw.MODULE_GLOBAL,function(){"use strict";var lang_arr={};return{set_lang_arr:function(_app,_messages,_need_clone){jQuery.isArray(_messages)||(lang_arr[_app]=_need_clone?jQuery.extend({},_messages):_messages)},lang:function(_msg,_arg1){if(null===_msg)return"";if("string"!=typeof _msg&&_msg)return egw().debug("warn","Cannot translate an object",_msg),_msg;var translation=_msg;_msg=_msg.toLowerCase();for(var apps=this.lang_order||["custom",this.getAppName(),"etemplate","common"],i=0;i<apps.length;++i)if("undefined"!=typeof lang_arr[apps[i]]&&"undefined"!=typeof lang_arr[apps[i]][_msg]){translation=lang_arr[apps[i]][_msg];break}if(1==arguments.length)return translation;if(2==arguments.length)return translation.replace("%1",arguments[1]);translation=translation.replace(/%([0-9]+)/g,"|%$1|");for(var i=1;i<arguments.length;++i)translation=translation.replace("|%"+i+"|",arguments[i]);return translation},langRequireApp:function(_window,_appname,_callback,_context){var lang=egw.preference("lang"),langs=[{app:"common",lang:lang}];_appname&&"eGroupWare"!=_appname&&langs.push({app:_appname,lang:lang}),langs.push({app:"custom",lang:"en"}),egw.langRequire(_window,langs,_callback,_context)},langRequire:function(_window,_apps,_callback,_context){for(var ready=this.module("ready",_window),files=this.module("files",this.window),jss=[],apps=[],i=0;i<_apps.length;i++)"undefined"==typeof lang_arr[_apps[i].app]&&jss.push(this.webserverUrl+"/phpgwapi/lang.php?app="+_apps[i].app+"&lang="+_apps[i].lang+"&etag="+(_apps[i].etag||this.config("max_lang_time"))),apps.push(_apps[i].app);if(this!==egw&&apps.length>0&&(this.lang_order=apps.reverse()),jss.length>0)if("function"==typeof _callback)files.includeJS(jss,_callback,_context||null);else{var token=ready.readyWaitFor();files.includeJS(jss,function(){ready.readyDone(token)},this)}else"function"==typeof _callback&&_callback.call(_context||null)}}}),egw.extend("links",egw.MODULE_GLOBAL,function(){"use strict";var link_registry=void 0,title_cache={},title_queue={},title_uid=null;return{link_get_registry:function(_app,_name){if("object"!=typeof link_registry)return alert("egw.open() link registry is NOT defined!"),!1;if("undefined"==typeof link_registry[_app])return!1;var reg=link_registry[_app];if("undefined"==typeof reg[_name])switch(_name){case"name":reg.name=_app;break;case"icon":var app_data=this.app(_app);"undefined"!=typeof app_data&&"undefined"!=typeof app_data.icon&&null!=app_data.icon?reg.icon=("undefined"!=typeof app_data.icon_app?app_data.icon_app:_app)+"/"+app_data.icon:reg.icon=_app+"/navbar"}return reg&&"undefined"==typeof _name?reg:"undefined"==typeof reg[_name]?!1:reg[_name]},get_mime_info:function(_type){var wildcard_mime;for(var app in link_registry){var reg=link_registry[app];if("undefined"!=typeof reg.mime)for(var mime in reg.mime){if(mime==_type)return reg.mime[_type];"/"==mime[0]&&_type.match(new RegExp(mime.substring(1,mime.length-1),"i"))&&(wildcard_mime=reg.mime[mime])}}return wildcard_mime?wildcard_mime:null},mime_open:function(_path,_type){var path;"object"==typeof _path?(path="undefined"==typeof _path.path?"/apps/"+_path.app2+"/"+_path.id2+"/"+_path.id:_path.path,"string"==typeof _path.type&&(_type=_path.type)):"/"!=_path[0]||(path=_path);var mime_info=this.get_mime_info(_type);if(mime_info){var data={};for(var attr in mime_info)switch(attr){case"mime_url":data[mime_info.mime_url]="vfs://default"+path;break;case"mime_data":break;case"mime_type":data[mime_info.mime_type]=_type;break;case"mime_id":data[mime_info.mime_id]=path;break;default:data[attr]=mime_info[attr]}"undefined"==typeof mime_info.mime_url&&(data.url="object"==typeof _path&&_path.download_url?_path.download_url:"/webdav.php"+path)}else var data="object"==typeof _path&&_path.download_url?_path.download_url:"/webdav.php"+path;return data},link_app_list:function(_must_support){var apps=[];for(var type in link_registry){var reg=link_registry[type];if("undefined"==typeof _must_support||!_must_support||"undefined"!=typeof reg[_must_support]){var app_sub=type.split("-");this.app(app_sub[0])&&apps.push({type:type,label:this.lang(this.link_get_registry(type,"name"))})}}apps=apps.sort(function(_a,_b){var al=_a.label.toUpperCase(),bl=_b.label.toUpperCase();return al==bl?0:al>bl?1:-1});for(var sorted={},i=0;i<apps.length;++i)sorted[apps[i].type]=apps[i].label;return sorted},set_link_registry:function(_registry,_app,_need_clone){"undefined"==typeof _app?link_registry=_need_clone?jQuery.extend(!0,{},_registry):_registry:link_registry[_app]=_need_clone?jQuery.extend(!0,{},_registry):_registry},link:function(_url,_extravars){if("http"==_url.substr(0,4)&&_url.indexOf("://")<=5);else{if("/"!=_url[0]){alert("egw.link('"+_url+"') called with url starting NOT with a slash!");var app=window.egw_appName;"login"!=app&&"logout"!=app&&(_url=app+"/"+_url)}this.webserverUrl&&"/"!=this.webserverUrl&&0!=_url.indexOf(this.webserverUrl+"/")&&(_url=this.webserverUrl+_url)}var vars={},url_othervars=_url.split("?",2);_url=url_othervars[0];var othervars=url_othervars[1];if(_extravars&&"object"==typeof _extravars?($j.extend(vars,_extravars),_extravars=othervars):(_extravars||(_extravars=""),othervars&&(_extravars+=(_extravars?"&":"")+othervars)),_extravars){_extravars=_extravars.split("&");for(var i=0;i<_extravars.length;++i){var name_val=_extravars[i].split("=",2),name=name_val[0],val=name_val[1]||"";-1!=val.indexOf("%26")&&(val=val.replace(/%26/g,"&")),name.lastIndexOf("[]")==name.length-2?(name=name.substr(0,name.length-2),"undefined"==typeof vars[name]&&(vars[name]=[]),vars[name].push(val)):vars[name]=val}}var query=[],ajax=vars.ajax||!1;delete vars.ajax;for(var name in vars){var val=vars[name]||"";if("object"==typeof val)for(var i=0;i<val.length;++i)query.push(name+"[]="+encodeURIComponent(val[i]));else query.push(name+"="+encodeURIComponent(val))}return ajax&&query.push("ajax="+encodeURIComponent(ajax)),query.length?_url+"?"+query.join("&"):_url},link_title:function(_app,_id,_callback,_context,_force_reload){return"undefined"!=typeof title_cache[_app]&&"undefined"!=typeof title_cache[_app][_id]&&_force_reload!==!0?("function"==typeof _callback&&_callback.call(_context,title_cache[_app][_id]),title_cache[_app][_id]):"function"!=typeof _callback?null:("undefined"==typeof title_queue[_app]&&(title_queue[_app]={}),"undefined"==typeof title_queue[_app][_id]&&(title_queue[_app][_id]=[]),title_queue[_app][_id].push({callback:_callback,context:_context}),void(null==title_uid&&(title_uid=this.jsonq(_app+".etemplate_widget_link.ajax_link_titles.etemplate",[{}],this.link_title_callback,this,this.link_title_before_send))))},link_title_before_send:function(_params){for(var app in title_queue)for(var id in title_queue[app])"undefined"==typeof _params[0][app]&&(_params[0][app]=[]),_params[0][app].push(id);title_uid=null},link_title_callback:function(_response){if("object"!=typeof _response)throw"Wrong parameter for egw.link_title_callback!";for(var app in _response){"object"!=typeof title_cache[app]&&(title_cache[app]={});for(var id in _response[app]){var title=_response[app][id];if(title_cache[app][id]=title,"undefined"!=typeof title_queue[app]&&"undefined"!=typeof title_queue[app][id]){for(var i=0;i<title_queue[app][id].length;++i){var callback=title_queue[app][id][i];callback.callback.call(callback.context,title)}delete title_queue[app][id]}}}},link_quick_add:function(_parent){if(!document.getElementById("quick_add_selectbox")){var select=jQuery(document.createElement("select")).attr("id","quick_add_selectbox");jQuery("string"==typeof _parent?"#"+_parent:_parent).append(select);var self=this;select.change(function(){this.value&&self.open("",this.value,"add",{},void 0,this.value,!0),this.value=""}),this.langRequire(window,[{app:"common",lang:this.preference("lang")}],function(){select.append(jQuery(document.createElement("option")).attr("value","").text(self.lang("Add")+" ..."));var apps=self.link_app_list("add");for(var app in apps){var option=jQuery(document.createElement("option")).attr("value",app).text(self.lang(self.link_get_registry(app,"entry")||apps[app]));select.append(option)}})}}}}),egw.extend("open",egw.MODULE_WND_LOCAL,function(_egw,_wnd){"use strict";function mailto(uri){for(var index,match=[],mailto=uri.match(/^mailto:([^?]+)/)||[],hashes=uri.slice(uri.indexOf("?")+1).split("&"),i=0;i<hashes.length;i++)index=hashes[i].split("="),match.push(index[0]),match[index[0]]=index[1];var popup,content={to:mailto[1]||[],cc:match.cc||[],bcc:match.bcc||[]},compose=egw.getOpenWindows("mail",/(^compose_)||(^mail.compose)/);if(uri=uri.replace(/</g,"&lt;").replace(/>/g,"&gt;"),0==compose.length)if(uri.length>2083){popup=egw.open("","mail","add","","compose__","mail");var $tmpForm=jQuery(document.createElement("form")).appendTo("body"),$tmpInput=jQuery(document.createElement("input")).attr({name:"preset[mailto]",type:"text",value:uri}),$tmpSubmitInput=jQuery(document.createElement("input")).attr({type:"submit"});$tmpForm.attr({target:popup.name,action:"index.php?menuaction=mail.mail_compose.compose",method:"post"}).append($tmpInput).append($tmpSubmitInput),$tmpForm.submit(),$tmpForm.remove()}else egw.open("","mail","add",{"preset[mailto]":uri},"compose__","mail");if(1==compose.length)try{popup=egw.open_link("",compose[0],"100x100","mail"),popup.app.mail.setCompose(compose[0],content)}catch(e){egw.debug("warn",e.message),popup.close(),egw.windowClosed("mail",popup),window.setTimeout(function(){egw.open_link(uri),console.debug("Trying again with ",uri)},500)}else if(compose.length>1){for(var prompt=$j(document.createElement("ul")),i=0;i<compose.length;i++){var w=window.open("",compose[i],"100x100");if(!w.closed){w.blur();var title=w.document.title||egw.lang("compose");$j("<li data-window = '"+compose[i]+"'>"+title+"</li>").click(function(){var w=egw.open_link("",$j(this).attr("data-window"),"100x100","mail");w.app.mail.setCompose(w.name,content),prompt.dialog("close")}).appendTo(prompt)}}_wnd.setTimeout(function(){this.focus()},200);var _buttons={};_buttons[egw.lang("cancel")]=function(){$j(this).dialog("close")},prompt.dialog({buttons:_buttons})}}return{open:function(id_data,app,type,extra,target,target_app,_check_popup_blocker){egw.debug("navigation","egw.open(id_data=%o, app=%s, type=%s, extra=%o, target=%s, target_app=%s)",id_data,app,type,extra,target,target_app);var id;if("undefined"==typeof target&&(target="_blank"),app)"file"!=app&&(id=id_data,id_data={id:id,app:app,extra:extra});else if("object"!=typeof id_data){var app_id=id_data.split(":",2);app=app_id[0],id=app_id[1]}else app=id_data.app,id=id_data.id,"undefined"!=typeof id_data.type&&(type=id_data.type);var url,popup,params;if("file"==app)url=this.mime_open(id_data),"object"==typeof url&&("undefined"!=typeof url.mime_popup&&(popup=url.mime_popup,delete url.mime_popup),"undefined"!=typeof url.mime_target&&(target=url.mime_target,delete url.mime_target),"string"==typeof url.url?url=url.url:(params=url,url="/index.php"));else{var app_registry=this.link_get_registry(app);if(!app||!app_registry)return void alert('egw.open() app "'+app+'" NOT defined in link registry!');if("undefined"==typeof type&&(type="edit"),"edit"==type&&"undefined"==typeof app_registry.edit&&(type="view"),"undefined"==typeof app_registry[type])return void alert('egw.open() type "'+type+'" is NOT defined in link registry for app "'+app+'"!');if(url="/index.php",params=jQuery.extend({},app_registry[type]),"view"==type||"edit"==type)params[app_registry[type+"_id"]]=id;else if("add"==type&&id){var app_id=id.split(":",2);params[app_registry.add_app]=app_id[0],params[app_registry.add_id]=app_id[1]}"string"==typeof extra?url+="?"+extra:"object"==typeof extra&&$j.extend(params,extra),popup=app_registry[type+"_popup"]}return this.open_link(this.link(url,params),target,popup,target_app,_check_popup_blocker)},open_link:function(_link,_target,_popup,_target_app,_check_popup_blocker,_mime_type){if(egw.debug("log","egw.open_link(_link=%s, _target=%s, _popup=%s, _target_app=%s)",_link,_target,_popup,_target_app),!_check_popup_blocker||!this._check_popupBlocker(_link,_target,_popup,_target_app)){var url=_link;if(0==url.indexOf("javascript:"))return void eval(url.substr(11));if(0==url.indexOf("mailto:"))return mailto(url);-1==url.indexOf("/")&&url.split(".").length>=3&&0!=url.indexOf("mailto:")&&0!=url.indexOf("/index.php")&&-1==url.indexOf("://")&&(url="/index.php?menuaction="+url),"/"==url[0]&&this.webserverUrl&&"/"!=this.webserverUrl&&0!=url.indexOf(this.webserverUrl+"/")&&(url=this.webserverUrl+url);var mime_info=_mime_type?this.get_mime_info(_mime_type):void 0;if(mime_info&&(mime_info.mime_url||mime_info.mime_data)){var data={};for(var attr in mime_info)switch(attr){case"mime_popup":_popup=mime_info.mime_popup;break;case"mime_target":_target=mime_info.mime_target;break;case"mime_type":data[mime_info.mime_type]=_mime_type;break;case"mime_data":data[mime_info[attr]]=_link;break;case"mime_url":data[mime_info[attr]]=url;break;default:data[attr]=mime_info[attr]}url=egw.link("/index.php",data)}else mime_info&&(mime_info.mime_popup&&(_popup=mime_info.mime_popup),mime_info.mime_target&&(_target=mime_info.mime_target));if(_popup){var w_h=_popup.split("x"),popup_window=this.openPopup(url,w_h[0],w_h[1],_target||"_blank",_target_app,!0);return egw().storeWindow(_target_app,popup_window),popup_window}return"undefined"==typeof _target||"_self"==_target||"undefined"!=typeof this.link_app_list()[_target]?("_self"==_target&&(_target=void 0),this.link_handler(url,_target)):("_browser"==_target&&(_target=egwIsMobile()?"_self":"_blank"),_wnd.open(url,_target))}},openPopup:function(_url,_width,_height,_windowName,_app,_returnID,_status,_skip_framework){if(egw.debug("navigation","openPopup(%s, %s, %s, %o, %s, %s)",_url,_windowName,_width,_height,_status,_app),"availHeight"==_height&&(_height=this.availHeight()),!_skip_framework&&_wnd.framework)return _wnd.framework.openPopup(_url,_width,_height,_windowName,_app,_returnID,_status,_wnd);"undefined"==typeof _app&&(_app=!1),"undefined"==typeof _returnID&&(_returnID=!1);var $wnd=jQuery(_wnd.top),positionLeft=$wnd.outerWidth()/2-_width/2+_wnd.screenX,positionTop=$wnd.outerHeight()/2-_height/2+_wnd.screenY;navigator.userAgent.match(/msie/i)&&(_windowName=_windowName?_windowName.replace(/[^a-zA-Z0-9_]+/,""):"_blank");var windowID=_wnd.open(_url,_windowName||"_blank","width="+_width+",height="+_height+",screenX="+positionLeft+",left="+positionLeft+",screenY="+positionTop+",top="+positionTop+",location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status="+_status);return windowID&&(windowID.egw=_wnd.egw),_returnID!==!1?windowID:void 0},availHeight:function(){return screen.availHeight<screen.height?navigator.userAgent.match(/windows/gi)?screen.availHeight-100:screen.availHeight:screen.height-100},link_handler:function(_url,_target){"admin"!==_target||_url.match(/menuaction=admin\.admin_ui\.index/)||(_url=_url.replace(/menuaction=([^&]+)/,"menuaction=admin.admin_ui.index&load=$1")),_wnd.framework?_wnd.framework.linkHandler(_url,_target):_wnd.location.href=_url},close:function(){_wnd.framework&&"function"==typeof _wnd.framework.popup_close?_wnd.framework.popup_close(_wnd):_wnd.close()},_check_popupBlocker:function(_link,_target,_popup,_target_app){var popup=window.open("","","top="+screen.height/2+",left="+screen.width/2+",width=1,height=1,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,dependent=yes");return popup&&"undefined"!=popup&&null!=popup?(popup.close(),!1):(et2_dialog.show_dialog(function(){window.egw.open_link(_link,_target,_popup,_target_app)},egw.lang("The browser popup blocker is on. Please click on OK button to see the pop-up.\n\nIf you would like to not see this message for the next time, allow your browser pop-up blocker to open popups from %1",window.location.hostname),"Popup Blocker Warning",{},et2_dialog.BUTTONS_OK,et2_dialog.WARNING_MESSAGE),!0)}}}),egw.extend("user",egw.MODULE_GLOBAL,function(){"use strict";var userData={apps:{}},accountStore={},accountData={};return{set_user:function(_data,_need_clone){userData=_need_clone?jQuery.extend(!0,{},_data):_data},user:function(_field){return userData[_field]},app:function(_app,_name){return"undefined"==typeof _name||"undefined"==typeof userData.apps[_app]?userData.apps[_app]:userData.apps[_app][_name]},accounts:function(type){"undefined"==typeof type&&(type="accounts");var list=[];return jQuery.isEmptyObject(accountStore)&&egw.json("home.egw_framework.ajax_user_list.template",[],function(data){accountStore=jQuery.extend(!0,{},data||{})}).sendRequest(),list="both"==type?list.concat(accountStore.accounts,accountStore.groups):list.concat(accountStore[type])},accountData:function(_account_ids,_field,_resolve_groups,_callback,_context){_field||(_field="account_email"),jQuery.isArray(_account_ids)||(_account_ids=[_account_ids]);for(var data={},i=0;i<_account_ids.length;++i){var account_id=_account_ids[i];if(account_id==userData.account_id)data[account_id]=userData[_field];else if("undefined"!=typeof accountData[account_id]&&"undefined"!=typeof accountData[account_id][_field]&&(!_resolve_groups||account_id>0))data[account_id]=accountData[account_id][_field];else{if(!("undefined"!=typeof accountData[account_id]&&"undefined"!=typeof accountData[account_id][_field]&&_resolve_groups&&0>account_id))continue;for(var id in accountData[account_id][_field])data[id]=accountData[account_id][_field][id]}_account_ids.splice(i--,1)}_account_ids.length?egw.json("home.egw_framework.ajax_account_data.template",[_account_ids,_field,_resolve_groups],function(_data){for(var account_id in _data)"undefined"==typeof accountData[account_id]&&(accountData[account_id]={}),data[account_id]=accountData[account_id][_field]=_data[account_id];if(_resolve_groups&&1===_account_ids.length&&_account_ids[0]<0){var group_id=_account_ids[0];"undefined"==typeof accountData[group_id]&&(accountData[group_id]={}),accountData[group_id][_field]=_data}_callback.call(_context,data)}).sendRequest():_callback.call(_context,data)},invalidate_account:function(_id,_type){if(_id?delete accountData[_id]:accountData={},!jQuery.isEmptyObject(accountStore))switch(_type){case"delete":case"edit":case"update":if(_id){for(var store=0>_id?accountStore.groups:accountStore.accounts,i=0;i<store.length;++i)if(store&&"undefined"!=typeof store[i]&&_id==store[i].value){"delete"==_type?delete store[i]:this.link_title("home-accounts",_id,function(_label){if(store[i].label=_label,0>_id)for(var j=0;j<accountStore.owngroups.length;++j)if(_id==accountStore.owngroups[j].value){accountStore.owngroups[j].label=_label;break}},this,!0);break}break}default:accountStore={}}}}}),egw.extend("config",egw.MODULE_GLOBAL,function(){"use strict";var configs={};return{config:function(_name,_app){return"undefined"==typeof _app&&(_app="phpgwapi"),"undefined"==typeof configs[_app]?null:configs[_app][_name]},set_configs:function(_configs,_need_clone){configs=_need_clone?jQuery.extend(!0,{},_configs):_configs}}}),egw.extend("images",egw.MODULE_GLOBAL,function(){"use strict";var images={},mime_alias_map={"text/vcard":"text/x-vcard","text/comma-separated-values":"text/csv","text/rtf":"application/rtf","text/xml":"application/xml","text/x-diff":"text/diff","application/x-jar":"application/java-archive","application/x-javascript":"application/javascript","application/x-troff":"text/troff","application/x-egroupware-etemplate":"application/xml"};return{set_images:function(_images,_need_clone){images=_need_clone?jQuery.extend(!0,{},_images):_images},image:function(_name,_app){var tries={};if("undefined"==typeof _app&&(_app=this.getAppName(),_name.indexOf("/")>0)){var split=_name.split("/",2);"dhtmlxtree"!==split[0]&&"egw_action"!==split[0]&&(_app=split[0],_name=split[1])}if(tries.vfs=_name,"undefined"!=typeof images.vfs&&"undefined"!=typeof images.vfs[_name])return this.webserverUrl+images.vfs[_name];if(tries[_app+("phpgwapi"==_app?" (current app)":"")]=_name,"undefined"!=typeof images[_app]&&"undefined"!=typeof images[_app][_name])return this.webserverUrl+images[_app][_name];if(tries.phpgwapi=_name,"undefined"!=typeof images.phpgwapi&&"undefined"!=typeof images.phpgwapi[_name])return this.webserverUrl+images.phpgwapi[_name];var matches=_name.match(/\.(png|gif|jpg)$/i);return matches?this.image(_name.replace(/.(png|gif|jpg)$/i,""),_app):(null!=matches&&(tries[_app+" (matched)"]=matches),egw.debug("log",'egw.image("'+_name+'", "'+_app+'") image NOT found! Tried ',tries),null)},mime_icon:function(_mime,_path,_size,_mtime){"undefined"==typeof _size&&(_size=128),_mime||(_mime="unknown"),"httpd/unix-directory"==_mime&&(_mime="directory");var type=_mime.toLowerCase().split("/"),image="egw"==type[0]?this.image("navbar",type[1]):void 0;if(image);else if("string"==typeof _path&&("image"==type[0]&&type[1].match(/^(png|jpe?g|gif|bmp)$/)||"application"==type[0]&&(0===type[1].indexOf("vnd.oasis.opendocument.")||"pdf"==type[1]||0===type[1].indexOf("vnd.openxmlformats-officedocument.")))){var params={path:_path,thsize:this.config("link_list_thumbnail")||64};_mtime&&(params.mtime=_mtime),image=this.link("/etemplate/thumbnail.php",params)}else"image"==type[0]&&"svg+xml"==type[1]?image=this.webserverUrl+"/webdav.php"+_path:"undefined"!=typeof type[1]&&((image=this.image("mime"+_size+"_"+type[0]+"_"+type[1],"etemplate"))||"undefined"!=typeof mime_alias_map[_mime]&&(image=this.mime_icon(mime_alias_map[_mime],_path,_size,_mtime)))||(image=this.image("mime"+_size+"_"+type[0],"etemplate"))||(image=this.image("mime"+_size+"_unknown","etemplate"));return image},image_element:function(_url,_alt){var icon;return icon=document.createElement("img"),_url&&(icon.src=_url),_alt&&(icon.alt=_alt),icon}}}),egw.extend("jsonq",egw.MODULE_GLOBAL,function(){"use strict";function jsonq_callback(_data){if("object"!=typeof _data)throw"jsonq_callback called with NO object as parameter!";if("undefined"==typeof _data.type){var json=egw.json("none");for(var uid in _data)if("undefined"!=typeof jsonq_queue[uid]){var job=jsonq_queue[uid],response=_data[uid];json.callback=job.callback,json.sender=job.sender,json.handleResponse({response:response}),delete jsonq_queue[uid]}else console.log("jsonq_callback received response for not existing queue uid="+uid+"!"),console.log(_data[uid]);jsonq_timer&&"object"!=typeof jsonq_queue["u"+(jsonq_uid-1)]&&(window.clearInterval(jsonq_timer),jsonq_timer=null)}}function jsonq_send(){if(jsonq_uid>0&&"object"==typeof jsonq_queue["u"+(jsonq_uid-1)]){var jobs_to_send={},something_to_send=!1;for(var uid in jsonq_queue){var job=jsonq_queue[uid];"send"!=job.menuaction&&("function"==typeof job.callbeforesend&&job.callbeforesend.call(job.sender,job.parameters),jobs_to_send[uid]={menuaction:job.menuaction,parameters:job.parameters},job.menuaction="send",job.parameters=null,something_to_send=!0)}if(something_to_send){var request=egw.json("home.queue",jobs_to_send,jsonq_callback,this);request.sendRequest(!0)}}}var jsonq_queue={},jsonq_uid=0,jsonq_timer=null;return{jsonq:function(_menuaction,_parameters,_callback,_sender,_callbeforesend){var uid="u"+jsonq_uid++;if(jsonq_queue[uid]={menuaction:_menuaction,parameters:_parameters?[].concat(_parameters):[],callback:_callback,sender:_sender,callbeforesend:_callbeforesend},null==jsonq_timer){var self=this;jsonq_timer=window.setInterval(function(){jsonq_send.call(self)},100)}return uid}}}),egw.extend("json",egw.MODULE_WND_LOCAL,function(_app,_wnd){"use strict";function json_request(_menuaction,_parameters,_callback,_context,_async,_sender,_egw){this.url=_egw.ajaxUrl(_menuaction),this.parameters=_parameters?[].concat(_parameters):[],this.async=_async?_async:!1,this.callback=_callback?_callback:null,this.context=_context?_context:null,this.sender=_sender?_sender:null,this.egw=_egw,this.request=null,this.onLoadFinish=null,this.jsFiles=0,this.jsCount=0,this.alertHandler=function(_message,_details){alert(_message),_details&&_egw.debug("info",_message,_details)}}var plugins={};"undefined"==typeof egw._global_json_handlers&&(egw._global_json_handlers={});var global_plugins=egw._global_json_handlers;json_request.prototype.sendRequest=function(async,method){"undefined"!=typeof async&&(this.async=async);var request_obj={json_data:this.egw.jsonEncode({request:{parameters:this.parameters}})};return this.request=(this.egw.window?this.egw.window.$j:$j).ajax({url:this.url,async:this.async,context:this,data:request_obj,dataType:"json",type:method||"POST",success:this.handleResponse,error:function(_xmlhttp,_err){"abort"!==_err&&(this.egw.message.call(this.egw,this.egw.lang("Ajax request failed")+": "+_xmlhttp.statusText+" ("+_xmlhttp.status+")\n\n"+this.egw.lang("Server error log should contain more information about the problem.")+"\n"+this.egw.lang("Trying it again will usually not help!")+"\n\nURL: "+this.url+"\n"+(_xmlhttp.getAllResponseHeaders()?_xmlhttp.getAllResponseHeaders().match(/^Date:.*$/m)[0]:"")),this.egw.debug("error","Ajax request to",this.url," failed: ",_err,_xmlhttp.status,_xmlhttp.statusText))}}),this.request},json_request.prototype.handleResponse=function(data){if(data&&"undefined"!=typeof data.response){for(var js_files=[],i=data.response.length-1;i>0;--i){var res=data.response[i];"js"==res.type&&"string"==typeof res.data&&(js_files.unshift(res.data),data.response.splice(i,1))}if(js_files.length>0){var start_time=(new Date).getTime();return void this.egw.includeJS(js_files,function(){var end_time=(new Date).getTime();this.handleResponse(data);var gen_time_div=$j("#divGenTime_"+this.egw.appname);gen_time_div.length||(gen_time_div=$j(".pageGenTime")),gen_time_div.append('<span class="asyncIncludeTime">'+egw.lang("async includes took %1s",(end_time-start_time)/1e3)+"</span>")},this)}for(var only_data=data.response.length>0,i=0;i<data.response.length;i++){var res=data.response[i];"string"==typeof res.type&&"data"!=res.type&&(only_data=!1);for(var handlers=[plugins,global_plugins],handler_idx=0;handler_idx<handlers.length;handler_idx++){var handler_level=handlers[handler_idx];if("undefined"!=typeof handler_level[res.type])for(var j=0;j<handler_level[res.type].length;j++)try{var plugin=handler_level[res.type][j];plugin.callback.call(plugin.context?plugin.context:this.context,res.type,res,this)}catch(e){var msg=e.message?e.message:e+"",stack=e.stack?"\n-- Stack trace --\n"+e.stack:"";this.egw.debug("error",'Exception "'+msg+'" while handling JSON response from '+this.url+" ["+JSON.stringify(this.parameters)+'] type "'+res.type+'", plugin',plugin,"response",res,stack)}}}null==this.callback||only_data||this.callback.call(this.context,res)}this.request=null};var json={json:function(_menuaction,_parameters,_callback,_context,_async,_sender){return new json_request(_menuaction,_parameters,_callback,_context,_async,_sender,this)},registerJSONPlugin:function(_callback,_context,_type,_global){"undefined"==typeof _type&&(_type="global"),"undefined"==typeof _global&&(_global=!1);var scoped=_global?global_plugins:plugins;"undefined"==typeof scoped[_type]&&(scoped[_type]=[]),scoped[_type].push({callback:_callback,context:_context})},unregisterJSONPlugin:function(_callback,_context,_type,_global){"undefined"==typeof _type&&(_type="global"),"undefined"==typeof _global&&(_global=!1);var scoped=_global?global_plugins:plugins;if("undefined"!=typeof scoped[_type])for(var i=0;i<scoped[_type].length;i++)if(scoped[_type][i].callback==_callback&&scoped[_type][i].context==_context){scoped[_type].slice(i,1);break}}};return json.registerJSONPlugin(function(type,res,req){if("undefined"!=typeof res.data.message&&"undefined"!=typeof res.data.details)return req.alertHandler(res.data.message,res.data.details),!0;throw"Invalid parameters"},null,"alert"),json.registerJSONPlugin(function(type,res,req){if("undefined"!=typeof res.data.id&&"undefined"!=typeof res.data.key&&"undefined"!=typeof res.data.value){var obj=_wnd.document.getElementById(res.data.id);return obj?(obj[res.data.key]=res.data.value,"innerHTML"==res.data.key&&egw_insertJS(res.data.value),!0):!1}throw"Invalid parameters"},null,"assign"),json.registerJSONPlugin(function(type,res,req){return req.callback?(req.callback.call(req.sender,res.data),!0):void 0},null,"data"),json.registerJSONPlugin(function(type,res,req){if("string"==typeof res.data){try{var func=new Function(res.data);func.call(req.egw?req.egw.window:window)}catch(e){req.egw.debug("error","Error while executing script: ",res.data,e)}return!0}throw"Invalid parameters"},null,"script"),json.registerJSONPlugin(function(type,res,req){if("string"==typeof res.data.func){for(var parts=res.data.func.split("."),func=parts.pop(),parent=req.egw.window,i=0;i<parts.length;++i)"undefined"!=typeof parent[parts[i]]?parent=parent[parts[i]]:1==i&&"app"==parts[0]&&"function"==typeof req.egw.window.app.classes[parts[1]]&&(parent=parent[parts[1]]=new req.egw.window.app.classes[parts[1]]);if("function"==typeof parent[func]){try{parent[func].apply(parent,res.data.parms)}catch(e){req.egw.debug("error",e.message," in function",res.data.func,"Parameters",res.data.parms)}return!0}throw'"'+res.data.func+'" is not a callable function (type is '+typeof parent[func]+")"}throw"Invalid parameters"},null,"apply"),json.registerJSONPlugin(function(type,res,req){if("string"==typeof res.data.select&&"string"==typeof res.data.func){try{var jQueryObject=$j(res.data.select,req.context);jQueryObject[res.data.func].apply(jQueryObject,res.data.parms)}catch(e){req.egw.debug("error","Function",res.data.func,"Parameters",res.data.parms)}return!0}throw"Invalid parameters"},_wnd,"jquery"),json.registerJSONPlugin(function(type,res,req){if("string"==typeof res.data.url&&"boolean"==typeof res.data.global)return res.data.global|=res.data.url.indexOf("?cd=10")>0,res.data.global?egw_topWindow().location.href=res.data.url:this&&this.DOMContainer&&this.DOMContainer.ownerDocument.defaultView!=window&&egw(this.DOMContainer.ownerDocument.defaultView).is_popup()?this.DOMContainer.ownerDocument.location.href=res.data.url:egw_appWindowOpen(res.data.app,res.data.url),!0;throw"Invalid parameters"},null,"redirect"),json.registerJSONPlugin(function(type,res,req){if("string"==typeof res.data)return req.egw.includeCSS(res.data),!0;throw"Invalid parameters"},null,"css"),json.registerJSONPlugin(function(type,res,req){if("string"==typeof res.data)return req.jsCount++,req.egw.includeJS(res.data,function(){req.jsFiles++,req.jsFiles==req.jsCount&&req.onLoadFinish&&req.onLoadFinish.call(req.sender)}),!0;throw"Invalid parameters"},null,"js"),json.registerJSONPlugin(function(type,res,req){if("string"==typeof res.data){for(;_wnd.document.childNodes.length>0;)_wnd.document.removeChild(_wnd.document.childNodes[0]);return _wnd.document.write(res.data),_wnd.document.close(),!0}throw"Invalid parameters"},null,"html"),json}),egw.extend("store",egw.MODULE_GLOBAL,function(_app,_wnd){"use strict";function mapKey(application,key){return application+"-"+key}return{getSessionItem:function(application,key){return key=mapKey(application,key),_wnd.sessionStorage.getItem(key)},setSessionItem:function(application,key,value){return key=mapKey(application,key),_wnd.sessionStorage.setItem(key,value)},removeSessionItem:function(application,key){return key=uniqueKey(application,key),_wnd.sessionStorage.removeItem(key)},setLocalStorageItem:function(application,item,value){return item=mapKey(application,item),localStorage.setItem(item,value)},getLocalStorageItem:function(application,item){return item=mapKey(application,item),localStorage.getItem(item)},removeLocalStorageItem:function(application,item){return item=mapKey(application,item),localStorage.removeItem(item)}}}),egw.extend("tooltip",egw.MODULE_WND_LOCAL,function(_app,_wnd){
"use strict";function hide(){null!=tooltip_div&&(tooltip_div.remove(),tooltip_div=null)}function show(){if(tooltip_div&&"undefined"!=typeof x&&"undefined"!=typeof y){var cursor_rect={left:x-8,top:y-8,right:x+8,bottom:y+8},window_width=$j(_wnd.document).width(),window_height=$j(_wnd.document).height(),space_left={left:cursor_rect.left,top:cursor_rect.top,right:window_width-cursor_rect.right,bottom:window_height-cursor_rect.bottom},tooltip_width=tooltip_div.width();tooltip_width>300&&(tooltip_width=300);var tooltip_height=tooltip_div.height();space_left.right<tooltip_width?tooltip_div.css("left",Math.max(0,cursor_rect.left-tooltip_width)):space_left.left>=tooltip_width?tooltip_div.css("left",cursor_rect.right):(tooltip_div.css("left",cursor_rect.right),tooltip_div.css("max-width",space_left.right)),space_left.bottom<tooltip_height?tooltip_div.css("top",cursor_rect.top-tooltip_height):space_left.top>=tooltip_height?tooltip_div.css("top",cursor_rect.bottom):(tooltip_div.css("top",cursor_rect.bottom),tooltip_div.css("max-height",space_left.bottom)),tooltip_div.fadeIn(100)}}function prepare(_html){hide(),tooltip_div=$j(_wnd.document.createElement("div")),tooltip_div.hide(),tooltip_div.append(_html),tooltip_div.addClass("egw_tooltip"),$j(_wnd.document.body).append(tooltip_div),tooltip_div.mouseenter(function(){hide()})}function showTooltipTimeout(){null!=current_elem&&(show_delta+=time_delta,show_delay>show_delta?_wnd.setTimeout(showTooltipTimeout,time_delta):(show_delta=0,show()))}var tooltip_div=null,current_elem=null,time_delta=100,show_delta=0,show_delay=200,x=0,y=0;return{tooltipBind:function(_elem,_html){""!=_html&&(_elem.bind("mouseenter.tooltip",function(e){return _elem!=current_elem&&(prepare(_html),current_elem=_elem,show_delta=0,x=e.clientX,y=e.clientY,_wnd.setTimeout(showTooltipTimeout,time_delta)),!1}),_elem.bind("mouseleave.tooltip",function(){current_elem=null,show_delta=0,tooltip_div&&tooltip_div.fadeOut(100)}),_elem.bind("mousemove.tooltip",function(e){var dx=x-e.clientX,dy=y-e.clientY,movedist=Math.sqrt(dx*dx+dy*dy);movedist>2&&(show_delta=0),x=e.clientX,y=e.clientY}))},tooltipUnbind:function(_elem){current_elem==_elem&&(hide(),current_elem=null),_elem.unbind(".tooltip")}}}),egw.extend("css",egw.MODULE_WND_LOCAL,function(_app,_wnd){"use strict";var sheet,selectors={},selectorCount=0;return{css:function(_selector,_rule){var index=sheet?Math.min(selectorCount,sheet.cssRules.length):0;if(!sheet||!sheet.ownerNode||sheet.ownerNode.ownerDocument!==_wnd.document){var style=_wnd.document.createElement("style");_wnd.document.getElementsByTagName("head")[0].appendChild(style),sheet=style.sheet?style.sheet:style.styleSheet,selectorCount=0,selectors={}}"undefined"!=typeof selectors[_selector]?(index=selectors[_selector],index<sheet.cssRules.length&&("undefined"!=typeof sheet.removeRule?sheet.removeRule(index):sheet.deleteRule(index)),delete selectors[_selector],_rule||selectorCount--):selectorCount++,_rule&&("undefined"!=typeof sheet.addRule?sheet.addRule(_selector,_rule,index):sheet.insertRule(_selector+"{"+_rule+"}",index),selectors[_selector]=index)}}}),function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"@@version"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",defaultValue:null,parse:"strict"},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(settings){return extendRemove(this._defaults,settings||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(input,dp_inst){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],input,dp_inst,tp_inst):void 0},onChangeMonthYear:function(year,month,dp_inst){tp_inst._updateDateTime(dp_inst),$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],year,month,dp_inst,tp_inst)},onClose:function(dateText,dp_inst){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(dp_inst),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],dateText,dp_inst,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(val){return val.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(val){return val.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&"undefined"==typeof $.ui.slider&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField).css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),0!==tp_inst._defaults.minDate&&0!==tp_inst._defaults.minDateTime||(tp_inst._defaults.minDate=new Date),0!==tp_inst._defaults.maxDate&&0!==tp_inst._defaults.maxDateTime||(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(dp_inst){var currDT=this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val();this.timeDefined=this._parseTime(currDT),this._limitMinMaxDateTime(dp_inst,!1),this._injectTimePicker()},_parseTime:function(timeString,withDate){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),withDate||!this._defaults.timeOnly){var dp_dateFormat=$.datepicker._get(this.inst,"dateFormat");try{var parseRes=parseDateTimeInternal(dp_dateFormat,this._defaults.timeFormat,timeString,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!parseRes.timeObj)return!1;$.extend(this,parseRes.timeObj)}catch(err){return $.timepicker.log("Error parsing the date/time string: "+err+"\ndate/time string = "+timeString+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+dp_dateFormat),!1}return!0}var timeObj=$.datepicker.parseTime(this._defaults.timeFormat,timeString,this._defaults);return timeObj?($.extend(this,timeObj),!0):!1},_injectTimePicker:function(){var $dp=this.inst.dpDiv,o=this.inst.settings,tp_inst=this,litem="",uitem="",show=null,max={},gridSize={},size=null,i=0,l=0;if(0===$dp.find("div.ui-timepicker-div").length&&o.showTimepicker){var noDisplay=' style="display:none;"',html='<div class="ui-timepicker-div'+(o.isRTL?" ui-timepicker-rtl":"")+'"><dl><dt class="ui_tpicker_time_label"'+(o.showTime?"":noDisplay)+">"+o.timeText+'</dt><dd class="ui_tpicker_time"'+(o.showTime?"":noDisplay)+"></dd>";for(i=0,l=this.units.length;l>i;i++){if(litem=this.units[i],uitem=litem.substr(0,1).toUpperCase()+litem.substr(1),show=null!==o["show"+uitem]?o["show"+uitem]:this.support[litem],max[litem]=parseInt(o[litem+"Max"]-(o[litem+"Max"]-o[litem+"Min"])%o["step"+uitem],10),gridSize[litem]=0,html+='<dt class="ui_tpicker_'+litem+'_label"'+(show?"":noDisplay)+">"+o[litem+"Text"]+'</dt><dd class="ui_tpicker_'+litem+'"><div class="ui_tpicker_'+litem+'_slider"'+(show?"":noDisplay)+"></div>",show&&o[litem+"Grid"]>0){if(html+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===litem)for(var h=o[litem+"Min"];h<=max[litem];h+=parseInt(o[litem+"Grid"],10)){gridSize[litem]++;var tmph=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:h},o);html+='<td data-for="'+litem+'">'+tmph+"</td>"}else for(var m=o[litem+"Min"];m<=max[litem];m+=parseInt(o[litem+"Grid"],10))gridSize[litem]++,html+='<td data-for="'+litem+'">'+(10>m?"0":"")+m+"</td>";html+="</tr></table></div>"}html+="</dd>"}var showTz=null!==o.showTimezone?o.showTimezone:this.support.timezone;html+='<dt class="ui_tpicker_timezone_label"'+(showTz?"":noDisplay)+">"+o.timezoneText+"</dt>",html+='<dd class="ui_tpicker_timezone" '+(showTz?"":noDisplay)+"></dd>",html+="</dl></div>";var $tp=$(html);for(o.timeOnly===!0&&($tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+o.timeOnlyTitle+"</div></div>"),$dp.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),i=0,l=tp_inst.units.length;l>i;i++)litem=tp_inst.units[i],uitem=litem.substr(0,1).toUpperCase()+litem.substr(1),show=null!==o["show"+uitem]?o["show"+uitem]:this.support[litem],tp_inst[litem+"_slider"]=tp_inst.control.create(tp_inst,$tp.find(".ui_tpicker_"+litem+"_slider"),litem,tp_inst[litem],o[litem+"Min"],max[litem],o["step"+uitem]),show&&o[litem+"Grid"]>0&&(size=100*gridSize[litem]*o[litem+"Grid"]/(max[litem]-o[litem+"Min"]),$tp.find(".ui_tpicker_"+litem+" table").css({width:size+"%",marginLeft:o.isRTL?"0":size/(-2*gridSize[litem])+"%",marginRight:o.isRTL?size/(-2*gridSize[litem])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(e){var $t=$(this),h=$t.html(),n=parseInt(h.replace(/[^0-9]/g),10),ap=h.replace(/[^apm]/gi),f=$t.data("for");"hour"===f&&(-1!==ap.indexOf("p")&&12>n?n+=12:-1!==ap.indexOf("a")&&12===n&&(n=0)),tp_inst.control.value(tp_inst,tp_inst[f+"_slider"],litem,n),tp_inst._onTimeChange(),tp_inst._onSelectHandler()}).css({cursor:"pointer",width:100/gridSize[litem]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=$tp.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(o.timezoneList,function(val,idx){return $("<option />").val("object"==typeof val?val.value:val).text("object"==typeof val?val.label:val)})),"undefined"!=typeof this.timezone&&null!==this.timezone&&""!==this.timezone){var local_timezone=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();local_timezone===this.timezone?selectLocalTimezone(tp_inst):this.timezone_select.val(this.timezone)}else"undefined"!=typeof this.hour&&null!==this.hour&&""!==this.hour?this.timezone_select.val(o.timezone):selectLocalTimezone(tp_inst);this.timezone_select.change(function(){tp_inst._onTimeChange(),tp_inst._onSelectHandler()});var $buttonPanel=$dp.find(".ui-datepicker-buttonpane");if($buttonPanel.length?$buttonPanel.before($tp):$dp.append($tp),this.$timeObj=$tp.find(".ui_tpicker_time"),null!==this.inst){var timeDefined=this.timeDefined;this._onTimeChange(),this.timeDefined=timeDefined}if(this._defaults.addSliderAccess){var sliderAccessArgs=this._defaults.sliderAccessArgs,rtl=this._defaults.isRTL;sliderAccessArgs.isRTL=rtl,setTimeout(function(){if(0===$tp.find(".ui-slider-access").length){$tp.find(".ui-slider:visible").sliderAccess(sliderAccessArgs);var sliderAccessWidth=$tp.find(".ui-slider-access:eq(0)").outerWidth(!0);sliderAccessWidth&&$tp.find("table:visible").each(function(){var $g=$(this),oldWidth=$g.outerWidth(),oldMarginLeft=$g.css(rtl?"marginRight":"marginLeft").toString().replace("%",""),newWidth=oldWidth-sliderAccessWidth,newMarginLeft=oldMarginLeft*newWidth/oldWidth+"%",css={width:newWidth,marginRight:0,marginLeft:0};css[rtl?"marginRight":"marginLeft"]=newMarginLeft,$g.css(css)})}},10)}tp_inst._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(dp_inst,adjustSliders){var o=this._defaults,dp_date=new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(dp_inst,"minDateTime")&&void 0!==$.datepicker._get(dp_inst,"minDateTime")&&dp_date){var minDateTime=$.datepicker._get(dp_inst,"minDateTime"),minDateTimeDate=new Date(minDateTime.getFullYear(),minDateTime.getMonth(),minDateTime.getDate(),0,0,0,0);null!==this.hourMinOriginal&&null!==this.minuteMinOriginal&&null!==this.secondMinOriginal&&null!==this.millisecMinOriginal&&null!==this.microsecMinOriginal||(this.hourMinOriginal=o.hourMin,this.minuteMinOriginal=o.minuteMin,this.secondMinOriginal=o.secondMin,this.millisecMinOriginal=o.millisecMin,this.microsecMinOriginal=o.microsecMin),dp_inst.settings.timeOnly||minDateTimeDate.getTime()===dp_date.getTime()?(this._defaults.hourMin=minDateTime.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=minDateTime.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=minDateTime.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=minDateTime.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=minDateTime.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(dp_inst,"maxDateTime")&&void 0!==$.datepicker._get(dp_inst,"maxDateTime")&&dp_date){var maxDateTime=$.datepicker._get(dp_inst,"maxDateTime"),maxDateTimeDate=new Date(maxDateTime.getFullYear(),maxDateTime.getMonth(),maxDateTime.getDate(),0,0,0,0);null!==this.hourMaxOriginal&&null!==this.minuteMaxOriginal&&null!==this.secondMaxOriginal&&null!==this.millisecMaxOriginal||(this.hourMaxOriginal=o.hourMax,this.minuteMaxOriginal=o.minuteMax,this.secondMaxOriginal=o.secondMax,this.millisecMaxOriginal=o.millisecMax,this.microsecMaxOriginal=o.microsecMax),dp_inst.settings.timeOnly||maxDateTimeDate.getTime()===dp_date.getTime()?(this._defaults.hourMax=maxDateTime.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=maxDateTime.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=maxDateTime.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=maxDateTime.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=maxDateTime.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(void 0!==adjustSliders&&adjustSliders===!0){var hourMax=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),minMax=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),secMax=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),millisecMax=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),microsecMax=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:hourMax}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:minMax}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:secMax}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:millisecMax}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:microsecMax}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var hour=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,minute=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,second=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,millisec=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,microsec=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,timezone=this.timezone_select?this.timezone_select.val():!1,o=this._defaults,pickerTimeFormat=o.pickerTimeFormat||o.timeFormat,pickerTimeSuffix=o.pickerTimeSuffix||o.timeSuffix;"object"==typeof hour&&(hour=!1),"object"==typeof minute&&(minute=!1),"object"==typeof second&&(second=!1),"object"==typeof millisec&&(millisec=!1),"object"==typeof microsec&&(microsec=!1),"object"==typeof timezone&&(timezone=!1),hour!==!1&&(hour=parseInt(hour,10)),minute!==!1&&(minute=parseInt(minute,10)),second!==!1&&(second=parseInt(second,10)),millisec!==!1&&(millisec=parseInt(millisec,10)),microsec!==!1&&(microsec=parseInt(microsec,10)),timezone!==!1&&(timezone=timezone.toString());var ampm=o[12>hour?"amNames":"pmNames"][0],hasChanged=hour!==parseInt(this.hour,10)||minute!==parseInt(this.minute,10)||second!==parseInt(this.second,10)||millisec!==parseInt(this.millisec,10)||microsec!==parseInt(this.microsec,10)||this.ampm.length>0&&12>hour!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&timezone!==this.timezone.toString();hasChanged&&(hour!==!1&&(this.hour=hour),minute!==!1&&(this.minute=minute),second!==!1&&(this.second=second),millisec!==!1&&(this.millisec=millisec),microsec!==!1&&(this.microsec=microsec),timezone!==!1&&(this.timezone=timezone),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=ampm),this.formattedTime=$.datepicker.formatTime(o.timeFormat,this,o),this.$timeObj&&(pickerTimeFormat===o.timeFormat?this.$timeObj.text(this.formattedTime+pickerTimeSuffix):this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat,this,o)+pickerTimeSuffix)),this.timeDefined=!0,hasChanged&&(this._updateDateTime(),this.$input.focus())}},_onSelectHandler:function(){var onSelect=this._defaults.onSelect||this.inst.settings.onSelect,inputEl=this.$input?this.$input[0]:null;onSelect&&inputEl&&onSelect.apply(inputEl,[this.formattedDateTime,this])},_updateDateTime:function(dp_inst){dp_inst=this.inst||dp_inst;var dtTmp=dp_inst.currentYear>0?new Date(dp_inst.currentYear,dp_inst.currentMonth,dp_inst.currentDay):new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay),dt=$.datepicker._daylightSavingAdjust(dtTmp),dateFmt=$.datepicker._get(dp_inst,"dateFormat"),formatCfg=$.datepicker._getFormatConfig(dp_inst),timeAvailable=null!==dt&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(dateFmt,null===dt?new Date:dt,formatCfg);var formattedDateTime=this.formattedDate;if(""===dp_inst.lastVal&&(dp_inst.currentYear=dp_inst.selectedYear,dp_inst.currentMonth=dp_inst.selectedMonth,dp_inst.currentDay=dp_inst.selectedDay),this._defaults.timeOnly===!0?formattedDateTime=this.formattedTime:this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||timeAvailable)&&(formattedDateTime+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=formattedDateTime,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(formattedDateTime);var altFormattedDateTime="",altSeparator=this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,altTimeSuffix=this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(altFormattedDateTime=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===dt?new Date:dt,formatCfg):this.formattedDate,altFormattedDateTime&&(altFormattedDateTime+=altSeparator)),altFormattedDateTime+=this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+altTimeSuffix:this.formattedTime+altTimeSuffix,this.$altInput.val(altFormattedDateTime)}else this.$input.val(formattedDateTime);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var inst=$.datepicker._getInst(this.$input.get(0)),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst&&tp_inst._defaults.timeOnly&&inst.input.val()!==inst.lastVal)try{$.datepicker._updateDatepicker(inst)}catch(err){$.timepicker.log(err)}}},_controls:{slider:{create:function(tp_inst,obj,unit,val,min,max,step){var rtl=tp_inst._defaults.isRTL;return obj.prop("slide",null).slider({orientation:"horizontal",value:rtl?-1*val:val,min:rtl?-1*max:min,max:rtl?-1*min:max,step:step,slide:function(event,ui){tp_inst.control.value(tp_inst,$(this),unit,rtl?-1*ui.value:ui.value),tp_inst._onTimeChange()},stop:function(event,ui){tp_inst._onSelectHandler()}})},options:function(tp_inst,obj,unit,opts,val){if(tp_inst._defaults.isRTL){if("string"==typeof opts)return"min"===opts||"max"===opts?void 0!==val?obj.slider(opts,-1*val):Math.abs(obj.slider(opts)):obj.slider(opts);var min=opts.min,max=opts.max;return opts.min=opts.max=null,void 0!==min&&(opts.max=-1*min),void 0!==max&&(opts.min=-1*max),obj.slider(opts)}return"string"==typeof opts&&void 0!==val?obj.slider(opts,val):obj.slider(opts)},value:function(tp_inst,obj,unit,val){return tp_inst._defaults.isRTL?void 0!==val?obj.slider("value",-1*val):Math.abs(obj.slider("value")):void 0!==val?obj.slider("value",val):obj.slider("value")}},select:{create:function(tp_inst,obj,unit,val,min,max,step){for(var sel='<select class="ui-timepicker-select" data-unit="'+unit+'" data-min="'+min+'" data-max="'+max+'" data-step="'+step+'">',format=tp_inst._defaults.pickerTimeFormat||tp_inst._defaults.timeFormat,i=min;max>=i;i+=step)sel+='<option value="'+i+'"'+(i===val?" selected":"")+">",sel+="hour"===unit?$.datepicker.formatTime($.trim(format.replace(/[^ht ]/gi,"")),{hour:i},tp_inst._defaults):"millisec"===unit||"microsec"===unit||i>=10?i:"0"+i.toString(),sel+="</option>";return sel+="</select>",obj.children("select").remove(),$(sel).appendTo(obj).change(function(e){tp_inst._onTimeChange(),tp_inst._onSelectHandler()}),obj},options:function(tp_inst,obj,unit,opts,val){var o={},$t=obj.children("select");if("string"==typeof opts){if(void 0===val)return $t.data(opts);o[opts]=val}else o=opts;return tp_inst.control.create(tp_inst,obj,$t.data("unit"),$t.val(),o.min||$t.data("min"),o.max||$t.data("max"),o.step||$t.data("step"))},value:function(tp_inst,obj,unit,val){var $t=obj.children("select");return void 0!==val?$t.val(val):$t.val()}}}}),$.fn.extend({timepicker:function(o){o=o||{};var tmp_args=Array.prototype.slice.call(arguments);return"object"==typeof o&&(tmp_args[0]=$.extend(o,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),tmp_args)})},datetimepicker:function(o){o=o||{};var tmp_args=arguments;return"string"==typeof o?"getDate"===o?$.fn.datepicker.apply($(this[0]),tmp_args):this.each(function(){var $t=$(this);$t.datepicker.apply($t,tmp_args)}):this.each(function(){var $t=$(this);$t.datepicker($.timepicker._newInst($t,o)._defaults)})}}),$.datepicker.parseDateTime=function(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings){var parseRes=parseDateTimeInternal(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings);if(parseRes.timeObj){var t=parseRes.timeObj;parseRes.date.setHours(t.hour,t.minute,t.second,t.millisec),parseRes.date.setMicroseconds(t.microsec)}return parseRes.date},$.datepicker.parseTime=function(timeFormat,timeString,options){var o=extendRemove(extendRemove({},$.timepicker._defaults),options||{}),strictParse=(-1!==timeFormat.replace(/\'.*?\'/g,"").indexOf("Z"),function(f,s,o){var treg,getPatternAmpm=function(amNames,pmNames){var markers=[];return amNames&&$.merge(markers,amNames),pmNames&&$.merge(markers,pmNames),markers=$.map(markers,function(val){return val.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+markers.join("|")+")?"},getFormatPositions=function(timeFormat){var finds=timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),orders={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(finds)for(var i=0;i<finds.length;i++)-1===orders[finds[i].toString().charAt(0)]&&(orders[finds[i].toString().charAt(0)]=i+1);return orders},regstr="^"+f.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(match){var ml=match.length;switch(match.charAt(0).toLowerCase()){case"h":return 1===ml?"(\\d?\\d)":"(\\d{"+ml+"})";case"m":return 1===ml?"(\\d?\\d)":"(\\d{"+ml+"})";case"s":return 1===ml?"(\\d?\\d)":"(\\d{"+ml+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return getPatternAmpm(o.amNames,o.pmNames);default:return"("+match.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(m){return"\\"+m})+")?"}}).replace(/\s/g,"\\s?")+o.timeSuffix+"$",order=getFormatPositions(f),ampm="";treg=s.match(new RegExp(regstr,"i"));var resTime={hour:0,minute:0,second:0,millisec:0,microsec:0};return treg?(-1!==order.t&&(void 0===treg[order.t]||0===treg[order.t].length?(ampm="",resTime.ampm=""):(ampm=-1!==$.inArray(treg[order.t].toUpperCase(),o.amNames)?"AM":"PM",resTime.ampm=o["AM"===ampm?"amNames":"pmNames"][0])),-1!==order.h&&("AM"===ampm&&"12"===treg[order.h]?resTime.hour=0:"PM"===ampm&&"12"!==treg[order.h]?resTime.hour=parseInt(treg[order.h],10)+12:resTime.hour=Number(treg[order.h])),-1!==order.m&&(resTime.minute=Number(treg[order.m])),-1!==order.s&&(resTime.second=Number(treg[order.s])),-1!==order.l&&(resTime.millisec=Number(treg[order.l])),-1!==order.c&&(resTime.microsec=Number(treg[order.c])),-1!==order.z&&void 0!==treg[order.z]&&(resTime.timezone=$.timepicker.timezoneOffsetNumber(treg[order.z])),
resTime):!1}),looseParse=function(f,s,o){try{var d=new Date("2012-01-01 "+s);if(isNaN(d.getTime())&&(d=new Date("2012-01-01T"+s),isNaN(d.getTime())&&(d=new Date("01/01/2012 "+s),isNaN(d.getTime()))))throw"Unable to parse time with native Date: "+s;return{hour:d.getHours(),minute:d.getMinutes(),second:d.getSeconds(),millisec:d.getMilliseconds(),microsec:d.getMicroseconds(),timezone:-1*d.getTimezoneOffset()}}catch(err){try{return strictParse(f,s,o)}catch(err2){$.timepicker.log("Unable to parse \ntimeString: "+s+"\ntimeFormat: "+f)}}return!1};return"function"==typeof o.parse?o.parse(timeFormat,timeString,o):"loose"===o.parse?looseParse(timeFormat,timeString,o):strictParse(timeFormat,timeString,o)},$.datepicker.formatTime=function(format,time,options){options=options||{},options=$.extend({},$.timepicker._defaults,options),time=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},time);var tmptime=format,ampmName=options.amNames[0],hour=parseInt(time.hour,10);return hour>11&&(ampmName=options.pmNames[0]),tmptime=tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(match){switch(match){case"HH":return("0"+hour).slice(-2);case"H":return hour;case"hh":return("0"+convert24to12(hour)).slice(-2);case"h":return convert24to12(hour);case"mm":return("0"+time.minute).slice(-2);case"m":return time.minute;case"ss":return("0"+time.second).slice(-2);case"s":return time.second;case"l":return("00"+time.millisec).slice(-3);case"c":return("00"+time.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===time.timezone?options.timezone:time.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===time.timezone?options.timezone:time.timezone,!0);case"T":return ampmName.charAt(0).toUpperCase();case"TT":return ampmName.toUpperCase();case"t":return ampmName.charAt(0).toLowerCase();case"tt":return ampmName.toLowerCase();default:return match.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(id,dateStr){var inst=this._getInst($(id)[0]),tp_inst=this._get(inst,"timepicker");tp_inst?(tp_inst._limitMinMaxDateTime(inst,!0),inst.inline=inst.stay_open=!0,this._base_selectDate(id,dateStr),inst.inline=inst.stay_open=!1,this._notifyChange(inst),this._updateDatepicker(inst)):this._base_selectDate(id,dateStr)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(inst){var input=inst.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==inst&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==input||"boolean"==typeof inst.stay_open&&inst.stay_open!==!1)){this._base_updateDatepicker(inst);var tp_inst=this._get(inst,"timepicker");tp_inst&&tp_inst._addTimePicker(inst)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(event){var inst=$.datepicker._getInst(event.target),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst&&$.datepicker._get(inst,"constrainInput")){var ampm=tp_inst.support.ampm,tz=null!==tp_inst._defaults.showTimezone?tp_inst._defaults.showTimezone:tp_inst.support.timezone,dateChars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat")),datetimeChars=tp_inst._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,ampm?"APM":"").replace(/Tt/g,ampm?"AaPpMm":"").replace(/tT/g,ampm?"AaPpMm":"").replace(/T/g,ampm?"AP":"").replace(/tt/g,ampm?"apm":"").replace(/t/g,ampm?"ap":"")+" "+tp_inst._defaults.separator+tp_inst._defaults.timeSuffix+(tz?tp_inst._defaults.timezoneList.join(""):"")+tp_inst._defaults.amNames.join("")+tp_inst._defaults.pmNames.join("")+dateChars,chr=String.fromCharCode(void 0===event.charCode?event.keyCode:event.charCode);return event.ctrlKey||" ">chr||!dateChars||datetimeChars.indexOf(chr)>-1}return $.datepicker._base_doKeyPress(event)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(inst){var tp_inst=this._get(inst,"timepicker");if(tp_inst){var altField=tp_inst._defaults.altField;if(altField){var date=(tp_inst._defaults.altFormat||tp_inst._defaults.dateFormat,this._getDate(inst)),formatCfg=$.datepicker._getFormatConfig(inst),altFormattedDateTime="",altSeparator=tp_inst._defaults.altSeparator?tp_inst._defaults.altSeparator:tp_inst._defaults.separator,altTimeSuffix=tp_inst._defaults.altTimeSuffix?tp_inst._defaults.altTimeSuffix:tp_inst._defaults.timeSuffix,altTimeFormat=null!==tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:tp_inst._defaults.timeFormat;altFormattedDateTime+=$.datepicker.formatTime(altTimeFormat,tp_inst,tp_inst._defaults)+altTimeSuffix,tp_inst._defaults.timeOnly||tp_inst._defaults.altFieldTimeOnly||null===date||(altFormattedDateTime=tp_inst._defaults.altFormat?$.datepicker.formatDate(tp_inst._defaults.altFormat,date,formatCfg)+altSeparator+altFormattedDateTime:tp_inst.formattedDate+altSeparator+altFormattedDateTime),$(altField).val(altFormattedDateTime)}}else $.datepicker._base_updateAlternate(inst)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(event){var inst=$.datepicker._getInst(event.target),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst&&tp_inst._defaults.timeOnly&&inst.input.val()!==inst.lastVal)try{$.datepicker._updateDatepicker(inst)}catch(err){$.timepicker.log(err)}return $.datepicker._base_doKeyUp(event)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(id){var inst=this._getInst($(id)[0]),$dp=inst.dpDiv;this._base_gotoToday(id);var tp_inst=this._get(inst,"timepicker");selectLocalTimezone(tp_inst);var now=new Date;this._setTime(inst,now),$(".ui-datepicker-today",$dp).click()},$.datepicker._disableTimepickerDatepicker=function(target){var inst=this._getInst(target);if(inst){var tp_inst=this._get(inst,"timepicker");$(target).datepicker("getDate"),tp_inst&&(inst.settings.showTimepicker=!1,tp_inst._defaults.showTimepicker=!1,tp_inst._updateDateTime(inst))}},$.datepicker._enableTimepickerDatepicker=function(target){var inst=this._getInst(target);if(inst){var tp_inst=this._get(inst,"timepicker");$(target).datepicker("getDate"),tp_inst&&(inst.settings.showTimepicker=!0,tp_inst._defaults.showTimepicker=!0,tp_inst._addTimePicker(inst),tp_inst._updateDateTime(inst))}},$.datepicker._setTime=function(inst,date){var tp_inst=this._get(inst,"timepicker");if(tp_inst){var defaults=tp_inst._defaults;tp_inst.hour=date?date.getHours():defaults.hour,tp_inst.minute=date?date.getMinutes():defaults.minute,tp_inst.second=date?date.getSeconds():defaults.second,tp_inst.millisec=date?date.getMilliseconds():defaults.millisec,tp_inst.microsec=date?date.getMicroseconds():defaults.microsec,tp_inst._limitMinMaxDateTime(inst,!0),tp_inst._onTimeChange(),tp_inst._updateDateTime(inst)}},$.datepicker._setTimeDatepicker=function(target,date,withDate){var inst=this._getInst(target);if(inst){var tp_inst=this._get(inst,"timepicker");if(tp_inst){this._setDateFromField(inst);var tp_date;date&&("string"==typeof date?(tp_inst._parseTime(date,withDate),tp_date=new Date,tp_date.setHours(tp_inst.hour,tp_inst.minute,tp_inst.second,tp_inst.millisec),tp_date.setMicroseconds(tp_inst.microsec)):(tp_date=new Date(date.getTime()),tp_date.setMicroseconds(date.getMicroseconds())),"Invalid Date"===tp_date.toString()&&(tp_date=void 0),this._setTime(inst,tp_date))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(target,date){var inst=this._getInst(target);if(inst){"string"==typeof date&&(date=new Date(date),date.getTime()||$.timepicker.log("Error creating Date object from string."));var tp_date,tp_inst=this._get(inst,"timepicker");date instanceof Date?(tp_date=new Date(date.getTime()),tp_date.setMicroseconds(date.getMicroseconds())):tp_date=date,tp_inst&&tp_date&&(tp_inst.support.timezone||null!==tp_inst._defaults.timezone||(tp_inst.timezone=-1*tp_date.getTimezoneOffset()),date=$.timepicker.timezoneAdjust(date,tp_inst.timezone),tp_date=$.timepicker.timezoneAdjust(tp_date,tp_inst.timezone)),this._updateDatepicker(inst),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(target,tp_date,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(target,noDefault){var inst=this._getInst(target);if(inst){var tp_inst=this._get(inst,"timepicker");if(tp_inst){void 0===inst.lastVal&&this._setDateFromField(inst,noDefault);var date=this._getDate(inst);return date&&tp_inst._parseTime($(target).val(),tp_inst.timeOnly)&&(date.setHours(tp_inst.hour,tp_inst.minute,tp_inst.second,tp_inst.millisec),date.setMicroseconds(tp_inst.microsec),null!=tp_inst.timezone&&(tp_inst.support.timezone||null!==tp_inst._defaults.timezone||(tp_inst.timezone=-1*date.getTimezoneOffset()),date=$.timepicker.timezoneAdjust(date,tp_inst.timezone))),date}return this._base_getDateDatepicker(target,noDefault)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(format,value,settings){var date;try{date=this._base_parseDate(format,value,settings)}catch(err){if(!(err.indexOf(":")>=0))throw err;date=this._base_parseDate(format,value.substring(0,value.length-(err.length-err.indexOf(":")-2)),settings),$.timepicker.log("Error parsing the date string: "+err+"\ndate string = "+value+"\ndate format = "+format)}return date},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(inst,day,month,year){var tp_inst=this._get(inst,"timepicker");return tp_inst?(tp_inst._updateDateTime(inst),tp_inst.$input.val()):this._base_formatDate(inst)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(target,name,value){var name_clone,inst=this._getInst(target);if(!inst)return null;var tp_inst=this._get(inst,"timepicker");if(tp_inst){var prop,min=null,max=null,onselect=null,overrides=tp_inst._defaults.evnts,fns={};if("string"==typeof name){if("minDate"===name||"minDateTime"===name)min=value;else if("maxDate"===name||"maxDateTime"===name)max=value;else if("onSelect"===name)onselect=value;else if(overrides.hasOwnProperty(name)){if("undefined"==typeof value)return overrides[name];fns[name]=value,name_clone={}}}else if("object"==typeof name){name.minDate?min=name.minDate:name.minDateTime?min=name.minDateTime:name.maxDate?max=name.maxDate:name.maxDateTime&&(max=name.maxDateTime);for(prop in overrides)overrides.hasOwnProperty(prop)&&name[prop]&&(fns[prop]=name[prop])}for(prop in fns)fns.hasOwnProperty(prop)&&(overrides[prop]=fns[prop],name_clone||(name_clone=$.extend({},name)),delete name_clone[prop]);if(name_clone&&isEmptyObject(name_clone))return;min?(min=0===min?new Date:new Date(min),tp_inst._defaults.minDate=min,tp_inst._defaults.minDateTime=min):max?(max=0===max?new Date:new Date(max),tp_inst._defaults.maxDate=max,tp_inst._defaults.maxDateTime=max):onselect&&(tp_inst._defaults.onSelect=onselect)}return void 0===value?this._base_optionDatepicker.call($.datepicker,target,name):this._base_optionDatepicker.call($.datepicker,target,name_clone||name,value)};var isEmptyObject=function(obj){var prop;for(prop in obj)if(obj.hasOwnProperty(prop))return!1;return!0},extendRemove=function(target,props){$.extend(target,props);for(var name in props)null!==props[name]&&void 0!==props[name]||(target[name]=props[name]);return target},detectSupport=function(timeFormat){var tf=timeFormat.replace(/'.*?'/g,"").toLowerCase(),isIn=function(f,t){return-1!==f.indexOf(t)};return{hour:isIn(tf,"h"),minute:isIn(tf,"m"),second:isIn(tf,"s"),millisec:isIn(tf,"l"),microsec:isIn(tf,"c"),timezone:isIn(tf,"z"),ampm:isIn(tf,"t")&&isIn(timeFormat,"h"),iso8601:isIn(timeFormat,"Z")}},convert24to12=function(hour){return hour%=12,0===hour&&(hour=12),String(hour)},computeEffectiveSetting=function(settings,property){return settings&&settings[property]?settings[property]:$.timepicker._defaults[property]},splitDateTime=function(dateTimeString,timeSettings){var separator=computeEffectiveSetting(timeSettings,"separator"),format=computeEffectiveSetting(timeSettings,"timeFormat"),timeParts=format.split(separator),timePartsLen=timeParts.length,allParts=dateTimeString.split(separator),allPartsLen=allParts.length;return allPartsLen>1?{dateString:allParts.splice(0,allPartsLen-timePartsLen).join(separator),timeString:allParts.splice(0,timePartsLen).join(separator)}:{dateString:dateTimeString,timeString:""}},parseDateTimeInternal=function(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings){var date,parts,parsedTime;if(parts=splitDateTime(dateTimeString,timeSettings),date=$.datepicker._base_parseDate(dateFormat,parts.dateString,dateSettings),""===parts.timeString)return{date:date};if(parsedTime=$.datepicker.parseTime(timeFormat,parts.timeString,timeSettings),!parsedTime)throw"Wrong time format";return{date:date,timeObj:parsedTime}},selectLocalTimezone=function(tp_inst,date){if(tp_inst&&tp_inst.timezone_select){var now=date||new Date;tp_inst.timezone_select.val(-now.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(tzMinutes,iso8601){if(isNaN(tzMinutes)||tzMinutes>840||-720>tzMinutes)return tzMinutes;var off=tzMinutes,minutes=off%60,hours=(off-minutes)/60,iso=iso8601?":":"",tz=(off>=0?"+":"-")+("0"+Math.abs(hours)).slice(-2)+iso+("0"+Math.abs(minutes)).slice(-2);return"+00:00"===tz?"Z":tz},$.timepicker.timezoneOffsetNumber=function(tzString){var normalized=tzString.toString().replace(":","");return"Z"===normalized.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(normalized)?("-"===normalized.substr(0,1)?-1:1)*(60*parseInt(normalized.substr(1,2),10)+parseInt(normalized.substr(3,2),10)):tzString},$.timepicker.timezoneAdjust=function(date,toTimezone){var toTz=$.timepicker.timezoneOffsetNumber(toTimezone);return isNaN(toTz)||date.setMinutes(date.getMinutes()+-date.getTimezoneOffset()-toTz),date},$.timepicker.timeRange=function(startTime,endTime,options){return $.timepicker.handleRange("timepicker",startTime,endTime,options)},$.timepicker.datetimeRange=function(startTime,endTime,options){$.timepicker.handleRange("datetimepicker",startTime,endTime,options)},$.timepicker.dateRange=function(startTime,endTime,options){$.timepicker.handleRange("datepicker",startTime,endTime,options)},$.timepicker.handleRange=function(method,startTime,endTime,options){function checkDates(changed,other){var startdt=startTime[method]("getDate"),enddt=endTime[method]("getDate"),changeddt=changed[method]("getDate");if(null!==startdt){var minDate=new Date(startdt.getTime()),maxDate=new Date(startdt.getTime());minDate.setMilliseconds(minDate.getMilliseconds()+options.minInterval),maxDate.setMilliseconds(maxDate.getMilliseconds()+options.maxInterval),options.minInterval>0&&minDate>enddt?endTime[method]("setDate",minDate):options.maxInterval>0&&enddt>maxDate?endTime[method]("setDate",maxDate):startdt>enddt&&other[method]("setDate",changeddt)}}function selected(changed,other,option){if(changed.val()){var date=changed[method].call(changed,"getDate");null!==date&&options.minInterval>0&&("minDate"===option&&date.setMilliseconds(date.getMilliseconds()+options.minInterval),"maxDate"===option&&date.setMilliseconds(date.getMilliseconds()-options.minInterval)),date.getTime&&other[method].call(other,"option",option,date)}}return options=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},options),$.fn[method].call(startTime,$.extend({onClose:function(dateText,inst){checkDates($(this),endTime)},onSelect:function(selectedDateTime){selected($(this),endTime,"minDate")}},options,options.start)),$.fn[method].call(endTime,$.extend({onClose:function(dateText,inst){checkDates($(this),startTime)},onSelect:function(selectedDateTime){selected($(this),startTime,"maxDate")}},options,options.end)),checkDates(startTime,endTime),selected(startTime,endTime,"minDate"),selected(endTime,startTime,"maxDate"),$([startTime.get(0),endTime.get(0)])},$.timepicker.log=function(err){window.console&&window.console.log(err)},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(m){return this.setMilliseconds(this.getMilliseconds()+Math.floor(m/1e3)),this.microseconds=m%1e3,this}),$.timepicker.version="@@version"}}(jQuery),egw.extend("calendar",egw.MODULE_WND_LOCAL,function(_app,_wnd){"use strict";function calendarPreferences(_egw){var dateformat=dateTimeFormat(_egw.preference("dateformat")),first_day={Monday:1,Sunday:0,Saturday:6},first_day_pref=_egw.preference("weekdaystarts","calendar");return{dateFormat:dateformat,firstDay:first_day_pref?first_day[first_day_pref]:0}}function dateTimeFormat(_php_format){return _php_format.replace("Y","yy").replace("d","dd").replace("m","mm").replace("M","M").replace("H","hh").replace("i","mm").replace("s","ss")}function timePreferences(_egw){return{timeFormat:12==egw.preference("timeformat")?"h:mmtt":"HH:mm",ampm:"12"==egw.preference("timeformat"),hourGrid:4,minuteGrid:10}}function setupCalendar(_egw,_input,_time,_callback,_context){calendar_translated||(_egw.css(".et2_date input.hasDatepicker:enabled:hover","background-image: url("+egw().image("datepopup")+")"),translateCalendar(),calendar_translated=!0),timepicker_translated||(translateTimepicker(),timepicker_translated=!0);var prefs=calendarPreferences(_egw),params={dateFormat:prefs.dateFormat,firstDay:prefs.firstDay,autoSize:!0,showButtonPanel:!0,showOtherMonths:!0,selectOtherMonths:!0,showWeek:!0,changeMonth:!0,changeYear:!0};_time?(params=jQuery.extend(params,timePreferences(_egw)),_wnd.jQuery(_input).datetimepicker(params)):_wnd.jQuery(_input).datepicker(params)}function setupTime(_egw,_input){timepicker_translated||(translateTimepicker(),timepicker_translated=!0),_wnd.jQuery(_input).timepicker(timePreferences(_egw))}function translateCalendar(){var translate_fields={nextText:!1,currentText:!1,prevText:!1,closeText:!1,dayNames:!1,dayNamesShort:3,dayNamesMin:2,monthNames:!1,monthNamesShort:3},regional={},full=[];for(var i in translate_fields){var trans=_wnd.jQuery.datepicker._defaults[i];if("string"==typeof trans)trans=egw().lang(trans);else{for(var key in trans)translate_fields[i]===!1?trans[key]=egw().lang(trans[key]):"indexOf"!=key&&(trans[key]=full[key].substr(0,translate_fields[i]));translate_fields[i]===!1&&(full=trans)}regional[i]=trans}_wnd.jQuery.datepicker.setDefaults(regional)}function translateTimepicker(){var translate_fields={timeOnlyTitle:!1,timeText:!1,hourText:!1,minuteText:!1,currentText:!1,closeText:!1},regional={};for(var i in translate_fields){var trans=_wnd.jQuery.timepicker._defaults[i];"string"==typeof trans&&(trans=egw().lang(trans)),regional[i]=trans}_wnd.jQuery.timepicker.setDefaults(regional)}var calendar_translated=!1,timepicker_translated=!1;return{calendar:function(_input,_time,_callback,_context){setupCalendar(this,_input,_time,_callback,_context)},time:function(_input,_callback,_context){setupTime(this,_input,_callback,_context)},dateTimeFormat:function(_php_format){return dateTimeFormat(_php_format)},week_start:function(date){var d=new Date(date),day=d.getUTCDay(),diff=0;switch(egw.preference("weekdaystarts","calendar")){case"Saturday":diff=6===day?0:0===day?-1:-(day+1);break;case"Monday":diff=0===day?-6:1-day;break;case"Sunday":default:diff=-day}return d.setUTCDate(d.getUTCDate()+diff),d}}}),egw.extend("data",egw.MODULE_APP_LOCAL,function(_app,_wnd){"use strict";function UID(_uid,_prefix){return _prefix=_prefix?_prefix:_app,_prefix+"::"+_uid}function _clearCache(_prefix){for(var indexes=[],i=0;i<window.localStorage.length;i++){var key=window.localStorage.key(i);if(0==key.indexOf(CACHE_KEY_PREFIX+_prefix)){var cached=JSON.parse(window.localStorage.getItem(key));cached.lastModification?indexes.push({key:key,lastModification:cached.lastModification}):window.localStorage.removeItem(key)}else if(0==key.indexOf(_prefix)){var cached=JSON.parse(window.localStorage.getItem(key));cached.timestamp?indexes.push({key:key,lastModification:cached.timestamp}):window.localStorage.removeItem(key)}}return _prefix&&0==indexes.length?_clearCache(""):indexes.length>0?(indexes.sort(function(a,b){return a.lastModification<b.lastModification?1:a.lastModification>b.lastModification?-1:0}),window.localStorage.removeItem(indexes.pop().key),1):indexes.length}function parseServerResponse(_result,_callback,_context,_execId,_widgetId){if((!_result||"undefined"==typeof _result.type)&&(_result&&"undefined"!=typeof _result.order&&"undefined"!=typeof _result.data||egw.debug("error","Invalid result for 'dataFetch'"),_result.lastModification&&(lastModification=_result.lastModification),_result.order&&_result.data)){if(!(_result.order.length&&_result.order[0]&&_result.order[0].indexOf&&0==_result.order[0].indexOf(_context.prefix)))for(var i=0;i<_result.order.length;i++)_result.order[i]=UID(_result.order[i],_context.prefix);for(var key in _result.data){var uid=UID(key,"object"==typeof _context&&null!=_context?_context.prefix:"");null===_result.data[key]&&("undefined"==typeof _context.refresh||_context.refresh&&!jQuery.inArray(key,_context.refresh))?egw.dataDeleteUID(uid):egw.dataStoreUID(uid,_result.data[key])}if(0==_result.order.length&&"object"==typeof _context&&_context.refresh)for(var i=0;i<_context.refresh.length;i++){var uid=UID(_context.refresh[i],_context.prefix);egw.dataStoreUID(uid,null),egw.dataDeleteUID(uid)}if(window.localStorage&&_context.prefix&&cacheCallback[_context.prefix]&&!_context.no_cache)for(var i=0;i<cacheCallback[_context.prefix].length;i++){var cc=cacheCallback[_context.prefix][i],cache_key=cc.callback.call(cc.context,_context);if(cache_key){cache_key=CACHE_KEY_PREFIX+_context.prefix+"::"+cache_key;try{for(var key in _result.data){var uid=UID(key,"object"==typeof _context&&null!=_context?_context.prefix:"");egw.dataUnregisterUID(uid,null,cache_key),egw.dataRegisterUID(uid,function(data,_uid){if(null==data){var cached=JSON.parse(window.localStorage[this])||!1;cached&&cached.order&&cached.order.indexOf(_uid)>=0&&(cached.order.splice(cached.order.indexOf(_uid),1),cached.total&&cached.total--,window.localStorage[this]=JSON.stringify(cached)),window.localStorage.removeItem(_uid)}else window.localStorage[_uid]=JSON.stringify({timestamp:(new Date).getTime(),data:data})},cache_key,_execId,_widgetId)}_result.data={},window.localStorage.setItem(cache_key,JSON.stringify(_result))}catch(e){if("QuotaExceededError"==e.name||"NS_ERROR_DOM_QUOTA_REACHED"==e.name){var count=_clearCache(_context.prefix);egw.debug("info","localStorage full, removed "+count+" stored datasets")}else egw.debug("warning","Tried to cache some data. It did not work.",cache_key,e)}}}_callback&&_callback.call(_context,{order:_result.order,total:parseInt(_result.total),readonlys:_result.readonlys,rows:_result.rows,lastModification:lastModification})}}var KNOWN_UID_LIMIT=200,CACHE_LIFETIME=29,CACHE_KEY_PREFIX="cached_fetch_",lastModification=null,cacheCallback={};return{dataFetch:function(_execId,_queriedRange,_filters,_widgetId,_callback,_context,_knownUids){var lm=lastModification;"undefined"!=typeof _context.lastModification&&(lm=_context.lastModification),_queriedRange.no_data?lm=0xffffffffffff:_queriedRange.only_data&&(lm=0),"undefined"!=typeof _queriedRange.refresh&&("string"==typeof _queriedRange.refresh?_context.refresh=[_queriedRange.refresh]:_context.refresh=_queriedRange.refresh);var knownUids=_knownUids?_knownUids:egw.dataKnownUIDs(_context.prefix?_context.prefix:_app);if(knownUids>KNOWN_UID_LIMIT&&knownUids.slice("undefined"!=typeof _queriedRange.start?_queriedRange.start:0,KNOWN_UID_LIMIT),window.localStorage&&_context.prefix&&cacheCallback[_context.prefix])for(var i=0;i<cacheCallback[_context.prefix].length;i++){var cc=cacheCallback[_context.prefix][i],cache_key=cc.callback.call(cc.context,_context);if(cache_key){cache_key=CACHE_KEY_PREFIX+_context.prefix+"::"+cache_key;var cached=window.localStorage.getItem(cache_key);if(cached){cached=JSON.parse(cached);var needs_update=!0;cached.lastModification&&Date.now()/1e3-cached.lastModification<CACHE_LIFETIME&&(needs_update=!1),egw.debug("log","Data cached query from "+new Date(1e3*cached.lastModification)+": "+cache_key+"("+(needs_update?"will be":"will not be")+" updated)\nprocessing...");var no_cache=_context.no_cache;if(_context.no_cache=!0,parseServerResponse(cached,_callback,_context,_execId,_widgetId),_context.no_cache=no_cache,cc.notification&&cc.notification.call(cc.context,needs_update),!needs_update)return}}}_context.filters=jQuery.extend({},_filters);var request=egw.json(_app+".etemplate_widget_nextmatch.ajax_get_rows.etemplate",[_execId,_queriedRange,_filters,_widgetId,knownUids,lm],function(result){parseServerResponse(result,_callback,_context,_execId,_widgetId)},this,!0);request.sendRequest()},dataCacheRegister:function(prefix,callback_function,notice_function,context){"undefined"==typeof cacheCallback[prefix]&&(cacheCallback[prefix]=[]),cacheCallback[prefix].push({callback:callback_function,notification:notice_function||!1,context:context||null})},dataCacheUnregister:function(prefix,callback){if("undefined"!=typeof callback)for(var i=0;i<cacheCallback[prefix].length;i++)if(cacheCallback[prefix][i].callback==callback)return void cacheCallback[prefix].splice(i,1);cacheCallback[prefix]=[]}}}),egw.extend("data_storage",egw.MODULE_GLOBAL,function(_app,_wnd){var localStorage={},registeredCallbacks={};egw.registerJSONPlugin(function(type,res,req){return"undefined"!=typeof res.data.uid&&"undefined"!=typeof res.data.data?(this.dataStoreUID(res.data.uid,res.data.data),!0):void 0},egw,"data",!0);var queue={},MAX_AGE=3e5,CLEANUP_INTERVAL=3e4;return _wnd.setInterval(function(){var time=(new Date).getTime();for(var uid in localStorage)time-localStorage[uid].timestamp>MAX_AGE&&"undefined"==typeof registeredCallbacks[uid]&&(egw.dataUnregisterUID(uid),delete localStorage[uid])},CLEANUP_INTERVAL),{dataRegisterUID:function(_uid,_callback,_context,_execId,_widgetId){if("undefined"==typeof registeredCallbacks[_uid]&&(registeredCallbacks[_uid]=[]),registeredCallbacks[_uid].push({callback:_callback,context:_context?_context:null,execId:_execId,widgetId:_widgetId}),"undefined"!=typeof localStorage[_uid])localStorage[_uid].timestamp=(new Date).getTime(),_callback.call(_context,localStorage[_uid].data,_uid);else if(window.localStorage&&window.localStorage[_uid])localStorage[_uid]=JSON.parse(window.localStorage[_uid]),_callback.call(_context,localStorage[_uid].data,_uid);else if(_execId&&_widgetId){var hash=_execId.substring(0,50);if("undefined"==typeof queue[hash]){var self=this;queue[hash]={uids:[],timer:null},queue[hash].timer=window.setTimeout(function(){self.dataFetch(_execId,{start:0,num_rows:0,only_data:!0,refresh:queue[hash].uids},[],_widgetId,null,_context,null),delete queue[hash]},100)}var parts=_uid.split("::");parts.shift(),queue[hash].uids.push(parts.join("::"))}else this.debug("log","Data for uid "+_uid+" not available.")},dataUnregisterUID:function(_uid,_callback,_context){if(_callback=_callback?_callback:null,_context=_context?_context:null,"undefined"!=typeof registeredCallbacks[_uid]){for(var i=registeredCallbacks[_uid].length-1;i>=0;i--)_callback&&registeredCallbacks[_uid][i].callback!==_callback||_context&&registeredCallbacks[_uid][i].context!==_context||registeredCallbacks[_uid].splice(i,1);0===registeredCallbacks[_uid].length&&delete registeredCallbacks[_uid]}},dataHasUID:function(_uid){return"undefined"!=typeof localStorage[_uid]},dataGetUIDdata:function(_uid){return localStorage[_uid]},dataKnownUIDs:function(_prefix){var result=[];for(var key in localStorage){var parts=key.split("::");parts.shift()===_prefix&&localStorage[key].data&&result.push(parts.join("::"))}return result},dataStoreUID:function(_uid,_data){var timestamp=(new Date).getTime();if(localStorage[_uid]={timestamp:timestamp,data:_data},"undefined"!=typeof registeredCallbacks[_uid])for(var i=registeredCallbacks[_uid].length-1;i>=0;i--)try{registeredCallbacks[_uid][i].callback.call(registeredCallbacks[_uid][i].context,_data,_uid)}catch(e){registeredCallbacks[_uid].splice(i,1)}},dataDeleteUID:function(_uid){"undefined"!=typeof localStorage[_uid]&&(delete localStorage[_uid],this.dataUnregisterUID(_uid))},dataRefreshUID:function(_uid){if("undefined"==typeof localStorage[_uid])return!1;if("undefined"!=typeof registeredCallbacks[_uid]&&registeredCallbacks[_uid].length>0){var _execId=registeredCallbacks[_uid][0].execId,nextmatchId=registeredCallbacks[_uid][0].widgetId,uid=_uid.split("::"),context={prefix:uid.shift()};uid=uid.join("::");for(var filters={},i=0;i<registeredCallbacks[_uid].length;i++){var callback=registeredCallbacks[_uid][i];if("object"==typeof callback.context&&"object"==typeof callback.context.self&&"object"==typeof callback.context.self._filters){filters=callback.context.self._filters;break}}return this.dataFetch(_execId,{refresh:uid},filters,nextmatchId,!1,context,[uid]),!0}return!1},dataSearchUIDs:function(_uid){var matches={},f=function(_uid){if("undefined"==typeof matches[_uid]&&(matches[_uid]=[]),"undefined"!=typeof registeredCallbacks[_uid])for(var n=0;n<registeredCallbacks[_uid].length;++n){var callback=registeredCallbacks[_uid][n];"undefined"!=typeof callback.context&&"undefined"!=typeof callback.context.self&&"undefined"!=typeof callback.context.self._widget&&matches[_uid].push(callback.context.self._widget)}};if("object"==typeof _uid&&"RegExp"==_uid.constructor.name)for(var uid in localStorage)_uid.test(uid)&&f(uid);else"undefined"!=typeof localStorage[_uid]&&f(_uid);return matches},dataRefreshUIDs:function(_uid,_type){var uids=this.dataSearchUIDs(_uid),widgets=[],uids4widget=[];for(var uid in uids)for(var n=0;n<uids[uid].length;++n){var widget=uids[uid][n],idx=widgets.indexOf(widget);-1==idx&&(widgets.push(widget),idx=widgets.length-1);var nm_uid=uid.replace(RegExp("^"+widget.controller.dataStorePrefix+"::"),"");"undefined"==typeof uids4widget[idx]?uids4widget[idx]=[nm_uid]:uids4widget[idx].push(nm_uid)}for(var w=0;w<widgets.length;++w)widgets[w].refresh(uids4widget[w],_type);return widgets}}}),jQuery(function(){"use strict";function button_log(buttonId){if("clear_log"!=buttonId){var ajax=new egw_json_request("home.egw_tail.ajax_delete",[filename,"empty_log"==buttonId]);ajax.sendRequest(!0)}$j("#log").text("")}function refresh_log(){var ajax=new egw_json_request("home.egw_tail.ajax_chunk",[filename,log_tail_start]);ajax.sendRequest(!0,function(_data){if(_data.length){log_tail_start=_data.next;var log=$j("#log").append(_data.content.replace(/</g,"&lt;"));log.animate({scrollTop:log.prop("scrollHeight")-log.height()+20},500)}_data.size===!1?$j("#download_log").hide():$j("#download_log").show().attr("title",this.egw.lang("Size")+_data.size),_data.writable===!1?($j("#purge_log").hide(),$j("#empty_log").hide()):($j("#purge_log").show(),$j("#empty_log").show()),window.setTimeout(refresh_log,_data.length?200:2e3)})}function resize_log(){$j("#log").width(egw_getWindowInnerWidth()-20).height(egw_getWindowInnerHeight()-33)}var log_tail_start=0,filename=$j('pre[id^="log"]');"undefined"!=typeof filename&&filename.length>0&&(filename=filename.attr("data-filename")),jQuery('input[id^="clear_log"]').on("click",function(){button_log(this.getAttribute("id"))}),jQuery('input[id^="purge_log"]').on("click",function(){button_log(this.getAttribute("id"))}),jQuery('input[id^="empty_log"]').on("click",function(){button_log(this.getAttribute("id"))}),egw_LAB.wait(function(){$j(document).ready(function(){"undefined"!=typeof filename&&filename.length>0&&(resize_log(),refresh_log())}),$j(window).resize(resize_log)})}),function(){"use strict";function addInterfaceFunctions(prototype,interfaces){var ifaces="undefined"==typeof prototype._ifacefuncs?[]:prototype._ifacefuncs;
prototype._ifacefuncs=[];for(var i=0;i<interfaces.length;i++){var iface=interfaces[i];if(!(iface instanceof Interface))throw"Interfaces must be instance of Interface!";for(var key in iface)prototype._ifacefuncs.push(key)}for(var i=0;i<ifaces.length;i++)prototype._ifacefuncs.push(ifaces[i])}function addAttributeFunctions(prototype,_super){function _copyMerge(_new,_old){var result={};if("undefined"!=typeof _new)for(var key in _new)result[key]=_new[key];for(var key in _old)"undefined"==typeof result[key]&&(result[key]=_old[key]);return result}var attributes={};for(var key in prototype.attributes)attributes[key]=_copyMerge({},prototype.attributes[key]);for(var key in _super.attributes){var _old=_super.attributes[key];attributes[key]=_copyMerge(attributes[key],_old)}prototype._validate_attributes&&prototype._validate_attributes(attributes),prototype.attributes=attributes}function classExtend(interfaces,prop){function Class(){if(!initializing){for(var i=0;i<this._ifacefuncs.length;i++){var func=this._ifacefuncs[i];if("function"!=typeof this[func])throw"Trying to create abstract object, interface function '"+func+"' not implemented."}if(getMem_freeMem_trace){this.__OBJ_UID="obj_"+egw.uid();var className=this.className();tracedObjects[this.__OBJ_UID]={created:(new Date).getTime(),class:className},egw.debug("log","*"+this.__OBJ_UID+" ("+className+")")}this.init&&this.init.apply(this,arguments)}}"undefined"==typeof prop&&(prop=interfaces,interfaces=[]),interfaces instanceof Array||(interfaces=[interfaces]),"undefined"==typeof prop.attributes&&(prop.attributes={});var _super=this.prototype;initializing=!0;var prototype=new this;initializing=!1;for(var name in prop)"function"==typeof prop[name]&&"function"==typeof _super[name]&&fnTest.test(prop[name])?prototype[name]=function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);return this._super=tmp,ret}}(name,prop[name]):prototype[name]=prop[name];return addInterfaceFunctions(prototype,interfaces),addAttributeFunctions(prototype,_super),Class.prototype=prototype,Class.prototype.constructor=Class,Class.extend=classExtend,Class}var initializing=!1,getMem_freeMem_trace=!1,tracedObjects={},fnTest=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Interface=function(fncts){for(var key in fncts)this[key]=fncts[key]},this.Class=function(){},Class.extend=classExtend,Class.prototype.attributes={},Class.prototype._ifacefuncs=[],Class.prototype.free=function(){this.destroy&&this.destroy(),getMem_freeMem_trace&&(delete tracedObjects[this.__OBJ_UID],egw.debug("log","-"+this.__OBJ_UID));for(var key in this)delete this[key];this.free=function(){}},getMem_freeMem_trace&&(Class.prototype.showTrace=function(){console.log(tracedObjects)},Class.prototype.className=function(){for(var key in window)if("et2"==key.substr(0,3)&&this.constructor==window[key])return key;return"?"}),Class.prototype.implements=function(_iface){for(var key in _iface)if(this._ifacefuncs.indexOf(key)<0)return!1;return!0},Class.prototype.instanceOf=function(_obj){return _obj instanceof Interface?this.implements(_obj):this instanceof _obj}}.call(window),egw.extend("message",egw.MODULE_WND_LOCAL,function(_app,_wnd){"use strict";function html_entity_decode(_str){return _str&&-1!=_str.indexOf("&")?jQuery("<span>"+_str+"</span>").text():_str}var message_timer,error_reg_exp,a_href_reg=/<a href="([^"]+)">([^<]+)<\/a>/gim,new_line_reg=/<\/?(p|br)\s*\/?>\n?/gi;return this.registerJSONPlugin(function(type,res,req){if("string"==typeof res.data)return egw.message(res.data,"error"),!0;throw"Invalid parameters"},null,"error"),{message:function(_msg,_type,_discard){var jQuery=_wnd.jQuery;if(_msg&&!_type&&("undefined"==typeof error_reg_exp&&(error_reg_exp=new RegExp("(error|"+egw.lang("error")+")","i")),_type=_msg.match(error_reg_exp)?"error":"success"),!this.is_popup()&&_wnd!==_wnd.top)return void egw(_wnd.top).message(_msg,_type);message_timer&&(_wnd.clearTimeout(message_timer),message_timer=null);var parent=jQuery("div#divAppboxHeader");if(parent.length&&!parent.hasClass("onlyPrint")||(parent=jQuery("body")),jQuery("div#egw_message").remove(),_msg){_msg=_msg.replace(new_line_reg,"\n");var msg_div=jQuery(_wnd.document.createElement("div")).attr("id","egw_message").text(_msg).addClass(_type+"_message").click(function(){if("info"==_type&&_discard&&msg_chkbox&&msg_chkbox.is(":checked")){var discarded=egw.getLocalStorageItem(egw.app_name(),"discardedMsgs");isDiscarded(_msg)||(discarded?jQuery.isArray(JSON.parse(discarded))&&discarded.push(_msg):discarded=[_msg],egw.setLocalStorageItem(egw.app_name(),"discardedMsgs",JSON.stringify(discarded)))}$j(this).remove()}).css("position","absolute");if(_discard&&"info"===_type){var isDiscarded=function(_msg){var discarded=JSON.parse(egw.getLocalStorageItem(egw.app_name(),"discardedMsgs"));if(jQuery.isArray(discarded))for(var i=0;i<discarded.length;i++)if(discarded[i]===_msg)return!0;return!1},msg_discard=jQuery(_wnd.document.createElement("div")).addClass("discard"),msg_chkbox=jQuery(_wnd.document.createElement("input")).attr({type:"checkbox",name:"msgChkbox"}).click(function(e){e.stopImmediatePropagation()}).appendTo(msg_discard);if(jQuery(_wnd.document.createElement("label")).text(egw.lang("Don't show this again")).css({"font-weight":"bold"}).attr({for:"msgChkbox"}).appendTo(msg_discard),isDiscarded(_msg))return;msg_div.append(msg_discard)}parent.prepend(msg_div);var matches=a_href_reg.exec(_msg);if(matches){var parts=_msg.split(matches[0]),href=html_entity_decode(matches[1]);msg_div.text(parts[0]),msg_div.append(jQuery(_wnd.document.createElement("a")).attr({href:href,target:0!=href.indexOf(egw.webserverUrl)?"_blank":"_self"}).text(matches[2])),msg_div.append(jQuery(_wnd.document.createElement("span")).text(parts[1]))}msg_div.css("right",(jQuery(_wnd).innerWidth()-msg_div.width())/2+"px"),"success"==_type&&(message_timer=_wnd.setTimeout(function(){jQuery("div#egw_message").remove()},5e3))}},is_popup:function(){var popup=!1;try{_wnd.opener&&_wnd.opener!=_wnd&&"function"==typeof _wnd.opener.top.egw&&(popup=!0)}catch(e){}return popup},app_name:function(){return!this.is_popup()&&_wnd.framework&&_wnd.framework.activeApp?_wnd.framework.activeApp.appName:_wnd.egw_appName},app_header:function(_header,_app){if(!this.is_popup()&&_wnd.framework&&_wnd.framework.setWebsiteTitle){var app=_app||this.app_name(),title=_wnd.document.title.replace(/[.*]$/,"["+_header+"]");return void _wnd.framework.setWebsiteTitle.call(_wnd.framework,app,title,_header)}_wnd.jQuery("div#divAppboxHeader").text(_header),_wnd.document.title=_wnd.document.title.replace(/[.*]$/,"["+_header+"]")},loading_prompt:function(_id,_stat,_msg,_node,_mode){var $container="",id="egw-loadin-prompt_"+_id||"egw-loading-prompt_1",mode=_mode||"spinner";if(_stat){var $node=jQuery(_node)||jQuery("body"),$container=jQuery(document.createElement("div")).attr("id",id).addClass("egw-loading-prompt-container ui-front");jQuery(document.createElement("span")).addClass("egw-loading-prompt-"+mode+"-msg").text(_msg).appendTo($container),jQuery(document.createElement("div")).addClass("egw-loading-prompt-"+mode+"-animator").appendTo($container);return $container.insertBefore($node),$container}return $container=jQuery("#"+id),$container.length>0&&$container.remove(),null},refresh:function(_msg,_app,_id,_type,_targetapp,_replace,_with,_msg_type,_links){this.debug("log","egw_refresh(%s, %s, %s, %o, %s, %s)",_msg,_app,_id,_type,_targetapp,_replace,_with,_msg_type,_links);var win="undefined"!=typeof _targetapp?_wnd.egw_appWindow(_targetapp):_wnd;this.message(_msg,_msg_type),"undefined"==typeof _links&&(_links=[]);var no_regular_refresh=!1;for(var app in _wnd.egw.window.app){var app_obj=_wnd.egw.window.app[app];"function"==typeof app_obj.observer&&app_obj.observer(_msg,_app,_id,_type,_msg_type,_links)===!1&&app===_app&&(no_regular_refresh=!0)}if(!no_regular_refresh&&(!win.framework||!win.framework.refresh||(win=win.framework.refresh(_msg,_app,_id,_type,_targetapp,_replace,_with,_msg_type)))){if("function"==typeof win.app_refresh&&"undefined"==typeof win.app_refresh.registered||"undefined"!=typeof win.app_refresh&&win.app_refresh.registered(_app))return void win.app_refresh(_msg,_app,_id,_type);if("undefined"!=typeof win.etemplate2&&win.etemplate2.app_refresh){var refresh_done=win.etemplate2.app_refresh(_msg,_app,_id,_type);if((_targetapp||this.app_name())!=_app&&(refresh_done=win.etemplate2.app_refresh(_msg,_targetapp||this.app_name())||refresh_done),refresh_done)return}var href=win.location.href;"undefined"!=typeof _replace&&(href=href.replace("string"==typeof _replace?new RegExp(_replace):_replace,"undefined"!=typeof _with&&null!=_with?_with:"")),-1!=href.indexOf("msg=")?href=href.replace(/msg=[^&]*/,"msg="+encodeURIComponent(_msg)):_msg&&(href+=(-1!=href.indexOf("?")?"&":"?")+"msg="+encodeURIComponent(_msg)),win.location.href=href}}}}),function(){"use strict";function lib$es6$promise$utils$$objectOrFunction(x){return"function"==typeof x||"object"==typeof x&&null!==x}function lib$es6$promise$utils$$isFunction(x){return"function"==typeof x}function lib$es6$promise$utils$$isMaybeThenable(x){return"object"==typeof x&&null!==x}function lib$es6$promise$asap$$setScheduler(scheduleFn){lib$es6$promise$asap$$customSchedulerFn=scheduleFn}function lib$es6$promise$asap$$setAsap(asapFn){lib$es6$promise$asap$$asap=asapFn}function lib$es6$promise$asap$$useNextTick(){return function(){process.nextTick(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useVertxTimer(){return function(){lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useMutationObserver(){var iterations=0,observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush),node=document.createTextNode("");return observer.observe(node,{characterData:!0}),function(){node.data=iterations=++iterations%2}}function lib$es6$promise$asap$$useMessageChannel(){var channel=new MessageChannel;return channel.port1.onmessage=lib$es6$promise$asap$$flush,function(){channel.port2.postMessage(0)}}function lib$es6$promise$asap$$useSetTimeout(){return function(){setTimeout(lib$es6$promise$asap$$flush,1)}}function lib$es6$promise$asap$$flush(){for(var i=0;lib$es6$promise$asap$$len>i;i+=2){var callback=lib$es6$promise$asap$$queue[i],arg=lib$es6$promise$asap$$queue[i+1];callback(arg),lib$es6$promise$asap$$queue[i]=void 0,lib$es6$promise$asap$$queue[i+1]=void 0}lib$es6$promise$asap$$len=0}function lib$es6$promise$asap$$attemptVertx(){try{var r=require,vertx=r("vertx");return lib$es6$promise$asap$$vertxNext=vertx.runOnLoop||vertx.runOnContext,lib$es6$promise$asap$$useVertxTimer()}catch(e){return lib$es6$promise$asap$$useSetTimeout()}}function lib$es6$promise$$internal$$noop(){}function lib$es6$promise$$internal$$selfFulfillment(){return new TypeError("You cannot resolve a promise with itself")}function lib$es6$promise$$internal$$cannotReturnOwn(){return new TypeError("A promises callback cannot return that same promise.")}function lib$es6$promise$$internal$$getThen(promise){try{return promise.then}catch(error){return lib$es6$promise$$internal$$GET_THEN_ERROR.error=error,lib$es6$promise$$internal$$GET_THEN_ERROR}}function lib$es6$promise$$internal$$tryThen(then,value,fulfillmentHandler,rejectionHandler){try{then.call(value,fulfillmentHandler,rejectionHandler)}catch(e){return e}}function lib$es6$promise$$internal$$handleForeignThenable(promise,thenable,then){lib$es6$promise$asap$$asap(function(promise){var sealed=!1,error=lib$es6$promise$$internal$$tryThen(then,thenable,function(value){sealed||(sealed=!0,thenable!==value?lib$es6$promise$$internal$$resolve(promise,value):lib$es6$promise$$internal$$fulfill(promise,value))},function(reason){sealed||(sealed=!0,lib$es6$promise$$internal$$reject(promise,reason))},"Settle: "+(promise._label||" unknown promise"));!sealed&&error&&(sealed=!0,lib$es6$promise$$internal$$reject(promise,error))},promise)}function lib$es6$promise$$internal$$handleOwnThenable(promise,thenable){thenable._state===lib$es6$promise$$internal$$FULFILLED?lib$es6$promise$$internal$$fulfill(promise,thenable._result):thenable._state===lib$es6$promise$$internal$$REJECTED?lib$es6$promise$$internal$$reject(promise,thenable._result):lib$es6$promise$$internal$$subscribe(thenable,void 0,function(value){lib$es6$promise$$internal$$resolve(promise,value)},function(reason){lib$es6$promise$$internal$$reject(promise,reason)})}function lib$es6$promise$$internal$$handleMaybeThenable(promise,maybeThenable){if(maybeThenable.constructor===promise.constructor)lib$es6$promise$$internal$$handleOwnThenable(promise,maybeThenable);else{var then=lib$es6$promise$$internal$$getThen(maybeThenable);then===lib$es6$promise$$internal$$GET_THEN_ERROR?lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$GET_THEN_ERROR.error):void 0===then?lib$es6$promise$$internal$$fulfill(promise,maybeThenable):lib$es6$promise$utils$$isFunction(then)?lib$es6$promise$$internal$$handleForeignThenable(promise,maybeThenable,then):lib$es6$promise$$internal$$fulfill(promise,maybeThenable)}}function lib$es6$promise$$internal$$resolve(promise,value){promise===value?lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$selfFulfillment()):lib$es6$promise$utils$$objectOrFunction(value)?lib$es6$promise$$internal$$handleMaybeThenable(promise,value):lib$es6$promise$$internal$$fulfill(promise,value)}function lib$es6$promise$$internal$$publishRejection(promise){promise._onerror&&promise._onerror(promise._result),lib$es6$promise$$internal$$publish(promise)}function lib$es6$promise$$internal$$fulfill(promise,value){promise._state===lib$es6$promise$$internal$$PENDING&&(promise._result=value,promise._state=lib$es6$promise$$internal$$FULFILLED,0!==promise._subscribers.length&&lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,promise))}function lib$es6$promise$$internal$$reject(promise,reason){promise._state===lib$es6$promise$$internal$$PENDING&&(promise._state=lib$es6$promise$$internal$$REJECTED,promise._result=reason,lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection,promise))}function lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection){var subscribers=parent._subscribers,length=subscribers.length;parent._onerror=null,subscribers[length]=child,subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment,subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection,0===length&&parent._state&&lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,parent)}function lib$es6$promise$$internal$$publish(promise){var subscribers=promise._subscribers,settled=promise._state;if(0!==subscribers.length){for(var child,callback,detail=promise._result,i=0;i<subscribers.length;i+=3)child=subscribers[i],callback=subscribers[i+settled],child?lib$es6$promise$$internal$$invokeCallback(settled,child,callback,detail):callback(detail);promise._subscribers.length=0}}function lib$es6$promise$$internal$$ErrorObject(){this.error=null}function lib$es6$promise$$internal$$tryCatch(callback,detail){try{return callback(detail)}catch(e){return lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e,lib$es6$promise$$internal$$TRY_CATCH_ERROR}}function lib$es6$promise$$internal$$invokeCallback(settled,promise,callback,detail){var value,error,succeeded,failed,hasCallback=lib$es6$promise$utils$$isFunction(callback);if(hasCallback){if(value=lib$es6$promise$$internal$$tryCatch(callback,detail),value===lib$es6$promise$$internal$$TRY_CATCH_ERROR?(failed=!0,error=value.error,value=null):succeeded=!0,promise===value)return void lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$cannotReturnOwn())}else value=detail,succeeded=!0;promise._state!==lib$es6$promise$$internal$$PENDING||(hasCallback&&succeeded?lib$es6$promise$$internal$$resolve(promise,value):failed?lib$es6$promise$$internal$$reject(promise,error):settled===lib$es6$promise$$internal$$FULFILLED?lib$es6$promise$$internal$$fulfill(promise,value):settled===lib$es6$promise$$internal$$REJECTED&&lib$es6$promise$$internal$$reject(promise,value))}function lib$es6$promise$$internal$$initializePromise(promise,resolver){try{resolver(function(value){lib$es6$promise$$internal$$resolve(promise,value)},function(reason){lib$es6$promise$$internal$$reject(promise,reason)})}catch(e){lib$es6$promise$$internal$$reject(promise,e)}}function lib$es6$promise$enumerator$$Enumerator(Constructor,input){var enumerator=this;enumerator._instanceConstructor=Constructor,enumerator.promise=new Constructor(lib$es6$promise$$internal$$noop),enumerator._validateInput(input)?(enumerator._input=input,enumerator.length=input.length,enumerator._remaining=input.length,enumerator._init(),0===enumerator.length?lib$es6$promise$$internal$$fulfill(enumerator.promise,enumerator._result):(enumerator.length=enumerator.length||0,enumerator._enumerate(),0===enumerator._remaining&&lib$es6$promise$$internal$$fulfill(enumerator.promise,enumerator._result))):lib$es6$promise$$internal$$reject(enumerator.promise,enumerator._validationError())}function lib$es6$promise$promise$all$$all(entries){return new lib$es6$promise$enumerator$$default(this,entries).promise}function lib$es6$promise$promise$race$$race(entries){function onFulfillment(value){lib$es6$promise$$internal$$resolve(promise,value)}function onRejection(reason){lib$es6$promise$$internal$$reject(promise,reason)}var Constructor=this,promise=new Constructor(lib$es6$promise$$internal$$noop);if(!lib$es6$promise$utils$$isArray(entries))return lib$es6$promise$$internal$$reject(promise,new TypeError("You must pass an array to race.")),promise;for(var length=entries.length,i=0;promise._state===lib$es6$promise$$internal$$PENDING&&length>i;i++)lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]),void 0,onFulfillment,onRejection);return promise}function lib$es6$promise$promise$resolve$$resolve(object){var Constructor=this;if(object&&"object"==typeof object&&object.constructor===Constructor)return object;var promise=new Constructor(lib$es6$promise$$internal$$noop);return lib$es6$promise$$internal$$resolve(promise,object),promise}function lib$es6$promise$promise$reject$$reject(reason){var Constructor=this,promise=new Constructor(lib$es6$promise$$internal$$noop);return lib$es6$promise$$internal$$reject(promise,reason),promise}function lib$es6$promise$promise$$needsResolver(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function lib$es6$promise$promise$$needsNew(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function lib$es6$promise$promise$$Promise(resolver){this._id=lib$es6$promise$promise$$counter++,this._state=void 0,this._result=void 0,this._subscribers=[],lib$es6$promise$$internal$$noop!==resolver&&(lib$es6$promise$utils$$isFunction(resolver)||lib$es6$promise$promise$$needsResolver(),this instanceof lib$es6$promise$promise$$Promise||lib$es6$promise$promise$$needsNew(),lib$es6$promise$$internal$$initializePromise(this,resolver))}function lib$es6$promise$polyfill$$polyfill(){var local;if("undefined"!=typeof global)local=global;else if("undefined"!=typeof self)local=self;else try{local=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var P=local.Promise;P&&"[object Promise]"===Object.prototype.toString.call(P.resolve())&&!P.cast||(local.Promise=lib$es6$promise$promise$$default)}var lib$es6$promise$utils$$_isArray;lib$es6$promise$utils$$_isArray=Array.isArray?Array.isArray:function(x){return"[object Array]"===Object.prototype.toString.call(x)};var lib$es6$promise$asap$$vertxNext,lib$es6$promise$asap$$customSchedulerFn,lib$es6$promise$asap$$scheduleFlush,lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray,lib$es6$promise$asap$$len=0,lib$es6$promise$asap$$asap=({}.toString,function(callback,arg){lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback,lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg,lib$es6$promise$asap$$len+=2,2===lib$es6$promise$asap$$len&&(lib$es6$promise$asap$$customSchedulerFn?lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush):lib$es6$promise$asap$$scheduleFlush())}),lib$es6$promise$asap$$browserWindow="undefined"!=typeof window?window:void 0,lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow||{},lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver||lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver,lib$es6$promise$asap$$isNode="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),lib$es6$promise$asap$$isWorker="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,lib$es6$promise$asap$$queue=new Array(1e3);lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$isNode?lib$es6$promise$asap$$useNextTick():lib$es6$promise$asap$$BrowserMutationObserver?lib$es6$promise$asap$$useMutationObserver():lib$es6$promise$asap$$isWorker?lib$es6$promise$asap$$useMessageChannel():void 0===lib$es6$promise$asap$$browserWindow&&"function"==typeof require?lib$es6$promise$asap$$attemptVertx():lib$es6$promise$asap$$useSetTimeout();var lib$es6$promise$$internal$$PENDING=void 0,lib$es6$promise$$internal$$FULFILLED=1,lib$es6$promise$$internal$$REJECTED=2,lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject,lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject;lib$es6$promise$enumerator$$Enumerator.prototype._validateInput=function(input){return lib$es6$promise$utils$$isArray(input)},lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},lib$es6$promise$enumerator$$Enumerator.prototype._init=function(){this._result=new Array(this.length)};var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function(){for(var enumerator=this,length=enumerator.length,promise=enumerator.promise,input=enumerator._input,i=0;promise._state===lib$es6$promise$$internal$$PENDING&&length>i;i++)enumerator._eachEntry(input[i],i)},lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function(entry,i){var enumerator=this,c=enumerator._instanceConstructor;lib$es6$promise$utils$$isMaybeThenable(entry)?entry.constructor===c&&entry._state!==lib$es6$promise$$internal$$PENDING?(entry._onerror=null,enumerator._settledAt(entry._state,i,entry._result)):enumerator._willSettleAt(c.resolve(entry),i):(enumerator._remaining--,enumerator._result[i]=entry)},lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function(state,i,value){var enumerator=this,promise=enumerator.promise;promise._state===lib$es6$promise$$internal$$PENDING&&(enumerator._remaining--,state===lib$es6$promise$$internal$$REJECTED?lib$es6$promise$$internal$$reject(promise,value):enumerator._result[i]=value),0===enumerator._remaining&&lib$es6$promise$$internal$$fulfill(promise,enumerator._result)},lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function(promise,i){var enumerator=this;lib$es6$promise$$internal$$subscribe(promise,void 0,function(value){enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED,i,value)},function(reason){enumerator._settledAt(lib$es6$promise$$internal$$REJECTED,i,reason)})};var lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all,lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race,lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve,lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject,lib$es6$promise$promise$$counter=0,lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default,lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default,lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default,lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default,lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler,lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap,lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap,lib$es6$promise$promise$$Promise.prototype={constructor:lib$es6$promise$promise$$Promise,then:function(onFulfillment,onRejection){var parent=this,state=parent._state;if(state===lib$es6$promise$$internal$$FULFILLED&&!onFulfillment||state===lib$es6$promise$$internal$$REJECTED&&!onRejection)return this;var child=new this.constructor(lib$es6$promise$$internal$$noop),result=parent._result;if(state){var callback=arguments[state-1];lib$es6$promise$asap$$asap(function(){lib$es6$promise$$internal$$invokeCallback(state,child,callback,result)})}else lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection);return child},catch:function(onRejection){return this.then(null,onRejection)}};var lib$es6$promise$polyfill$$default=lib$es6$promise$polyfill$$polyfill,lib$es6$promise$umd$$ES6Promise={Promise:lib$es6$promise$promise$$default,polyfill:lib$es6$promise$polyfill$$default};"function"==typeof define&&define.amd?define(function(){return lib$es6$promise$umd$$ES6Promise}):"undefined"!=typeof module&&module.exports?module.exports=lib$es6$promise$umd$$ES6Promise:"undefined"!=typeof this&&(this.ES6Promise=lib$es6$promise$umd$$ES6Promise),lib$es6$promise$polyfill$$default()}.call(this),app={classes:{}};var AppJS=function(){"use strict";return Class.extend({appname:"",et2:null,egw:null,init:function(){if(window.app[this.appname]=this,this.egw=egw(this.appname,window),!this.egw.is_popup()){var sidebox=jQuery("#favorite_sidebox_"+this.appname);if(0==sidebox.length&&null!=egw_getFramework()){var egw_fw=egw_getFramework();sidebox=$j("#favorite_sidebox_"+this.appname,egw_fw.sidemenuDiv)}window.top.app[this.appname]!==this&&window.top.app[this.appname]?window.top.app[this.appname]._init_sidebox(sidebox):this._init_sidebox(sidebox)}},destroy:function(_app){delete this.et2,this.sidebox&&this.sidebox.off(),delete this.sidebox,_app||delete window.app[this.appname]},et2_ready:function(et2,name){null!==this.et2&&egw.debug("log","Changed et2 object"),this.et2=et2.widgetContainer,this._fix_iFrameScrolling(),this.egw&&this.egw.is_popup()&&this._set_Window_title(),this.highlight_favorite()},observer:function(_msg,_app,_id,_type,_msg_type,_links){},open:function(_action,_senders){var id_app=_senders[0].id.split("::");egw.open(id_app[1],this.appname)},action:function(_action,_elems){var select_all=_action.getManager().getActionById("select_all"),confirm_msg=(_elems.length>1||select_all&&select_all.checked)&&"undefined"!=typeof _action.data.confirm_multiple?_action.data.confirm_multiple:_action.data.confirm;if("undefined"!=typeof confirm_msg){var that=this,action_id=_action.id;et2_dialog.show_dialog(function(button_id,value){button_id!=et2_dialog.NO_BUTTON&&that._do_action(action_id,_elems)},confirm_msg,egw.lang("Confirmation required"),et2_dialog.BUTTONS_YES_NO,et2_dialog.QUESTION_MESSAGE)}else if("function"==typeof this._do_action)this._do_action(_action.id,_elems);else{for(var nm=null,action=_action;null==nm&&null!=action.parent;)action.data.nextmatch&&(nm=action.data.nextmatch),action=action.parent;if(null!=nm){var value={};value[nm.options.settings.action_var]=_action.id,nm.set_value(value),nm.getInstanceManager().submit()}}},setState:function(state,template){if("string"==typeof state&&(-1==state.indexOf("{")&&"null"!=state||(state=JSON.parse(state))),"object"!=typeof state)return void egw.debug("error","Unable to set state to %o, needs to be an object",state);if(null==state&&(state={}),state.state&&state.state.id&&state.state.app)return egw.open(state.state,void 0,void 0,{},"_self");for(var nextmatched=!1,et2=template?etemplate2.getByTemplate(template):etemplate2.getByApplication(this.appname),i=0;i<et2.length;i++)if(et2[i].widgetContainer.iterateOver(function(_widget){state.state&&state.state.search&&(state.state.search=unescape(state.state.search)),state.state&&state.state.sort&&state.state.sort.id&&_widget.sortBy(state.state.sort.id,state.state.sort.asc,!1),state.state&&state.state.selectcols&&_widget.set_columns(jQuery.extend([],state.state.selectcols)),_widget.applyFilters(state.state||state.filter||{}),nextmatched=!0},this,et2_nextmatch),nextmatched)return!1;var safe_name=jQuery.isEmptyObject(state)||jQuery.isEmptyObject(state.state||state.filter)?"blank":state.name.replace(/[^A-Za-z0-9-_]/g,"_"),url="/"+this.appname+"/index.php";return egw.link_get_registry(this.appname,"list")?url=egw.link("/index.php",jQuery.extend({favorite:safe_name},egw.link_get_registry(this.appname,"list"))):egw.app(this.appname).index&&(url=egw.link("/index.php","menuaction="+egw.app(this.appname).index+"&favorite="+safe_name)),egw.open_link(url,void 0,void 0,this.appname),!1},getState:function(){for(var state={},et2=etemplate2.getByApplication(this.appname),i=0;i<et2.length;i++)et2[i].widgetContainer.iterateOver(function(_widget){state=_widget.getValue()},this,et2_nextmatch);return state},viewEntry:function(_action,_senders,_noEdit,et2_callback){var id=_senders[0].id,noEdit=_noEdit||!1,rowID="",content={},self=this;if(id){var parts=id.split("::");rowID=parts[1],content=egw.dataGetUIDdata(id),content.data&&(content=content.data)}var app={classes:window.app.classes},destroy=function(){self.viewContainer.remove(),delete self.viewTemplate,delete self.viewContainer,delete self.et2_view,this.destroy(app);for(var v in self)this[v]=self[v];app=null};this.viewContainer=jQuery(document.createElement("div")).addClass("et2_mobile_view").css({"z-index":102,width:"100%",height:"100%",background:"white",display:"block",position:"fixed",top:0,left:0,bottom:0,right:0,overflow:"auto",padding:"60px 0 10px 0"}).attr("id","popupMainDiv").appendTo("body");jQuery(document.createElement("span")).addClass("egw_fw_mobile_popup_close loaded").click(function(){destroy.call(app[self.appname])}).appendTo(this.viewContainer);if(!noEdit){jQuery(document.createElement("span")).addClass("mobile-view-editBtn").click(function(){egw.open(rowID,self.appname)}).text(egw.lang("Edit")).appendTo(this.viewContainer)}this.viewTemplate=jQuery(document.createElement("div")).attr("id",this.appname+"-view").addClass("et2_mobile-view-container").appendTo(this.viewContainer);var templateName=_action.data.mobileViewTemplate||"edit",templateURL=egw.webserverUrl+"/"+this.appname+"/templates/mobile/"+templateName+".xet?1",data={content:content,readonlys:{__ALL__:!0,link_to:!1},currentapp:this.appname};this.et2_view=new etemplate2(this.viewTemplate[0],!1),templateName&&this.et2_view.load(this.appname+"."+templateName,templateURL,data,"function"==typeof et2_callback?et2_callback:function(){},app),app[this.appname].close=destroy},_init_sidebox:function(sidebox){if(!this.egw.is_popup()){var egw_fw=egw_getFramework(),tutorial=$j("#egw_tutorial_"+this.appname+"_sidebox",egw_fw?egw_fw.sidemenuDiv:document);tutorial.length&&!this.tutorial_initialised&&(this.egwTutorial_init(tutorial[0]),this.tutorial_initialised=!0)}if(sidebox.length){var self=this;this.sidebox&&this.sidebox.off(),this.sidebox=sidebox,sidebox.off().on("click.sidebox","div.ui-icon-trash",this,this.delete_favorite).on("click.sidebox","li[data-id]",this,function(event){var li=$j(this);li.siblings().removeClass("ui-state-highlight"),"blank"!==li.attr("data-id")&&window.setTimeout(function(){li.addClass("ui-state-highlight")},50);var state={},pref=egw.preference("favorite_"+this.dataset.id,self.appname);return pref&&jQuery.extend(!0,state,pref),"add"!=this.dataset.id?(event.stopImmediatePropagation(),self.setState.call(self,state),!1):void 0}).addClass("ui-helper-clearfix"),jQuery("ul","#favorite_sidebox_"+this.appname).sortable({
items:'li:not([data-id$="add"])',placeholder:"ui-fav-sortable-placeholder",delay:250,helper:function(event,item){item.attr("data-appname",self.appname);var h_parent=item.parent().parent().clone();return h_parent.find("li").not('[data-id="'+item.attr("data-id")+'"]').remove(),h_parent.appendTo("body"),h_parent},refreshPositions:!0,update:function(event,ui){var favSortedList=jQuery(this).sortable("toArray",{attribute:"data-id"});self.egw.set_preference(self.appname,"fav_sort_pref",favSortedList),self._refresh_fav_nm()}});var egw_fw=egw_getFramework();return egw_fw&&egw_fw.applications[this.appname]&&egw_fw.applications[this.appname].browser&&egw_fw.applications[this.appname].browser.baseDiv&&$j(egw_fw.applications[this.appname].browser.baseDiv).off(".sidebox").on("change.sidebox",function(){self.highlight_favorite()}),!0}return!1},add_favorite:function(state){"undefined"==typeof this.favorite_popup&&this._create_favorite_popup(),this.favorite_popup.state=jQuery.extend({},this.getState(),state||{}),this.favorite_popup.state=jQuery.extend(!0,{},this.favorite_popup.state);var filter_list=[],add_to_popup=function(arr){filter_list.push("<ul>"),jQuery.each(arr,function(index,filter){filter_list.push("<li id='index'><span class='filter_id'>"+index+"</span>"+("object"!=typeof filter?"<span class='filter_value'>"+filter+"</span>":"")),"object"==typeof filter&&null!=filter&&add_to_popup(filter),filter_list.push("</li>")}),filter_list.push("</ul>")};return add_to_popup(this.favorite_popup.state),$j("#"+this.appname+"_favorites_popup_state",this.favorite_popup).replaceWith($j(filter_list.join("")).attr("id",this.appname+"_favorites_popup_state")),$j("#"+this.appname+"_favorites_popup_state",this.favorite_popup).hide().siblings(".ui-icon-circle-plus").removeClass("ui-icon-circle-minus"),this.favorite_popup.dialog("open"),console.log(this),!1},_refresh_fav_nm:function(){var self=this;if(!etemplate2||!etemplate2.getByApplication)throw new Error("_refresh_fav_nm():Either et2 is not ready/ not there yet. Make sure that etemplate2 is ready before call this method.");for(var et2=etemplate2.getByApplication(self.appname),i=0;i<et2.length;i++)et2[i].widgetContainer.iterateOver(function(_widget){_widget.stored_filters=_widget.load_favorites(self.appname),_widget.init_filters(_widget)},self,et2_favorites)},_create_favorite_popup:function(){var self=this,favorite_prefix="favorite_";this.favorite_popup&&this.favorite_popup.group&&(this.favorite_popup.group.free(),delete this.favorite_popup),this.favorite_popup=$j('<div id="'+this.dom_id+'_nm_favorites_popup" title="'+egw().lang("New favorite")+'"> <form> <label for="name">'+this.egw.lang("name")+'</label><input type="text" name="name" id="name"/> <div id="'+this.appname+'_favorites_popup_admin"/> <span>'+this.egw.lang("Details")+'</span><span style="float:left;" class="ui-icon ui-icon-circle-plus ui-button" /> <ul id="'+this.appname+'_favorites_popup_state"/> </form> </div>').appendTo(this.et2&&"calendar"!=this.appname?this.et2.getDOMNode():$j("body")),$j(".ui-icon-circle-plus",this.favorite_popup).prev().andSelf().click(function(){$j("#"+self.appname+"_favorites_popup_state",self.favorite_popup).slideToggle().siblings(".ui-icon-circle-plus").toggleClass("ui-icon-circle-minus")});var apps=egw().user("apps"),is_admin="undefined"!=typeof apps.admin;is_admin&&(this.favorite_popup.group=et2_createWidget("select-account",{id:"favorite[group]",account_type:"groups",empty_label:"Groups",no_lang:!0,parent_node:this.appname+"_favorites_popup_admin"},this.et2&&"calendar"!=this.appname?this.et2:null),this.favorite_popup.group.loadingFinished());var buttons={};return buttons.save={text:this.egw.lang("save"),default:!0,click:function(){var name=$j("#name",this);if(name.val()){name.val(name.val().replace(/(<([^>]+)>)/gi,""));var safe_name=name.val().replace(/[^A-Za-z0-9-_]/g,"_"),favorite={name:name.val(),group:"undefined"!=typeof self.favorite_popup.group&&self.favorite_popup.group.get_value()?self.favorite_popup.group.get_value():!1,state:self.favorite_popup.state},favorite_pref=favorite_prefix+safe_name;if("undefined"!=typeof self.favorite_popup.group&&""!=self.favorite_popup.group.getValue()?(self.egw.jsonq(self.appname+".egw_framework.ajax_set_favorite.template",[self.appname,name.val(),"add",self.favorite_popup.group.get_value(),self.favorite_popup.state]),self.favorite_popup.group.set_value("")):self.egw.set_preference(self.appname,favorite_pref,favorite),self.sidebox){$j('[data-id="'+safe_name+'"]',self.sidebox).remove();var html="<li data-id='"+safe_name+"' data-group='"+favorite.group+"' class='ui-menu-item' role='menuitem'>\n",href="javascript:app."+self.appname+".setState("+JSON.stringify(favorite)+");";html+="<a href='"+href+"' class='ui-corner-all' tabindex='-1'>",html+="<div class='sideboxstar'></div>"+favorite.name,html+="<div class='ui-icon ui-icon-trash' title='"+egw.lang("Delete")+"'/>",html+="</a></li>\n",$j(html).insertBefore($j("li",self.sidebox).last()),self._init_sidebox(self.sidebox)}self._refresh_fav_nm()}delete self.favorite_popup.state,name.val(""),$j("#filters",self.favorite_popup).empty(),$j(this).dialog("close")}},buttons[this.egw.lang("cancel")]=function(){"undefined"!=typeof self.favorite_popup.group&&self.favorite_popup.group.set_value&&self.favorite_popup.group.set_value(null),$j(this).dialog("close")},this.favorite_popup.dialog({autoOpen:!1,modal:!0,buttons:buttons,close:function(){}}),this.favorite_popup.off("keydown").on("keydown",jQuery.proxy(function(e){var tagName=e.target.tagName.toLowerCase();return tagName="input"===tagName&&"button"===e.target.type?"button":tagName,e.keyCode==jQuery.ui.keyCode.ENTER&&"textarea"!==tagName&&"select"!==tagName&&"button"!==tagName?(e.preventDefault(),$j("button[default]",this.favorite_popup.parent()).trigger("click"),!1):void 0},this)),!1},delete_favorite:function(event){event.stopImmediatePropagation();var app=event.data,id=$j(this).parentsUntil("li").parent().attr("data-id"),group=$j(this).parentsUntil("li").parent().attr("data-group")||"",line=$j('li[data-id="'+id+'"]',app.sidebox),name=line.first().text(),trash=this;line.addClass("loading");var do_delete=function(button_id){if(button_id!=et2_dialog.YES_BUTTON)return void line.removeClass("loading");$j(trash).hide();var request=egw.json(app.appname+".egw_framework.ajax_set_favorite.template",[app.appname,id,"delete",group,""],function(result){result.type||(result&&"boolean"==typeof result?(line.slideUp("slow",function(){}),app._refresh_fav_nm()):line.removeClass("loading").addClass("ui-state-error"))},$j(trash).parentsUntil("li").parent(),!0,$j(trash).parentsUntil("li").parent());request.sendRequest(!0)};return et2_dialog.show_dialog(do_delete,egw.lang("Delete")+" "+name+"?","Delete",et2_dialog.YES_NO,et2_dialog.QUESTION_MESSAGE),!1},highlight_favorite:function(){if(this.sidebox){var state=this.getState(),best_match=!1,best_count=0,self=this;$j("li[data-id]",this.sidebox).removeClass("ui-state-highlight"),$j("li[data-id]",this.sidebox).each(function(i,href){var favorite={};if(this.dataset.id&&egw.preference("favorite_"+this.dataset.id,self.appname)&&(favorite=egw.preference("favorite_"+this.dataset.id,self.appname)),favorite&&!jQuery.isEmptyObject(favorite)){var match_count=0;for(var state_key in state)if("undefined"==typeof favorite.state||"undefined"==typeof state[state_key]||"undefined"==typeof favorite.state[state_key]||state[state_key]!=favorite.state[state_key]&&(state[state_key]||favorite.state[state_key])){if("undefined"!=typeof state[state_key]&&state[state_key]&&"object"==typeof state[state_key]&&"undefined"!=typeof favorite.state&&"undefined"!=typeof favorite.state[state_key]&&favorite.state[state_key]&&"object"==typeof favorite.state[state_key]){if(("undefined"!=typeof state[state_key].length||"undefined"!=typeof state[state_key].length)&&(state[state_key].length||Object.keys(state[state_key]).length)!=(favorite.state[state_key].length||Object.keys(favorite.state[state_key]).length)){if(!(0!==state[state_key].length&&0!==Object.keys(state[state_key]).length||0!=favorite.state[state_key].length&&0!==Object.keys(favorite.state[state_key]).length))continue;return}for(var sub_key in state[state_key])if(state[state_key][sub_key]==favorite.state[state_key][sub_key]||!state[state_key][sub_key]&&!favorite.state[state_key][sub_key])match_count++;else if(state[state_key][sub_key]&&favorite.state[state_key][sub_key]&&"object"==typeof state[state_key][sub_key]&&"object"==typeof favorite.state[state_key][sub_key])JSON.stringify(state[state_key][sub_key])===JSON.stringify(favorite.state[state_key][sub_key])&&match_count++;else if(state[state_key][sub_key]&&state[state_key][sub_key]!=favorite.state[state_key][sub_key])return}else if("selectcols"==state_key);else if("undefined"!=typeof state[state_key]&&"undefined"!=typeof favorite.state&&"undefined"!=typeof favorite.state[state_key]&&state[state_key]!=favorite.state[state_key])return}else match_count++;match_count>best_count&&(best_match=this.dataset.id,best_count=match_count)}}),best_match&&$j('li[data-id="'+best_match+'"]',this.sidebox).addClass("ui-state-highlight")}},_fix_iFrameScrolling:function(){/iPhone|iPod|iPad/.test(navigator.userAgent)&&jQuery("iframe").on({load:function(){for(var body=this.contentWindow.document.body,div=jQuery(document.createElement("div")).css({height:jQuery(this.parentNode).height(),width:jQuery(this.parentNode).width(),overflow:"scroll"});body.firstChild;)div.append(body.firstChild);jQuery(body).append(div)}})},_set_Window_title:function(){var title=this.getWindowTitle();title&&(document.title=this.et2._inst.uniqueId+": "+title)},getWindowTitle:function(){var titleWidget=this.et2.getWidgetById("title");return titleWidget?titleWidget.options.value:this.et2._inst.uniqueId},handle_dropped_mail:function(_action,_selected,_target){var ids=_target.id.split("::");if(2==ids.length&&"mail"!=ids[0]){for(var vfs_path="/apps/"+ids[0]+"/"+ids[1],mail_ids=[],i=0;i<_selected.length;i++)mail_ids.push(_selected[i].id);mail_ids.length&&(egw.message(egw.lang("Please wait...")),this.egw.json("filemanager.filemanager_ui.ajax_action",["mail",mail_ids,vfs_path],function(data){egw.refresh(data.msg||"",ids[0],ids[1],"update")}).sendRequest(!0))}},egwTutorialGetData:function(){var self=this;return new Promise(function(_resolve,_reject){var resolve=_resolve;self.egw.json("home.home_tutorial_ui.ajax_data",[self.egw.app_name()],function(_data){resolve(_data)}).sendRequest()})},egwTutorial_init:function(div){var etemplate=new etemplate2(div,!1),template=egw.webserverUrl+"/etemplate/templates/default/egw_tutorial.xet?1";this.egwTutorialGetData().then(function(_data){var lang=egw.preference("lang"),content={content:{list:[]}};if(_data&&_data[egw.app_name()]&&(_data[egw.app_name()][lang]||(lang="en"),"undefined"!=typeof _data[egw.app_name()][lang]&&_data[egw.app_name()][lang].length>0)){for(var i=0;i<_data[egw.app_name()][lang].length;i++){var tuid=egw.app_name()+"-"+lang+"-"+i;_data[egw.app_name()][lang][i].onclick="app."+egw.app_name()+'.egwTutorialPopup("'+tuid+'")'}content.content.list=_data[egw.app_name()][lang],template.indexOf(".xet")>0?etemplate.load("",template,content,function(){}):etemplate.load(template,"",content)}},function(_err){console.log(_err)})},egwTutorialPopup:function(_tuid){var url=egw.link("/index.php","menuaction=home.home_tutorial_ui.popup&tuid="+_tuid);egw.open_link(url,"_blank","960x580")},mailvelopeAvailable:function(_callback){var self=this,callback=jQuery.proxy(_callback,this);"undefined"!=typeof mailvelope?this.mailvelopeOpenKeyring().then(callback):jQuery(window).on("mailvelope",function(){self.mailvelopeOpenKeyring().then(callback)})},mailvelopeSyncHandlerObj:{uploadSync:function(_uploadObj){return new Promise(function(_resolve,_reject){})},downloadSync:function(_downloadObj){return new Promise(function(_resolve,_reject){})},backup:function(_backup){return new Promise(function(_resolve,_reject){jQuery.ajax({method:"PUT",url:egw.webserverUrl+"/webdav.php/home/"+egw.user("account_lid")+"/.PK_PGP",contentType:"application/json",data:JSON.stringify(_backup),success:function(){_resolve(_backup)},error:function(_err){_reject(_err)}})})},restore:function(){return new Promise(function(_resolve,_reject){var resolve=_resolve,reject=_reject;jQuery.ajax({url:egw.webserverUrl+"/webdav.php/home/"+egw.user("account_lid")+"/.PK_PGP",method:"GET",success:function(_backup){resolve(JSON.parse(_backup)),egw.message("Your key has been restored successfully.")},error:function(_err){reject(_err)}})})}},_mailvelopeBackupFileOperator:function(_url,_cmd,_successCallback,_errorCallback,_data){var ajaxObj={url:_url||egw.webserverUrl+"/webdav.php/home/"+egw.user("account_lid")+"/.PK_PGP",method:_cmd,success:_successCallback,error:_errorCallback};switch(_cmd){case"PUT":jQuery.extend({},ajaxObj,{data:JSON.stringify(_data),contentType:"application/json"});break;case"GET":jQuery.extend({},ajaxObj,{dataType:"json"});break;case"DELETE":}jQuery.ajax(ajaxObj)},mailvelopeCreateBackupDialog:function(_selector,_initSetup){var self=this,selector=_selector||"body",initSetup=_initSetup;return jQuery('iframe[src^="chrome-extension"],iframe[src^="about:blank?mvelo"]').remove(),new Promise(function(_resolve,_reject){var resolve=_resolve,reject=_reject;mailvelope.getKeyring("egroupware").then(function(_keyring){_keyring.addSyncHandler(self.mailvelopeSyncHandlerObj);var options={initialSetup:initSetup};_keyring.createKeyBackupContainer(selector,options).then(function(_popupId){var $backup_selector=jQuery('iframe[src^="chrome-extension"],iframe[src^="about:blank?mvelo"]');$backup_selector.css({position:"absolute","z-index":1}),resolve(_popupId)},function(_err){reject(_err)})},function(_err){reject(_err)})})},mailvelopeDeleteBackup:function(){var self=this;et2_dialog.show_dialog(function(_button_id){_button_id==et2_dialog.YES_BUTTON&&self._mailvelopeBackupFileOperator(void 0,"DELETE",function(){self.egw.message(self.egw.lang("The backup key has been deleted."))},function(_err){self.egw.message(self.egw.lang("Was not able to delete the backup key because %1",_err))})},self.egw.lang("Are you sure, you would like to delete the backup key?"),self.egw.lang("Delete backup key"),{},et2_dialog.BUTTONS_YES_CANCEL,et2_dialog.QUESTION_MESSAGE,void 0,self.egw)},mailvelopeCreateRestoreDialog:function(_selector,_restorePassword){var self=this,restorePassword=_restorePassword,selector=_selector||"body";return jQuery('iframe[src^="chrome-extension"],iframe[src^="about:blank?mvelo"]').remove(),new Promise(function(_resolve,_reject){var resolve=_resolve,reject=_reject;mailvelope.getKeyring("egroupware").then(function(_keyring){_keyring.addSyncHandler(self.mailvelopeSyncHandlerObj);var options={restorePassword:restorePassword};_keyring.restoreBackupContainer(selector,options).then(function(_restoreId){var $restore_selector=jQuery('iframe[src^="chrome-extension"],iframe[src^="about:blank?mvelo"]');$restore_selector.css({position:"absolute","z-index":1}),resolve(_restoreId)},function(_err){reject(_err)})},function(_err){reject(_err)})})},mailvelopeCreateBackupRestoreDialog:function(){var self=this,appname=egw.app_name(),menu=[{},{label:"Restore key",image:"lock",onclick:"app."+appname+".mailvelopeCreateRestoreDialog('#_mvelo')"},{label:"Restore password",image:"password",onclick:"app."+appname+".mailvelopeCreateRestoreDialog('#_mvelo', true)"},{label:"Delete backup",image:"delete",onclick:"app."+appname+".mailvelopeDeleteBackup"},{label:"Backup Key",image:"save",onclick:"app."+appname+".mailvelopeCreateBackupDialog('#_mvelo', false)"}],dialog=function(_content,_callback){return et2_createWidget("dialog",{callback:function(_button_id,_value){"function"==typeof _callback&&_callback.call(this,_button_id,_value.value)},title:egw.lang("Backup/Restore"),buttons:[{button_id:"close",text:"Close",id:"dialog[close]",image:"cancelled",default:!0}],value:{content:{menu:_content}},template:egw.webserverUrl+"/etemplate/templates/default/pgp_backup_restore.xet",class:"pgp_backup_restore",modal:!0})};"undefined"!=typeof mailvelope?mailvelope.getKeyring("egroupware").then(function(_keyring){self._mailvelopeBackupFileOperator(void 0,"GET",function(_data){dialog(menu)},function(){menu.splice(3,1),menu[3].onclick="app."+appname+".mailvelopeCreateBackupDialog('#_mvelo', true)",dialog(menu)})},function(){mailvelope.createKeyring("egroupware").then(function(){dialog(menu)})}):this.mailvelopeInstallationOffer()},mailvelopeInstallationOffer:function(){var buttons=[{text:"Install",id:"install",image:"check",default:!0},{text:"Close",id:"close",image:"cancelled"}],dialog=function(_content,_callback){return et2_createWidget("dialog",{callback:function(_button_id,_value){"function"==typeof _callback&&_callback.call(this,_button_id,_value.value)},title:egw.lang("PGP Encryption Installation"),buttons:buttons,dialog_type:"info",value:{content:_content},template:egw.webserverUrl+"/etemplate/templates/default/pgp_installation.xet",class:"pgp_installation",modal:!0})},content=[{},{domain:this.egw.lang('Add your domain as "%1" in options to list of email providers and enable API.',"*."+this._mailvelopeDomain()),video:"test",control:"true"}];dialog(content,function(_button){"install"==_button&&("undefined"!=typeof chrome?window.open("https://chrome.google.com/webstore/detail/mailvelope/kajibbejlbohfaggdiogboambcijhkke"):"undefined"!=typeof InstallTrigger&&InstallTrigger.enabled()&&InstallTrigger.install({mailvelope:"https://download.mailvelope.com/releases/latest/mailvelope.firefox.xpi"},function(_url,_status){return 0==_status?void et2_dialog.alert(lang("Mailvelope addon installation succeded. Now you may configure the options.")):void et2_dialog.alert(lang("Mailvelope addon installation faild! Please try agian."))}))})},begin_pgp_message:"-----BEGIN PGP MESSAGE-----",end_pgp_message:"-----END PGP MESSAGE-----",mailvelope_keyring:void 0,mailvelope_iframe_selector:'iframe[src^="chrome-extension"],iframe[src^="about:blank?mvelo"]',mailvelopeOpenKeyring:function(){var self=this;return new Promise(function(_resolve,_reject){self.mailvelope_keyring&&_resolve(self.mailvelope_keyring);var resolve=_resolve,reject=_reject;mailvelope.getKeyring("egroupware").then(function(_keyring){self.mailvelope_keyring=_keyring,resolve(_keyring)},function(_err){mailvelope.createKeyring("egroupware").then(function(_keyring){self.mailvelope_keyring=_keyring;var mvelo_settings_selector=self.mailvelope_iframe_selector.split(",").map(function(_val){return"body>"+_val}).join(",");mailvelope.createSettingsContainer("body",_keyring,{email:self.egw.user("account_email"),fullName:self.egw.user("account_fullname")}).then(function(){jQuery(mvelo_settings_selector).css({position:"absolute",top:0}),jQuery('<button class="et2_button et2_button_text" id="mailvelope_close_settings">'+self.egw.lang("Close")+"</button>").css({position:"absolute",top:8,right:8,"z-index":2}).click(function(){self.mailvelope_keyring.exportOwnPublicKey(self.egw.user("account_email")).then(function(_pubKey){self.mailvelopeCreateBackupDialog().then(function(_popupId){jQuery('iframe[src^="chrome-extension"],iframe[src^="about:blank?mvelo"]').css({position:"absolute","z-index":1})},function(_err){egw.message(_err)}),jQuery(mvelo_settings_selector).each(function(index,item){item.src.match(/keyBackupDialog.html/,"ig")||item.remove()}),jQuery("button#mailvelope_close_settings").remove();var buttons=[{button_id:2,text:"Yes",id:"dialog[yes]",image:"check",default:!0},{button_id:3,text:"No",id:"dialog[no]",image:"cancelled"}];egw.user("apps").admin&&(buttons.unshift({button_id:5,text:"Yes and allow non-admin users to do that too (recommended)",id:"dialog[yes_allow]",image:"check",default:!0}),delete buttons[1].default),et2_dialog.show_dialog(function(_button_id){if(_button_id!=et2_dialog.NO_BUTTON){var keys={};keys[self.egw.user("account_id")]=_pubKey,self.egw.json("addressbook.addressbook_bo.ajax_set_pgp_keys",[keys,_button_id!=et2_dialog.YES_BUTTON?!0:void 0]).sendRequest().then(function(_data){self.egw.message(_data.response[0].data)})}},self.egw.lang("It is recommended to store your public key in addressbook, so other users can write you encrypted mails."),self.egw.lang("Store your public key in Addressbook?"),{},buttons,et2_dialog.QUESTION_MESSAGE,void 0,self.egw)},function(_err){self.egw.message(_err.message+"\n\n"+self.egw.lang("You will NOT be able to send or receive encrypted mails before completing that step!"),"error")})}).appendTo("body")}),resolve(_keyring)},function(_err){reject(_err)})})})},_mailvelopeDomain:function(){var parts=document.location.hostname.split(".");return parts.length>1&&parts.shift(),parts.join(".")},mailvelopeGetCheckRecipients:function(_recipients){var rfc822_preg=/<([^'" <>]+)>$/,recipients=_recipients.map(function(_recipient){var matches=_recipient.match(rfc822_preg);return matches?matches[1].toLowerCase():_recipient.toLowerCase()}),self=this;return new Promise(function(_resolve,_reject){var resolve=_resolve,reject=_reject;self.mailvelopeOpenKeyring().then(function(_keyring){var keyring=_keyring;_keyring.validKeyForAddress(recipients).then(function(_status){var no_key=[];for(var email in _status)_status[email]||no_key.push(email);no_key.length?self.egw.json("addressbook.addressbook_bo.ajax_get_pgp_keys",[no_key]).sendRequest().then(function(_data){var data=_data.response[0].data,promises=[];for(var email in data)promises.push(keyring.importPublicKey(data[email]).then(function(_result){"IMPORTED"==_result&&no_key.splice(no_key.indexOf(email),1)}));Promise.all(promises).then(function(){no_key.length?reject(new Error(self.egw.lang("No key for recipient:")+" "+no_key.join(", "))):resolve(recipients)})}):resolve(recipients)})},function(_err){reject(_err)})})}})}.call(this);dhtmlx=function(a){for(var b in a)dhtmlx[b]=a[b];return dhtmlx},dhtmlx.extend_api=function(a,b,c){var d=window[a];d&&(window[a]=function(a){if(a&&"object"==typeof a&&!a.tagName){var f,c=d.apply(this,b._init?b._init(a):arguments);for(f in dhtmlx)b[f]&&this[b[f]](dhtmlx[f]);for(f in a)b[f]?this[b[f]](a[f]):0==f.indexOf("on")&&this.attachEvent(f,a[f])}else c=d.apply(this,arguments);return b._patch&&b._patch(this),c||this},window[a].prototype=d.prototype,c&&dhtmlXHeir(window[a].prototype,c))},dhtmlxAjax={get:function(a,b){var c=new dtmlXMLLoaderObject(!0);return c.async=arguments.length<3,c.waitCall=b,c.loadXML(a),c},post:function(a,b,c){var d=new dtmlXMLLoaderObject(!0);return d.async=arguments.length<4,d.waitCall=c,d.loadXML(a,!0,b),d},getSync:function(a){return this.get(a,null,!0)},postSync:function(a,b){return this.post(a,b,null,!0)}},dtmlXMLLoaderObject.count=0,dtmlXMLLoaderObject.prototype.waitLoadFunction=function(a){var b=!0;return this.check=function(){!a||null==a.onloadAction||a.xmlDoc.readyState&&4!=a.xmlDoc.readyState||!b||(b=!1,dtmlXMLLoaderObject.count++,"function"==typeof a.onloadAction&&a.onloadAction(a.mainObject,null,null,null,a),a.waitCall&&(a.waitCall.call(this,a),a.waitCall=null))}},dtmlXMLLoaderObject.prototype.getXMLTopNode=function(a,b){if(this.xmlDoc.responseXML){var c=this.xmlDoc.responseXML.getElementsByTagName(a);0==c.length&&-1!=a.indexOf(":")&&(c=this.xmlDoc.responseXML.getElementsByTagName(a.split(":")[1]));var d=c[0]}else d=this.xmlDoc.documentElement;return d?(this._retry=!1,d):!this._retry&&_isIE?(this._retry=!0,b=this.xmlDoc,this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/,""),!0),this.getXMLTopNode(a,b)):(dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]),document.createElement("DIV"))},dtmlXMLLoaderObject.prototype.loadXMLString=function(a,b){if(_isIE)this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDoc.async=this.async,this.xmlDoc.onreadystatechange=function(){},this.xmlDoc.loadXML(a);else{var c=new DOMParser;this.xmlDoc=c.parseFromString(a,"text/xml")}b||(this.onloadAction&&this.onloadAction(this.mainObject,null,null,null,this),this.waitCall&&(this.waitCall(),this.waitCall=null))},dtmlXMLLoaderObject.prototype.loadXML=function(a,b,c,d){this.rSeed&&(a+=(-1!=a.indexOf("?")?"&":"?")+"a_dhx_rSeed="+(new Date).valueOf()),this.filePath=a,this.xmlDoc=!_isIE&&window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),this.async&&(this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this)),this.xmlDoc.open(b?"POST":"GET",a,this.async),d?(this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")"),this.xmlDoc.setRequestHeader("Content-type","text/xml")):b&&this.xmlDoc.setRequestHeader("Content-type",this.contenttype||"application/x-www-form-urlencoded"),this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.xmlDoc.send(c),this.async||new this.waitLoadFunction(this)()},dtmlXMLLoaderObject.prototype.destructor=function(){return this.setXSLParamValue=this.getXMLTopNode=this.xmlNodeToJSON=this.doSerialization=this.loadXMLString=this.loadXML=this.doXSLTransToString=this.doXSLTransToObject=this.doXPathOpera=this.doXPath=this.xmlDoc=this.mainObject=this.onloadAction=this.filePath=this.rSeed=this.async=this._retry=this._getAllNamedChilds=this._filterXPath=null},dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;for(b._tagvalue=a.firstChild?a.firstChild.nodeValue:"",c=0;c<a.childNodes.length;c++){var d=a.childNodes[c].tagName;d&&(b[d]||(b[d]=[]),b[d].push(this.xmlNodeToJSON(a.childNodes[c])))}return b},dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null,a.dragStarter=null,a.dragLanding=null},dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,b){a.onmousedown=this.preCreateDragCopy,a.dragStarter=b,this.addDragLanding(a,b)},dhtmlDragAndDropObject.prototype.addDragLanding=function(a,b){a.dragLanding=b},dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){return!a&&!window.event||2!=(a||event).button?window.dhtmlDragAndDrop.waitDrag?(window.dhtmlDragAndDrop.waitDrag=0,document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU,document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM,!1):(window.dhtmlDragAndDrop.dragNode&&window.dhtmlDragAndDrop.stopDrag(a),window.dhtmlDragAndDrop.waitDrag=1,window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup,window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove,window.dhtmlDragAndDrop.dragStartNode=this,window.dhtmlDragAndDrop.dragStartObject=this.dragStarter,document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy,document.body.onmousemove=window.dhtmlDragAndDrop.callDrag,window.dhtmlDragAndDrop.downtime=(new Date).valueOf(),a&&a.preventDefault&&a.preventDefault(),!1):void 0},dhtmlDragAndDropObject.prototype.callDrag=function(a){if(a||(a=window.event),dragger=window.dhtmlDragAndDrop,!((new Date).valueOf()-dragger.downtime<100)){if(!dragger.dragNode){if(!dragger.waitDrag)return dragger.stopDrag(a,!0);if(dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,a),!dragger.dragNode)return dragger.stopDrag();dragger.dragNode.onselectstart=function(){return!1},dragger.gldragNode=dragger.dragNode,document.body.appendChild(dragger.dragNode),document.body.onmouseup=dragger.stopDrag,dragger.waitDrag=0,dragger.dragNode.pWindow=window,dragger.initFrameRoute()}if(dragger.dragNode.parentNode!=window.document.body&&dragger.gldragNode){var b=dragger.gldragNode;dragger.gldragNode.old&&(b=dragger.gldragNode.old),b.parentNode.removeChild(b);var c=dragger.dragNode.pWindow;if(b.pWindow&&b.pWindow.dhtmlDragAndDrop.lastLanding&&b.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(b.pWindow.dhtmlDragAndDrop.lastLanding),_isIE){var d=document.createElement("Div");d.innerHTML=dragger.dragNode.outerHTML,dragger.dragNode=d.childNodes[0]}else dragger.dragNode=dragger.dragNode.cloneNode(!0);dragger.dragNode.pWindow=window,dragger.gldragNode.old=dragger.dragNode,document.body.appendChild(dragger.dragNode),c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=a.clientX+15+(dragger.fx?-1*dragger.fx:0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px",dragger.dragNode.style.top=a.clientY+3+(dragger.fy?-1*dragger.fy:0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";var e=a.srcElement?a.srcElement:a.target;dragger.checkLanding(e,a)}},dhtmlDragAndDropObject.prototype.calculateFramePosition=function(a){if(window.name){for(var b=parent.frames[window.name].frameElement.offsetParent,c=0,d=0;b;)c+=b.offsetLeft,d+=b.offsetTop,b=b.offsetParent;if(parent.dhtmlDragAndDrop){var e=parent.dhtmlDragAndDrop.calculateFramePosition(1);c+=1*e.split("_")[0],d+=1*e.split("_")[1]}if(a)return c+"_"+d;this.fx=c,this.fy=d}return"0_0"},dhtmlDragAndDropObject.prototype.checkLanding=function(a,b){a&&a.dragLanding?(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding),this.lastLanding=a,this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,b.clientX,b.clientY,b),this.lastLanding_scr=_isIE?b.srcElement:b.target):a&&"BODY"!=a.tagName?this.checkLanding(a.parentNode,b):(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding,b.clientX,b.clientY,b),this.lastLanding=0,this._onNotFound&&this._onNotFound())},dhtmlDragAndDropObject.prototype.stopDrag=function(a,b){if(dragger=window.dhtmlDragAndDrop,!b){dragger.stopFrameRoute();var c=dragger.lastLanding;dragger.lastLanding=null,c&&c.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,c,_isIE?event.srcElement:a.target)}dragger.lastLanding=null,dragger.dragNode&&dragger.dragNode.parentNode==document.body&&dragger.dragNode.parentNode.removeChild(dragger.dragNode),dragger.dragNode=0,dragger.gldragNode=0,dragger.fx=0,dragger.fy=0,dragger.dragStartNode=0,dragger.dragStartObject=0,document.body.onmouseup=dragger.tempDOMU,document.body.onmousemove=dragger.tempDOMM,dragger.tempDOMU=null,dragger.tempDOMM=null,dragger.waitDrag=0},dhtmlDragAndDropObject.prototype.stopFrameRoute=function(a){a&&window.dhtmlDragAndDrop.stopDrag(1,1);for(var b=0;b<window.frames.length;b++)try{window.frames[b]!=a&&window.frames[b].dhtmlDragAndDrop&&window.frames[b].dhtmlDragAndDrop.stopFrameRoute(window)}catch(c){}try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.stopFrameRoute(window)}catch(d){}},dhtmlDragAndDropObject.prototype.initFrameRoute=function(a,b){a&&(window.dhtmlDragAndDrop.preCreateDragCopy(),window.dhtmlDragAndDrop.dragStartNode=a.dhtmlDragAndDrop.dragStartNode,window.dhtmlDragAndDrop.dragStartObject=a.dhtmlDragAndDrop.dragStartObject,window.dhtmlDragAndDrop.dragNode=a.dhtmlDragAndDrop.dragNode,window.dhtmlDragAndDrop.gldragNode=a.dhtmlDragAndDrop.dragNode,window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag,window.waitDrag=0,!_isIE&&b&&(!_isFF||_FFrv<1.8)&&window.dhtmlDragAndDrop.calculateFramePosition());try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.initFrameRoute(window)}catch(c){}for(var d=0;d<window.frames.length;d++)try{window.frames[d]!=a&&window.frames[d].dhtmlDragAndDrop&&window.frames[d].dhtmlDragAndDrop.initFrameRoute(window,!a||b?1:0)}catch(e){}},_OperaRv=_KHTMLrv=_FFrv=_isChrome=_isMacOS=_isKHTML=_isOpera=_isIE=_isFF=!1,-1!=navigator.userAgent.indexOf("Macintosh")&&(_isMacOS=!0),navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(_isChrome=!0),-1!=navigator.userAgent.indexOf("Safari")||-1!=navigator.userAgent.indexOf("Konqueror")?(_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5)),_KHTMLrv>525?(_isFF=!0,_FFrv=1.9):_isKHTML=!0):-1!=navigator.userAgent.indexOf("Opera")?(_isOpera=!0,_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))):-1!=navigator.appName.indexOf("Microsoft")?(_isIE=!0,(-1!=navigator.appVersion.indexOf("MSIE 8.0")||-1!=navigator.appVersion.indexOf("MSIE 9.0")||-1!=navigator.appVersion.indexOf("MSIE 10.0")||document.documentMode>7)&&"BackCompat"!=document.compatMode&&(_isIE=8)):"Netscape"==navigator.appName&&-1!=navigator.userAgent.indexOf("Trident")?_isIE=8:(_isFF=!0,
_FFrv=parseFloat(navigator.userAgent.split("rv:")[1])),dtmlXMLLoaderObject.prototype.doXPath=function(a,b,c,d){if(_isKHTML||!_isIE&&!window.XPathResult)return this.doXPathOpera(a,b);if(_isIE)return b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML),b||dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]),null!=c&&b.setProperty("SelectionNamespaces","xmlns:xsl='"+c+"'"),"single"==d?b.selectSingleNode(a):b.selectNodes(a)||[];var e=b;b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML),b||dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]),-1!=b.nodeName.indexOf("document")?e=b:(e=b,b=b.ownerDocument);var g=XPathResult.ANY_TYPE;"single"==d&&(g=XPathResult.FIRST_ORDERED_NODE_TYPE);var f=[],h=b.evaluate(a,e,function(){return c},g,null);if(g==XPathResult.FIRST_ORDERED_NODE_TYPE)return h.singleNodeValue;for(var i=h.iterateNext();i;)f[f.length]=i,i=h.iterateNext();return f},j.prototype.catchError=function(a,b){this.catches[a]=b},j.prototype.throwError=function(a,b,c){return this.catches[a]?this.catches[a](a,b,c):this.catches.ALL?this.catches.ALL(a,b,c):(alert("Error type: "+a+"\nDescription: "+b),null)},window.dhtmlxError=new j,dtmlXMLLoaderObject.prototype.doXPathOpera=function(a,b){var c=a.replace(/[\/]+/gi,"/").split("/"),d=null,e=1;if(!c.length)return[];if("."==c[0])d=[b];else{if(""!=c[0])return[];d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(c[e].replace(/\[[^\]]*\]/g,"")),e++}for(;e<c.length;e++)d=this._getAllNamedChilds(d,c[e]);return-1!=c[e-1].indexOf("[")&&(d=this._filterXPath(d,c[e-1])),d},dtmlXMLLoaderObject.prototype._filterXPath=function(a,b){for(var c=[],b=b.replace(/[^\[]*\[\@/g,"").replace(/[\[\]\@]*/g,""),d=0;d<a.length;d++)a[d].getAttribute(b)&&(c[c.length]=a[d]);return c},dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a,b){var c=[];_isKHTML&&(b=b.toUpperCase());for(var d=0;d<a.length;d++)for(var e=0;e<a[d].childNodes.length;e++)_isKHTML?a[d].childNodes[e].tagName&&a[d].childNodes[e].tagName.toUpperCase()==b&&(c[c.length]=a[d].childNodes[e]):a[d].childNodes[e].tagName==b&&(c[c.length]=a[d].childNodes[e]);return c},dtmlXMLLoaderObject.prototype.xslDoc=null,dtmlXMLLoaderObject.prototype.setXSLParamValue=function(a,b,c){c||(c=this.xslDoc),c.responseXML&&(c=c.responseXML);var d=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+a+"']",c,"http://www.w3.org/1999/XSL/Transform","single");null!=d&&(d.firstChild.nodeValue=b)},dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(a,b){if(a||(a=this.xslDoc),a.responseXML&&(a=a.responseXML),b||(b=this.xmlDoc),b.responseXML&&(b=b.responseXML),_isIE){d=new ActiveXObject("Msxml2.DOMDocument.3.0");try{b.transformNodeToObject(a,d)}catch(c){d=b.transformNode(a)}}else{this.XSLProcessor||(this.XSLProcessor=new XSLTProcessor,this.XSLProcessor.importStylesheet(a));var d=this.XSLProcessor.transformToDocument(b)}return d},dtmlXMLLoaderObject.prototype.doXSLTransToString=function(a,b){var c=this.doXSLTransToObject(a,b);return"string"==typeof c?c:this.doSerialization(c)},dtmlXMLLoaderObject.prototype.doSerialization=function(a){if(a||(a=this.xmlDoc),a.responseXML&&(a=a.responseXML),_isIE)return a.xml;var b=new XMLSerializer;return b.serializeToString(a)},dhtmlxEventable=function(a){a.attachEvent=function(a,c,d){return a="ev_"+a.toLowerCase(),this[a]||(this[a]=new this.eventCatcher(d||this)),a+":"+this[a].addEvent(c)},a.callEvent=function(a,c){return a="ev_"+a.toLowerCase(),this[a]?this[a].apply(this,c):!0},a.checkEvent=function(a){return!!this["ev_"+a.toLowerCase()]},a.eventCatcher=function(a){var c=[],d=function(){for(var d=!0,g=0;g<c.length;g++)if(null!=c[g])var f=c[g].apply(a,arguments),d=d&&f;return d};return d.addEvent=function(a){return"function"!=typeof a&&(a=eval(a)),a?c.push(a)-1:!1},d.removeEvent=function(a){c[a]=null},d},a.detachEvent=function(a){if(0!=a){var c=a.split(":");this[c[0]].removeEvent(c[1])}},a.detachAllEvents=function(){for(var a in this)0==a.indexOf("ev_")&&(this.detachEvent(a),this[a]=null)},a=null},xmlPointer.prototype={text:function(){if(!_isFF)return this.d.xml;var x=new XMLSerializer;return x.serializeToString(this.d)},get:function(name){return this.d.getAttribute(name)},exists:function(){return!!this.d},content:function(){return this.d.firstChild?this.d.firstChild.data:""},each:function(name,f,t,i){var a=this.d.childNodes,c=new xmlPointer;if(a.length)for(i=i||0;i<a.length;i++)if(a[i].tagName==name&&(c.d=a[i],-1==f.apply(t,[c,i])))return},get_all:function(){for(var a={},b=this.d.attributes,i=0;i<b.length;i++)a[b[i].name]=b[i].value;return a},sub:function(name){var a=this.d.childNodes,c=new xmlPointer;if(a.length)for(var i=0;i<a.length;i++)if(a[i].tagName==name)return c.d=a[i],c},up:function(name){return new xmlPointer(this.d.parentNode)},set:function(name,val){this.d.setAttribute(name,val)},clone:function(name){return new xmlPointer(this.d)},sub_exists:function(name){var a=this.d.childNodes;if(a.length)for(var i=0;i<a.length;i++)if(a[i].tagName==name)return!0;return!1},through:function(name,rule,v,f,t){var a=this.d.childNodes;if(a.length)for(var i=0;i<a.length;i++){if(a[i].tagName==name&&null!=a[i].getAttribute(rule)&&""!=a[i].getAttribute(rule)&&(!v||a[i].getAttribute(rule)==v)){var c=new xmlPointer(a[i]);f.apply(t,[c,i])}var w=this.d;this.d=a[i],this.through(name,rule,v,f,t),this.d=w}}},dhtmlXTreeObject.prototype.setDataMode=function(mode){this._datamode=mode},dhtmlXTreeObject.prototype._doContClick=function(ev,force){if(!force&&2!=ev.button)return this._acMenu&&(this._acMenu.hideContextMenu?this._acMenu.hideContextMenu():this.cMenu._contextEnd()),!0;for(var el=_isIE?ev.srcElement:ev.target;el&&"BODY"!=el.tagName&&!el.parentObject;)el=el.parentNode;if(!el||!el.parentObject)return!0;var obj=el.parentObject;if(this.callEvent("onRightClick",[obj.id,ev])||((ev.srcElement||ev.target).oncontextmenu=function(e){return(e||event).cancelBubble=!0,!1}),this._acMenu=obj.cMenu||this.cMenu,this._acMenu){if(!this.callEvent("onBeforeContextMenu",[obj.id]))return!0;if(_isMacOS||((ev.srcElement||ev.target).oncontextmenu=function(e){return(e||event).cancelBubble=!0,!1}),this._acMenu.showContextMenu){var dEl0=window.document.documentElement,dEl1=window.document.body,corrector=new Array(dEl0.scrollLeft||dEl1.scrollLeft,dEl0.scrollTop||dEl1.scrollTop);if(_isIE)var x=ev.clientX+corrector[0],y=ev.clientY+corrector[1];else var x=ev.pageX,y=ev.pageY;this._acMenu.showContextMenu(x-1,y-1),this.contextID=obj.id,ev.cancelBubble=!0,this._acMenu._skip_hide=!0}else el.contextMenuId=obj.id,el.contextMenu=this._acMenu,el.a=this._acMenu._contextStart,el.a(el,ev),el.a=null;return!1}return!0},dhtmlXTreeObject.prototype.enableIEImageFix=function(mode){mode?(this._getImg=function(){var z=document.createElement("DIV");return z.innerHTML="&nbsp;",z.className="dhx_bg_img_fix",z},this._setSrc=function(a,b){a.style.backgroundImage="url("+b+")"},this._getSrc=function(a){var z=a.style.backgroundImage;return z.substr(4,z.length-5).replace(/(^")|("$)/g,"")}):(this._getImg=function(id){return document.createElement(id==this.rootId?"div":"img")},this._setSrc=function(a,b){a.src=b},this._getSrc=function(a){return a.src})},dhtmlXTreeObject.prototype.destructor=function(){for(var a in this._idpull){var z=this._idpull[a];z&&(z.parentObject=null,z.treeNod=null,z.childNodes=null,z.span=null,z.tr.nodem=null,z.tr=null,z.htmlNode.objBelong=null,z.htmlNode=null,this._idpull[a]=null)}this.parentObject.innerHTML="",this.XMLLoader&&this.XMLLoader.destructor(),this.allTree.onselectstart=null,this.allTree.oncontextmenu=null,this.allTree.onmousedown=null;for(var a in this)this[a]=null},cObject.prototype=new Object,cObject.prototype.clone=function(){function _dummy(){}return _dummy.prototype=this,new _dummy},dhtmlXTreeObject.prototype._globalIdStorageAdd=function(itemId,itemObject){return this._globalIdStorageFind(itemId,1,1)?(itemId=itemId+"_"+(new Date).valueOf(),this._globalIdStorageAdd(itemId,itemObject)):(this._idpull[itemId]=itemObject,this._pullSize++,itemId)},dhtmlXTreeObject.prototype._globalIdStorageSub=function(itemId){this._idpull[itemId]&&(this._unselectItem(this._idpull[itemId]),this._idpull[itemId]=null,this._pullSize--),this._locker&&this._locker[itemId]&&(this._locker[itemId]=!1)},dhtmlXTreeObject.prototype._globalIdStorageFind=function(itemId,skipXMLSearch,skipParsing,isreparse){var z=this._idpull[itemId];return z?z:null},dhtmlXTreeObject.prototype._escape=function(str){switch(this.utfesc){case"none":return str;case"utf8":return encodeURIComponent(str);default:return escape(str)}},dhtmlXTreeObject.prototype._drawNewTr=function(htmlObject,node){var tr=document.createElement("tr"),td1=document.createElement("td"),td2=document.createElement("td");return td1.appendChild(document.createTextNode(" ")),td2.colSpan=3,td2.appendChild(htmlObject),tr.appendChild(td1),tr.appendChild(td2),tr},dhtmlXTreeObject.prototype.loadXMLString=function(xmlString,afterCall){var that=this;this.parsCount||this.callEvent("onXLS",[that,null]),this.xmlstate=1,afterCall&&(this.XMLLoader.waitCall=afterCall),this.XMLLoader.loadXMLString(xmlString)},dhtmlXTreeObject.prototype.loadXML=function(file,afterCall){if(afterCall=afterCall||this.AJAX_callback,this._datamode&&"xml"!=this._datamode)return this["load"+this._datamode.toUpperCase()](file,afterCall);var that=this;this.parsCount||this.callEvent("onXLS",[that,this._ld_id]),this._ld_id=null,this.xmlstate=1,this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,!0,this.no_cashe),afterCall&&(this.XMLLoader.waitCall=afterCall),this.XMLLoader.loadXML(file)},dhtmlXTreeObject.prototype._attachChildNode=function(parentObject,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs,beforeNode,afterNode){beforeNode&&beforeNode.parentObject&&(parentObject=beforeNode.parentObject),0==parentObject.XMLload&&this.XMLsource&&!this.XMLloadingWarning&&(parentObject.XMLload=1,this._loadDynXML(parentObject.id));var Count=parentObject.childsCount,Nodes=parentObject.childNodes;if(afterNode&&afterNode.tr.previousSibling&&(afterNode.tr.previousSibling.previousSibling?beforeNode=afterNode.tr.previousSibling.nodem:optionStr=optionStr.replace("TOP","")+",TOP"),beforeNode){var ik,jk;for(ik=0;Count>ik;ik++)if(Nodes[ik]==beforeNode){for(jk=Count;jk!=ik;jk--)Nodes[1+jk]=Nodes[jk];break}ik++,Count=ik}if(optionStr)for(var tempStr=optionStr.split(","),i=0;i<tempStr.length;i++)switch(tempStr[i]){case"TOP":for(parentObject.childsCount>0&&(beforeNode=new Object,beforeNode.tr=parentObject.childNodes[0].tr.previousSibling),parentObject._has_top=!0,ik=Count;ik>0;ik--)Nodes[ik]=Nodes[ik-1];Count=0}var n;(n=this._idpull[itemId])&&-1==n.span||(n=Nodes[Count]=new dhtmlXTreeItemObject(itemId,itemText,parentObject,this,itemActionHandler,1),itemId=Nodes[Count].id,parentObject.childsCount++),n.htmlNode||(n.label=itemText,n.htmlNode=this._createItem(this.checkBoxOff?1:0,n),n.htmlNode.objBelong=n),image1&&(n.images[0]=image1),image2&&(n.images[1]=image2),image3&&(n.images[2]=image3);var tr=this._drawNewTr(n.htmlNode);if((this.XMLloadingWarning||this._hAdI)&&(n.htmlNode.parentNode.parentNode.style.display="none"),beforeNode&&beforeNode.tr&&beforeNode.tr.nextSibling?parentObject.htmlNode.childNodes[0].insertBefore(tr,beforeNode.tr.nextSibling):this.parsingOn==parentObject.id?this.parsedArray[this.parsedArray.length]=tr:parentObject.htmlNode.childNodes[0].appendChild(tr),beforeNode&&!beforeNode.span&&(beforeNode=null),this.XMLsource&&(childs&&0!=childs?n.XMLload=0:n.XMLload=1),n.tr=tr,tr.nodem=n,0==parentObject.itemId&&(tr.childNodes[0].className="hiddenRow"),(parentObject._r_logic||this._frbtr)&&this._setSrc(n.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0]),optionStr)for(var tempStr=optionStr.split(","),i=0;i<tempStr.length;i++)switch(tempStr[i]){case"SELECT":this.selectItem(itemId,!1);break;case"CALL":this.selectItem(itemId,!0);break;case"CHILD":n.XMLload=0;break;case"CHECKED":this.XMLloadingWarning?this.setCheckList+=this.dlmtr+itemId:this.setCheck(itemId,1);break;case"HCHECKED":this._setCheck(n,"unsure");break;case"OPEN":n.openMe=1}if(!this.XMLloadingWarning&&(this._getOpenState(parentObject)<0&&!this._hAdI&&this.openItem(parentObject.id),beforeNode&&(this._correctPlus(beforeNode),this._correctLine(beforeNode)),this._correctPlus(parentObject),this._correctLine(parentObject),this._correctPlus(n),parentObject.childsCount>=2&&(this._correctPlus(Nodes[parentObject.childsCount-2]),this._correctLine(Nodes[parentObject.childsCount-2])),2!=parentObject.childsCount&&this._correctPlus(Nodes[0]),this.tscheck&&this._correctCheckStates(parentObject),this._onradh))if(1==this.xmlstate){var old=this.onXLE;this.onXLE=function(id){this._onradh(itemId),old&&old(id)}}else this._onradh(itemId);return n},dhtmlXTreeObject.prototype.insertNewItem=function(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children){var parentObject=this._globalIdStorageFind(parentId);if(!parentObject)return-1;var nodez=this._attachChildNode(parentObject,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children);return this._idpull[this.rootId].XMLload||(this._idpull[this.rootId].XMLload=1),nodez},dhtmlXTreeObject.prototype.insertNewChild=function(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children){return this.insertNewItem(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children)},dhtmlXTreeObject.prototype._parseXMLTree=function(a,b,c,d,xml){var p=new xmlPointer(xml.getXMLTopNode("tree"));a._parse(p),a._p=p},dhtmlXTreeObject.prototype._parseItem=function(c,temp,preNode,befNode){var id;if(this._srnd&&(!this._idpull[id=c.get("id")]||!this._idpull[id].span))return void this._addItemSRND(temp.id,id,c);var a=c.get_all();if("object"==typeof this.waitUpdateXML&&!this.waitUpdateXML[a.id])return void this._parse(c,a.id,1);var zST=[];if(a.select&&zST.push("SELECT"),a.top&&zST.push("TOP"),a.call&&(this.nodeAskingCall=a.id),-1==a.checked?zST.push("HCHECKED"):a.checked&&zST.push("CHECKED"),a.open&&zST.push("OPEN"),this.waitUpdateXML)if(this._globalIdStorageFind(a.id))var newNode=this.updateItem(a.id,a.text,a.im0,a.im1,a.im2,a.checked,a.child);else{0==this.npl?zST.push("TOP"):preNode=temp.childNodes[this.npl];var newNode=this._attachChildNode(temp,a.id,a.text,0,a.im0,a.im1,a.im2,zST.join(","),a.child,0,preNode);a.id=newNode.id,preNode=null}else var newNode=this._attachChildNode(temp,a.id,a.text,0,a.im0,a.im1,a.im2,zST.join(","),a.child,befNode||0,preNode);if(a.tooltip&&(newNode.span.parentNode.parentNode.title=a.tooltip),a.style&&(newNode.span.style.cssText?newNode.span.style.cssText+=";"+a.style:newNode.span.setAttribute("style",newNode.span.getAttribute("style")+"; "+a.style)),a.radio&&(newNode._r_logic=!0),a.nocheckbox){var check_node=newNode.span.parentNode.previousSibling.previousSibling;check_node.style.display="none",newNode.nocheckbox=!0}a.disabled&&(null!=a.checked&&this._setCheck(newNode,a.checked),this.disableCheckbox(newNode,1)),newNode._acc=a.child||0,this.parserExtension&&this.parserExtension._parseExtension.call(this,c,a,temp?temp.id:0),this.setItemColor(newNode,a.aCol,a.sCol),"1"==a.locked&&this.lockItem(newNode.id,!0,!0),(a.imwidth||a.imheight)&&this.setIconSize(a.imwidth,a.imheight,newNode),"0"!=a.closeable&&"1"!=a.closeable||this.setItemCloseable(newNode,a.closeable);var zcall="";a.topoffset&&this.setItemTopOffset(newNode,a.topoffset),this.slowParse&&"object"!=typeof this.waitUpdateXML||c.sub_exists("item")&&(zcall=this._parse(c,a.id,1)),""!=zcall&&(this.nodeAskingCall=zcall),c.each("userdata",function(u){this.setUserData(c.get("id"),u.get("name"),u.content())},this)},dhtmlXTreeObject.prototype._parse=function(p,parentId,level,start){if(this._srnd&&!this.parentObject.offsetHeight){var self=this;return window.setTimeout(function(){self._parse(p,parentId,level,start)},100)}if(p.exists()){if(this.skipLock=!0,!parentId){parentId=p.get("id");var skey=p.get("dhx_security");skey&&(dhtmlx.security_key=skey),p.get("radio")&&(this.htmlNode._r_logic=!0),this.parsingOn=parentId,this.parsedArray=new Array,this.setCheckList="",this.nodeAskingCall=""}var temp=this._globalIdStorageFind(parentId);if(!temp)return dhtmlxError.throwError("DataStructure","XML refers to not existing parent");if(this.parsCount=this.parsCount?this.parsCount+1:1,this.XMLloadingWarning=1,!temp.childsCount||start||this._edsbps||temp._has_top)var preNode=0;else var preNode=0;if(this.npl=0,p.each("item",function(c,i){temp.XMLload=1,this._parseItem(c,temp,0,preNode),this.npl++},this,start),!level){if(p.each("userdata",function(u){this.setUserData(p.get("id"),u.get("name"),u.content())},this),temp.XMLload=1,this.waitUpdateXML){this.waitUpdateXML=!1;for(var i=temp.childsCount-1;i>=0;i--)temp.childNodes[i]._dmark&&this.deleteItem(temp.childNodes[i].id)}for(var i=(this._globalIdStorageFind(this.parsingOn),0);i<this.parsedArray.length;i++)temp.htmlNode.childNodes[0].appendChild(this.parsedArray[i]);this.parsedArray=[],this.lastLoadedXMLId=parentId,this.XMLloadingWarning=0;for(var chArr=this.setCheckList.split(this.dlmtr),n=0;n<chArr.length;n++)chArr[n]&&this.setCheck(chArr[n],1);this.XMLsource&&this.tscheck&&this.smcheck&&temp.id!=this.rootId&&(0===temp.checkstate?this._setSubChecked(0,temp):1===temp.checkstate&&this._setSubChecked(1,temp)),this._redrawFrom(this,null,start),p.get("order")&&"none"!=p.get("order")&&this._reorderBranch(temp,p.get("order"),!0),""!=this.nodeAskingCall&&this.callEvent("onClick",[this.nodeAskingCall,this.getSelectedItemId()]),this._branchUpdate&&this._branchUpdateNext(p)}if(1==this.parsCount){if(this.parsingOn=null,!this._edsbps||!this._edsbpsA.length){var that=this;window.setTimeout(function(){that.callEvent("onXLE",[that,parentId])},1),this.xmlstate=0}this.skipLock=!1}return this.parsCount--,!level&&this.onXLE&&this.onXLE(this,parentId),this.nodeAskingCall}},dhtmlXTreeObject.prototype._branchUpdateNext=function(p){p.each("item",function(c){var nid=c.get("id");this._idpull[nid]&&!this._idpull[nid].XMLload||(this._branchUpdate++,this.smartRefreshItem(c.get("id"),c))},this),this._branchUpdate--},dhtmlXTreeObject.prototype.checkUserData=function(node,parentId){if(1==node.nodeType&&"userdata"==node.tagName){var name=node.getAttribute("name");name&&node.childNodes[0]&&this.setUserData(parentId,name,node.childNodes[0].data)}},dhtmlXTreeObject.prototype._redrawFrom=function(dhtmlObject,itemObject,start,visMode){if(itemObject)tempx=itemObject;else{var tempx=dhtmlObject._globalIdStorageFind(dhtmlObject.lastLoadedXMLId);if(dhtmlObject.lastLoadedXMLId=-1,!tempx)return 0}for(var acc=0,i=start?start-1:0;i<tempx.childsCount;i++)this._branchUpdate&&1!=this._getOpenState(tempx)||itemObject&&1!=visMode||(tempx.childNodes[i].htmlNode.parentNode.parentNode.style.display=""),1==tempx.childNodes[i].openMe&&(this._openItem(tempx.childNodes[i]),tempx.childNodes[i].openMe=0),dhtmlObject._redrawFrom(dhtmlObject,tempx.childNodes[i]);tempx.unParsed||!tempx.XMLload&&this.XMLsource||(tempx._acc=acc),dhtmlObject._correctLine(tempx),dhtmlObject._correctPlus(tempx)},dhtmlXTreeObject.prototype._createSelf=function(){var div=document.createElement("div");return div.className="containerTableStyle",div.style.width=this.width,div.style.height=this.height,this.parentObject.appendChild(div),div},dhtmlXTreeObject.prototype._xcloseAll=function(itemObject){if(!itemObject.unParsed){if(this.rootId!=itemObject.id){if(!itemObject.htmlNode)return;for(var Nodes=itemObject.htmlNode.childNodes[0].childNodes,Count=Nodes.length,i=1;Count>i;i++)Nodes[i].style.display="none";this._correctPlus(itemObject)}for(var i=0;i<itemObject.childsCount;i++)itemObject.childNodes[i].childsCount&&this._xcloseAll(itemObject.childNodes[i])}},dhtmlXTreeObject.prototype._xopenAll=function(itemObject){this._HideShow(itemObject,2);for(var i=0;i<itemObject.childsCount;i++)this._xopenAll(itemObject.childNodes[i])},dhtmlXTreeObject.prototype._correctPlus=function(itemObject){if(itemObject.htmlNode){var imsrc=itemObject.htmlNode.childNodes[0].childNodes[0].childNodes[0].lastChild,imsrc2=itemObject.htmlNode.childNodes[0].childNodes[0].childNodes[2].childNodes[0],workArray=this.lineArray;if(this.XMLsource&&!itemObject.XMLload){var workArray=this.plusArray;if(this._setSrc(imsrc2,this.iconURL+itemObject.images[2]),this._txtimg)return imsrc.innerHTML="[+]"}else if(itemObject.childsCount||itemObject.unParsed)if(itemObject.htmlNode.childNodes[0].childNodes[1]&&"none"!=itemObject.htmlNode.childNodes[0].childNodes[1].style.display){if(!itemObject.wsign)var workArray=this.minusArray;if(this._setSrc(imsrc2,this.iconURL+itemObject.images[1]),this._txtimg)return imsrc.innerHTML="[-]"}else{if(!itemObject.wsign)var workArray=this.plusArray;if(this._setSrc(imsrc2,this.iconURL+itemObject.images[2]),this._txtimg)return imsrc.innerHTML="[+]"}else this._setSrc(imsrc2,this.iconURL+itemObject.images[0]);var tempNum=2;itemObject.treeNod.treeLinesOn?(itemObject.parentObject&&(tempNum=this._getCountStatus(itemObject.id,itemObject.parentObject)),this._setSrc(imsrc,this.imPath+workArray[tempNum])):this._setSrc(imsrc,this.imPath+workArray[3])}},dhtmlXTreeObject.prototype._correctLine=function(itemObject){if(itemObject.htmlNode){var sNode=itemObject.parentObject;if(sNode)if(0!=this._getLineStatus(itemObject.id,sNode)&&this.treeLinesOn)for(var i=1;i<=itemObject.childsCount&&itemObject.htmlNode.childNodes[0].childNodes[i];i++)itemObject.htmlNode.childNodes[0].childNodes[i].childNodes[0].style.backgroundImage="url("+this.imPath+this.lineArray[5]+")",itemObject.htmlNode.childNodes[0].childNodes[i].childNodes[0].style.backgroundRepeat="repeat-y";else for(var i=1;i<=itemObject.childsCount&&itemObject.htmlNode.childNodes[0].childNodes[i];i++)itemObject.htmlNode.childNodes[0].childNodes[i].childNodes[0].style.backgroundImage="",itemObject.htmlNode.childNodes[0].childNodes[i].childNodes[0].style.backgroundRepeat=""}},dhtmlXTreeObject.prototype._getCountStatus=function(itemId,itemObject){return itemObject.childsCount<=1?itemObject.id==this.rootId?4:0:itemObject.childNodes[0].id==itemId?itemObject.id==this.rootId?2:1:itemObject.childNodes[itemObject.childsCount-1].id==itemId?0:1},dhtmlXTreeObject.prototype._getLineStatus=function(itemId,itemObject){return itemObject.childNodes[itemObject.childsCount-1].id==itemId?0:1},dhtmlXTreeObject.prototype._HideShow=function(itemObject,mode){if(this.XMLsource&&!itemObject.XMLload){if(1==mode)return;return itemObject.XMLload=1,void this._loadDynXML(itemObject.id)}var Nodes=itemObject.htmlNode.childNodes[0].childNodes,Count=Nodes.length;if(Count>1){"none"==Nodes[1].style.display&&1!=mode||2==mode?nodestyle="":(this.allTree.childNodes[0].border="1",this.allTree.childNodes[0].border="0",nodestyle="none");for(var i=1;Count>i;i++)Nodes[i].style.display=nodestyle}this._correctPlus(itemObject)},dhtmlXTreeObject.prototype._getOpenState=function(itemObject){if(!itemObject.htmlNode)return 0;var z=itemObject.htmlNode.childNodes[0].childNodes;return z.length<=1?0:"none"!=z[1].style.display?1:-1},dhtmlXTreeObject.prototype.onRowClick2=function(){var that=this.parentObject.treeNod;return that.callEvent("onDblClick",[this.parentObject.id,that])?(this.parentObject.closeble&&"0"!=this.parentObject.closeble?that._HideShow(this.parentObject):that._HideShow(this.parentObject,2),that.checkEvent("onOpenEnd")&&(that.xmlstate?(that._oie_onXLE.push(that.onXLE),that.onXLE=that._epnFHe):that.callEvent("onOpenEnd",[this.parentObject.id,that._getOpenState(this.parentObject)])),!1):!1},dhtmlXTreeObject.prototype.onRowClick=function(){var that=this.parentObject.treeNod;return that.callEvent("onOpenStart",[this.parentObject.id,that._getOpenState(this.parentObject)])?(this.parentObject.closeble&&"0"!=this.parentObject.closeble?that._HideShow(this.parentObject):that._HideShow(this.parentObject,2),void(that.checkEvent("onOpenEnd")&&(that.xmlstate?(that._oie_onXLE.push(that.onXLE),that.onXLE=that._epnFHe):that.callEvent("onOpenEnd",[this.parentObject.id,that._getOpenState(this.parentObject)])))):0},dhtmlXTreeObject.prototype._epnFHe=function(that,id,flag){id!=this.rootId&&this.callEvent("onOpenEnd",[id,that.getOpenState(id)]),that.onXLE=that._oie_onXLE.pop(),flag||that._oie_onXLE.length||that.onXLE&&that.onXLE(that,id)},dhtmlXTreeObject.prototype.onRowClickDown=function(e){e=e||window.event;var that=this.parentObject.treeNod;that._selectItem(this.parentObject,e)},dhtmlXTreeObject.prototype.getSelectedItemId=function(){for(var str=new Array,i=0;i<this._selected.length;i++)str[i]=this._selected[i].id;return str.join(this.dlmtr)},dhtmlXTreeObject.prototype._selectItem=function(node,e,mode){if("undefined"==typeof mode&&(mode=!1),!mode&&this.checkEvent("onSelect")&&(this._onSSCFold=this.getSelectedItemId()),this._amsel&&e&&(e.ctrlKey||e.metaKey||e.shiftKey)||this._unselectItems(),node.i_sel&&this._amsel&&e&&(e.ctrlKey||e.metaKey))this._unselectItem(node);else if(!(node.i_sel||this._amselS&&0!=this._selected.length&&this._selected[0].parentObject!=node.parentObject))if(this._amsel&&e&&e.shiftKey&&0!=this._selected.length&&this._selected[this._selected.length-1].parentObject==node.parentObject){var f=this._getIndex(this._selected[this._selected.length-1]),d=this._getIndex(node);if(f>d){var l=f;f=d,d=l}for(var g=f;d>=g;g++)node.parentObject.childNodes[g].i_sel||this._markItem(node.parentObject.childNodes[g])}else this._markItem(node);if(!mode&&this.checkEvent("onSelect")){var z=this.getSelectedItemId();z!=this._onSSCFold&&this.callEvent("onSelect",[z])}},dhtmlXTreeObject.prototype._markItem=function(node){node.scolor&&(node.span.style.color=node.scolor),node.span.className="selectedTreeRow",node.i_sel=!0,this._selected[this._selected.length]=node},dhtmlXTreeObject.prototype.getIndexById=function(itemId){var z=this._globalIdStorageFind(itemId);return z?this._getIndex(z):null},dhtmlXTreeObject.prototype._getIndex=function(w){for(var z=w.parentObject,i=0;i<z.childsCount;i++)if(z.childNodes[i]==w)return i},dhtmlXTreeObject.prototype._unselectItem=function(node){if(node&&node.i_sel){node.span.className="standartTreeRow",node.acolor&&(node.span.style.color=node.acolor),node.i_sel=!1;for(var i=0;i<this._selected.length;i++)if(!this._selected[i].i_sel){this._selected.splice(i,1);break}}},dhtmlXTreeObject.prototype._unselectItems=function(){for(var i=0;i<this._selected.length;i++){var node=this._selected[i];node.span.className="standartTreeRow",node.acolor&&(node.span.style.color=node.acolor),node.i_sel=!1}this._selected=new Array},dhtmlXTreeObject.prototype.onRowSelect=function(e,htmlObject,mode){e=e||window.event;var obj=this.parentObject;htmlObject&&(obj=htmlObject.parentObject);var that=obj.treeNod,lastId=that.getSelectedItemId();e&&e.skipUnSel||that._selectItem(obj,e,mode),mode||(obj.actionHandler?obj.actionHandler(obj.id,lastId):that.callEvent("onClick",[obj.id,lastId]))},dhtmlXTreeObject.prototype._correctCheckStates=function(dhtmlObject){if(this.tscheck&&dhtmlObject&&dhtmlObject.id!=this.rootId){var act=dhtmlObject.childNodes,flag1=0,flag2=0;if(0!=dhtmlObject.childsCount){for(var i=0;i<dhtmlObject.childsCount;i++)if(!act[i].dscheck)if(0==act[i].checkstate)flag1=1;else{if(1!=act[i].checkstate){flag1=1,flag2=1;break}flag2=1}flag1&&flag2?this._setCheck(dhtmlObject,"unsure"):flag1?this._setCheck(dhtmlObject,!1):this._setCheck(dhtmlObject,!0),this._correctCheckStates(dhtmlObject.parentObject)}}},dhtmlXTreeObject.prototype.onCheckBoxClick=function(e){return this.treeNod.callEvent("onBeforeCheck",[this.parentObject.id,this.parentObject.checkstate])?this.parentObject.dscheck?!0:(this.treeNod.tscheck?1==this.parentObject.checkstate?this.treeNod._setSubChecked(!1,this.parentObject):this.treeNod._setSubChecked(!0,this.parentObject):1==this.parentObject.checkstate?this.treeNod._setCheck(this.parentObject,!1):this.treeNod._setCheck(this.parentObject,!0),this.treeNod._correctCheckStates(this.parentObject.parentObject),this.treeNod.callEvent("onCheck",[this.parentObject.id,this.parentObject.checkstate])):void 0},dhtmlXTreeObject.prototype._createItem=function(acheck,itemObject,mode){var table=document.createElement("table");table.cellSpacing=0,table.cellPadding=0,table.border=0,this.hfMode&&(table.style.tableLayout="fixed"),table.style.margin=0,table.style.padding=0;var tbody=document.createElement("tbody"),tr=document.createElement("tr"),td1=document.createElement("td");if(td1.className="standartTreeImage",this._txtimg){var img0=document.createElement("div");td1.appendChild(img0),img0.className="dhx_tree_textSign"}else{var img0=this._getImg(itemObject.id);img0.border="0","IMG"==img0.tagName&&(img0.align="absmiddle"),td1.appendChild(img0),img0.style.padding=0,img0.style.margin=0,img0.style.width=this.def_line_img_x,img0.style.height=this.def_line_img_y}var td11=document.createElement("td"),inp=this._getImg(this.cBROf?this.rootId:itemObject.id);inp.checked=0,this._setSrc(inp,this.imPath+this.checkArray[0]),inp.style.width="16px",inp.style.height="16px",acheck||(td11.style.display="none"),td11.appendChild(inp),this.cBROf||"IMG"!=inp.tagName||(inp.align="absmiddle"),inp.onclick=this.onCheckBoxClick,inp.treeNod=this,inp.parentObject=itemObject,window._KHTMLrv?td11.width="16px":td11.width="20px";var td12=document.createElement("td");td12.className="standartTreeImage";var img=this._getImg(this.timgen?itemObject.id:this.rootId);img.onmousedown=this._preventNsDrag,img.ondragstart=this._preventNsDrag,img.border="0",this._aimgs&&(img.parentObject=itemObject,"IMG"==img.tagName&&(img.align="absmiddle"),img.onclick=this.onRowSelect),mode||this._setSrc(img,this.iconURL+this.imageArray[0]),td12.appendChild(img),img.style.padding=0,img.style.margin=0,this.timgen?(td12.style.width=img.style.width=this.def_img_x,img.style.height=this.def_img_y):(img.style.width="0px",img.style.height="0px",(_isOpera||window._KHTMLrv)&&(td12.style.display="none"));var td2=document.createElement("td");return td2.className="standartTreeRow",itemObject.span=document.createElement("span"),itemObject.span.className="standartTreeRow",this.mlitems?(itemObject.span.style.width=this.mlitems,itemObject.span.style.display="block"):td2.noWrap=!0,_isIE&&_isIE>7?td2.style.width="999999px":window._KHTMLrv||(td2.style.width="100%"),itemObject.span.innerHTML=itemObject.label,td2.appendChild(itemObject.span),td2.parentObject=itemObject,td1.parentObject=itemObject,td2.onclick=this.onRowSelect,td1.onclick=this.onRowClick,td2.ondblclick=this.onRowClick2,this.ettip&&(tr.title=itemObject.label),this.dragAndDropOff&&(this._aimgs&&(this.dragger.addDraggableItem(td12,this),td12.parentObject=itemObject),this.dragger.addDraggableItem(td2,this)),itemObject.span.style.paddingLeft="5px",itemObject.span.style.paddingRight="5px",td2.style.verticalAlign="",td2.style.fontSize="10pt",td2.style.cursor=this.style_pointer,tr.appendChild(td1),tr.appendChild(td11),tr.appendChild(td12),tr.appendChild(td2),tbody.appendChild(tr),table.appendChild(tbody),(this.ehlt||this.checkEvent("onMouseIn")||this.checkEvent("onMouseOut"))&&(tr.onmousemove=this._itemMouseIn,tr[_isIE?"onmouseleave":"onmouseout"]=this._itemMouseOut),table},dhtmlXTreeObject.prototype.setImagePath=function(newPath){this.imPath=newPath,this.iconURL=newPath},dhtmlXTreeObject.prototype.setIconPath=function(path){this.iconURL=path},dhtmlXTreeObject.prototype.setOnRightClickHandler=function(func){this.attachEvent("onRightClick",func)},dhtmlXTreeObject.prototype.setOnClickHandler=function(func){this.attachEvent("onClick",func)},dhtmlXTreeObject.prototype.setOnSelectStateChange=function(func){this.attachEvent("onSelect",func)},dhtmlXTreeObject.prototype.setXMLAutoLoading=function(filePath){this.XMLsource=filePath},dhtmlXTreeObject.prototype.setOnCheckHandler=function(func){this.attachEvent("onCheck",func)},dhtmlXTreeObject.prototype.setOnOpenHandler=function(func){this.attachEvent("onOpenStart",func)},dhtmlXTreeObject.prototype.setOnOpenStartHandler=function(func){this.attachEvent("onOpenStart",func)},dhtmlXTreeObject.prototype.setOnOpenEndHandler=function(func){
this.attachEvent("onOpenEnd",func)},dhtmlXTreeObject.prototype.setOnDblClickHandler=function(func){this.attachEvent("onDblClick",func)},dhtmlXTreeObject.prototype.openAllItems=function(itemId){var temp=this._globalIdStorageFind(itemId);return temp?void this._xopenAll(temp):0},dhtmlXTreeObject.prototype.getOpenState=function(itemId){var temp=this._globalIdStorageFind(itemId);return temp?this._getOpenState(temp):""},dhtmlXTreeObject.prototype.closeAllItems=function(itemId){itemId===window.undefined&&(itemId=this.rootId);var temp=this._globalIdStorageFind(itemId);return temp?(this._xcloseAll(temp),this.allTree.childNodes[0].border="1",void(this.allTree.childNodes[0].border="0")):0},dhtmlXTreeObject.prototype.setUserData=function(itemId,name,value){var sNode=this._globalIdStorageFind(itemId,0,!0);sNode&&("hint"==name&&(sNode.htmlNode.childNodes[0].childNodes[0].title=value),"undefined"==typeof sNode.userData["t_"+name]&&(sNode._userdatalist?sNode._userdatalist+=","+name:sNode._userdatalist=name),sNode.userData["t_"+name]=value)},dhtmlXTreeObject.prototype.getUserData=function(itemId,name){var sNode=this._globalIdStorageFind(itemId,0,!0);if(sNode)return sNode.userData["t_"+name]},dhtmlXTreeObject.prototype.getItemColor=function(itemId){var temp=this._globalIdStorageFind(itemId);if(!temp)return 0;var res=new Object;return temp.acolor&&(res.acolor=temp.acolor),temp.scolor&&(res.scolor=temp.scolor),res},dhtmlXTreeObject.prototype.setItemColor=function(itemId,defaultColor,selectedColor){if(itemId&&itemId.span)var temp=itemId;else var temp=this._globalIdStorageFind(itemId);return temp?(temp.i_sel?selectedColor&&(temp.span.style.color=selectedColor):defaultColor&&(temp.span.style.color=defaultColor),selectedColor&&(temp.scolor=selectedColor),defaultColor&&(temp.acolor=defaultColor),void 0):0},dhtmlXTreeObject.prototype.getItemText=function(itemId){var temp=this._globalIdStorageFind(itemId);return temp?temp.htmlNode.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML:0},dhtmlXTreeObject.prototype.getParentId=function(itemId){var temp=this._globalIdStorageFind(itemId);return temp&&temp.parentObject?temp.parentObject.id:""},dhtmlXTreeObject.prototype.changeItemId=function(itemId,newItemId){if(itemId!=newItemId){var temp=this._globalIdStorageFind(itemId);if(!temp)return 0;temp.id=newItemId,temp.span.contextMenuId=newItemId,this._idpull[newItemId]=this._idpull[itemId],delete this._idpull[itemId]}},dhtmlXTreeObject.prototype.doCut=function(){this.nodeCut&&this.clearCut(),this.nodeCut=(new Array).concat(this._selected);for(var i=0;i<this.nodeCut.length;i++){var tempa=this.nodeCut[i];tempa._cimgs=new Array,tempa._cimgs[0]=tempa.images[0],tempa._cimgs[1]=tempa.images[1],tempa._cimgs[2]=tempa.images[2],tempa.images[0]=tempa.images[1]=tempa.images[2]=this.cutImage,this._correctPlus(tempa)}},dhtmlXTreeObject.prototype.doPaste=function(itemId){var tobj=this._globalIdStorageFind(itemId);if(!tobj)return 0;for(var i=0;i<this.nodeCut.length;i++)this._checkPNodes(tobj,this.nodeCut[i])||this._moveNode(this.nodeCut[i],tobj);this.clearCut()},dhtmlXTreeObject.prototype.clearCut=function(){for(var i=0;i<this.nodeCut.length;i++){var tempa=this.nodeCut[i];tempa.images[0]=tempa._cimgs[0],tempa.images[1]=tempa._cimgs[1],tempa.images[2]=tempa._cimgs[2],this._correctPlus(tempa)}this.nodeCut=new Array},dhtmlXTreeObject.prototype._moveNode=function(itemObject,targetObject){return this._moveNodeTo(itemObject,targetObject)},dhtmlXTreeObject.prototype._fixNodesCollection=function(target,zParent){var flag=0,Nodes=target.childNodes,Count=target.childsCount-1;if(zParent!=Nodes[Count]){for(var i=0;Count>i;i++)Nodes[i]==Nodes[Count]&&(Nodes[i]=Nodes[i+1],Nodes[i+1]=Nodes[Count]);for(var i=0;Count+1>i;i++)if(flag){var temp=Nodes[i];Nodes[i]=flag,flag=temp}else Nodes[i]==zParent&&(flag=Nodes[i],Nodes[i]=Nodes[Count])}},dhtmlXTreeObject.prototype._recreateBranch=function(itemObject,targetObject,beforeNode,level){var i,st="";if(beforeNode){for(i=0;i<targetObject.childsCount&&targetObject.childNodes[i]!=beforeNode;i++);0!=i?beforeNode=targetObject.childNodes[i-1]:(st="TOP",beforeNode="")}var t2=this._onradh;this._onradh=null;var newNode=this._attachChildNode(targetObject,itemObject.id,itemObject.label,0,itemObject.images[0],itemObject.images[1],itemObject.images[2],st,0,beforeNode);if(newNode._userdatalist=itemObject._userdatalist,newNode.userData=itemObject.userData.clone(),itemObject._attrs){newNode._attrs={};for(var attr in itemObject._attrs)newNode._attrs[attr]=itemObject._attrs[attr]}newNode.XMLload=itemObject.XMLload,t2&&(this._onradh=t2,this._onradh(newNode.id));for(var i=0;i<itemObject.childsCount;i++)this._recreateBranch(itemObject.childNodes[i],newNode,0,1);return newNode},dhtmlXTreeObject.prototype._moveNodeTo=function(itemObject,targetObject,beforeNode){if(itemObject.treeNod._nonTrivialNode)return itemObject.treeNod._nonTrivialNode(this,targetObject,beforeNode,itemObject);if(this._checkPNodes(targetObject,itemObject))return!1;if(targetObject.mytype)var framesMove=itemObject.treeNod.lWin!=targetObject.lWin;else var framesMove=itemObject.treeNod.lWin!=targetObject.treeNod.lWin;if(!this.callEvent("onDrag",[itemObject.id,targetObject.id,beforeNode?beforeNode.id:null,itemObject.treeNod,targetObject.treeNod]))return!1;0==targetObject.XMLload&&this.XMLsource&&(targetObject.XMLload=1,this._loadDynXML(targetObject.id)),this.openItem(targetObject.id);var oldTree=itemObject.treeNod,c=itemObject.parentObject.childsCount,z=itemObject.parentObject;if(framesMove||oldTree.dpcpy){var _otiid=itemObject.id;itemObject=this._recreateBranch(itemObject,targetObject,beforeNode),oldTree.dpcpy||oldTree.deleteItem(_otiid)}else{var Count=targetObject.childsCount,Nodes=targetObject.childNodes;0==Count&&(targetObject._open=!0),oldTree._unselectItem(itemObject),Nodes[Count]=itemObject,itemObject.treeNod=targetObject.treeNod,targetObject.childsCount++;var tr=this._drawNewTr(Nodes[Count].htmlNode);beforeNode?(targetObject.htmlNode.childNodes[0].insertBefore(tr,beforeNode.tr),this._fixNodesCollection(targetObject,beforeNode),Nodes=targetObject.childNodes):(targetObject.htmlNode.childNodes[0].appendChild(tr),1==this.dadmode&&this._fixNodesCollection(targetObject,beforeNode))}if(!oldTree.dpcpy&&!framesMove){var zir=itemObject.tr;if(document.all&&-1!=navigator.appVersion.search(/MSIE\ 5\.0/gi)?window.setTimeout(function(){zir.parentNode.removeChild(zir)},250):itemObject.parentObject.htmlNode.childNodes[0].removeChild(itemObject.tr),beforeNode&&targetObject==itemObject.parentObject)z.childNodes[z.childsCount-1]=0;else for(var i=0;i<z.childsCount;i++)if(z.childNodes[i].id==itemObject.id){z.childNodes[i]=0;break}oldTree._compressChildList(z.childsCount,z.childNodes),z.childsCount--}if(!framesMove&&!oldTree.dpcpy){if(itemObject.tr=tr,tr.nodem=itemObject,itemObject.parentObject=targetObject,oldTree!=targetObject.treeNod){if(itemObject.treeNod._registerBranch(itemObject,oldTree))return;this._clearStyles(itemObject),this._redrawFrom(this,itemObject.parentObject),this._onradh&&this._onradh(itemObject.id)}this._correctPlus(targetObject),this._correctLine(targetObject),this._correctLine(itemObject),this._correctPlus(itemObject),beforeNode?this._correctPlus(beforeNode):targetObject.childsCount>=2&&(this._correctPlus(Nodes[targetObject.childsCount-2]),this._correctLine(Nodes[targetObject.childsCount-2])),this._correctPlus(Nodes[targetObject.childsCount-1]),this.tscheck&&this._correctCheckStates(targetObject),oldTree.tscheck&&oldTree._correctCheckStates(z)}return c>1&&(oldTree._correctPlus(z.childNodes[c-2]),oldTree._correctLine(z.childNodes[c-2])),oldTree._correctPlus(z),oldTree._correctLine(z),this.callEvent("onDrop",[itemObject.id,targetObject.id,beforeNode?beforeNode.id:null,oldTree,targetObject.treeNod]),itemObject.id},dhtmlXTreeObject.prototype._clearStyles=function(itemObject){if(itemObject.htmlNode){var td1=itemObject.htmlNode.childNodes[0].childNodes[0].childNodes[1],td3=td1.nextSibling.nextSibling;itemObject.span.innerHTML=itemObject.label,itemObject.i_sel=!1,itemObject._aimgs&&this.dragger.removeDraggableItem(td1.nextSibling),this.checkBoxOff?(td1.childNodes[0].style.display="",td1.childNodes[0].onclick=this.onCheckBoxClick,this._setSrc(td1.childNodes[0],this.imPath+this.checkArray[itemObject.checkstate])):td1.childNodes[0].style.display="none",td1.childNodes[0].treeNod=this,this.dragger.removeDraggableItem(td3),this.dragAndDropOff&&this.dragger.addDraggableItem(td3,this),this._aimgs&&this.dragger.addDraggableItem(td1.nextSibling,this),td3.childNodes[0].className="standartTreeRow",td3.onclick=this.onRowSelect,td3.ondblclick=this.onRowClick2,td1.previousSibling.onclick=this.onRowClick,this._correctLine(itemObject),this._correctPlus(itemObject);for(var i=0;i<itemObject.childsCount;i++)this._clearStyles(itemObject.childNodes[i])}},dhtmlXTreeObject.prototype._registerBranch=function(itemObject,oldTree){oldTree&&oldTree._globalIdStorageSub(itemObject.id),itemObject.id=this._globalIdStorageAdd(itemObject.id,itemObject),itemObject.treeNod=this;for(var i=0;i<itemObject.childsCount;i++)this._registerBranch(itemObject.childNodes[i],oldTree);return 0},dhtmlXTreeObject.prototype.enableThreeStateCheckboxes=function(mode){this.tscheck=convertStringToBoolean(mode)},dhtmlXTreeObject.prototype.setOnMouseInHandler=function(func){this.ehlt=!0,this.attachEvent("onMouseIn",func)},dhtmlXTreeObject.prototype.setOnMouseOutHandler=function(func){this.ehlt=!0,this.attachEvent("onMouseOut",func)},dhtmlXTreeObject.prototype.enableTreeImages=function(mode){this.timgen=convertStringToBoolean(mode)},dhtmlXTreeObject.prototype.enableFixedMode=function(mode){this.hfMode=convertStringToBoolean(mode)},dhtmlXTreeObject.prototype.enableCheckBoxes=function(mode,hidden){this.checkBoxOff=convertStringToBoolean(mode),this.cBROf=!(this.checkBoxOff||convertStringToBoolean(hidden))},dhtmlXTreeObject.prototype.enableMultiselection=function(mode,strict){this._amsel=convertStringToBoolean(mode),this._amselS=convertStringToBoolean(strict)},dhtmlXTreeObject.prototype.setStdImages=function(image1,image2,image3){this.imageArray[0]=image1,this.imageArray[1]=image2,this.imageArray[2]=image3},dhtmlXTreeObject.prototype.enableTreeLines=function(mode){this.treeLinesOn=convertStringToBoolean(mode)},dhtmlXTreeObject.prototype.setImageArrays=function(arrayName,image1,image2,image3,image4,image5){switch(arrayName){case"plus":this.plusArray[0]=image1,this.plusArray[1]=image2,this.plusArray[2]=image3,this.plusArray[3]=image4,this.plusArray[4]=image5;break;case"minus":this.minusArray[0]=image1,this.minusArray[1]=image2,this.minusArray[2]=image3,this.minusArray[3]=image4,this.minusArray[4]=image5}},dhtmlXTreeObject.prototype.openItem=function(itemId){this.skipLock=!0;var temp=this._globalIdStorageFind(itemId);return temp?this._openItem(temp):0},dhtmlXTreeObject.prototype._openItem=function(item){var state=this._getOpenState(item);if(0>state||this.XMLsource&&!item.XMLload){if(!this.callEvent("onOpenStart",[item.id,state]))return 0;this._HideShow(item,2),this.checkEvent("onOpenEnd")&&(this.onXLE==this._epnFHe&&this._epnFHe(this,item.id,!0),this.xmlstate&&this.XMLsource?(this._oie_onXLE.push(this.onXLE),this.onXLE=this._epnFHe):this.callEvent("onOpenEnd",[item.id,this._getOpenState(item)]))}else this._srnd&&this._HideShow(item,2);item.parentObject&&!this._skip_open_parent&&this._openItem(item.parentObject)},dhtmlXTreeObject.prototype.closeItem=function(itemId){if(this.rootId==itemId)return 0;this.skipLock=!0;var temp=this._globalIdStorageFind(itemId);return temp?(temp.closeble&&this._HideShow(temp,1),void(this.skipLock=!1)):0},dhtmlXTreeObject.prototype.getLevel=function(itemId){var temp=this._globalIdStorageFind(itemId);return temp?this._getNodeLevel(temp,0):0},dhtmlXTreeObject.prototype.setItemCloseable=function(itemId,flag){if(flag=convertStringToBoolean(flag),itemId&&itemId.span)var temp=itemId;else var temp=this._globalIdStorageFind(itemId);return temp?void(temp.closeble=flag):0},dhtmlXTreeObject.prototype._getNodeLevel=function(itemObject,count){return itemObject.parentObject?this._getNodeLevel(itemObject.parentObject,count+1):count},dhtmlXTreeObject.prototype.hasChildren=function(itemId){var temp=this._globalIdStorageFind(itemId);return temp?this.XMLsource&&!temp.XMLload?!0:temp.childsCount:0},dhtmlXTreeObject.prototype._getLeafCount=function(itemNode){for(var a=0,b=0;b<itemNode.childsCount;b++)0==itemNode.childNodes[b].childsCount&&a++;return a},dhtmlXTreeObject.prototype.setItemText=function(itemId,newLabel,newTooltip){var temp=this._globalIdStorageFind(itemId);return temp?(temp.label=newLabel,temp.span.innerHTML=newLabel,void(temp.span.parentNode.parentNode.title=newTooltip||"")):0},dhtmlXTreeObject.prototype.getItemTooltip=function(itemId){var temp=this._globalIdStorageFind(itemId);return temp?temp.span.parentNode.parentNode._dhx_title||temp.span.parentNode.parentNode.title||"":""},dhtmlXTreeObject.prototype.refreshItem=function(itemId){itemId||(itemId=this.rootId);this._globalIdStorageFind(itemId);this.deleteChildItems(itemId),this._loadDynXML(itemId)},dhtmlXTreeObject.prototype.setItemImage2=function(itemId,image1,image2,image3){var temp=this._globalIdStorageFind(itemId);return temp?(temp.images[1]=image2,temp.images[2]=image3,temp.images[0]=image1,void this._correctPlus(temp)):0},dhtmlXTreeObject.prototype.setItemImage=function(itemId,image1,image2){var temp=this._globalIdStorageFind(itemId);return temp?(image2?(temp.images[1]=image1,temp.images[2]=image2):temp.images[0]=image1,void this._correctPlus(temp)):0},dhtmlXTreeObject.prototype.getSubItems=function(itemId){var temp=this._globalIdStorageFind(itemId,0,1);if(!temp)return 0;var z="";for(i=0;i<temp.childsCount;i++)z?z+=this.dlmtr+temp.childNodes[i].id:z=""+temp.childNodes[i].id;return z},dhtmlXTreeObject.prototype._getAllScraggyItems=function(node){for(var z="",i=0;i<node.childsCount;i++)if(node.childNodes[i].unParsed||node.childNodes[i].childsCount>0){if(node.childNodes[i].unParsed)var zb=this._getAllScraggyItemsXML(node.childNodes[i].unParsed,1);else var zb=this._getAllScraggyItems(node.childNodes[i]);zb&&(z?z+=this.dlmtr+zb:z=zb)}else z?z+=this.dlmtr+node.childNodes[i].id:z=""+node.childNodes[i].id;return z},dhtmlXTreeObject.prototype._getAllFatItems=function(node){for(var z="",i=0;i<node.childsCount;i++)if(node.childNodes[i].unParsed||node.childNodes[i].childsCount>0){if(z?z+=this.dlmtr+node.childNodes[i].id:z=""+node.childNodes[i].id,node.childNodes[i].unParsed)var zb=this._getAllFatItemsXML(node.childNodes[i].unParsed,1);else var zb=this._getAllFatItems(node.childNodes[i]);zb&&(z+=this.dlmtr+zb)}return z},dhtmlXTreeObject.prototype._getAllSubItems=function(itemId,z,node){if(node)temp=node;else var temp=this._globalIdStorageFind(itemId);if(!temp)return 0;z="";for(var i=0;i<temp.childsCount;i++){z?z+=this.dlmtr+temp.childNodes[i].id:z=""+temp.childNodes[i].id;var zb=this._getAllSubItems(0,z,temp.childNodes[i]);zb&&(z+=this.dlmtr+zb)}return z},dhtmlXTreeObject.prototype.selectItem=function(itemId,mode,preserve){mode=convertStringToBoolean(mode);var temp=this._globalIdStorageFind(itemId);if(!temp||!temp.parentObject)return 0;this.XMLloadingWarning?temp.parentObject.openMe=1:this._openItem(temp.parentObject);var ze=null;preserve&&(ze=new Object,ze.ctrlKey=!0,temp.i_sel&&(ze.skipUnSel=!0)),mode?this.onRowSelect(ze,temp.htmlNode.childNodes[0].childNodes[0].childNodes[3],!1):this.onRowSelect(ze,temp.htmlNode.childNodes[0].childNodes[0].childNodes[3],!0)},dhtmlXTreeObject.prototype.getSelectedItemText=function(){for(var str=new Array,i=0;i<this._selected.length;i++)str[i]=this._selected[i].span.innerHTML;return str.join(this.dlmtr)},dhtmlXTreeObject.prototype._compressChildList=function(Count,Nodes){Count--;for(var i=0;Count>i;i++)0==Nodes[i]&&(Nodes[i]=Nodes[i+1],Nodes[i+1]=0)},dhtmlXTreeObject.prototype._deleteNode=function(itemId,htmlObject,skip){if(!htmlObject||!htmlObject.parentObject)return 0;var tempos=0,tempos2=0;htmlObject.tr.nextSibling&&(tempos=htmlObject.tr.nextSibling.nodem),htmlObject.tr.previousSibling&&(tempos2=htmlObject.tr.previousSibling.nodem);for(var sN=htmlObject.parentObject,Count=sN.childsCount,Nodes=sN.childNodes,i=0;Count>i;i++)if(Nodes[i].id==itemId){skip||sN.htmlNode.childNodes[0].removeChild(Nodes[i].tr),Nodes[i]=0;break}this._compressChildList(Count,Nodes),skip||sN.childsCount--,tempos&&(this._correctPlus(tempos),this._correctLine(tempos)),tempos2&&(this._correctPlus(tempos2),this._correctLine(tempos2)),this.tscheck&&this._correctCheckStates(sN),skip||this._globalIdStorageRecSub(htmlObject)},dhtmlXTreeObject.prototype.setCheck=function(itemId,state){var sNode=this._globalIdStorageFind(itemId,0,1);sNode&&("unsure"===state?this._setCheck(sNode,state):(state=convertStringToBoolean(state),this.tscheck&&this.smcheck?this._setSubChecked(state,sNode):this._setCheck(sNode,state)),this.smcheck&&this._correctCheckStates(sNode.parentObject))},dhtmlXTreeObject.prototype._setCheck=function(sNode,state){if(sNode){if((sNode.parentObject._r_logic||this._frbtr)&&state)if(this._frbtrs)this._frbtrL&&this.setCheck(this._frbtrL.id,0),this._frbtrL=sNode;else for(var i=0;i<sNode.parentObject.childsCount;i++)this._setCheck(sNode.parentObject.childNodes[i],0);var z=sNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];"unsure"==state?sNode.checkstate=2:state?sNode.checkstate=1:sNode.checkstate=0,sNode.dscheck&&(sNode.checkstate=sNode.dscheck),this._setSrc(z,this.imPath+(sNode.parentObject._r_logic||this._frbtr?this.radioArray:this.checkArray)[sNode.checkstate])}},dhtmlXTreeObject.prototype.setSubChecked=function(itemId,state){var sNode=this._globalIdStorageFind(itemId);this._setSubChecked(state,sNode),this._correctCheckStates(sNode.parentObject)},dhtmlXTreeObject.prototype._setSubChecked=function(state,sNode){if(state=convertStringToBoolean(state),sNode){if((sNode.parentObject._r_logic||this._frbtr)&&state)for(var i=0;i<sNode.parentObject.childsCount;i++)this._setSubChecked(0,sNode.parentObject.childNodes[i]);if(sNode._r_logic||this._frbtr)this._setSubChecked(state,sNode.childNodes[0]);else for(var i=0;i<sNode.childsCount;i++)this._setSubChecked(state,sNode.childNodes[i]);var z=sNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];state?sNode.checkstate=1:sNode.checkstate=0,sNode.dscheck&&(sNode.checkstate=sNode.dscheck),this._setSrc(z,this.imPath+(sNode.parentObject._r_logic||this._frbtr?this.radioArray:this.checkArray)[sNode.checkstate])}},dhtmlXTreeObject.prototype.isItemChecked=function(itemId){var sNode=this._globalIdStorageFind(itemId);if(sNode)return sNode.checkstate},dhtmlXTreeObject.prototype.deleteChildItems=function(itemId){var sNode=this._globalIdStorageFind(itemId);if(sNode)for(var j=sNode.childsCount,i=0;j>i;i++)this._deleteNode(sNode.childNodes[0].id,sNode.childNodes[0])},dhtmlXTreeObject.prototype.deleteItem=function(itemId,selectParent){if(!this._onrdlh||this._onrdlh(itemId)){this._deleteItem(itemId,selectParent)}this.allTree.childNodes[0].border="1",this.allTree.childNodes[0].border="0"},dhtmlXTreeObject.prototype._deleteItem=function(itemId,selectParent,skip){selectParent=convertStringToBoolean(selectParent);var sNode=this._globalIdStorageFind(itemId);if(sNode){var pid=this.getParentId(itemId),zTemp=sNode.parentObject;return this._deleteNode(itemId,sNode,skip),this._editCell&&this._editCell.id==itemId&&(this._editCell=null),this._correctPlus(zTemp),this._correctLine(zTemp),selectParent&&pid!=this.rootId&&this.selectItem(pid,1),zTemp}},dhtmlXTreeObject.prototype._globalIdStorageRecSub=function(itemObject){for(var i=0;i<itemObject.childsCount;i++)this._globalIdStorageRecSub(itemObject.childNodes[i]),this._globalIdStorageSub(itemObject.childNodes[i].id);this._globalIdStorageSub(itemObject.id);var z=itemObject;z.span=null,z.tr.nodem=null,z.tr=null,z.htmlNode=null},dhtmlXTreeObject.prototype.insertNewNext=function(itemId,newItemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children){var sNode=this._globalIdStorageFind(itemId);if(!sNode||!sNode.parentObject)return 0;var nodez=this._attachChildNode(0,newItemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children,sNode);return nodez},dhtmlXTreeObject.prototype.getItemIdByIndex=function(itemId,index){var z=this._globalIdStorageFind(itemId);return!z||index>=z.childsCount?null:z.childNodes[index].id},dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(itemId,index){var z=this._globalIdStorageFind(itemId);return!z||index>=z.childsCount?null:z.childNodes[index].id},dhtmlXTreeObject.prototype.setDragHandler=function(func){this.attachEvent("onDrag",func)},dhtmlXTreeObject.prototype._clearMove=function(){this._lastMark&&(this._lastMark.className=this._lastMark.className.replace(/dragAndDropRow/g,""),this._lastMark=null),this.allTree.className=this.allTree.className.replace(" selectionBox","")},dhtmlXTreeObject.prototype.enableDragAndDrop=function(mode,rmode){"temporary_disabled"==mode?(this.dADTempOff=!1,mode=!0):this.dADTempOff=!0,this.dragAndDropOff=convertStringToBoolean(mode),this.dragAndDropOff&&this.dragger.addDragLanding(this.allTree,this),arguments.length>1&&(this._ddronr=!convertStringToBoolean(rmode))},dhtmlXTreeObject.prototype._setMove=function(htmlNode,x,y){if(htmlNode.parentObject.span){var a1=getAbsoluteTop(htmlNode),a2=getAbsoluteTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode,this.dadmodefix=0;var zN=htmlNode.parentObject.span;zN.className+=" dragAndDropRow",this._lastMark=zN,this._autoScroll(null,a1,a2)}},dhtmlXTreeObject.prototype._autoScroll=function(node,a1,a2){this.autoScroll&&(node&&(a1=getAbsoluteTop(node),a2=getAbsoluteTop(this.allTree)-this.allTree.scrollTop),a1-a2-parseInt(this.allTree.scrollTop)>parseInt(this.allTree.offsetHeight)-50&&(this.allTree.scrollTop=parseInt(this.allTree.scrollTop)+20),a1-a2<parseInt(this.allTree.scrollTop)+30&&(this.allTree.scrollTop=parseInt(this.allTree.scrollTop)-20))},dhtmlXTreeObject.prototype._createDragNode=function(htmlObject,e){if(!this.dADTempOff)return null;var obj=htmlObject.parentObject;if(!this.callEvent("onBeforeDrag",[obj.id,e]))return null;obj.i_sel||this._selectItem(obj,e);var dragSpan=document.createElement("div"),text=new Array;if(this._itim_dg)for(var i=0;i<this._selected.length;i++)text[i]="<table cellspacing='0' cellpadding='0'><tr><td><img width='18px' height='18px' src='"+this._getSrc(this._selected[i].span.parentNode.previousSibling.childNodes[0])+"'></td><td>"+this._selected[i].span.innerHTML+"</td></tr></table>";else text=this.getSelectedItemText().split(this.dlmtr);return dragSpan.innerHTML=text.join(""),dragSpan.style.position="absolute",dragSpan.className="dragSpanDiv",this._dragged=(new Array).concat(this._selected),dragSpan},dhtmlXTreeObject.prototype._focusNode=function(item){var z=getAbsoluteTop(item.htmlNode)-getAbsoluteTop(this.allTree);(z>this.allTree.offsetHeight-30||0>z)&&(this.allTree.scrollTop=z+this.allTree.scrollTop)},dhtmlXTreeObject.prototype._preventNsDrag=function(e){return e&&e.preventDefault?(e.preventDefault(),!1):!1},dhtmlXTreeObject.prototype._drag=function(sourceHtmlObject,dhtmlObject,targetHtmlObject){this._autoOpenTimer&&clearTimeout(this._autoOpenTimer),targetHtmlObject.parentObject||(targetHtmlObject=this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.dadmodec=0),this._clearMove();var z=sourceHtmlObject.parentObject.treeNod;if(z&&z._clearMove&&z._clearMove(""),!this.dragMove||this.dragMove()){if(z&&z._clearMove&&z._dragged)var col=z._dragged;else var col=new Array(sourceHtmlObject.parentObject);for(var trg=targetHtmlObject.parentObject,i=0;i<col.length;i++){var newID=this._moveNode(col[i],trg);this.dadmodec&&newID!==!1&&(trg=this._globalIdStorageFind(newID,!0,!0)),newID&&!this._sADnD&&this.selectItem(newID,0,1)}}z&&(z._dragged=new Array)},dhtmlXTreeObject.prototype._dragIn=function(htmlObject,shtmlObject,x,y){if(!this.dADTempOff)return 0;var fobj=shtmlObject.parentObject,tobj=htmlObject.parentObject;if(tobj||!this._ddronr){if(!this.callEvent("onDragIn",[fobj.id,tobj?tobj.id:null,fobj.treeNod,this]))return tobj&&this._autoScroll(htmlObject),0;if(tobj){if(null==fobj.childNodes)return this._setMove(htmlObject,x,y),htmlObject;for(var stree=fobj.treeNod,i=0;i<stree._dragged.length;i++)if(this._checkPNodes(tobj,stree._dragged[i]))return this._autoScroll(htmlObject),0;this._setMove(htmlObject,x,y),this._getOpenState(tobj)<=0&&(this._autoOpenId=tobj.id,this._autoOpenTimer=window.setTimeout(new callerFunction(this._autoOpenItem,this),1e3))}else this.allTree.className+=" selectionBox";return htmlObject}},dhtmlXTreeObject.prototype._autoOpenItem=function(e,treeObject){treeObject.openItem(treeObject._autoOpenId)},dhtmlXTreeObject.prototype._dragOut=function(htmlObject){this._clearMove(),this._autoOpenTimer&&clearTimeout(this._autoOpenTimer)},dhtmlXTreeObject.prototype.moveItem=function(itemId,mode,targetId,targetTree){var sNode=this._globalIdStorageFind(itemId);if(!sNode)return 0;var resultId=null;switch(mode){case"right":alert("Not supported yet");break;case"item_child":var tNode=(targetTree||this)._globalIdStorageFind(targetId);if(!tNode)return 0;resultId=(targetTree||this)._moveNodeTo(sNode,tNode,0);break;case"item_sibling":var tNode=(targetTree||this)._globalIdStorageFind(targetId);if(!tNode)return 0;resultId=(targetTree||this)._moveNodeTo(sNode,tNode.parentObject,tNode);break;case"item_sibling_next":var tNode=(targetTree||this)._globalIdStorageFind(targetId);if(!tNode)return 0;resultId=tNode.tr&&tNode.tr.nextSibling&&tNode.tr.nextSibling.nodem?(targetTree||this)._moveNodeTo(sNode,tNode.parentObject,tNode.tr.nextSibling.nodem):(targetTree||this)._moveNodeTo(sNode,tNode.parentObject);break;case"left":sNode.parentObject.parentObject&&(resultId=this._moveNodeTo(sNode,sNode.parentObject.parentObject,sNode.parentObject));break;case"up":var z=this._getPrevNode(sNode);if(-1==z||!z.parentObject)return null;resultId=this._moveNodeTo(sNode,z.parentObject,z);break;case"up_strict":var z=this._getIndex(sNode);0!=z&&(resultId=this._moveNodeTo(sNode,sNode.parentObject,sNode.parentObject.childNodes[z-1]));break;case"down_strict":var z=this._getIndex(sNode),count=sNode.parentObject.childsCount-2;z==count?resultId=this._moveNodeTo(sNode,sNode.parentObject):count>z&&(resultId=this._moveNodeTo(sNode,sNode.parentObject,sNode.parentObject.childNodes[z+2]));break;case"down":var z=this._getNextNode(this._lastChild(sNode));if(-1==z||!z.parentObject)return;if(z.parentObject==sNode.parentObject)var z=this._getNextNode(z);if(-1==z)resultId=this._moveNodeTo(sNode,sNode.parentObject);else{if(-1==z||!z.parentObject)return;resultId=this._moveNodeTo(sNode,z.parentObject,z)}}return _isIE&&_isIE<8&&(this.allTree.childNodes[0].border="1",this.allTree.childNodes[0].border="0"),resultId},dhtmlXTreeObject.prototype._loadDynXML=function(id,src){src=src||this.XMLsource;var sn=(new Date).valueOf();this._ld_id=id,this.loadXML(src+getUrlSymbol(src)+"uid="+sn+"&id="+this._escape(id))},dhtmlXTreeObject.prototype._checkPNodes=function(item1,item2){return this._dcheckf?!1:item2==item1?1:item1.parentObject?this._checkPNodes(item1.parentObject,item2):0},dhtmlXTreeObject.prototype.disableDropCheck=function(mode){this._dcheckf=convertStringToBoolean(mode)},dhtmlXTreeObject.prototype.preventIECaching=function(mode){this.no_cashe=convertStringToBoolean(mode),this.XMLLoader.rSeed=this.no_cashe},dhtmlXTreeObject.prototype.preventIECashing=dhtmlXTreeObject.prototype.preventIECaching,dhtmlXTreeObject.prototype.disableCheckbox=function(itemId,mode){if("object"!=typeof itemId)var sNode=this._globalIdStorageFind(itemId,0,1);else var sNode=itemId;sNode&&(sNode.dscheck=convertStringToBoolean(mode)?(sNode.checkstate||0)%3+3:sNode.checkstate>2?sNode.checkstate-3:sNode.checkstate,this._setCheck(sNode),sNode.dscheck<3&&(sNode.dscheck=!1))},dhtmlXTreeObject.prototype.setEscapingMode=function(mode){this.utfesc=mode},dhtmlXTreeObject.prototype.enableHighlighting=function(mode){this.ehlt=!0,this.ehlta=convertStringToBoolean(mode)},dhtmlXTreeObject.prototype._itemMouseOut=function(){var that=this.childNodes[3].parentObject,tree=that.treeNod;tree.callEvent("onMouseOut",[that.id]),that.id==tree._l_onMSI&&(tree._l_onMSI=null),tree.ehlta&&(that.span.className=that.span.className.replace("_lor",""))},dhtmlXTreeObject.prototype._itemMouseIn=function(){var that=this.childNodes[3].parentObject,tree=that.treeNod;tree._l_onMSI!=that.id&&tree.callEvent("onMouseIn",[that.id]),tree._l_onMSI=that.id,tree.ehlta&&(that.span.className=that.span.className.replace("_lor",""),that.span.className=that.span.className.replace(/((standart|selected)TreeRow)/,"$1_lor"))},dhtmlXTreeObject.prototype.enableActiveImages=function(mode){this._aimgs=convertStringToBoolean(mode)},dhtmlXTreeObject.prototype.focusItem=function(itemId){var sNode=this._globalIdStorageFind(itemId);return sNode?void this._focusNode(sNode):0},dhtmlXTreeObject.prototype.getAllSubItems=function(itemId){return this._getAllSubItems(itemId)},dhtmlXTreeObject.prototype.getAllChildless=function(){return this._getAllScraggyItems(this.htmlNode)},dhtmlXTreeObject.prototype.getAllLeafs=dhtmlXTreeObject.prototype.getAllChildless,dhtmlXTreeObject.prototype._getAllScraggyItems=function(node){for(var z="",i=0;i<node.childsCount;i++)if(node.childNodes[i].unParsed||node.childNodes[i].childsCount>0){if(node.childNodes[i].unParsed)var zb=this._getAllScraggyItemsXML(node.childNodes[i].unParsed,1);else var zb=this._getAllScraggyItems(node.childNodes[i]);zb&&(z?z+=this.dlmtr+zb:z=zb)}else z?z+=this.dlmtr+node.childNodes[i].id:z=""+node.childNodes[i].id;return z},dhtmlXTreeObject.prototype._getAllFatItems=function(node){for(var z="",i=0;i<node.childsCount;i++)if(node.childNodes[i].unParsed||node.childNodes[i].childsCount>0){if(z?z+=this.dlmtr+node.childNodes[i].id:z=""+node.childNodes[i].id,node.childNodes[i].unParsed)var zb=this._getAllFatItemsXML(node.childNodes[i].unParsed,1);else var zb=this._getAllFatItems(node.childNodes[i]);zb&&(z+=this.dlmtr+zb)}return z},dhtmlXTreeObject.prototype.getAllItemsWithKids=function(){return this._getAllFatItems(this.htmlNode)},dhtmlXTreeObject.prototype.getAllFatItems=dhtmlXTreeObject.prototype.getAllItemsWithKids,dhtmlXTreeObject.prototype.getAllChecked=function(){return this._getAllChecked("","",1)},dhtmlXTreeObject.prototype.getAllUnchecked=function(itemId){return itemId&&(itemId=this._globalIdStorageFind(itemId)),this._getAllChecked(itemId,"",0)},dhtmlXTreeObject.prototype.getAllPartiallyChecked=function(){return this._getAllChecked("","",2)},dhtmlXTreeObject.prototype.getAllCheckedBranches=function(){var temp=[this._getAllChecked("","",1)],second=this._getAllChecked("","",2);return second&&temp.push(second),temp.join(this.dlmtr)},dhtmlXTreeObject.prototype._getAllChecked=function(htmlNode,list,mode){htmlNode||(htmlNode=this.htmlNode),htmlNode.checkstate==mode&&(htmlNode.nocheckbox||(list?list+=this.dlmtr+htmlNode.id:list=""+htmlNode.id));for(var j=htmlNode.childsCount,i=0;j>i;i++)list=this._getAllChecked(htmlNode.childNodes[i],list,mode);return list?list:""},dhtmlXTreeObject.prototype.setItemStyle=function(itemId,style_string,resetCss){var resetCss=resetCss||!1,temp=this._globalIdStorageFind(itemId);return temp?void(temp.span.style.cssText?temp.span.style.cssText=resetCss?style_string:temp.span.style.cssText+";"+style_string:temp.span.setAttribute("style",temp.span.getAttribute("style")+"; "+style_string)):0},dhtmlXTreeObject.prototype.enableImageDrag=function(mode){this._itim_dg=convertStringToBoolean(mode)},dhtmlXTreeObject.prototype.setOnDragIn=function(func){this.attachEvent("onDragIn",func)},dhtmlXTreeObject.prototype.enableDragAndDropScrolling=function(mode){this.autoScroll=convertStringToBoolean(mode)},dhtmlXTreeObject.prototype.setSkin=function(name){var tmp=this.parentObject.className.replace(/dhxtree_[^ ]*/gi,"");this.parentObject.className=tmp+" dhxtree_"+name,"dhx_terrace"==name&&this.enableTreeLines(!1)},function(){dhtmlx.extend_api("dhtmlXTreeObject",{_init:function(obj){
return[obj.parent,obj.width||"100%",obj.height||"100%",obj.root_id||0]},auto_save_selection:"enableAutoSavingSelected",auto_tooltip:"enableAutoTooltips",checkbox:"enableCheckBoxes",checkbox_3_state:"enableThreeStateCheckboxes",checkbox_smart:"enableSmartCheckboxes",context_menu:"enableContextMenu",distributed_parsing:"enableDistributedParsing",drag:"enableDragAndDrop",drag_copy:"enableMercyDrag",drag_image:"enableImageDrag",drag_scroll:"enableDragAndDropScrolling",editor:"enableItemEditor",hover:"enableHighlighting",images:"enableTreeImages",image_fix:"enableIEImageFix",image_path:"setImagePath",lines:"enableTreeLines",loading_item:"enableLoadingItem",multiline:"enableMultiLineItems",multiselect:"enableMultiselection",navigation:"enableKeyboardNavigation",radio:"enableRadioButtons",radio_single:"enableSingleRadioMode",rtl:"enableRTL",search:"enableKeySearch",smart_parsing:"enableSmartXMLParsing",smart_rendering:"enableSmartRendering",text_icons:"enableTextSigns",xml:"loadXML",skin:"setSkin"},{})}(),dhtmlXTreeObject.prototype._dp_init=function(dp){dp.attachEvent("insertCallback",function(upd,id,parent){var data=this._loader.doXPath(".//item",upd),text=data[0].getAttribute("text");this.obj.insertNewItem(parent,id,text,0,0,0,0,"CHILD")}),dp.attachEvent("updateCallback",function(upd,id,parent){var data=this._loader.doXPath(".//item",upd),text=data[0].getAttribute("text");this.obj.setItemText(id,text),this.obj.getParentId(id)!=parent&&this.obj.moveItem(id,"item_child",parent),this.setUpdated(id,!0,"updated")}),dp.attachEvent("deleteCallback",function(upd,id,parent){this.obj.setUserData(id,this.action_param,"true_deleted"),this.obj.deleteItem(id,!1)}),dp._methods=["setItemStyle","","changeItemId","deleteItem"],this.attachEvent("onEdit",function(state,id){return 3==state&&dp.setUpdated(id,!0),!0}),this.attachEvent("onDrop",function(id,id_2,id_3,tree_1,tree_2){tree_1==tree_2&&dp.setUpdated(id,!0)}),this._onrdlh=function(rowId){var z=dp.getState(rowId);return"inserted"==z?(dp.set_invalid(rowId,!1),dp.setUpdated(rowId,!1),!0):"true_deleted"==z?(dp.setUpdated(rowId,!1),!0):(dp.setUpdated(rowId,!0,"deleted"),!1)},this._onradh=function(rowId){dp.setUpdated(rowId,!0,"inserted")},dp._getRowData=function(rowId){var data={},z=this.obj._globalIdStorageFind(rowId),z2=z.parentObject,i=0;for(i=0;i<z2.childsCount&&z2.childNodes[i]!=z;i++);for(data.tr_id=z.id,data.tr_pid=z2.id,data.tr_order=i,data.tr_text=z.span.innerHTML,z2=(z._userdatalist||"").split(","),i=0;i<z2.length;i++)data[z2[i]]=z.userData["t_"+z2[i]];return data}},jsonPointer.prototype={text:function(){var afff=function(n){for(var p=[],i=0;i<n.length;i++)p.push("{"+sfff(n[i])+"}");return p.join(",")},sfff=function(n){var p=[];for(var a in n)"object"==typeof n[a]?a.length?p.push('"'+a+'":['+afff(n[a])+"]"):p.push('"'+a+'":{'+sfff(n[a])+"}"):p.push('"'+a+'":"'+n[a]+'"');return p.join(",")};return"{"+sfff(this.d)+"}"},get:function(name){return this.d[name]},exists:function(){return!!this.d},content:function(){return this.d.content},each:function(name,f,t){var a=this.d[name],c=new jsonPointer;if(a)for(var i=0;i<a.length;i++)c.d=a[i],f.apply(t,[c,i])},get_all:function(){return this.d},sub:function(name){return new jsonPointer(this.d[name],this.d)},sub_exists:function(name){return!!this.d[name]},each_x:function(name,rule,f,t,i){var a=this.d[name],c=new jsonPointer(0,this.d);if(a)for(i=i||0;i<a.length;i++)if(a[i][rule]&&(c.d=a[i],-1==f.apply(t,[c,i])))return},up:function(name){return new jsonPointer(this.dp,this.d)},set:function(name,val){this.d[name]=val},clone:function(name){return new jsonPointer(this.d,this.dp)},through:function(name,rule,v,f,t){var a=this.d[name];if(a.length)for(var i=0;i<a.length;i++){if(null!=a[i][rule]&&""!=a[i][rule]&&(!v||a[i][rule]==v)){var c=new jsonPointer(a[i],this.d);f.apply(t,[c,i])}var w=this.d;this.d=a[i],this.sub_exists(name)&&this.through(name,rule,v,f,t),this.d=w}}},dhtmlXTreeObject.prototype.loadJSArrayFile=function(file,afterCall){this.parsCount||this.callEvent("onXLS",[this,this._ld_id]),this._ld_id=null,this.xmlstate=1;var that=this;this.XMLLoader=new dtmlXMLLoaderObject(function(){eval("var z="+arguments[4].xmlDoc.responseText),that.loadJSArray(z)},this,!0,this.no_cashe),afterCall&&(this.XMLLoader.waitCall=afterCall),this.XMLLoader.loadXML(file)},dhtmlXTreeObject.prototype.loadCSV=function(file,afterCall){this.parsCount||this.callEvent("onXLS",[this,this._ld_id]),this._ld_id=null,this.xmlstate=1;var that=this;this.XMLLoader=new dtmlXMLLoaderObject(function(){that.loadCSVString(arguments[4].xmlDoc.responseText)},this,!0,this.no_cashe),afterCall&&(this.XMLLoader.waitCall=afterCall),this.XMLLoader.loadXML(file)},dhtmlXTreeObject.prototype.loadJSArray=function(ar,afterCall){for(var z=[],i=0;i<ar.length;i++)z[ar[i][1]]||(z[ar[i][1]]=[]),z[ar[i][1]].push({id:ar[i][0],text:ar[i][2]});var top={id:this.rootId},f=function(top,f){if(z[top.id]){top.item=z[top.id];for(var j=0;j<top.item.length;j++)f(top.item[j],f)}};f(top,f),this.loadJSONObject(top,afterCall)},dhtmlXTreeObject.prototype.loadCSVString=function(csv,afterCall){for(var z=[],ar=csv.split("\n"),i=0;i<ar.length;i++){var t=ar[i].split(",");z[t[1]]||(z[t[1]]=[]),z[t[1]].push({id:t[0],text:t[2]})}var top={id:this.rootId},f=function(top,f){if(z[top.id]){top.item=z[top.id];for(var j=0;j<top.item.length;j++)f(top.item[j],f)}};f(top,f),this.loadJSONObject(top,afterCall)},dhtmlXTreeObject.prototype.loadJSONObject=function(json,afterCall){this.parsCount||this.callEvent("onXLS",[this,null]),this.xmlstate=1;var p=new jsonPointer(json);this._parse(p),this._p=p,afterCall&&afterCall()},dhtmlXTreeObject.prototype.loadJSON=function(file,afterCall){this.parsCount||this.callEvent("onXLS",[this,this._ld_id]),this._ld_id=null,this.xmlstate=1;var that=this;this.XMLLoader=new dtmlXMLLoaderObject(function(){try{eval("var t="+arguments[4].xmlDoc.responseText)}catch(e){return void dhtmlxError.throwError("LoadXML","Incorrect JSON",[arguments[4].xmlDoc,this])}var p=new jsonPointer(t);that._parse(p),that._p=p},this,!0,this.no_cashe),afterCall&&(this.XMLLoader.waitCall=afterCall),this.XMLLoader.loadXML(file)},dhtmlXTreeObject.prototype.serializeTreeToJSON=function(){for(var out=['{"id":"'+this.rootId+'", "item":['],p=[],i=0;i<this.htmlNode.childsCount;i++)p.push(this._serializeItemJSON(this.htmlNode.childNodes[i]));return out.push(p.join(",")),out.push("]}"),out.join("")},dhtmlXTreeObject.prototype._serializeItemJSON=function(itemNode){var out=[];if(itemNode.unParsed)return itemNode.unParsed.text();if(this._selected.length)var lid=this._selected[0].id;else lid="";var text=itemNode.span.innerHTML;if(text=text.replace(/\"/g,'\\"',text),this._xfullXML?out.push('{ "id":"'+itemNode.id+'", '+(1==this._getOpenState(itemNode)?' "open":"1", ':"")+(lid==itemNode.id?' "select":"1",':"")+' "text":"'+text+'", "im0":"'+itemNode.images[0]+'", "im1":"'+itemNode.images[1]+'", "im2":"'+itemNode.images[2]+'" '+(itemNode.acolor?', "aCol":"'+itemNode.acolor+'" ':"")+(itemNode.scolor?', "sCol":"'+itemNode.scolor+'" ':"")+(1==itemNode.checkstate?', "checked":"1" ':2==itemNode.checkstate?', "checked":"-1"':"")+(itemNode.closeable?', "closeable":"1" ':"")+(this.XMLsource&&0==itemNode.XMLload?', "child":"1" ':"")):out.push('{ "id":"'+itemNode.id+'", '+(1==this._getOpenState(itemNode)?' "open":"1", ':"")+(lid==itemNode.id?' "select":"1",':"")+' "text":"'+text+'"'+(this.XMLsource&&0==itemNode.XMLload?', "child":"1" ':"")),this._xuserData&&itemNode._userdatalist){out.push(', "userdata":[');for(var names=itemNode._userdatalist.split(","),p=[],i=0;i<names.length;i++)p.push('{ "name":"'+names[i]+'" , "content":"'+itemNode.userData["t_"+names[i]]+'" }');out.push(p.join(",")),out.push("]")}if(itemNode.childsCount){out.push(', "item":[');for(var p=[],i=0;i<itemNode.childsCount;i++)p.push(this._serializeItemJSON(itemNode.childNodes[i]));out.push(p.join(",")),out.push("]\n")}return out.push("}\n"),out.join("")},"undefined"==typeof Array.prototype.indexOf&&(Array.prototype.indexOf=function(_elem){for(var i=0;i<this.length;i++)if(this[i]===_elem)return i;return-1});var _egwQueuedCallbacks={};egwEventQueue.prototype.flush=function(){this.events={}},egwEventQueue.prototype.queue=function(_proc,_context,_args,_id){"undefined"!=typeof _args&&_args instanceof Array||(_args=[]),this.key_id++;var key="";key="string"==typeof _id&&_id?_id:"ev_"+this.key_id;var cnt=1;return"undefined"!=typeof this.events[key]&&(cnt=this.events[key].cnt+1),this.events[key]={proc:_proc,context:_context,args:_args,cnt:cnt},key},egwEventQueue.prototype.run=function(_key){if("undefined"!=typeof this.events[_key]){var eventObj=this.events[_key];eventObj.cnt--,0==eventObj.cnt&&(eventObj.proc.apply(eventObj.context,eventObj.args),delete this.events[_key])}},egwEventQueue.prototype.queueTimeout=function(_proc,_context,_args,_id,_timeout){var key=this.queue(_proc,_context,_args,_id),self=this;window.setTimeout(function(){self.run(key)},_timeout)},egwFnct.prototype.hasHandler=function(){return null!==this.fnct&&!this.isDefault},egwFnct.prototype.setValue=function(_value){if(this.value=null,this.fnct=null,"function"==typeof _value)this.fnct=_value;else if("string"==typeof _value&&"javaScript:"==_value.substr(0,11)&&"function"==typeof window[_value.substr(11)])this.fnct=window[_value.substr(11)],console.log("Global function is bad!",_value);else if(this.acceptedTypes.indexOf(typeof _value)>=0)this.value=_value;else if("string"==typeof _value&&"javaScript:app."==_value.substr(0,15)&&window.app){var parts=_value.split(".");3==parts.length&&"object"==typeof window.app[parts[1]]&&"function"==typeof window.app[parts[1]][parts[2]]&&(this.fnct=window.app[parts[1]][parts[2]],this.context=window.app[parts[1]])}else _value&&egw.debug("warn","Unable to parse Exec function %o for action '%s'",_value,this.context.id)},egwFnct.prototype.exec=function(){return this.fnct?this.fnct.apply(this.context,arguments):this.value};var _egw_mobileBrowser=null,egw_globalActionManager=null,egw_globalObjectManager=null;"undefined"==typeof window._egwActionClasses&&(window._egwActionClasses={}),_egwActionClasses.default={actionConstructor:egwAction,implementation:null},_egwActionClasses.actionManager={actionConstructor:egwActionManager,implementation:null},egwAction.prototype.remove=function(){if(this.children=[],this.parent){var idx=this.parent.children.indexOf(this);idx>=0&&this.parent.children.splice(idx,1)}},egwAction.prototype.getActionById=function(_id,_search_depth){if(this.id==_id)return this;if("undefined"==typeof _search_depth&&(_search_depth=Number.MAX_VALUE),this.canHaveChildren)for(var i=0;i<this.children.length&&_search_depth>0;i++){var elem=this.children[i].getActionById(_id,_search_depth-1);if(elem)return elem}return null},egwAction.prototype.getActionsByAttr=function(_attr,_val){var _actions=[];if("undefined"!=typeof this[_attr]&&this[_attr]===_val&&_actions.push(this),this.canHaveChildren)for(var i=0;i<this.children.length;i++)_actions=_actions.concat(this.children[i].getActionsByAttr(_attr,_val));return _actions},egwAction.prototype.addAction=function(_type,_id,_caption,_iconUrl,_onExecute,_allowOnMultiple){if(_type||(_type="popup"),this.canHaveChildren){var constructor=_egwActionClasses[_type].actionConstructor;if("function"==typeof constructor){var action=new constructor(this,_id,_caption,_iconUrl,_onExecute,_allowOnMultiple);return this.children.push(action),action}throw"Given action type not registered."}throw"This action does not allow child elements!"},egwAction.prototype.defaultIcons={view:"view",edit:"edit",open:"edit",add:"new",new:"new",delete:"delete",cat:"attach",document:"etemplate/merge",print:"print",copy:"copy",move:"move",cut:"cut",paste:"editpaste",save:"save",apply:"apply",cancel:"cancel",continue:"continue",next:"continue",finish:"finish",back:"back",previous:"back",close:"close"},egwAction.prototype.updateActions=function(_actions,_app){if(!this.canHaveChildren)throw"This action element cannot have children!";"undefined"==typeof _app&&(_app=egw_getAppName());var egw=window.egw(_app);jQuery.isArray(_actions)&&(_actions=jQuery.extend({},_actions));for(var i in _actions){var elem=_actions[i];if("string"==typeof elem&&(_actions[i]=elem={caption:elem}),"object"==typeof elem){"string"!=typeof elem.id&&(elem.id=i),"undefined"==typeof elem.iconUrl&&("undefined"==typeof elem.icon&&(elem.icon=this.defaultIcons[elem.id]),"undefined"!=typeof elem.icon&&(elem.iconUrl=egw.image(elem.icon)),delete elem.icon),"delete"==elem.id&&"undefined"==typeof elem.shortcut&&(elem.shortcut={keyCode:46,shift:!1,ctrl:!1,alt:!1,caption:egw.lang("Del")}),!elem.caption||"undefined"!=typeof elem.no_lang&&elem.no_lang||(elem.caption=egw.lang(elem.caption),"string"==typeof elem.hint&&(elem.hint=egw.lang(elem.hint))),delete elem.no_lang;for(var attr in{confirm:"",confirm_multiple:""})"string"==typeof elem[attr]&&(elem[attr]=egw.lang(elem[attr])+("?"!=elem[attr].substr(-1)?"?":""));"undefined"!=typeof elem.enabled&&elem.enabled!==!0||("undefined"!=typeof elem.enableClass?elem.enabled=this.enableClass:"undefined"!=typeof elem.disableClass?elem.enabled=this.not_disableClass:"undefined"!=typeof elem.enableId&&(elem.enabled=this.enableId));var action=this.getActionById(elem.id);if(!action){"undefined"==typeof elem.type&&(elem.type="popup");var constructor=null;if(this.canHaveChildren!==!0&&-1==this.canHaveChildren.indexOf(elem.type))throw"This child type '"+elem.type+"' is not allowed!";if("undefined"!=typeof _egwActionClasses[elem.type]&&(constructor=_egwActionClasses[elem.type].actionConstructor),"function"!=typeof constructor||!constructor)throw'Given action type "'+elem.type+'" not registered.';action=new constructor(this,elem.id),this.children.push(action)}action.updateAction(elem),elem.children&&action.updateActions(elem.children,_app)}}},egwAction.prototype.not_disableClass=function(_action,_senders,_target){return!$j(_target.iface.getDOMNode()).hasClass(_action.data.disableClass)},egwAction.prototype.enableClass=function(_action,_senders,_target){return $j(_target.iface.getDOMNode()).hasClass(_action.data.enableClass)},egwAction.prototype.enableId=function(_action,_senders,_target){return"string"==typeof _action.data.enableId&&(_action.data.enableId=new RegExp(_action.data.enableId)),_target.id.match(_action.data.enableId)},egwAction.prototype.setDefaultExecute=function(_value){if("actionManager"==this.type||this.onExecute.hasHandler()||(this.onExecute.isDefault=!0,this.onExecute.setValue(_value)),this.canHaveChildren)for(var i=0;i<this.children.length;i++)this.children[i].setDefaultExecute(_value)},egwAction.prototype.execute=function(_senders,_target){if("undefined"==typeof _target&&(_target=null),this.data&&(this.data.confirm||this.data.confirm_multiple)&&this.onExecute.fcnt!=window.nm_action&&"undefined"!=typeof et2_dialog){var msg=this.data.confirm||"";if(_senders.length>1){this.data.confirm_multiple&&(msg=this.data.confirm_multiple);var obj_manager=egw_getObjectManager(this.getManager().parent.id,!1);obj_manager&&obj_manager.getAllSelected()&&(msg+="\n\n"+egw().lang("Attention: action will be applied to all rows, not only visible ones!"))}var self=this;if(msg.trim().length>0)return void et2_dialog.show_dialog(function(_button){return _button==et2_dialog.YES_BUTTON?self.onExecute.exec(self,_senders,_target):void 0},msg,self.data.hint,{},et2_dialog.BUTTONS_YES_NO,et2_dialog.QUESTION_MESSAGE)}return this.onExecute.exec(this,_senders,_target)},egwAction.prototype.set_onExecute=function(_value){this.onExecute.setValue(_value)},egwAction.prototype.set_caption=function(_value){this.caption=_value},egwAction.prototype.set_iconUrl=function(_value){this.iconUrl=_value},egwAction.prototype.set_enabled=function(_value){this.enabled.setValue(_value)},egwAction.prototype.set_allowOnMultiple=function(_value){this.allowOnMultiple=_value},egwAction.prototype.set_hideOnDisabled=function(_value){this.hideOnDisabled=_value},egwAction.prototype.set_hideOnMobile=function(_value){this.hideOnMobile=_value},egwAction.prototype.set_data=function(_value){this.data=_value},egwAction.prototype.updateAction=function(_data){egwActionStoreJSON(_data,this,"data")},egwAction.prototype.appendToTree=function(_tree,_addChildren){"undefined"==typeof _addChildren&&(_addChildren=!0),"undefined"==typeof _addParent&&(_addParent=!0);var root=_tree.root,parent_cntr=null,cntr={action:this,children:[]};if(this.parent&&"actionManager"!=this.type){parent_cntr=_egwActionTreeContains(root,this.parent),parent_cntr||(parent_cntr=this.parent.appendToTree(_tree,!1));for(var added=!1,i=0;i<parent_cntr.children.length;i++)if(parent_cntr.children[i].action==this){cntr=parent_cntr.children[i],added=!0;break}added||parent_cntr.children.push(cntr)}else{for(var added=!1,i=0;i<root.length;i++)if(root[i].action==this){cntr=root[i],added=!0;break}added||root.push(cntr)}if(_addChildren)for(var i=0;i<this.children.length;i++)this.children[i].appendToTree(_tree,!0);return cntr},egwAction.prototype.getManager=function(){return"actionManager"==this.type?this:this.parent?this.parent.getManager():null},egwActionImplementation.prototype.registerAction=function(_actionObjectInterface,_triggerCallback,_context){return"undefined"==typeof _context&&(_context=null),this.doRegisterAction(_actionObjectInterface,_triggerCallback,_context)},egwActionImplementation.prototype.unregisterAction=function(_actionObjectInterface){return this.doUnregisterAction(_actionObjectInterface)},egwActionImplementation.prototype.executeImplementation=function(_context,_selected,_links){return this.doExecuteImplementation(_context,_selected,_links)},egwActionLink.prototype.updateLink=function(_data){egwActionStoreJSON(_data,this,!0)},egwActionLink.prototype.set_enabled=function(_value){this.enabled=_value},egwActionLink.prototype.set_visible=function(_value){this.visible=_value},egwActionLink.prototype.set_actionId=function(_value){if(this.actionId=_value,this.actionObj=this.manager.getActionById(_value),!this.actionObj)throw"Action object with id '"+_value+"' does not exist!"};var EGW_AO_STATE_NORMAL=0,EGW_AO_STATE_SELECTED=1,EGW_AO_STATE_FOCUSED=2,EGW_AO_STATE_VISIBLE=4,EGW_AO_EVENT_DRAG_OVER_ENTER=0,EGW_AO_EVENT_DRAG_OVER_LEAVE=1,EGW_AO_SHIFT_STATE_NONE=0,EGW_AO_SHIFT_STATE_MULTI=1,EGW_AO_SHIFT_STATE_BLOCK=2,EGW_AO_FLAG_IS_CONTAINER=1,EGW_AO_FLAG_DEFAULT_FOCUS=2;egwActionObject.prototype.setAOI=function(_aoi){null==_aoi&&(_aoi=new egwActionObjectDummyInterface),this.iface&&_aoi.setState(this.iface.getState()),this.iface=_aoi,this.iface.setStateChangeCallback(this._ifaceCallback,this),this.iface.setReconnectActionsCallback(this._reconnectCallback,this)},egwActionObject.prototype.getObjectById=function(_id,_search_depth){if(this.id==_id)return this;"undefined"==typeof _search_depth&&(_search_depth=Number.MAX_VALUE);for(var i=0;i<this.children.length&&_search_depth>0;i++){var obj=this.children[i].getObjectById(_id,_search_depth-1);if(obj)return obj}return null},egwActionObject.prototype.addObject=function(_id,_interface,_flags){return this.insertObject(!1,_id,_interface,_flags)},egwActionObject.prototype.insertObject=function(_index,_id,_iface,_flags){_index===!1&&(_index=this.children.length);var obj=null;if("object"==typeof _id?(obj=_id,obj.parent=null,obj.setFocused(!1),obj.parent=this):"string"==typeof _id&&(obj=new egwActionObject(_id,this,_iface,this.manager,_flags)),!obj)throw"Error while adding new element to the ActionObjects!";return this.children.splice(_index,0,obj),obj},egwActionObject.prototype.clear=function(){for(;this.children.length>0;)this.children[0].remove();this.selectedChildren=[],this.focusedChild=null,this.actionLinks=[]},egwActionObject.prototype.remove=function(){if(this.setFocused(!1),this.setSelected(!1),this.setAllSelected(!1),this.unregisterActions(),this.clear(),null!=this.parent){var idx=this.parent.children.indexOf(this);idx>=0&&this.parent.children.splice(idx,1)}},egwActionObject.prototype.getRootObject=function(){return null===this.parent?this:this.parent.getRootObject()},egwActionObject.prototype.getParentList=function(){if(null===this.parent)return[];var list=this.parent.getParentList();return list.unshift(this.parent),list},egwActionObject.prototype.getContainerRoot=function(){return egwBitIsSet(this.flags,EGW_AO_FLAG_IS_CONTAINER)||null===this.parent?this:this.parent.getContainerRoot()},egwActionObject.prototype.getSelectedObjects=function(_test,_list){if("undefined"==typeof _test&&(_test=null),"undefined"==typeof _list&&(_list={elements:[]}),_test&&!_test(this)||!this.getSelected()||_list.elements.push(this),this.selectedChildren)for(var i=0;i<this.selectedChildren.length;i++)this.selectedChildren[i].getSelectedObjects(_test,_list);return _list.elements},egwActionObject.prototype.getAllSelected=function(){if(this.children.length==this.selectedChildren.length){for(var i=0;i<this.children.length;i++)if(!this.children[i].getAllSelected())return!1;return!egwBitIsSet(this.flags,EGW_AO_FLAG_IS_CONTAINER)||this.children.length>0}return!1},egwActionObject.prototype.toggleAllSelected=function(_select){return"undefined"==typeof _select&&(_select=!this.getAllSelected()),_select&&this.manager&&this.manager.getActionById("select_all")?this.manager.getActionById("select_all").execute(this):void this.setAllSelected(_select)},egwActionObject.prototype.flatList=function(_visibleOnly,_obj){"undefined"==typeof _obj&&(_obj={elements:[]}),"undefined"==typeof _visibleOnly&&(_visibleOnly=!1),_visibleOnly&&!this.getVisible()||_obj.elements.push(this);for(var i=0;i<this.children.length;i++)this.children[i].flatList(_visibleOnly,_obj);return _obj.elements},egwActionObject.prototype.traversePath=function(_to){var contRoot=this.getContainerRoot();if(contRoot){var flatList=contRoot.flatList(),thisId=flatList.indexOf(this),toId=flatList.indexOf(_to);if(-1!==thisId&&-1!==toId){var from=Math.min(thisId,toId),to=Math.max(thisId,toId);return flatList.slice(from,to+1)}}return[]},egwActionObject.prototype.getIndex=function(){return null===this.parent?0:this.parent.children.indexOf(this)},egwActionObject.prototype.getFocusedObject=function(){return this.focusedChild||null},egwActionObject.prototype._ifaceCallback=function(_newState,_changedBit,_shiftState){"undefined"==typeof _shiftState&&(_shiftState=EGW_AO_SHIFT_STATE_NONE);var selected=egwBitIsSet(_newState,EGW_AO_STATE_SELECTED),visible=egwBitIsSet(_newState,EGW_AO_STATE_VISIBLE);if(_changedBit==EGW_AO_STATE_VISIBLE&&visible!=this.getVisible()){if(!visible)return this.setSelected(!1),this.setFocused(!1),EGW_AO_STATE_NORMAL;this.registerActions()}if(this.parent&&visible&&_changedBit==EGW_AO_STATE_SELECTED){var selected=egwBitIsSet(_newState,EGW_AO_STATE_SELECTED),objs=[];if(selected){this.parent.children.indexOf(this);if(!egwBitIsSet(_shiftState,EGW_AO_SHIFT_STATE_MULTI)){this.getContainerRoot().setAllSelected(!1)}if(egwBitIsSet(_shiftState,EGW_AO_SHIFT_STATE_BLOCK)){var focused=this.getFocusedObject();if(focused){objs=this.traversePath(focused);for(var i=0;i<objs.length;i++)objs[i].setSelected(!0)}}}0!=objs.length&&egwBitIsSet(_shiftState,EGW_AO_SHIFT_STATE_BLOCK)||(this.setFocused(!0),_newState=egwSetBit(EGW_AO_STATE_FOCUSED,_newState,!0)),this.setSelected(selected)}return _newState},egwActionObject.prototype.handleKeyPress=function(_keyCode,_shift,_ctrl,_alt){switch(_keyCode){case EGW_KEY_ARROW_UP:case EGW_KEY_ARROW_DOWN:case EGW_KEY_PAGE_UP:case EGW_KEY_PAGE_DOWN:if(!_alt){var intval=_keyCode==EGW_KEY_ARROW_UP||_keyCode==EGW_KEY_ARROW_DOWN?1:10;if(this.children.length>0){var focused=this.getFocusedObject(),selObj=null;if(selObj=focused?_keyCode==EGW_KEY_ARROW_UP||_keyCode==EGW_KEY_PAGE_UP?focused.getPrevious(intval):focused.getNext(intval):this.children[0],null!=selObj){if(_shift)for(var objs=focused.traversePath(selObj),i=0;i<objs.length;i++)objs[i].setSelected(!0);else this.setAllSelected(!1);selObj.setSelected(!0),selObj.setFocused(!0),selObj.makeVisible()}return!0}}break;case EGW_KEY_A:if(_ctrl&&!_shift&&!_alt)return this.toggleAllSelected(),!0}return!1},egwActionObject.prototype.getPrevious=function(_intval){if(null!=this.parent){if(this.getFocused()&&!this.getSelected())return this;var flatTree=this.getContainerRoot().flatList(),idx=flatTree.indexOf(this);if(idx>0)return idx=Math.max(1,idx-_intval),flatTree[idx]}return this},egwActionObject.prototype.getNext=function(_intval){if(null!=this.parent){if(this.getFocused()&&!this.getSelected())return this;var flatTree=this.getContainerRoot().flatList(!0),idx=flatTree.indexOf(this);if(idx<flatTree.length-1)return idx=Math.min(flatTree.length-1,idx+_intval),flatTree[idx]}return this},egwActionObject.prototype.getSelected=function(){return egwBitIsSet(this.getState(),EGW_AO_STATE_SELECTED)},egwActionObject.prototype.getFocused=function(){return egwBitIsSet(this.getState(),EGW_AO_STATE_FOCUSED)},egwActionObject.prototype.getVisible=function(){return egwBitIsSet(this.getState(),EGW_AO_STATE_VISIBLE)},egwActionObject.prototype.getState=function(){return this.iface.getState()},egwActionObject.prototype.setFocused=function(_focused){"undefined"==typeof _focused&&(_focused=!0);var state=this.iface.getState();if(egwBitIsSet(state,EGW_AO_STATE_FOCUSED)!=_focused){var currentlyFocused=this.getFocusedObject();currentlyFocused&&currentlyFocused!=this&&currentlyFocused.setFocused(!1),this.iface.setState(egwSetBit(state,EGW_AO_STATE_FOCUSED,_focused)),this.parent&&this.parent.updateFocusedChild(this,_focused)}null!=this.focusedChild&&0==_focused&&this.focusedChild.setFocused(!1)},egwActionObject.prototype.setSelected=function(_selected){var state=this.iface.getState();egwBitIsSet(state,EGW_AO_STATE_SELECTED)!=_selected&&egwBitIsSet(state,EGW_AO_STATE_VISIBLE)&&(this.iface.setState(egwSetBit(state,EGW_AO_STATE_SELECTED,_selected)),this.parent&&this.parent.updateSelectedChildren(this,_selected||this.selectedChildren.length>0))},egwActionObject.prototype.setAllSelected=function(_selected,_informParent){"undefined"==typeof _informParent&&(_informParent=!0);var state=this.iface.getState();if(egwBitIsSet(state,EGW_AO_STATE_SELECTED)!=_selected&&(this.iface.setState(egwSetBit(state,EGW_AO_STATE_SELECTED,_selected)),_informParent&&this.parent&&this.parent.updateSelectedChildren(this,_selected)),_selected||this.selectedChildren.length>0)for(var i=0;i<this.children.length;i++)this.children[i].setAllSelected(_selected,!1);if(this.selectedChildren=[],_selected)for(var i=0;i<this.children.length;i++)this.selectedChildren.push(this.children[i]);egwQueueCallback(this.setSelectedCallback,[],this,"setSelectedCallback")},egwActionObject.prototype.updateSelectedChildren=function(_child,_selected){var id=this.selectedChildren.indexOf(_child),wasEmpty=0==this.selectedChildren.length;_selected&&-1==id?this.selectedChildren.push(_child):_selected||-1==id||this.selectedChildren.splice(id,1),wasEmpty!=this.selectedChildren.length==0&&this.parent&&this.parent.updateSelectedChildren(this,wasEmpty),egwQueueCallback(this.setSelectedCallback,this.getContainerRoot().getSelectedObjects(),this,"setSelectedCallback")},egwActionObject.prototype.updateFocusedChild=function(_child,_focused){_focused?this.focusedChild=_child:this.focusedChild==_child&&(this.focusedChild=null),this.parent&&this.parent.updateFocusedChild(_child,_focused)},egwActionObject.prototype.updateActionLinks=function(_actionLinks,_recursive,_doCreate){"undefined"==typeof _recursive&&(_recursive=!1),"undefined"==typeof _doCreate&&(_doCreate=!0);for(var i=0;i<_actionLinks.length;i++){var elem=_actionLinks[i];if("string"==typeof elem&&(elem={actionId:elem}),"undefined"!=typeof elem.actionId&&elem.actionId){var actionLink=this.getActionLink(elem.actionId);!actionLink&&_doCreate&&(actionLink=new egwActionLink(this.manager),this.actionLinks.push(actionLink)),actionLink&&actionLink.updateLink(elem)}}if(_recursive)for(var i=0;i<this.children.length;i++)this.children[i].updateActionLinks(_actionLinks,!0,_doCreate);this.getVisible()&&null!=this.iface&&this.registerActions()},egwActionObject.prototype._reconnectCallback=function(){this.registeredImpls=[],this.registerActions()},egwActionObject.prototype.registerActions=function(){var groups=this.getActionImplementationGroups();for(var group in groups)if("undefined"!=typeof _egwActionClasses[group]&&_egwActionClasses[group].implementation&&this.iface){var impl=_egwActionClasses[group].implementation();-1==this.registeredImpls.indexOf(impl)&&impl.registerAction(this.iface,this.executeActionImplementation,this)&&this.registeredImpls.push(impl)}},egwActionObject.prototype.unregisterActions=function(){for(;this.registeredImpls.length>0;){var impl=this.registeredImpls.pop();this.iface&&impl.unregisterAction(this.iface)}},egwActionObject.prototype.triggerCallback=function(){return this.onBeforeTrigger?this.onBeforeTrigger():!0},egwActionObject.prototype.makeVisible=function(){this.iface.makeVisible()};var EGW_AO_EXEC_SELECTED=0,EGW_AO_EXEC_THIS=1;egwActionObject.prototype.executeActionImplementation=function(_implContext,_implType,_execType){if("undefined"==typeof _execType&&(_execType=EGW_AO_EXEC_SELECTED),"string"==typeof _implType&&(_implType=_egwActionClasses[_implType].implementation()),"object"==typeof _implType&&_implType){if(_execType==EGW_AO_EXEC_SELECTED){egwBitIsSet(EGW_AO_FLAG_IS_CONTAINER,this.flags)||this.forceSelection();var selectedActions=this.getSelectedLinks(_implType.type)}else _execType==EGW_AO_EXEC_THIS&&(selectedActions=this._getLinks([this],_implType.type));if(selectedActions.selected.length>0&&egwObjectLength(selectedActions.links)>0)return _implType.executeImplementation(_implContext,selectedActions.selected,selectedActions.links)}return!1},egwActionObject.prototype.forceSelection=function(){var selected=this.getContainerRoot().getSelectedObjects(),thisInList=-1!=selected.indexOf(this);thisInList||(this.getContainerRoot().setAllSelected(!1),this.setSelected(!0)),this.setFocused(!0)},egwActionObject.prototype.getSelectedLinks=function(_actionType){var selected=this.getContainerRoot().getSelectedObjects();return this._getLinks(selected,_actionType)},egwActionObject.prototype._getLinks=function(_objs,_actionType){for(var actionLinks={},testedSelected=[],test=function(olink){if(olink.actionObj.type==_actionType){"undefined"==typeof actionLinks[olink.actionId]&&(actionLinks[olink.actionId]={actionObj:olink.actionObj,enabled:1==testedSelected.length,visible:!1,cnt:0});var llink=actionLinks[olink.actionId];if(llink.enabled=llink.enabled&&olink.actionObj.enabled.exec(olink.actionObj,_objs,_objs[i])&&olink.enabled&&olink.visible,llink.visible=llink.visible||olink.visible,llink.cnt++,olink.actionObj&&olink.actionObj.children.length>0)for(var j=0;j<olink.actionObj.children.length;j++){var child=olink.actionObj.children[j];test({actionObj:child,actionId:child.id,enabled:olink.enabled,visible:olink.visible})}}},i=0;i<_objs.length;i++){var obj=_objs[i];if(!egwBitIsSet(obj.flags,EGW_AO_FLAG_IS_CONTAINER)&&obj.triggerCallback()){testedSelected.push(obj);for(var j=0;j<obj.actionLinks.length;j++)test(obj.actionLinks[j])}}for(var k in actionLinks)actionLinks[k].enabled=actionLinks[k].enabled&&actionLinks[k].cnt>=testedSelected.length&&(actionLinks[k].actionObj.allowOnMultiple===!0||"only"==actionLinks[k].actionObj.allowOnMultiple&&actionLinks[k].cnt>1||0==actionLinks[k].actionObj.allowOnMultiple&&1==actionLinks[k].cnt),egwIsMobile()||(actionLinks[k].actionObj.hideOnMobile=!1),actionLinks[k].visible=actionLinks[k].visible&&!actionLinks[k].actionObj.hideOnMobile&&(actionLinks[k].enabled||!actionLinks[k].actionObj.hideOnDisabled);return{selected:testedSelected,links:actionLinks}},egwActionObject.prototype.getActionLink=function(_actionId){for(var i=0;i<this.actionLinks.length;i++)if(this.actionLinks[i].actionObj.id==_actionId)return this.actionLinks[i];return null},egwActionObject.prototype.getActionImplementationGroups=function(_test,_groups){"undefined"==typeof _groups&&(_groups={}),"undefined"==typeof _test&&(_test=function(_obj){return!0});for(var i=0;i<this.actionLinks.length;i++){var action=this.actionLinks[i].actionObj;
"undefined"!=typeof action&&_test(this)&&("undefined"==typeof _groups[action.type]&&(_groups[action.type]=[]),_groups[action.type].push({object:this,link:this.actionLinks[i]}))}for(var i=0;i<this.children.length;i++)this.children[i].getActionImplementationGroups(_test,_groups);return _groups},egwActionObject.prototype.isDragOut=function(_event){return(_event.altKey||_event.metaKey)&&_event.shiftKey&&1==_event.which},egwActionObject.prototype.isSelection=function(_event){return!_event.shiftKey&&1==_event.which&&(_event.metaKey||_event.ctrlKey)},egwActionObjectInterface.prototype.setStateChangeCallback=function(_callback,_context){this.stateChangeCallback=_callback,this.stateChangeContext=_context},egwActionObjectInterface.prototype.setReconnectActionsCallback=function(_callback,_context){this.reconnectActionsCallback=_callback,this.reconnectActionsContext=_context},egwActionObjectInterface.prototype.reconnectActions=function(){this.reconnectActionsCallback&&this.reconnectActionsCallback.call(this.reconnectActionsContext)},egwActionObjectInterface.prototype.updateState=function(_stateBit,_set,_shiftState){var newState=egwSetBit(this._state,_stateBit,_set);this.stateChangeCallback?this._state=this.stateChangeCallback.call(this.stateChangeContext,newState,_stateBit,_shiftState):this._state=newState},egwActionObjectInterface.prototype.getDOMNode=function(){return this.doGetDOMNode()},egwActionObjectInterface.prototype.setState=function(_state){_state!=this._state&&(this._state=_state,this.doSetState(_state))},egwActionObjectInterface.prototype.getState=function(){return this._state},egwActionObjectInterface.prototype.triggerEvent=function(_event,_data){return"undefined"==typeof _data&&(_data=null),this.doTriggerEvent(_event,_data)},egwActionObjectInterface.prototype.makeVisible=function(){return this.doMakeVisible()};var egwActionObjectDummyInterface=egwActionObjectInterface,EGW_KEY_BACKSPACE=8,EGW_KEY_TAB=9,EGW_KEY_ENTER=13,EGW_KEY_ESCAPE=27,EGW_KEY_DELETE=46,EGW_KEY_SPACE=32,EGW_KEY_PAGE_UP=33,EGW_KEY_PAGE_DOWN=34,EGW_KEY_ARROW_LEFT=37,EGW_KEY_ARROW_UP=38,EGW_KEY_ARROW_RIGHT=39,EGW_KEY_ARROW_DOWN=40,EGW_KEY_0=48,EGW_KEY_1=49,EGW_KEY_2=50,EGW_KEY_3=51,EGW_KEY_4=52,EGW_KEY_5=53,EGW_KEY_6=54,EGW_KEY_7=55,EGW_KEY_8=56,EGW_KEY_9=57,EGW_KEY_A=65,EGW_KEY_B=66,EGW_KEY_C=67,EGW_KEY_D=68,EGW_KEY_E=69,EGW_KEY_F=70,EGW_KEY_G=71,EGW_KEY_H=72,EGW_KEY_I=73,EGW_KEY_J=74,EGW_KEY_K=75,EGW_KEY_L=76,EGW_KEY_M=77,EGW_KEY_N=78,EGW_KEY_O=79,EGW_KEY_P=80,EGW_KEY_Q=81,EGW_KEY_R=82,EGW_KEY_S=83,EGW_KEY_T=84,EGW_KEY_U=85,EGW_KEY_V=86,EGW_KEY_W=87,EGW_KEY_X=88,EGW_KEY_Y=89,EGW_KEY_Z=90,EGW_KEY_MENU=93,EGW_KEY_F1=112,EGW_KEY_F2=113,EGW_KEY_F3=114,EGW_KEY_F4=115,EGW_KEY_F5=116,EGW_KEY_F6=117,EGW_KEY_F7=118,EGW_KEY_F8=119,EGW_KEY_F9=120,EGW_KEY_F10=121,EGW_KEY_F11=122,EGW_KEY_F12=123,EGW_VALID_KEYS=[8,9,13,27,46,32,33,34,37,38,39,40,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,93,112,113,114,115,116,117,118,119,120,121,122,123],egw_keycode_translation_function=function(_nativeKeyCode){return _nativeKeyCode>=96&&105>=_nativeKeyCode&&(_nativeKeyCode-=48),_nativeKeyCode};$j(document).ready(function(){$j(document).keydown(function(e){var keyCode=e.which;if(keyCode=egw_keycode_translation_function(keyCode),keyCode=egw_keycode_makeValid(keyCode),-1!=keyCode){var inInput=_egw_nodeIsInInput(e.target);(!inInput||keyCode>=EGW_KEY_F1&&EGW_KEY_F12>=keyCode)&&egw_keyHandler(keyCode,e.shiftKey,e.ctrlKey||e.metaKey,e.altKey)&&e.preventDefault()}})}),$j(window).on("contextmenu",document,function(event){return 1!=event.originalEvent.x||1!=event.originalEvent.y?!0:!event.ctrlKey&&egw_keyHandler(EGW_KEY_MENU,event.shiftKey,event.ctrlKey||event.metaKey,event.altKey)?(event.preventDefault(),!1):!0});var egw_registeredShortcuts={},_egw_active_menu=null;egwMenu.prototype._checkImpl=function(){return"function"==typeof egwMenuImpl},egwMenu.prototype.showAt=function(_x,_y,_force){if("undefined"==typeof _force&&(_force=!1),null!=_egw_active_menu){if(_egw_active_menu==this&&!_force)return this.hide(),!1;_egw_active_menu.hide()}if(null==this.instance&&this._checkImpl){this.instance=new egwMenuImpl(this.children),_egw_active_menu=this;var self=this;return this.instance.showAt(_x,_y,function(){self.instance=null,_egw_active_menu=null}),!0}return!1},egwMenu.prototype.hide=function(){_egw_active_menu==this&&(_egw_active_menu=null),null!=this.instance&&(this.instance.hide(),this.instance=null)},egwMenu.prototype.addItem=function(_id,_caption,_iconUrl,_onClick){var item=_egwGenMenuItem(this,_id,_caption,_iconUrl,_onClick);return this.children.push(item),item},egwMenu.prototype.clear=function(){this.children=[]},egwMenu.prototype.loadStructure=function(_elements){this.children=_egwGenMenuStructure(_elements,this)},egwMenu.prototype.getItem=function(_id){return _egwSearchMenuItem(this.children,_id)},egwMenu.prototype.setGlobalOnClick=function(_onClick){_egwSetMenuOnClick(this.children,_onClick)},egwMenuItem.prototype.getItem=function(_id){return this.id===_id?this:_egwSearchMenuItem(this.children,_id)},egwMenuItem.prototype.setGlobalOnClick=function(_onClick){this.onClick=_onClick,_egwSetMenuOnClick(this.children,_onClick)},egwMenuItem.prototype.addItem=function(_id,_caption,_iconUrl,_onClick){var item=_egwGenMenuItem(this,_id,_caption,_iconUrl,_onClick);return this.children.push(item),item},egwMenuItem.prototype.set_id=function(_value){this.id=_value},egwMenuItem.prototype.set_caption=function(_value){this.caption=_value},egwMenuItem.prototype.set_checkbox=function(_value){this.checkbox=_value},egwMenuItem.prototype.set_checked=function(_value){if(_value&&this.groupIndex>0)for(var i=0;i<this.parent.children.length;i++){var obj=this.parent.children[i];obj.groupIndex==this.groupIndex&&(obj.checked=!1)}this.checked=_value},egwMenuItem.prototype.set_groupIndex=function(_value){this.groupIndex=_value},egwMenuItem.prototype.set_enabled=function(_value){this.enabled=_value},egwMenuItem.prototype.set_onClick=function(_value){this.onClick=_value},egwMenuItem.prototype.set_iconUrl=function(_value){this.iconUrl=_value},egwMenuItem.prototype.set_default=function(_value){this.default=_value},egwMenuItem.prototype.set_data=function(_value){this.data=_value},egwMenuItem.prototype.set_hint=function(_value){this.hint=_value},egwMenuItem.prototype.set_shortcutCaption=function(_value){this.shortcutCaption=_value},function($){function calculateEuclideanDistance(x1,y1,x2,y2){var diffX=x2-x1,diffY=y2-y1;return Math.sqrt(diffX*diffX+diffY*diffY)}function onTouchStart(event){var e=event.originalEvent;if(!e.touches||1===e.targetTouches.length&&1===e.touches.length){startTapAndHoldDetector.call(this,event);var element=$(this);element.bind(TOUCHMOVE,onTouchMove),element.bind(TOUCHEND,onTouchEnd)}else stopTapAndHoldDetector.call(this)}function onTouchMove(event){if(null!=tapAndHoldTimer){var e=event.originalEvent,x=e.changedTouches?e.changedTouches[0].pageX:e.pageX,y=e.changedTouches?e.changedTouches[0].pageY:e.pageY,tapAndHoldPoint=$(this).data("taphold.point"),euclideanDistance=calculateEuclideanDistance(tapAndHoldPoint.x,tapAndHoldPoint.y,x,y);euclideanDistance>MAX_DISTANCE_ALLOWED_IN_TAP_AND_HOLD_EVENT&&stopTapAndHoldDetector.call(this)}}function onTouchEnd(event){stopTapAndHoldDetector.call(this)}function onTapAndHold(event){clear.call(this),$(this).data("taphold.handler").call(this,event)}function clear(){tapAndHoldTimer=null,$(this).unbind(TOUCHMOVE,onTouchMove),$(this).unbind(TOUCHEND,onTouchEnd)}function startTapAndHoldDetector(event){if(null==tapAndHoldTimer){var self=this;tapAndHoldTimer=setTimeout(function(){onTapAndHold.call(self,event)},TAP_AND_HOLD_TRIGGER_TIMER);var e=event.originalEvent,tapAndHoldPoint={};tapAndHoldPoint.x=e.changedTouches?e.changedTouches[0].pageX:e.pageX,tapAndHoldPoint.y=e.changedTouches?e.changedTouches[0].pageY:e.pageY,$(this).data("taphold.point",tapAndHoldPoint)}}function stopTapAndHoldDetector(){clearTimeout(tapAndHoldTimer),clear.call(this)}var TAP_AND_HOLD_TRIGGER_TIMER=600,MAX_DISTANCE_ALLOWED_IN_TAP_AND_HOLD_EVENT=40,TOUCHSTART="touchstart",TOUCHEND="touchend",TOUCHMOVE="touchmove",tapAndHoldTimer=null;$.event.special.taphold={setup:function(){},add:function(handleObj){$(this).data("taphold.handler",handleObj.handler),handleObj.data?$(this).bind(TOUCHSTART,handleObj.data,onTouchStart):$(this).bind(TOUCHSTART,onTouchStart)},remove:function(handleObj){stopTapAndHoldDetector.call(this),handleObj.data?$(this).unbind(TOUCHSTART,handleObj.data,onTouchStart):$(this).unbind(TOUCHSTART,onTouchStart)},teardown:function(){}}}(jQuery),"undefined"==typeof window._egwActionClasses&&(window._egwActionClasses={}),_egwActionClasses.popup={actionConstructor:egwPopupAction,implementation:getPopupImplementation};var _popupActionImpl=null;"undefined"==typeof window._egwActionClasses&&(window._egwActionClasses={}),_egwActionClasses.drag={actionConstructor:egwDragAction,implementation:getDragImplementation},_egwActionClasses.drop={actionConstructor:egwDropAction,implementation:getDropImplementation};var _dragActionImpl=null,_dropActionImpl=null,EGW_AI_DRAG=256,EGW_AI_DRAG_OUT=1|EGW_AI_DRAG,EGW_AI_DRAG_OVER=2|EGW_AI_DRAG;dhtmlXMenuObject.prototype.init=function(){1!=this._isInited&&(this.dLoad?(this.callEvent("onXLS",[]),this._xmlLoader.loadXML(this.dLoadUrl+this.dLoadSign+"action=loadMenu&etc="+(new Date).getTime())):(this._initTopLevelMenu(),this._isInited=!0))},dhtmlXMenuObject.prototype._countVisiblePolygonItems=function(id){var count=0;for(var a in this.itemPull){var par=this.itemPull[a].parent,tp=this.itemPull[a].type;null!=this.idPull[a]&&(par!=id||"item"!=tp&&"radio"!=tp&&"checkbox"!=tp||"none"==this.idPull[a].style.display||count++)}return count},dhtmlXMenuObject.prototype._redefineComplexState=function(id){if(this.idPrefix+this.topId!=id&&null!=this.idPull["polygon_"+id]&&null!=this.idPull[id]){var u=this._countVisiblePolygonItems(id);u>0&&!this.itemPull[id].complex&&this._updateItemComplexState(id,!0,!1),0==u&&this.itemPull[id].complex&&this._updateItemComplexState(id,!1,!1)}},dhtmlXMenuObject.prototype._updateItemComplexState=function(id,state,over){if(!this.context&&"TopLevel"==this._getItemLevelType(id.replace(this.idPrefix,"")))return void(this.itemPull[id].complex=state);if(null!=this.idPull[id]&&null!=this.itemPull[id]&&(this.itemPull[id].complex=state,id!=this.idPrefix+this.topId)){var arrowObj=null,item=this.idPull[id].childNodes[this._rtl?0:2];if(item.childNodes[0]&&0===String(item.childNodes[0].className).search("complex_arrow")&&(arrowObj=item.childNodes[0]),this.itemPull[id].complex){if(null==arrowObj){for(arrowObj=document.createElement("DIV"),arrowObj.className="complex_arrow",arrowObj.id="arrow_"+id;item.childNodes.length>0;)item.removeChild(item.childNodes[0]);item.appendChild(arrowObj)}return void(this.dLoad&&"get"==this.itemPull[id].loaded&&this.loaderIcon?"complex_arrow_loading"!=arrowObj.className&&(arrowObj.className="complex_arrow_loading"):arrowObj.className="complex_arrow")}this.itemPull[id].complex||null==arrowObj||(item.removeChild(arrowObj),null!=this.itemPull[id].hotkey_backup&&this.setHotKey&&this.setHotKey(id.replace(this.idPrefix,""),this.itemPull[id].hotkey_backup))}},dhtmlXMenuObject.prototype._getItemLevelType=function(id){return this.itemPull[this.idPrefix+id].parent==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"},dhtmlXMenuObject.prototype._redistribTopLevelSelection=function(id,parent){var i=this._getSubItemToDeselectByPolygon("parent");this._removeSubItemFromSelected(-1,-1);for(var q=0;q<i.length;q++)i[q]!=id&&this._hidePolygon(i[q]),null!=this.idPull[i[q]]&&i[q]!=id&&(this.idPull[i[q]].className=this.idPull[i[q]].className.replace(/Selected/g,"Normal"));"enabled"==this.itemPull[this.idPrefix+id].state&&(this.idPull[this.idPrefix+id].className="dhtmlxMenu_"+this.skin+"_TopLevel_Item_Selected",this._addSubItemToSelected(this.idPrefix+id,"parent"),this.menuSelected="win"==this.menuMode?-1!=this.menuSelected?id:this.menuSelected:id,this.itemPull[this.idPrefix+id].complex&&-1!=this.menuSelected&&this._showPolygon(this.idPrefix+id,this.dirTopLevel))},dhtmlXMenuObject.prototype._initTopLevelMenu=function(){if(this.dirTopLevel="bottom",this.dirSubLevel=this._rtl?"left":"right",this.context)this.idPull[this.idPrefix+this.topId]=new Array(0,0),this._addSubMenuPolygon(this.idPrefix+this.topId,this.idPrefix+this.topId);else for(var m=this._getMenuNodes(this.idPrefix+this.topId),q=0;q<m.length;q++)"item"==this.itemPull[m[q]].type&&this._renderToplevelItem(m[q],null),"separator"==this.itemPull[m[q]].type&&this._renderSeparator(m[q],null)},dhtmlXMenuObject.prototype._renderToplevelItem=function(id,pos){var main_self=this,m=document.createElement("DIV");if(m.id=id,"enabled"==this.itemPull[id].state&&null!=this.itemPull[id].cssNormal?m.className=this.itemPull[id].cssNormal:m.className="dhtmlxMenu_"+this.skin+"_TopLevel_Item_"+("enabled"==this.itemPull[id].state?"Normal":"Disabled"),""!=this.itemPull[id].title){var t1=document.createElement("DIV");t1.className="top_level_text",t1.innerHTML=this.itemPull[id].title,m.appendChild(t1)}if(this.itemPull[id].tip.length>0&&(m.title=this.itemPull[id].tip),""!=this.itemPull[id].imgen||""!=this.itemPull[id].imgdis){var imgTop=this.itemPull[id]["enabled"==this.itemPull[id].state?"imgen":"imgdis"];if(imgTop){var img=document.createElement("IMG");img.border="0",img.id="image_"+id,img.src=this.imagePath+imgTop,img.className="dhtmlxMenu_TopLevel_Item_Icon",m.childNodes.length>0&&!this._rtl?m.insertBefore(img,m.childNodes[0]):m.appendChild(img)}}m.onselectstart=function(e){return e=e||event,e.returnValue=!1,!1},m.oncontextmenu=function(e){return e=e||event,e.returnValue=!1,!1},this.cont||(this.cont=document.createElement("DIV"),this.cont.dir="ltr",this.cont.className="right"==this._align?"align_right":"align_left",this.base.appendChild(this.cont)),null!=pos&&(pos++,0>pos&&(pos=0),pos>this.cont.childNodes.length-1&&(pos=null)),null!=pos?this.cont.insertBefore(m,this.cont.childNodes[pos]):this.cont.appendChild(m),this.idPull[m.id]=m,this.itemPull[id].complex&&!this.dLoad&&this._addSubMenuPolygon(this.itemPull[id].id,this.itemPull[id].id),m.onmouseover=function(){"web"==main_self.menuMode&&window.clearTimeout(main_self.menuTimeoutHandler);var i=main_self._getSubItemToDeselectByPolygon("parent");main_self._removeSubItemFromSelected(-1,-1);for(var q=0;q<i.length;q++)i[q]!=this.id&&main_self._hidePolygon(i[q]),null!=main_self.idPull[i[q]]&&i[q]!=this.id&&(null!=main_self.itemPull[i[q]].cssNormal?main_self.idPull[i[q]].className=main_self.itemPull[i[q]].cssNormal:("sub_item_selected"==main_self.idPull[i[q]].className&&(main_self.idPull[i[q]].className="sub_item"),main_self.idPull[i[q]].className=main_self.idPull[i[q]].className.replace(/Selected/g,"Normal")));if("enabled"==main_self.itemPull[this.id].state){if(this.className="dhtmlxMenu_"+main_self.skin+"_TopLevel_Item_Selected",main_self._addSubItemToSelected(this.id,"parent"),main_self.menuSelected="win"==main_self.menuMode?-1!=main_self.menuSelected?this.id:main_self.menuSelected:this.id,main_self.dLoad&&"no"==main_self.itemPull[this.id].loaded){main_self.menuModeTopLevelTimeout&&"web"==main_self.menuMode&&!main_self.context&&(this._mouseOver=!0,this._dynLoadTM=(new Date).getTime());var xmlLoader=new dtmlXMLLoaderObject(main_self._xmlParser,window);main_self.itemPull[this.id].loaded="get",main_self.callEvent("onXLS",[]),xmlLoader.loadXML(main_self.dLoadUrl+main_self.dLoadSign+"action=loadMenu&parentId="+this.id.replace(main_self.idPrefix,"")+"&etc="+(new Date).getTime())}if((!main_self.dLoad||main_self.dLoad&&(!main_self.itemPull[this.id].loaded||"yes"==main_self.itemPull[this.id].loaded))&&main_self.itemPull[this.id].complex&&-1!=main_self.menuSelected)if(main_self.menuModeTopLevelTimeout&&"web"==main_self.menuMode&&!main_self.context){this._mouseOver=!0;var showItemId=this.id;this._menuOpenTM=window.setTimeout(function(){main_self._showPolygon(showItemId,main_self.dirTopLevel)},main_self.menuModeTopLevelTimeoutTime)}else main_self._showPolygon(this.id,main_self.dirTopLevel)}main_self._doOnTouchMenu(this.id.replace(main_self.idPrefix,""))},m.onmouseout=function(){main_self.itemPull[this.id].complex&&-1!=main_self.menuSelected||"enabled"!=main_self.itemPull[this.id].state||(null!=main_self.itemPull[this.id].cssNormal?m.className=main_self.itemPull[this.id].cssNormal:m.className="dhtmlxMenu_"+main_self.skin+"_TopLevel_Item_Normal"),"web"==main_self.menuMode&&(window.clearTimeout(main_self.menuTimeoutHandler),main_self.menuTimeoutHandler=window.setTimeout(function(){main_self._clearAndHide()},main_self.menuTimeoutMsec,"JavaScript")),main_self.menuModeTopLevelTimeout&&"web"==main_self.menuMode&&!main_self.context&&(this._mouseOver=!1,window.clearTimeout(this._menuOpenTM))},m.onclick=function(e){if("web"==main_self.menuMode&&window.clearTimeout(main_self.menuTimeoutHandler),"web"==main_self.menuMode||"disabled"!=main_self.itemPull[this.id].state){if(e=e||event,e.cancelBubble=!0,e.returnValue=!1,"win"==main_self.menuMode&&main_self.itemPull[this.id].complex){if(main_self.menuSelected==this.id){main_self.menuSelected=-1;var s=!1}else{main_self.menuSelected=this.id;var s=!0}s?main_self._showPolygon(this.id,main_self.dirTopLevel):main_self._hidePolygon(this.id)}var tc=main_self.itemPull[this.id].complex?"c":"-",td="enabled"!=main_self.itemPull[this.id].state?"d":"-",cas={ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey};return main_self._doOnClick(this.id.replace(main_self.idPrefix,""),tc+td+"t",cas),!1}},"dhx_terrace"==this.skin&&this._improveTerraceSkin()},dhtmlXMenuObject.prototype.setImagePath=function(){},dhtmlXMenuObject.prototype.setIconsPath=function(path){this.imagePath=path},dhtmlXMenuObject.prototype.setIconPath=dhtmlXMenuObject.prototype.setIconsPath,dhtmlXMenuObject.prototype._updateItemImage=function(id,levelType){id=this.idPrefix+id;var isTopLevel=this.itemPull[id].parent==this.idPrefix+this.topId&&!this.context,imgObj=null;if(isTopLevel)for(var q=0;q<this.idPull[id].childNodes.length;q++)try{"dhtmlxMenu_TopLevel_Item_Icon"==this.idPull[id].childNodes[q].className&&(imgObj=this.idPull[id].childNodes[q])}catch(e){}else try{var imgObj=this.idPull[id].childNodes[this._rtl?2:0].childNodes[0]}catch(e){}if("radio"==this.itemPull[id].type)var imgSrc=this.itemPull[id]["enabled"==this.itemPull[id].state?"imgen":"imgdis"];else var imgSrc=this.itemPull[id]["enabled"==this.itemPull[id].state?"imgen":"imgdis"];if(imgSrc.length>0)if(null!=imgObj)imgObj.src=this.imagePath+imgSrc;else if(isTopLevel){var imgObj=document.createElement("IMG");imgObj.className="dhtmlxMenu_TopLevel_Item_Icon",imgObj.src=this.imagePath+imgSrc,imgObj.border="0",imgObj.id="image_"+id,!this._rtl&&this.idPull[id].childNodes.length>0?this.idPull[id].insertBefore(imgObj,this.idPull[id].childNodes[0]):this.idPull[id].appendChild(imgObj)}else{var imgObj=document.createElement("IMG");imgObj.className="sub_icon",imgObj.src=this.imagePath+imgSrc,imgObj.border="0",imgObj.id="image_"+id;for(var item=this.idPull[id].childNodes[this._rtl?2:0];item.childNodes.length>0;)item.removeChild(item.childNodes[0]);item.appendChild(imgObj)}else null!=imgObj&&imgObj.parentNode.removeChild(imgObj)},dhtmlXMenuObject.prototype.removeItem=function(id,_isTId,_recCall){_isTId||(id=this.idPrefix+id);var pId=null;if(id!=this.idPrefix+this.topId){if(null==this.itemPull[id])return;this.idPull["polygon_"+id]&&this.idPull["polygon_"+id]._tmShow&&window.clearTimeout(this.idPull["polygon_"+id]._tmShow);var t=this.itemPull[id].type;if("separator"==t){var item=this.idPull["separator_"+id];this.itemPull[id].parent==this.idPrefix+this.topId?(item.onclick=null,item.onselectstart=null,item.id=null,item.parentNode.removeChild(item)):(item.childNodes[0].childNodes[0].onclick=null,item.childNodes[0].childNodes[0].onselectstart=null,item.childNodes[0].childNodes[0].id=null,item.childNodes[0].removeChild(item.childNodes[0].childNodes[0]),item.removeChild(item.childNodes[0]),item.parentNode.removeChild(item)),this.idPull["separator_"+id]=null,this.itemPull[id]=null,delete this.idPull["separator_"+id],delete this.itemPull[id],item=null}else{pId=this.itemPull[id].parent;var item=this.idPull[id];for(item.onclick=null,item.oncontextmenu=null,item.onmouseover=null,item.onmouseout=null,item.onselectstart=null,item.id=null;item.childNodes.length>0;)item.removeChild(item.childNodes[0]);item.parentNode.removeChild(item),this.idPull[id]=null,this.itemPull[id]=null,delete this.idPull[id],delete this.itemPull[id],item=null}t=null}for(var a in this.itemPull)this.itemPull[a].parent==id&&this.removeItem(a,!0,!0);var p2=new Array(id);null==pId||_recCall||null!=this.idPull["polygon_"+pId]&&0==this.idPull["polygon_"+pId].tbd.childNodes.length&&(p2.push(pId),this._updateItemComplexState(pId,!1,!1));for(var q=0;q<p2.length;q++)if(this.idPull["polygon_"+p2[q]]){var p=this.idPull["polygon_"+p2[q]];if(p.onclick=null,p.oncontextmenu=null,p.tbl.removeChild(p.tbd),p.tbd=null,p.removeChild(p.tbl),p.tbl=null,p.id=null,p.parentNode.removeChild(p),p=null,this._isIE6){var pc="polygon_"+p2[q]+"_ie6cover";null!=this.idPull[pc]&&(document.body.removeChild(this.idPull[pc]),delete this.idPull[pc])}null!=this.idPull["arrowup_"+id]&&this._removeArrow&&this._removeArrow("arrowup_"+id),null!=this.idPull["arrowdown_"+id]&&this._removeArrow&&this._removeArrow("arrowdown_"+id),this.idPull["polygon_"+p2[q]]=null,delete this.idPull["polygon_"+p2[q]]}p2=null,"dhx_terrace"==this.skin&&1==arguments.length&&this._improveTerraceSkin()},dhtmlXMenuObject.prototype._getAllParents=function(id){var parents=new Array;for(var a in this.itemPull)if(this.itemPull[a].parent==id&&(parents[parents.length]=this.itemPull[a].id,this.itemPull[a].complex))for(var t=this._getAllParents(this.itemPull[a].id),q=0;q<t.length;q++)parents[parents.length]=t[q];return parents},dhtmlXMenuObject.prototype.renderAsContextMenu=function(){this.context=!0,1==this.base._autoSkinUpdate&&(this.base.className=this.base.className.replace("dhtmlxMenu_"+this.skin+"_Middle",""),this.base._autoSkinUpdate=!1),null!=this.addBaseIdAsContextZone&&this.addContextZone(this.addBaseIdAsContextZone)},dhtmlXMenuObject.prototype.addContextZone=function(zoneId){if(zoneId==document.body){zoneId="document.body."+this.idPrefix;var zone=document.body}else var zone=document.getElementById(zoneId);var zoneExists=!1;for(var a in this.contextZones)zoneExists=zoneExists||a==zoneId||this.contextZones[a]==zone;if(1==zoneExists)return!1;this.contextZones[zoneId]=zone;var main_self=this;_isOpera?(this.operaContext=function(e){main_self._doOnContextMenuOpera(e,main_self)},zone.addEventListener("mouseup",this.operaContext,!1)):(null==zone.oncontextmenu||zone._oldContextMenuHandler||(zone._oldContextMenuHandler=zone.oncontextmenu),zone.oncontextmenu=function(e){for(var q in dhtmlxMenuObjectLiveInstances)q!=main_self._UID&&dhtmlxMenuObjectLiveInstances[q].context&&dhtmlxMenuObjectLiveInstances[q]._hideContextMenu();return e=e||event,e.cancelBubble=!0,e.returnValue=!1,main_self._doOnContextBeforeCall(e,this),!1})},dhtmlXMenuObject.prototype._doOnContextMenuOpera=function(e,main_self){for(var q in dhtmlxMenuObjectLiveInstances)q!=main_self._UID&&dhtmlxMenuObjectLiveInstances[q].context&&dhtmlxMenuObjectLiveInstances[q]._hideContextMenu();return e.cancelBubble=!0,e.returnValue=!1,0==e.button&&1==e.ctrlKey&&main_self._doOnContextBeforeCall(e,this),!1},dhtmlXMenuObject.prototype.removeContextZone=function(zoneId){if(!this.isContextZone(zoneId))return!1;zoneId==document.body&&(zoneId="document.body."+this.idPrefix);var zone=this.contextZones[zoneId];_isOpera?zone.removeEventListener("mouseup",this.operaContext,!1):(zone.oncontextmenu=null!=zone._oldContextMenuHandler?zone._oldContextMenuHandler:null,zone._oldContextMenuHandler=null);try{this.contextZones[zoneId]=null,delete this.contextZones[zoneId]}catch(e){}return!0},dhtmlXMenuObject.prototype.isContextZone=function(zoneId){if(zoneId==document.body&&null!=this.contextZones["document.body."+this.idPrefix])return!0;var isZone=!1;return null!=this.contextZones[zoneId]&&this.contextZones[zoneId]==document.getElementById(zoneId)&&(isZone=!0),isZone},dhtmlXMenuObject.prototype._isContextMenuVisible=function(){return null==this.idPull["polygon_"+this.idPrefix+this.topId]?!1:""==this.idPull["polygon_"+this.idPrefix+this.topId].style.display},dhtmlXMenuObject.prototype._showContextMenu=function(x,y,zoneId){return this._clearAndHide(),null==this.idPull["polygon_"+this.idPrefix+this.topId]?!1:(window.clearTimeout(this.menuTimeoutHandler),this.idPull[this.idPrefix+this.topId]=new Array(x,y),this._showPolygon(this.idPrefix+this.topId,"bottom"),void this.callEvent("onContextMenu",[zoneId]))},dhtmlXMenuObject.prototype._hideContextMenu=function(){return null==this.idPull["polygon_"+this.idPrefix+this.topId]?!1:(this._clearAndHide(),this._hidePolygon(this.idPrefix+this.topId),void(this.zInd=this.zIndInit))},dhtmlXMenuObject.prototype._doOnContextBeforeCall=function(e,cZone){this.contextMenuZoneId=cZone.id,this._clearAndHide(),this._hideContextMenu();var p=e.srcElement||e.target,px=_isIE||_isOpera||_KHTMLrv?e.offsetX:e.layerX,py=_isIE||_isOpera||_KHTMLrv?e.offsetY:e.layerY,mx=getAbsoluteLeft(p)+px,my=getAbsoluteTop(p)+py;this.checkEvent("onBeforeContextMenu")?this.callEvent("onBeforeContextMenu",[cZone.id,e])&&this.contextAutoShow&&(this._showContextMenu(mx,my,cZone.id),this.callEvent("onAfterContextMenu",[cZone.id,e])):this.contextAutoShow&&(this._showContextMenu(mx,my,cZone.id),this.callEvent("onAfterContextMenu",[cZone.id]))},dhtmlXMenuObject.prototype.showContextMenu=function(x,y){this._showContextMenu(x,y,!1)},dhtmlXMenuObject.prototype.hideContextMenu=function(){this._hideContextMenu()},dhtmlXMenuObject.prototype._autoDetectVisibleArea=function(){this._isVisibleArea||(this.menuX1=document.body.scrollLeft,this.menuX2=this.menuX1+(window.innerWidth||document.body.clientWidth),this.menuY1=Math.max((_isIE?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop),this.menuY2=this.menuY1+(_isIE?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight))},dhtmlXMenuObject.prototype.getItemPosition=function(id){id=this.idPrefix+id;var pos=-1;if(null==this.itemPull[id])return pos;for(var parent=this.itemPull[id].parent,obj=null!=this.idPull["polygon_"+parent]?this.idPull["polygon_"+parent].tbd:this.cont,q=0;q<obj.childNodes.length;q++)obj.childNodes[q]!=this.idPull["separator_"+id]&&obj.childNodes[q]!=this.idPull[id]||(pos=q);return pos},dhtmlXMenuObject.prototype.setItemPosition=function(id,pos){if(id=this.idPrefix+id,null!=this.idPull[id]){var isOnTopLevel=this.itemPull[id].parent==this.idPrefix+this.topId,itemData=this.idPull[id],itemPos=this.getItemPosition(id.replace(this.idPrefix,"")),parent=this.itemPull[id].parent,obj=null!=this.idPull["polygon_"+parent]?this.idPull["polygon_"+parent].tbd:this.cont;obj.removeChild(obj.childNodes[itemPos]),0>pos&&(pos=0),isOnTopLevel&&1>pos&&(pos=1),pos<obj.childNodes.length?obj.insertBefore(itemData,obj.childNodes[pos]):obj.appendChild(itemData)}},dhtmlXMenuObject.prototype.getParentId=function(id){return id=this.idPrefix+id,null==this.itemPull[id]?null:(null!=this.itemPull[id].parent?this.itemPull[id].parent:this.topId).replace(this.idPrefix,"")},dhtmlXMenuObject.prototype.addNewSibling=function(nextToId,itemId,itemText,disabled,imgEnabled,imgDisabled){var id=this.idPrefix+(null!=itemId?itemId:this._genStr(24)),parentId=this.idPrefix+(null!=nextToId?this.getParentId(nextToId):this.topId);this._addItemIntoGlobalStrorage(id,parentId,itemText,"item",disabled,imgEnabled,imgDisabled),parentId!=this.idPrefix+this.topId||this.context?this._renderSublevelItem(id,this.getItemPosition(nextToId)):this._renderToplevelItem(id,this.getItemPosition(nextToId))},dhtmlXMenuObject.prototype.addNewChild=function(parentId,pos,itemId,itemText,disabled,imgEnabled,imgDisabled){if(null==parentId){if(!this.context)return this.addNewSibling(parentId,itemId,itemText,disabled,imgEnabled,imgDisabled),void(null!=pos&&this.setItemPosition(itemId,pos));parentId=this.topId}itemId=this.idPrefix+(null!=itemId?itemId:this._genStr(24)),this.setHotKey&&this.setHotKey(parentId,""),parentId=this.idPrefix+parentId,this._addItemIntoGlobalStrorage(itemId,parentId,itemText,"item",disabled,imgEnabled,imgDisabled),null==this.idPull["polygon_"+parentId]&&this._renderSublevelPolygon(parentId,parentId),this._renderSublevelItem(itemId,pos-1),this._redefineComplexState(parentId)},dhtmlXMenuObject.prototype._addItemIntoGlobalStrorage=function(itemId,itemParentId,itemText,itemType,disabled,img,imgDis){var item={id:itemId,title:itemText,imgen:null!=img?img:"",imgdis:null!=imgDis?imgDis:"",type:itemType,state:1==disabled?"disabled":"enabled",parent:itemParentId,complex:!1,hotkey:"",tip:""};this.itemPull[item.id]=item},dhtmlXMenuObject.prototype._addSubMenuPolygon=function(id,parentId){var j=(this._renderSublevelPolygon(id,parentId),this._getMenuNodes(parentId));for(q=0;q<j.length;q++)"separator"==this.itemPull[j[q]].type?this._renderSeparator(j[q],null):this._renderSublevelItem(j[q],null);if(id==parentId);else;for(var q=0;q<j.length;q++)this.itemPull[j[q]].complex&&this._addSubMenuPolygon(id,this.itemPull[j[q]].id)},dhtmlXMenuObject.prototype._renderSublevelPolygon=function(id,parentId){var s=document.createElement("DIV");s.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_Polygon "+(this._rtl?"dir_right":""),s.dir="ltr",s.oncontextmenu=function(e){return e=e||event,e.returnValue=!1,e.cancelBubble=!0,!1},s.id="polygon_"+parentId,s.onclick=function(e){e=e||event,e.cancelBubble=!0},s.style.display="none",document.body.insertBefore(s,document.body.firstChild);var tbl=document.createElement("TABLE");tbl.className="dhtmlxMebu_SubLevelArea_Tbl",tbl.cellSpacing=0,tbl.cellPadding=0,tbl.border=0;var tbd=document.createElement("TBODY");return tbl.appendChild(tbd),s.appendChild(tbl),s.tbl=tbl,s.tbd=tbd,this.idPull[s.id]=s,null!=this.sxDacProc&&(this.idPull["sxDac_"+parentId]=new this.sxDacProc(s,s.className),_isIE?(this.idPull["sxDac_"+parentId]._setSpeed(this.dacSpeedIE),this.idPull["sxDac_"+parentId]._setCustomCycle(this.dacCyclesIE)):(this.idPull["sxDac_"+parentId]._setSpeed(this.dacSpeed),this.idPull["sxDac_"+parentId]._setCustomCycle(this.dacCycles))),s},dhtmlXMenuObject.prototype._renderSublevelItem=function(id,pos){var main_self=this,tr=document.createElement("TR");tr.className="enabled"==this.itemPull[id].state?"sub_item":"sub_item_dis";var t1=document.createElement("TD");t1.className="sub_item_icon";var icon=this.itemPull[id]["enabled"==this.itemPull[id].state?"imgen":"imgdis"];if(""!=icon){var tp=this.itemPull[id].type;if("checkbox"==tp||"radio"==tp){var img=document.createElement("DIV");img.id="image_"+this.itemPull[id].id,img.className="sub_icon "+icon,t1.appendChild(img)}if("checkbox"!=tp&&"radio"!=tp){var img=document.createElement("IMG");img.id="image_"+this.itemPull[id].id,img.className="sub_icon",img.src=this.imagePath+icon,t1.appendChild(img)}}var t2=document.createElement("TD");if(t2.className="sub_item_text",""!=this.itemPull[id].title){var t2t=document.createElement("DIV");t2t.className="sub_item_text",t2t.innerHTML=this.itemPull[id].title,t2.appendChild(t2t)}else t2.innerHTML="&nbsp;";var t3=document.createElement("TD");if(t3.className="sub_item_hk",this.itemPull[id].complex){var arw=document.createElement("DIV");arw.className="complex_arrow",arw.id="arrow_"+this.itemPull[id].id,t3.appendChild(arw)}else if(this.itemPull[id].hotkey.length>0&&!this.itemPull[id].complex){var t3t=document.createElement("DIV");t3t.className="sub_item_hk",t3t.innerHTML=this.itemPull[id].hotkey,t3.appendChild(t3t)}else t3.innerHTML="&nbsp;";tr.appendChild(this._rtl?t3:t1),tr.appendChild(t2),tr.appendChild(this._rtl?t1:t3),tr.id=this.itemPull[id].id,tr.parent=this.itemPull[id].parent,this.itemPull[id].tip.length>0&&(tr.title=this.itemPull[id].tip),this._hideTMData||(this._hideTMData={}),
tr.onselectstart=function(e){return e=e||event,e.returnValue=!1,!1},tr.onmouseover=function(e){main_self._hideTMData[this.id]&&window.clearTimeout(main_self._hideTMData[this.id]),"web"==main_self.menuMode&&window.clearTimeout(main_self.menuTimeoutHandler),this._visible||main_self._redistribSubLevelSelection(this.id,this.parent),this._visible=!0},tr.onmouseout=function(){"web"==main_self.menuMode&&(main_self.menuTimeoutHandler&&window.clearTimeout(main_self.menuTimeoutHandler),main_self.menuTimeoutHandler=window.setTimeout(function(){main_self&&main_self._clearAndHide&&main_self._clearAndHide()},main_self.menuTimeoutMsec,"JavaScript"));var k=this;main_self._hideTMData[this.id]&&window.clearTimeout(main_self._hideTMData[this.id]),main_self._hideTMData[this.id]=window.setTimeout(function(){k._visible=!1},50)},tr.onclick=function(e){if(main_self.checkEvent("onClick")||!main_self.itemPull[this.id].complex){e=e||event,e.cancelBubble=!0,e.returnValue=!1,tc=main_self.itemPull[this.id].complex?"c":"-",td="enabled"==main_self.itemPull[this.id].state?"-":"d";var cas={ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey};switch(main_self.itemPull[this.id].type){case"checkbox":main_self._checkboxOnClickHandler(this.id.replace(main_self.idPrefix,""),tc+td+"n",cas);break;case"radio":main_self._radioOnClickHandler(this.id.replace(main_self.idPrefix,""),tc+td+"n",cas);break;case"item":main_self._doOnClick(this.id.replace(main_self.idPrefix,""),tc+td+"n",cas)}return!1}};var polygon=this.idPull["polygon_"+this.itemPull[id].parent];null!=pos&&(pos++,0>pos&&(pos=0),pos>polygon.tbd.childNodes.length-1&&(pos=null)),null!=pos&&null!=polygon.tbd.childNodes[pos]?polygon.tbd.insertBefore(tr,polygon.tbd.childNodes[pos]):polygon.tbd.appendChild(tr),this.idPull[tr.id]=tr},dhtmlXMenuObject.prototype._renderSeparator=function(id,pos){var level=this.context?"SubLevelArea":this.itemPull[id].parent==this.idPrefix+this.topId?"TopLevel":"SubLevelArea";if("TopLevel"!=level||!this.context){var main_self=this;if("TopLevel"!=level){var tr=document.createElement("TR");tr.className="sub_sep";var td=document.createElement("TD");td.colSpan="3",tr.appendChild(td)}var k=document.createElement("DIV");if(k.id="separator_"+id,k.className="TopLevel"==level?"top_sep":"sub_sep",k.onselectstart=function(e){e=e||event,e.returnValue=!1},k.onclick=function(e){e=e||event,e.cancelBubble=!0;var cas={ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey};main_self._doOnClick(this.id.replace("separator_"+main_self.idPrefix,""),"--s",cas)},"TopLevel"==level){if(null!=pos)pos++,0>pos&&(pos=0),null!=this.cont.childNodes[pos]?this.cont.insertBefore(k,this.cont.childNodes[pos]):this.cont.appendChild(k);else{var last=this.cont.childNodes[this.cont.childNodes.length-1];-1==String(last).search("TopLevel_Text")?this.cont.appendChild(k):this.cont.insertBefore(k,last)}this.idPull[k.id]=k}else{var polygon=this.idPull["polygon_"+this.itemPull[id].parent];null!=pos&&(pos++,0>pos&&(pos=0),pos>polygon.tbd.childNodes.length-1&&(pos=null)),null!=pos&&null!=polygon.tbd.childNodes[pos]?polygon.tbd.insertBefore(tr,polygon.tbd.childNodes[pos]):polygon.tbd.appendChild(tr),td.appendChild(k),this.idPull[k.id]=tr}}},dhtmlXMenuObject.prototype.addNewSeparator=function(nextToId,itemId){itemId=this.idPrefix+(null!=itemId?itemId:this._genStr(24));var parentId=this.idPrefix+this.getParentId(nextToId);this._addItemIntoGlobalStrorage(itemId,parentId,"","separator",!1,"",""),this._renderSeparator(itemId,this.getItemPosition(nextToId))},dhtmlXMenuObject.prototype.hide=function(){this._clearAndHide()},dhtmlXMenuObject.prototype.clearAll=function(){this.removeItem(this.idPrefix+this.topId,!0),this._isInited=!1,this.idPrefix=this._genStr(12),this.itemPull={}},dhtmlXMenuObject.prototype.unload=function(){if("function"==typeof window.addEventListener?(window.removeEventListener("click",this._bodyClick,!1),window.removeEventListener("contextmenu",this._bodyContext,!1)):(document.body.detachEvent("onclick",this._bodyClick),document.body.detachEvent("oncontextmenu",this._bodyContext)),this._bodyClick=null,this._bodyContext=null,this.removeItem(this.idPrefix+this.topId,!0),this.itemPull=null,this.idPull=null,this.context)for(var a in this.contextZones)this.removeContextZone(a);null!=this.cont&&(this.cont.className="",this.cont.parentNode.removeChild(this.cont),this.cont=null),null!=this.base&&(this.base.className="",this.context||(this.base.oncontextmenu=this.base._oldContextMenuHandler||null),this.base.onselectstart=null,this.base=null),this.setSkin=null,this.detachAllEvents(),this._xmlLoader&&(this._xmlLoader.destructor(),this._xmlLoader=null),this._align=null,this._arrowFFFix=null,this._isIE6=null,this._isInited=null,this._rtl=null,this._scrollDownTMStep=null,this._scrollDownTMTime=null,this._scrollUpTMStep=null,this._scrollUpTMTime=null,this._topLevelBottomMargin=null,this._topLevelOffsetLeft=null,this._topLevelBottomMargin=null,this._topLevelRightMargin=null,this.addBaseIdAsContextZone=null,this.context=null,this.contextAutoHide=null,this.contextAutoShow=null,this.contextHideAllMode=null,this.contextMenuZoneId=null,this.dLoad=null,this.dLoadSign=null,this.dLoadUrl=null,this.loaderIcon=null,this.fixedPosition=null,this.dirSubLevel=null,this.dirTopLevel=null,this.limit=null,this.menuSelected=null,this.menuLastClicked=null,this.idPrefix=null,this.imagePath=null,this.menuMode=null,this.menuModeTopLevelTimeout=null,this.menuModeTopLevelTimeoutTime=null,this.menuTimeoutHandler=null,this.menuTimeoutMsec=null,this.menuTouched=null,this.isDhtmlxMenuObject=null,this.itemHotKeyTagName=null,this.itemHrefTagName=null,this.itemTagName=null,this.itemTextTagName=null,this.itemTipTagName=null,this.userDataTagName=null,this.skin=null,this.topId=null,this.dacCycles=null,this.dacCyclesIE=null,this.dacSpeed=null,this.dacSpeedIE=null,this.zInd=null,this.zIndInit=null,this.zIndStep=null,this._enableDacSupport=null,this._selectedSubItems=null,this._openedPolygons=null,this._addSubItemToSelected=null,this._removeSubItemFromSelected=null,this._getSubItemToDeselectByPolygon=null,this._hidePolygon=null,this._showPolygon=null,this._redistribSubLevelSelection=null,this._doOnClick=null,this._doOnTouchMenu=null,this._searchMenuNode=null,this._getMenuNodes=null,this._genStr=null,this._clearAndHide=null,this._doOnLoad=null,this.getItemType=null,this.forEachItem=null,this.init=null,this.loadXML=null,this.loadXMLString=null,this._buildMenu=null,this._xmlParser=null,this._showSubLevelItem=null,this._hideSubLevelItem=null,this._countVisiblePolygonItems=null,this._redefineComplexState=null,this._updateItemComplexState=null,this._getItemLevelType=null,this._redistribTopLevelSelection=null,this._initTopLevelMenu=null,this._renderToplevelItem=null,this.setImagePath=null,this.setIconsPath=null,this.setIconPath=null,this._updateItemImage=null,this.removeItem=null,this._getAllParents=null,this.renderAsContextMenu=null,this.addContextZone=null,this.removeContextZone=null,this.isContextZone=null,this._isContextMenuVisible=null,this._showContextMenu=null,this._doOnContextBeforeCall=null,this._autoDetectVisibleArea=null,this._addItemIntoGlobalStrorage=null,this._addSubMenuPolygon=null,this._renderSublevelPolygon=null,this._renderSublevelItem=null,this._renderSeparator=null,this._hideContextMenu=null,this.clearAll=null,this.getItemPosition=null,this.setItemPosition=null,this.getParentId=null,this.addNewSibling=null,this.addNewChild=null,this.addNewSeparator=null,this.attachEvent=null,this.callEvent=null,this.checkEvent=null,this.eventCatcher=null,this.detachEvent=null,this.dhx_Event=null,this.unload=null,this.items=null,this.radio=null,this.detachAllEvents=null,this.hide=null,this.showContextMenu=null,this.hideContextMenu=null,this._changeItemState=null,this._changeItemVisible=null,this._updateLoaderIcon=null,this._clearAllSelectedSubItemsInPolygon=null,this._checkArrowsState=null,this._addUpArrow=null,this._addDownArrow=null,this._removeUpArrow=null,this._removeDownArrow=null,this._isArrowExists=null,this._doScrollUp=null,this._doScrollDown=null,this._countPolygonItems=null,this._getRadioImgObj=null,this._setRadioState=null,this._radioOnClickHandler=null,this._getCheckboxState=null,this._setCheckboxState=null,this._readLevel=null,this._updateCheckboxImage=null,this._checkboxOnClickHandler=null,this._removeArrow=null,this.setItemEnabled=null,this.setItemDisabled=null,this.isItemEnabled=null,this.getItemText=null,this.setItemText=null,this.loadFromHTML=null,this.hideItem=null,this.showItem=null,this.isItemHidden=null,this.setUserData=null,this.getUserData=null,this.setOpenMode=null,this.setWebModeTimeout=null,this.enableDynamicLoading=null,this.getItemImage=null,this.setItemImage=null,this.clearItemImage=null,this.setAutoShowMode=null,this.setAutoHideMode=null,this.setContextMenuHideAllMode=null,this.getContextMenuHideAllMode=null,this.setVisibleArea=null,this.setTooltip=null,this.getTooltip=null,this.setHotKey=null,this.getHotKey=null,this.setItemSelected=null,this.setTopText=null,this.setRTL=null,this.setAlign=null,this.setHref=null,this.clearHref=null,this.getCircuit=null,this.contextZones=null,this.setOverflowHeight=null,this.userData=null,this.getRadioChecked=null,this.setRadioChecked=null,this.addRadioButton=null,this.setCheckboxState=null,this.getCheckboxState=null,this.addCheckbox=null,this.serialize=null,this.extendedModule=null,dhtmlxMenuObjectLiveInstances[this._UID]=null;try{delete dhtmlxMenuObjectLiveInstances[this._UID]}catch(e){}this._UID=null};var dhtmlxMenuObjectLiveInstances={};dhtmlXMenuObject.prototype.i18n={dhxmenuextalert:"dhtmlxmenu_ext.js required"},function(){dhtmlx.extend_api("dhtmlXMenuObject",{_init:function(obj){return[obj.parent,obj.skin]},align:"setAlign",top_text:"setTopText",context:"renderAsContextMenu",icon_path:"setIconsPath",open_mode:"setOpenMode",rtl:"setRTL",skin:"setSkin",dynamic:"enableDynamicLoading",xml:"loadXML",items:"items",overflow:"setOverflowHeight"},{items:function(arr,parent){for(var pos=1e5,lastItemId=null,i=0;i<arr.length;i++){var item=arr[i];"separator"==item.type?(this.addNewSeparator(lastItemId,pos,item.id),lastItemId=item.id):(this.addNewChild(parent,pos,item.id,item.text,item.disabled,item.img,item.img_disabled),lastItemId=item.id,item.items&&this.items(item.items,item.id))}}})}(),dhtmlXMenuObject.prototype._improveTerraceSkin=function(){for(var a in this.itemPull)if(this.itemPull[a].parent==this.idPrefix+this.topId&&null!=this.idPull[a]){var bl=!1,br=!1;this.idPull[a].parentNode.firstChild==this.idPull[a]&&(bl=!0),this.idPull[a].parentNode.lastChild==this.idPull[a]&&(br=!0);for(var b in this.itemPull)"separator"==this.itemPull[b].type&&this.itemPull[b].parent==this.idPrefix+this.topId&&(this.idPull[a].nextSibling==this.idPull["separator_"+b]&&(br=!0),this.idPull[a].previousSibling==this.idPull["separator_"+b]&&(bl=!0));this.idPull[a].style.borderLeft=bl?"1px solid #cecece":"0px solid white",this.idPull[a].style.borderTopLeftRadius=this.idPull[a].style.borderBottomLeftRadius=bl?"5px":"0px",this.idPull[a].style.borderTopRightRadius=this.idPull[a].style.borderBottomRightRadius=br?"5px":"0px",this.idPull[a]._bl=bl,this.idPull[a]._br=br}},dhtmlXMenuObject.prototype._improveTerraceButton=function(id,state){state?(this.idPull[id].style.borderBottomLeftRadius=this.idPull[id]._bl?"5px":"0px",this.idPull[id].style.borderBottomRightRadius=this.idPull[id]._br?"5px":"0px"):(this.idPull[id].style.borderBottomLeftRadius="0px",this.idPull[id].style.borderBottomRightRadius="0px")},dhtmlXMenuObject.prototype.extendedModule="DHXMENUEXT",dhtmlXMenuObject.prototype.setItemEnabled=function(id){this._changeItemState(id,"enabled",this._getItemLevelType(id))},dhtmlXMenuObject.prototype.setItemDisabled=function(id){this._changeItemState(id,"disabled",this._getItemLevelType(id))},dhtmlXMenuObject.prototype.isItemEnabled=function(id){return null!=this.itemPull[this.idPrefix+id]?"enabled"==this.itemPull[this.idPrefix+id].state:!1},dhtmlXMenuObject.prototype._changeItemState=function(id,newState,levelType){var t=!1,j=this.idPrefix+id;return null!=this.itemPull[j]&&null!=this.idPull[j]&&this.itemPull[j].state!=newState&&(this.itemPull[j].state=newState,this.itemPull[j].parent!=this.idPrefix+this.topId||this.context?this.idPull[j].className="sub_item"+("enabled"==this.itemPull[j].state?"":"_dis"):this.idPull[j].className="dhtmlxMenu_"+this.skin+"_TopLevel_Item_"+("enabled"==this.itemPull[j].state?"Normal":"Disabled"),this._updateItemComplexState(this.idPrefix+id,this.itemPull[this.idPrefix+id].complex,!1),this._updateItemImage(id,levelType),this.idPrefix+this.menuLastClicked==j&&"TopLevel"!=levelType&&this._redistribSubLevelSelection(j,this.itemPull[j].parent),"TopLevel"==levelType&&!this.context),t},dhtmlXMenuObject.prototype.getItemText=function(id){return null!=this.itemPull[this.idPrefix+id]?this.itemPull[this.idPrefix+id].title:""},dhtmlXMenuObject.prototype.setItemText=function(id,text){if(id=this.idPrefix+id,null!=this.itemPull[id]&&null!=this.idPull[id])if(this._clearAndHide(),this.itemPull[id].title=text,this.itemPull[id].parent!=this.idPrefix+this.topId||this.context){for(var tObj=null,q=0;q<this.idPull[id].childNodes[1].childNodes.length;q++)"sub_item_text"==String(this.idPull[id].childNodes[1].childNodes[q].className||"")&&(tObj=this.idPull[id].childNodes[1].childNodes[q]);""==String(this.itemPull[id].title).length||null==this.itemPull[id].title?tObj&&(tObj.parentNode.removeChild(tObj),tObj=null,this.idPull[id].childNodes[1].innerHTML="&nbsp;"):(tObj||(tObj=document.createElement("DIV"),tObj.className="sub_item_text",this.idPull[id].childNodes[1].innerHTML="",this.idPull[id].childNodes[1].appendChild(tObj)),tObj.innerHTML=this.itemPull[id].title)}else{for(var tObj=null,q=0;q<this.idPull[id].childNodes.length;q++)try{"top_level_text"==this.idPull[id].childNodes[q].className&&(tObj=this.idPull[id].childNodes[q])}catch(e){}""==String(this.itemPull[id].title).length||null==this.itemPull[id].title?null!=tObj&&tObj.parentNode.removeChild(tObj):(tObj||(tObj=document.createElement("DIV"),tObj.className="top_level_text",this._rtl&&this.idPull[id].childNodes.length>0?this.idPull[id].insertBefore(tObj,this.idPull[id].childNodes[0]):this.idPull[id].appendChild(tObj)),tObj.innerHTML=this.itemPull[id].title)}},dhtmlXMenuObject.prototype.loadFromHTML=function(objId,clearAfterAdd,onLoadFunction){this.itemTagName="DIV","string"==typeof objId&&(objId=document.getElementById(objId)),this._buildMenu(objId,null),this.init(),clearAfterAdd&&objId.parentNode.removeChild(objId),null!=onLoadFunction&&onLoadFunction()},dhtmlXMenuObject.prototype.hideItem=function(id){this._changeItemVisible(id,!1)},dhtmlXMenuObject.prototype.showItem=function(id){this._changeItemVisible(id,!0)},dhtmlXMenuObject.prototype.isItemHidden=function(id){var isHidden=null;return null!=this.idPull[this.idPrefix+id]&&(isHidden="none"==this.idPull[this.idPrefix+id].style.display),isHidden},dhtmlXMenuObject.prototype._changeItemVisible=function(id,visible){var itemId=this.idPrefix+id;null!=this.itemPull[itemId]&&("separator"==this.itemPull[itemId].type&&(itemId="separator_"+itemId),null!=this.idPull[itemId]&&(this.idPull[itemId].style.display=visible?"":"none",this._redefineComplexState(this.itemPull[this.idPrefix+id].parent)))},dhtmlXMenuObject.prototype.setUserData=function(id,name,value){this.userData[this.idPrefix+id+"_"+name]=value},dhtmlXMenuObject.prototype.getUserData=function(id,name){return null!=this.userData[this.idPrefix+id+"_"+name]?this.userData[this.idPrefix+id+"_"+name]:null},dhtmlXMenuObject.prototype.setOpenMode=function(mode){"win"==mode||"web"==mode?this.menuMode=mode:"web"==this.menuMode},dhtmlXMenuObject.prototype.setWebModeTimeout=function(tm){this.menuTimeoutMsec=isNaN(tm)?400:tm},dhtmlXMenuObject.prototype.enableDynamicLoading=function(url,icon){this.dLoad=!0,this.dLoadUrl=url,this.dLoadSign=-1==String(this.dLoadUrl).search(/\?/)?"?":"&",this.loaderIcon=icon,this.init()},dhtmlXMenuObject.prototype._updateLoaderIcon=function(id,state){if(null!=this.idPull[id]&&!(String(this.idPull[id].className).search("TopLevel_Item")>=0)){var ind=this._rtl?0:2;if(this.idPull[id].childNodes[ind]&&this.idPull[id].childNodes[ind].childNodes[0]){var aNode=this.idPull[id].childNodes[ind].childNodes[0];0===String(aNode.className).search("complex_arrow")&&(aNode.className="complex_arrow"+(state?"_loading":""))}}},dhtmlXMenuObject.prototype.getItemImage=function(id){var imgs=new Array(null,null);return id=this.idPrefix+id,"item"==this.itemPull[id].type&&(imgs[0]=this.itemPull[id].imgen,imgs[1]=this.itemPull[id].imgdis),imgs},dhtmlXMenuObject.prototype.setItemImage=function(id,img,imgDis){"item"==this.itemPull[this.idPrefix+id].type&&(this.itemPull[this.idPrefix+id].imgen=img,this.itemPull[this.idPrefix+id].imgdis=imgDis,this._updateItemImage(id,this._getItemLevelType(id)))},dhtmlXMenuObject.prototype.clearItemImage=function(id){this.setItemImage(id,"","")},dhtmlXMenuObject.prototype.setAutoShowMode=function(mode){this.contextAutoShow=1==mode},dhtmlXMenuObject.prototype.setAutoHideMode=function(mode){this.contextAutoHide=1==mode},dhtmlXMenuObject.prototype.setContextMenuHideAllMode=function(mode){this.contextHideAllMode=1==mode},dhtmlXMenuObject.prototype.getContextMenuHideAllMode=function(){return this.contextHideAllMode},dhtmlXMenuObject.prototype.setVisibleArea=function(x1,x2,y1,y2){this._isVisibleArea=!0,this.menuX1=x1,this.menuX2=x2,this.menuY1=y1,this.menuY2=y2},dhtmlXMenuObject.prototype.setTooltip=function(id,tip){id=this.idPrefix+id,null!=this.itemPull[id]&&null!=this.idPull[id]&&(this.idPull[id].title=tip.length>0?tip:null,this.itemPull[id].tip=tip)},dhtmlXMenuObject.prototype.getTooltip=function(id){return null==this.itemPull[this.idPrefix+id]?null:this.itemPull[this.idPrefix+id].tip},dhtmlXMenuObject.prototype.setHotKey=function(id,hkey){if(id=this.idPrefix+id,null!=this.itemPull[id]&&null!=this.idPull[id]&&(this.itemPull[id].parent!=this.idPrefix+this.topId||this.context)&&!this.itemPull[id].complex){var t=this.itemPull[id].type;if("item"==t||"checkbox"==t||"radio"==t){var hkObj=null;try{"sub_item_hk"==this.idPull[id].childNodes[this._rtl?0:2].childNodes[0].className&&(hkObj=this.idPull[id].childNodes[this._rtl?0:2].childNodes[0])}catch(e){}if(0==hkey.length)this.itemPull[id].hotkey_backup=this.itemPull[id].hotkey,this.itemPull[id].hotkey="",null!=hkObj&&hkObj.parentNode.removeChild(hkObj);else{if(this.itemPull[id].hotkey=hkey,this.itemPull[id].hotkey_backup=null,null==hkObj){hkObj=document.createElement("DIV"),hkObj.className="sub_item_hk";for(var item=this.idPull[id].childNodes[this._rtl?0:2];item.childNodes.length>0;)item.removeChild(item.childNodes[0]);item.appendChild(hkObj)}hkObj.innerHTML=hkey}}}},dhtmlXMenuObject.prototype.getHotKey=function(id){return null==this.itemPull[this.idPrefix+id]?null:this.itemPull[this.idPrefix+id].hotkey},dhtmlXMenuObject.prototype.setItemSelected=function(id){return null==this.itemPull[this.idPrefix+id]?null:void 0},dhtmlXMenuObject.prototype.setTopText=function(text){this.context||(null==this._topText&&(this._topText=document.createElement("DIV"),this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this._rtl?"left":"left"==this._align?"right":"left"),this.base.appendChild(this._topText)),this._topText.innerHTML=text)},dhtmlXMenuObject.prototype.setAlign=function(align){this._align!=align&&("left"!=align&&"right"!=align||(this._align=align,this.cont&&(this.cont.className="right"==this._align?"align_right":"align_left"),null!=this._topText&&(this._topText.className="dhtmlxMenu_TopLevel_Text_"+("left"==this._align?"right":"left"))))},dhtmlXMenuObject.prototype.setHref=function(itemId,href,target){null!=this.itemPull[this.idPrefix+itemId]&&(this.itemPull[this.idPrefix+itemId].href_link=href,null!=target&&(this.itemPull[this.idPrefix+itemId].href_target=target))},dhtmlXMenuObject.prototype.clearHref=function(itemId){null!=this.itemPull[this.idPrefix+itemId]&&(delete this.itemPull[this.idPrefix+itemId].href_link,delete this.itemPull[this.idPrefix+itemId].href_target)},dhtmlXMenuObject.prototype.getCircuit=function(id){for(var parents=new Array(id);this.getParentId(id)!=this.topId;)id=this.getParentId(id),parents[parents.length]=id;return parents.reverse()},dhtmlXMenuObject.prototype._clearAllSelectedSubItemsInPolygon=function(polygon){for(var subIds=this._getSubItemToDeselectByPolygon(polygon),q=0;q<this._openedPolygons.length;q++)this._openedPolygons[q]!=polygon&&this._hidePolygon(this._openedPolygons[q]);for(var q=0;q<subIds.length;q++)null!=this.idPull[subIds[q]]&&"enabled"==this.itemPull[subIds[q]].state&&(this.idPull[subIds[q]].className="dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Normal")},dhtmlXMenuObject.prototype._checkArrowsState=function(id){var polygon=this.idPull["polygon_"+id],arrowUp=this.idPull["arrowup_"+id],arrowDown=this.idPull["arrowdown_"+id];0==polygon.scrollTop?arrowUp.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowUp_Disabled":arrowUp.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowUp"+(arrowUp.over?"_Over":""),polygon.scrollTop+polygon.offsetHeight<polygon.scrollHeight?arrowDown.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowDown"+(arrowDown.over?"_Over":""):arrowDown.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowDown_Disabled"},dhtmlXMenuObject.prototype._addUpArrow=function(id){var main_self=this,arrow=document.createElement("DIV");arrow.pId=this.idPrefix+id,arrow.id="arrowup_"+this.idPrefix+id,arrow.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowUp",arrow.innerHTML="<div class='dhtmlxMenu_"+this.skin+"_SubLevelArea_Arrow'><div class='dhtmlxMenu_SubLevelArea_Arrow_Icon'></div></div>",arrow.style.display="none",arrow.over=!1,arrow.onselectstart=function(e){return e=e||event,e.returnValue=!1,!1},arrow.oncontextmenu=function(e){return e=e||event,e.returnValue=!1,!1},arrow.onmouseover=function(){"web"==main_self.menuMode&&window.clearTimeout(main_self.menuTimeoutHandler),main_self._clearAllSelectedSubItemsInPolygon(this.pId),this.className!="dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowUp_Disabled"&&(this.className="dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowUp_Over",this.over=!0,main_self._canScrollUp=!0,main_self._doScrollUp(this.pId,!0))},arrow.onmouseout=function(){"web"==main_self.menuMode&&(window.clearTimeout(main_self.menuTimeoutHandler),main_self.menuTimeoutHandler=window.setTimeout(function(){main_self._clearAndHide()},main_self.menuTimeoutMsec,"JavaScript")),this.over=!1,main_self._canScrollUp=!1,this.className!="dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowUp_Disabled"&&(this.className="dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowUp",window.clearTimeout(main_self._scrollUpTM))},arrow.onclick=function(e){return e=e||event,e.returnValue=!1,e.cancelBubble=!0,!1},document.body.insertBefore(arrow,document.body.firstChild),this.idPull[arrow.id]=arrow},dhtmlXMenuObject.prototype._addDownArrow=function(id){var main_self=this,arrow=document.createElement("DIV");arrow.pId=this.idPrefix+id,arrow.id="arrowdown_"+this.idPrefix+id,arrow.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowDown",arrow.innerHTML="<div class='dhtmlxMenu_"+this.skin+"_SubLevelArea_Arrow'><div class='dhtmlxMenu_SubLevelArea_Arrow_Icon'></div></div>",arrow.style.display="none",arrow.over=!1,arrow.onselectstart=function(e){return e=e||event,e.returnValue=!1,!1},arrow.oncontextmenu=function(e){return e=e||event,e.returnValue=!1,!1},arrow.onmouseover=function(){"web"==main_self.menuMode&&window.clearTimeout(main_self.menuTimeoutHandler),main_self._clearAllSelectedSubItemsInPolygon(this.pId),this.className!="dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowDown_Disabled"&&(this.className="dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowDown_Over",this.over=!0,main_self._canScrollDown=!0,main_self._doScrollDown(this.pId,!0))},arrow.onmouseout=function(){"web"==main_self.menuMode&&(window.clearTimeout(main_self.menuTimeoutHandler),main_self.menuTimeoutHandler=window.setTimeout(function(){main_self._clearAndHide()},main_self.menuTimeoutMsec,"JavaScript")),this.over=!1,main_self._canScrollDown=!1,this.className!="dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowDown_Disabled"&&(this.className="dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowDown",window.clearTimeout(main_self._scrollDownTM))},arrow.onclick=function(e){return e=e||event,e.returnValue=!1,e.cancelBubble=!0,!1},document.body.insertBefore(arrow,document.body.firstChild),this.idPull[arrow.id]=arrow},dhtmlXMenuObject.prototype._removeUpArrow=function(id){var fullId="arrowup_"+this.idPrefix+id;this._removeArrow(fullId)},dhtmlXMenuObject.prototype._removeDownArrow=function(id){var fullId="arrowdown_"+this.idPrefix+id;this._removeArrow(fullId)},dhtmlXMenuObject.prototype._removeArrow=function(fullId){var arrow=this.idPull[fullId];arrow.onselectstart=null,arrow.oncontextmenu=null,arrow.onmouseover=null,arrow.onmouseout=null,arrow.onclick=null,arrow.parentNode&&arrow.parentNode.removeChild(arrow),arrow=null,this.idPull[fullId]=null;try{delete this.idPull[fullId]}catch(e){}},dhtmlXMenuObject.prototype._isArrowExists=function(id){return null!=this.idPull["arrowup_"+id]&&null!=this.idPull["arrowdown_"+id]},dhtmlXMenuObject.prototype._doScrollUp=function(id,checkArrows){var polygon=this.idPull["polygon_"+id];if(this._canScrollUp&&polygon.scrollTop>0){var theEnd=!1,nextScrollTop=polygon.scrollTop-this._scrollUpTMStep;if(0>nextScrollTop&&(theEnd=!0,nextScrollTop=0),polygon.scrollTop=nextScrollTop,!theEnd){var that=this;this._scrollUpTM=window.setTimeout(function(){that._doScrollUp(id,!1)},this._scrollUpTMTime)}}else this._canScrollUp=!1,this._checkArrowsState(id);checkArrows&&this._checkArrowsState(id)},dhtmlXMenuObject.prototype._doScrollDown=function(id,checkArrows){var polygon=this.idPull["polygon_"+id];if(this._canScrollDown&&polygon.scrollTop+polygon.offsetHeight<=polygon.scrollHeight){var theEnd=!1,nextScrollTop=polygon.scrollTop+this._scrollDownTMStep;if(nextScrollTop+polygon.offsetHeight>polygon.scollHeight&&(theEnd=!0,nextScrollTop=polygon.scollHeight-polygon.offsetHeight),polygon.scrollTop=nextScrollTop,!theEnd){var that=this;this._scrollDownTM=window.setTimeout(function(){that._doScrollDown(id,!1)},this._scrollDownTMTime)}}else this._canScrollDown,this._checkArrowsState(id);checkArrows&&this._checkArrowsState(id)},dhtmlXMenuObject.prototype._countPolygonItems=function(id){var count=0;for(var a in this.itemPull){var par=this.itemPull[a].parent,tp=this.itemPull[a].type;par!=this.idPrefix+id||"item"!=tp&&"radio"!=tp&&"checkbox"!=tp||count++}return count},dhtmlXMenuObject.prototype.setOverflowHeight=function(itemsNum){if("auto"===itemsNum)return this.limit=0,void(this.autoOverflow=!0);if(!(0==this.limit&&0>=itemsNum)){if(this._clearAndHide(),this.limit>=0&&itemsNum>0)return void(this.limit=itemsNum);if(this.limit>0&&0>=itemsNum){for(var a in this.itemPull)if(this._isArrowExists(a)){var b=String(a).replace(this.idPrefix,"");this._removeUpArrow(b),this._removeDownArrow(b),this.idPull["polygon_"+a].style.height=""}return void(this.limit=0)}}},dhtmlXMenuObject.prototype._getRadioImgObj=function(id){try{var imgObj=this.idPull[this.idPrefix+id].childNodes[this._rtl?2:0].childNodes[0]}catch(e){var imgObj=null}return imgObj},dhtmlXMenuObject.prototype._setRadioState=function(id,state){var imgObj=this._getRadioImgObj(id);if(null!=imgObj){var rObj=this.itemPull[this.idPrefix+id];rObj.checked=state,rObj.imgen="rdbt_"+(rObj.checked?"1":"0"),rObj.imgdis=rObj.imgen,imgObj.className="sub_icon "+rObj.imgen}},dhtmlXMenuObject.prototype._radioOnClickHandler=function(id,type,casState){if("d"!=type.charAt(1)&&null!=this.itemPull[this.idPrefix+id].group){var group=this.itemPull[this.idPrefix+id].group;this.checkEvent("onRadioClick")?this.callEvent("onRadioClick",[group,this.getRadioChecked(group),id,this.contextMenuZoneId,casState])&&this.setRadioChecked(group,id):this.setRadioChecked(group,id),this.checkEvent("onClick")&&this.callEvent("onClick",[id])}},dhtmlXMenuObject.prototype.getRadioChecked=function(group){for(var id=null,q=0;q<this.radio[group].length;q++){var itemId=this.radio[group][q].replace(this.idPrefix,""),imgObj=this._getRadioImgObj(itemId);if(null!=imgObj){var checked=imgObj.className.match(/rdbt_1$/gi);null!=checked&&(id=itemId)}}return id},dhtmlXMenuObject.prototype.setRadioChecked=function(group,id){if(null!=this.radio[group])for(var q=0;q<this.radio[group].length;q++){var itemId=this.radio[group][q].replace(this.idPrefix,"");this._setRadioState(itemId,itemId==id)}},dhtmlXMenuObject.prototype.addRadioButton=function(mode,nextToId,pos,itemId,itemText,group,state,disabled){if(this.context&&nextToId==this.topId);else{if(null==this.itemPull[this.idPrefix+nextToId])return;if("child"==mode&&"item"!=this.itemPull[this.idPrefix+nextToId].type)return}var id=this.idPrefix+(null!=itemId?itemId:this._genStr(24)),img="rdbt_"+(state?"1":"0"),imgDis=img;if("sibling"==mode){var parentId=this.idPrefix+this.getParentId(nextToId);this._addItemIntoGlobalStrorage(id,parentId,itemText,"radio",disabled,img,imgDis),this._renderSublevelItem(id,this.getItemPosition(nextToId))}else{var parentId=this.idPrefix+nextToId;this._addItemIntoGlobalStrorage(id,parentId,itemText,"radio",disabled,img,imgDis),null==this.idPull["polygon_"+parentId]&&this._renderSublevelPolygon(parentId,parentId),this._renderSublevelItem(id,pos-1),this._redefineComplexState(parentId)}var gr=null!=group?group:this._genStr(24);this.itemPull[id].group=gr,null==this.radio[gr]&&(this.radio[gr]=new Array),this.radio[gr][this.radio[gr].length]=id,1==state&&this.setRadioChecked(gr,String(id).replace(this.idPrefix,""))},dhtmlXMenuObject.prototype._getCheckboxState=function(id){return null==this.itemPull[this.idPrefix+id]?null:this.itemPull[this.idPrefix+id].checked},dhtmlXMenuObject.prototype._setCheckboxState=function(id,state){null!=this.itemPull[this.idPrefix+id]&&(this.itemPull[this.idPrefix+id].checked=state)},dhtmlXMenuObject.prototype._updateCheckboxImage=function(id){if(null!=this.idPull[this.idPrefix+id]){this.itemPull[this.idPrefix+id].imgen="chbx_"+(this._getCheckboxState(id)?"1":"0"),this.itemPull[this.idPrefix+id].imgdis=this.itemPull[this.idPrefix+id].imgen;try{this.idPull[this.idPrefix+id].childNodes[this._rtl?2:0].childNodes[0].className="sub_icon "+this.itemPull[this.idPrefix+id].imgen}catch(e){}}},dhtmlXMenuObject.prototype._checkboxOnClickHandler=function(id,type,casState){if("d"!=type.charAt(1)&&null!=this.itemPull[this.idPrefix+id]){var state=this._getCheckboxState(id);this.checkEvent("onCheckboxClick")?this.callEvent("onCheckboxClick",[id,state,this.contextMenuZoneId,casState])&&this.setCheckboxState(id,!state):this.setCheckboxState(id,!state),this.checkEvent("onClick")&&this.callEvent("onClick",[id])}},dhtmlXMenuObject.prototype.setCheckboxState=function(id,state){this._setCheckboxState(id,state),this._updateCheckboxImage(id)},dhtmlXMenuObject.prototype.getCheckboxState=function(id){return this._getCheckboxState(id)},dhtmlXMenuObject.prototype.addCheckbox=function(mode,nextToId,pos,itemId,itemText,state,disabled){if(this.context&&nextToId==this.topId);else{if(null==this.itemPull[this.idPrefix+nextToId])return;if("child"==mode&&"item"!=this.itemPull[this.idPrefix+nextToId].type)return}var img="chbx_"+(state?"1":"0"),imgDis=img;if("sibling"==mode){var id=this.idPrefix+(null!=itemId?itemId:this._genStr(24)),parentId=this.idPrefix+this.getParentId(nextToId);this._addItemIntoGlobalStrorage(id,parentId,itemText,"checkbox",disabled,img,imgDis),this.itemPull[id].checked=state,this._renderSublevelItem(id,this.getItemPosition(nextToId))}else{var id=this.idPrefix+(null!=itemId?itemId:this._genStr(24)),parentId=this.idPrefix+nextToId;this._addItemIntoGlobalStrorage(id,parentId,itemText,"checkbox",disabled,img,imgDis),this.itemPull[id].checked=state,null==this.idPull["polygon_"+parentId]&&this._renderSublevelPolygon(parentId,parentId),this._renderSublevelItem(id,pos-1),this._redefineComplexState(parentId)}},dhtmlXMenuObject.prototype._readLevel=function(parentId){var xml="";for(var a in this.itemPull)if(this.itemPull[a].parent==parentId){
var imgEn="",imgDis="",hotKey="",itemId=String(this.itemPull[a].id).replace(this.idPrefix,""),itemType="",itemText=""!=this.itemPull[a].title?' text="'+this.itemPull[a].title+'"':"",itemState="";"item"==this.itemPull[a].type&&(""!=this.itemPull[a].imgen&&(imgEn=' img="'+this.itemPull[a].imgen+'"'),""!=this.itemPull[a].imgdis&&(imgDis=' imgdis="'+this.itemPull[a].imgdis+'"'),""!=this.itemPull[a].hotkey&&(hotKey="<hotkey>"+this.itemPull[a].hotkey+"</hotkey>")),"separator"==this.itemPull[a].type?itemType=' type="separator"':"disabled"==this.itemPull[a].state&&(itemState=' enabled="false"'),"checkbox"==this.itemPull[a].type&&(itemType=' type="checkbox"'+(this.itemPull[a].checked?' checked="true"':"")),"radio"==this.itemPull[a].type&&(itemType=' type="radio" group="'+this.itemPull[a].group+'" '+(this.itemPull[a].checked?' checked="true"':"")),xml+="<item id='"+itemId+"'"+itemText+itemType+imgEn+imgDis+itemState+">",xml+=hotKey,this.itemPull[a].complex&&(xml+=this._readLevel(a)),xml+="</item>"}return xml},dhtmlXMenuObject.prototype.serialize=function(){var xml="<menu>"+this._readLevel(this.idPrefix+this.topId)+"</menu>";return xml},"function"==typeof egw&&egw(window).includeCSS(egw.webserverUrl+"/phpgwapi/js/egw_action/test/skins/dhtmlxmenu_egw.css"),egwMenuImpl.prototype._translateStructure=function(_structure,_parentId,_idCnt){for(var counter=0,last_id=null,i=0;i<_structure.length;i++){var elem=_structure[i],id=elem.id||"elem_"+(_idCnt+counter);if(counter++,"-"==elem.caption&&null!=last_id)this.dhtmlxmenu.addNewSeparator(last_id,id);else{if(elem.checkbox&&0===elem.groupIndex)this.dhtmlxmenu.addCheckbox("child",_parentId,i,id,elem.caption,elem.checked,!elem.enabled);else if(elem.checkbox&&elem.groupIndex>0)elem._dhtmlx_grpid="grp_"+_idCnt+"_"+elem.groupIndex,this.dhtmlxmenu.addRadioButton("child",_parentId,i,id,elem.caption,elem._dhtmlx_grpid,elem.checked,!elem.enabled);else{var caption=elem.caption;elem.default&&(caption="<b>"+caption+"</b>"),this.dhtmlxmenu.addNewChild(_parentId,i,id,caption,!elem.enabled,elem.iconUrl,elem.iconUrl)}null!=elem.shortcutCaption&&this.dhtmlxmenu.setHotKey(id,elem.shortcutCaption),elem.children.length>0&&(counter+=this._translateStructure(elem.children,id,_idCnt+counter))}this.dhtmlxmenu.setUserData(id,"egw_menu",elem),elem.hint&&this.dhtmlxmenu.setTooltip(id,elem.hint);var last_id=id}return counter},egwMenuImpl.prototype.showAt=function(_x,_y,_onHide){var self=this;_onHide&&this.dhtmlxmenu.attachEvent("onHide",function(id){null===id&&_onHide()});var self=this;window.setTimeout(function(){self.dhtmlxmenu.showContextMenu(_x,_y)},0)},egwMenuImpl.prototype.hide=function(){this.dhtmlxmenu.hide()},function(){var SelectParser;SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(child){return"OPTGROUP"===child.nodeName.toUpperCase()?this.add_group(child):this.add_option(child)},SelectParser.prototype.add_group=function(group){var group_position,option,_i,_len,_ref,_results;for(group_position=this.parsed.length,this.parsed.push({array_index:group_position,group:!0,label:this.escapeExpression(group.label),children:0,disabled:group.disabled}),_ref=group.childNodes,_results=[],_i=0,_len=_ref.length;_len>_i;_i++)option=_ref[_i],_results.push(this.add_option(option,group_position,group.disabled));return _results},SelectParser.prototype.add_option=function(option,group_position,group_disabled){return"OPTION"===option.nodeName.toUpperCase()?(""!==option.text?(null!=group_position&&(this.parsed[group_position].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,selected:option.selected,disabled:group_disabled===!0?group_disabled:option.disabled,group_array_index:group_position,classes:option.className,style:option.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(text){var map,unsafe_chars;return null==text||text===!1?"":/[\&\<\>\"\'\`]/.test(text)?(map={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g,text.replace(unsafe_chars,function(chr){return map[chr]||"&amp;"})):text},SelectParser}(),SelectParser.select_to_array=function(select){var child,parser,_i,_len,_ref;for(parser=new SelectParser,_ref=select.childNodes,_i=0,_len=_ref.length;_len>_i;_i++)child=_ref[_i],parser.add_node(child);return parser.parsed},this.SelectParser=SelectParser}.call(this),function(){var AbstractChosen,root;root=this,AbstractChosen=function(){function AbstractChosen(form_field,options){this.form_field=form_field,this.options=null!=options?options:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup())}return AbstractChosen.prototype.set_default_values=function(){var _this=this;return this.click_test_action=function(evt){return _this.test_active_click(evt)},this.activate_action=function(evt){return _this.activate_field(evt)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=this.options.single_backstroke_delete||!1,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1},AbstractChosen.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(evt){var _this=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return _this.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(evt){var _this=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return _this.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(options){var content,data,_i,_len,_ref;for(content="",_ref=this.results_data,_i=0,_len=_ref.length;_len>_i;_i++)data=_ref[_i],data.group&&(data.search_match||data.group_match)?content+=this.result_add_group(data):!data.empty&&data.search_match&&(content+=this.result_add_option(data)),(null!=options?options.first:void 0)&&(data.selected&&this.is_multiple?this.choice_build(data):data.selected&&!this.is_multiple&&this.single_set_selected_text(data.text));return content},AbstractChosen.prototype.result_add_option=function(option){var classes,style;return classes=[],option.disabled||option.selected&&this.is_multiple||classes.push("active-result"),!option.disabled||option.selected&&this.is_multiple||classes.push("disabled-result"),option.selected&&classes.push("result-selected"),null!=option.group_array_index&&classes.push("group-option"),""!==option.classes&&classes.push(option.classes),style=""!==option.style.cssText?' style="'+option.style+'"':"",'<li class="'+classes.join(" ")+'"'+style+' data-option-array-index="'+option.array_index+'">'+option.search_text+"</li>"},AbstractChosen.prototype.result_add_group=function(group){return'<li class="group-result">'+group.search_text+"</li>"},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(evt){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var option,regex,regexAnchor,results,searchText,startpos,text,zregex,_i,_len,_ref;for(this.no_results_clear(),results=0,searchText=this.get_search_text(),regexAnchor=this.search_contains?"":"^",regex=new RegExp(regexAnchor+searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),zregex=new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),_ref=this.results_data,_i=0,_len=_ref.length;_len>_i;_i++)option=_ref[_i],option.empty||(option.group&&(option.group_match=!1),option.group&&!this.group_search||(option.search_match=!1,option.search_text=option.group?option.label:option.html,option.search_match=this.search_string_match(option.search_text,regex),option.search_match&&(results+=1),option.search_match?(searchText.length&&(startpos=option.search_text.search(zregex),text=option.search_text.substr(0,startpos+searchText.length)+"</em>"+option.search_text.substr(startpos+searchText.length),option.search_text=text.substr(0,startpos)+"<em>"+text.substr(startpos)),null!=option.group_array_index&&(this.results_data[option.group_array_index].group_match=!0)):null!=option.group_array_index&&this.results_data[option.group_array_index].search_match&&(option.search_match=!0)));return 1>results&&searchText.length?(this.update_results_content(""),this.result_clear_highlight(),this.no_results(searchText)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.search_string_match=function(search_string,regex){var part,parts,_i,_len;if(regex.test(search_string))return!0;if(this.enable_split_word_search&&(search_string.indexOf(" ")>=0||0===search_string.indexOf("["))&&(parts=search_string.replace(/\[|\]/g,"").split(" "),parts.length))for(_i=0,_len=parts.length;_len>_i;_i++)if(part=parts[_i],regex.test(part))return!0},AbstractChosen.prototype.choices_count=function(){var option,_i,_len,_ref;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,_ref=this.form_field.options,_i=0,_len=_ref.length;_len>_i;_i++)option=_ref[_i],option.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(evt){return evt.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(evt){var stroke,_ref;switch(stroke=null!=(_ref=evt.which)?_ref:evt.keyCode,this.search_field_scale(),stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(evt.preventDefault(),this.results_showing)return this.result_select(evt);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.generate_field_id=function(){return this.generate_random_id()},AbstractChosen.browser_is_supported=function(){var _ref;return"Microsoft Internet Explorer"===window.navigator.appName?null!==(_ref=document.documentMode)&&_ref>=8:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),root.AbstractChosen=AbstractChosen}.call(this),function(){var $,Chosen,root,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};root=this,$=jQuery,$.fn.extend({chosen:function(options){return AbstractChosen.browser_is_supported()?this.each(function(input_field){var $this;return $this=$(this),$this.hasClass("chzn-done")?void 0:$this.data("chosen",new Chosen(this,options))}):this},unchosen:function(){return $(this).each(function(input_field){var chosen,element;return element=$(this),chosen=element.data("chosen"),chosen&&(chosen.remove(),element.data("chosen",null)),element})}}),Chosen=function(_super){function Chosen(){return _ref=Chosen.__super__.constructor.apply(this,arguments)}return __extends(Chosen,_super),Chosen.prototype.setup=function(){return this.form_field_jq=$(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},Chosen.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},Chosen.prototype.set_up_html=function(){var container_classes,container_props;return container_classes=["chzn-container"],container_classes.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&container_classes.push(this.form_field.className),this.is_rtl&&container_classes.push("chzn-rtl"),container_props={class:container_classes.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(container_props.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chzn"),this.container=$("<div />",container_props),this.is_multiple?this.container.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop"><ul class="chzn-results"></ul></div>'):this.container.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chzn-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var _this=this;return this.container.mousedown(function(evt){_this.container_mousedown(evt)}),this.container.mouseup(function(evt){_this.container_mouseup(evt)}),this.container.mouseenter(function(evt){_this.mouse_enter(evt)}),this.container.mouseleave(function(evt){_this.mouse_leave(evt)}),this.search_results.mouseup(function(evt){_this.search_results_mouseup(evt)}),this.search_results.mouseover(function(evt){_this.search_results_mouseover(evt)}),this.search_results.mouseout(function(evt){_this.search_results_mouseout(evt)}),this.search_results.bind("mousewheel DOMMouseScroll",function(evt){_this.search_results_mousewheel(evt)}),this.form_field_jq.bind("liszt:updated",function(evt){_this.results_update_field(evt)}),this.form_field_jq.bind("liszt:activate",function(evt){_this.activate_field(evt)}),this.form_field_jq.bind("liszt:open",function(evt){_this.container_mousedown(evt)}),this.search_field.blur(function(evt){_this.input_blur(evt)}),this.search_field.keyup(function(evt){_this.keyup_checker(evt)}),this.search_field.keydown(function(evt){_this.keydown_checker(evt)}),this.search_field.focus(function(evt){_this.input_focus(evt)}),this.is_multiple?this.search_choices.click(function(evt){_this.choices_click(evt)}):this.container.click(function(evt){evt.preventDefault()})},Chosen.prototype.unregister_observers=function(){return this.form_field_jq.unbind()},Chosen.prototype.remove_html=function(){return this.form_field_jq.show().removeClass("chzn-done"),this.container.remove()},Chosen.prototype.unregister_observers=function(){return this.form_field_jq.unbind()},Chosen.prototype.remove_html=function(){return this.form_field_jq.show().removeClass("chzn-done"),this.container.remove()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field()):(this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus",this.activate_action))},Chosen.prototype.container_mousedown=function(evt){return this.is_disabled||(evt&&"mousedown"===evt.type&&!this.results_showing&&evt.preventDefault(),null!=evt&&$(evt.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!evt||$(evt.target)[0]!==this.selected_item[0]&&!$(evt.target).parents("a.chzn-single").length||(evt.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),$(document).click(this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(evt){return"ABBR"!==evt.target.nodeName||this.is_disabled?void 0:this.results_reset(evt)},Chosen.prototype.search_results_mousewheel=function(evt){var delta,_ref1,_ref2;return delta=-(null!=(_ref1=evt.originalEvent)?_ref1.wheelDelta:void 0)||(null!=(_ref2=evt.originialEvent)?_ref2.detail:void 0),null!=delta?(evt.preventDefault(),"DOMMouseScroll"===evt.type&&(delta=40*delta),this.search_results.scrollTop(delta+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(evt){return!this.active_field&&this.container.hasClass("chzn-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return $(document).unbind("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(evt){return this.container.is($(evt.target).closest(".chzn-container"))?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=root.SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chzn-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chzn-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){if(this.result_clear_highlight(),this.result_highlight=el,this.result_highlight.addClass("highlighted"),maxHeight=parseInt(this.search_results.css("maxHeight"),10),visible_top=this.search_results.scrollTop(),visible_bottom=maxHeight+visible_top,high_top=this.result_highlight.position().top+this.search_results.scrollTop(),high_bottom=high_top+this.result_highlight.outerHeight(),high_bottom>=visible_bottom)return this.search_results.scrollTop(high_bottom-maxHeight>0?high_bottom-maxHeight:0);if(visible_top>high_top)return this.search_results.scrollTop(high_top)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count())return this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1;this.container.addClass("chzn-with-drop"),this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this});var windowHeight=$(window).height(),dropdownTop=this.container.offset().top+this.container.height()-$(window).scrollTop();return totalHeight=this.dropdown.height()+dropdownTop,this.dropdown.toggleClass("chzn-above",totalHeight>windowHeight),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},Chosen.prototype.update_results_content=function(content){return this.search_results.html(content)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chzn-with-drop"),this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.reset_tab_index=function(){var tabbed_item;return tabbed_item=this.is_multiple?this.search_field:this.selected_item,this.form_field_jq.attr("tabindex",tabbed_item.attr("tabindex")),tabbed_item.attr("tabindex")-1},Chosen.prototype.set_tab_index=function(el){var ti;return this.form_field_jq.attr("tabindex")?(ti=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.search_field.attr("tabindex",ti)):void 0},Chosen.prototype.set_label_behavior=function(){var _this=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=$("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.click(function(evt){return _this.is_multiple?_this.container_mousedown(evt):_this.activate_field()}):void 0},Chosen.prototype.reset_tab_index=function(){var tabbed_item;return tabbed_item=this.is_multiple?this.search_field:this.selected_item,this.form_field_jq.attr("tabindex",tabbed_item.attr("tabindex")),tabbed_item.attr("tabindex")-1},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(evt){var target;return target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first(),target.length?(this.result_highlight=target,this.result_select(evt),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(evt){var target;return target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first(),target?this.result_do_highlight(target):void 0},Chosen.prototype.search_results_mouseout=function(evt){return $(evt.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(item){var choice,close_link,_this=this;return choice=$("<li />",{class:"search-choice"}).html("<span>"+item.html+"</span>"),item.disabled?choice.addClass("search-choice-disabled"):(close_link=$("<a />",{href:"#",class:"search-choice-close",rel:item.array_index}),close_link.click(function(evt){return _this.choice_destroy_link_click(evt)}),choice.append(close_link)),this.search_container.before(choice)},Chosen.prototype.choice_destroy_link_click=function(evt){return evt.preventDefault(),evt.stopPropagation(),this.is_disabled?void 0:this.choice_destroy($(evt.target))},Chosen.prototype.choice_destroy=function(link){return this.result_deselect(link.attr("rel"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),link.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.form_field.options[0].selected=!0,this.selected_option_count=null,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(evt){var high,item;return this.result_highlight?(high=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(this.is_multiple?high.removeClass("active-result"):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=high),high.addClass("result-selected"),item=this.results_data[high[0].getAttribute("data-option-array-index")],item.selected=!0,this.form_field.options[item.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(item):this.single_set_selected_text(item.text),(evt.metaKey||evt.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[item.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(text){return null==text&&(text=this.default_text),text===this.default_text?this.selected_item.addClass("chzn-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chzn-default")),this.selected_item.find("span").text(text)},Chosen.prototype.result_deselect=function(pos){var result_data;return result_data=this.results_data[pos],this.form_field.options[result_data.options_index].disabled?!1:(result_data.selected=!1,this.form_field.options[result_data.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[result_data.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chzn-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":$("<div/>").text($.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var do_high,selected_results;return selected_results=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),do_high=selected_results.length?selected_results.first():this.search_results.find(".active-result").first(),null!=do_high?this.result_do_highlight(do_high):void 0},Chosen.prototype.no_results=function(terms){var no_results_html;return no_results_html=$('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),no_results_html.find("span").first().html(terms),this.search_results.append(no_results_html)},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.remove=function(){return this.reset_tab_index(),this.unregister_observers(),this.remove_html()},Chosen.prototype.keydown_arrow=function(){var next_sib;return this.results_showing&&this.result_highlight?(next_sib=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(next_sib):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var prev_sibs;return this.results_showing||this.is_multiple?this.result_highlight?(prev_sibs=this.result_highlight.prevAll("li.active-result"),prev_sibs.length?this.result_do_highlight(prev_sibs.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var next_available_destroy;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(next_available_destroy=this.search_container.siblings("li.search-choice").last(),next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")?(this.pending_backstroke=next_available_destroy,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(evt){var stroke,_ref1;switch(stroke=null!=(_ref1=evt.which)?_ref1:evt.keyCode,this.search_field_scale(),8!==stroke&&this.pending_backstroke&&this.clear_backstroke(),stroke){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(evt),this.mouse_on_container=!1;break;case 13:evt.preventDefault();break;case 38:evt.preventDefault(),this.keyup_arrow();break;case 40:evt.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var div,f_width,h,style,style_block,styles,w,_i,_len;if(this.is_multiple){for(h=0,w=0,style_block="position:absolute; left: -1000px; top: -1000px; display:none;",styles=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],_i=0,_len=styles.length;_len>_i;_i++)style=styles[_i],style_block+=style+":"+this.search_field.css(style)+";";return div=$("<div />",{style:style_block}),div.text(this.search_field.val()),$("body").append(div),w=div.width()+25,div.remove(),f_width=this.container.outerWidth(),w>f_width-10&&(w=f_width-10),this.search_field.css({width:w+"px"})}},Chosen}(AbstractChosen),root.Chosen=Chosen}.call(this),CKEDITOR.editorConfig=function(config){};
//# sourceMappingURL=jsapi.min.js.map