MFNamespace("MFWA.Configurations",function(i){var c;var e=MFNamespace("MFWA.Data.Cache");var a=MFNamespace("MFWA.Data.Operations");var h=MFNamespace("MFWA.SettingsTree");var g=MFNamespace("MFWA.Dialogs.Alerts");var j=MFNamespace("MFWA.I18n.Settings");var d=MFNamespace("MFWA.I18n.TaskPane");var f=MFNamespace("MFWA.Layout");var b=function(){$("#txtDefaultViewID").val("");if($("#gotoItemSel").val()=="other"){$("#txtDefaultViewID").css("display","block")}else{$("#txtDefaultViewID").css("display","none")}};return{fetch:function(k,l){e.getConfigurations(k,function(m){c=m;i.TaskPane=c.TaskPane;i.ViewAndModifyOptions=c.TaskPane.ViewAndModifyOptions;i.Controls=c.Controls;i.Navigation=c.Navigation;i.LayOut=m.VaultLevel.LayOut;if(!c.Navigation.ShowBreadCrumb){$("#menubar").parent().css("background-image",'url("Images/menu_gradient.png")');$("#menubar").css("background-image",'url("Images/onlymenu_background.png")')}if(l){l()}})},ShowSelectedConfiguration:function(k){$("#configNavigation").css("display","none");$("#configTaskPane").css("display","none");$("#configControls").css("display","none");$("#configvault").css("display","none");$("#configAllValuts").css("display","none");$("#config"+k).css("display","block");if($("#"+k)){var m=$("#taskpane").attr("guid");var l=i.LoadSavedValues(m,k)}},DisableConfigPage:function(k){$("#rightPanel").children().css("display","none");if($("#accessMessage")[0]){$("#accessMessage").css("display","block")}else{$("#rightPanel").append("<div id='accessMessage' class='error'>"+k.Message+"</div>")}},LoadSavedValues:function(k,l){MFWA.Data.Cache.isLoggedInToApplication(function(m){if(m.Value==true){$("#rightPanel").children().css("display","block");$("#accessMessage").css("display","none");e.getConfigurations(k,function(r){if(l=="Navigation"){if(r.Navigation.ShowTopMenu){$("#topMenuShow")[0].checked=true}else{$("#topMenuHide")[0].checked=true}if(r.Navigation.ShowBreadCrumb){$("#breadCrumbShow")[0].checked=true}else{$("#breadCrumbHide")[0].checked=true}$("#lastModified").html(r.Navigation.ModifiedDate)}else{if(l=="TaskPane"){if(r.TaskPane.ShowNew){$("#showNew")[0].checked=true}else{$("#hideNew")[0].checked=true}if(r.TaskPane.ShowWorkFlow){$("#showState")[0].checked=true}else{$("#hideState")[0].checked=true}$("#lastModified").html(r.TaskPane.ModifiedDate);var o=$("#configTaskPane").find(".taskPaneItems input:radio");for(var n=0;n<o.length;n=n+2){if(r.TaskPane.ViewAndModifyOptions[o[n].name]){$("#show"+o[n].name)[0].checked=true}else{$("#hide"+o[n].name)[0].checked=true}}var p=$("#configTaskPane").find(".gotoItems input:radio");for(var n=0;n<p.length;n=n+2){if(r.TaskPane.GotoOptions[p[n].name]){$("#show"+p[n].name.replace("/","view"))[0].checked=true}else{$("#hide"+p[n].name.replace("/","view"))[0].checked=true}}}else{if(l=="Controls"){$("#lastModified").html(r.Controls.ModifiedDate);if(r.Controls.CanSaveColumnSettings){$("#showAllowColumn")[0].checked=true}else{$("#hideAllowColumn")[0].checked=true}if(r.Controls.ShowDocumentCard){$("#showDocumentCard")[0].checked=true}else{$("#hideDocumentCard")[0].checked=true}if(r.Controls.ShowWorkFlowLinkInPropPane){$("#showWorkFlowLink")[0].checked=true}else{$("#hideWorkFlowLink")[0].checked=true}if(r.Controls.ShowContextMenu){$("#showContextMenu")[0].checked=true}else{$("#hideContextMenu")[0].checked=true}if(r.Controls.ShowCheckoutDialog){$("#showCheckoutDlg")[0].checked=true}else{$("#hideCheckoutDlg")[0].checked=true}if(r.Controls.ShowAdvancedSearch){$("#showAdvancedSearch")[0].checked=true}else{$("#hideAdvancedSearch")[0].checked=true}if(r.Controls.ShowHiddenProperties){$("#showHiddenProp")[0].checked=true}else{$("#hideHiddenProp")[0].checked=true}}else{if(l=="general"){e.getOnlineVaultsList(function(u){var t="<option value=''> </option>";for(var s in u){t+='<option value="'+u[s].GUID+'">'+u[s].Name+"</option>"}$("#selectVaults").html(t);$("#selectVaults").val(r.SystemLevel.VaultGUID)});$("#lastModified").html(r.SystemLevel.ModifiedDate);var q;if(r.SystemLevel.IpRange.length>0){q=r.SystemLevel.IpRange.split("/");$("#restrictAccess")[0].checked=true;$("#txtIpRange1").attr("disabled","");$("#txtIpRange2").attr("disabled","");$("#txtIpRange1").val(q[0]);$("#txtIpRange2").val(q[1])}else{$("#restrictAccess")[0].checked=false;$("#txtIpRange1").val("");$("#txtIpRange2").val("");$("#txtIpRange1").attr("disabled","disabled");$("#txtIpRange2").attr("disabled","disabled")}$("#autoLogin")[0].checked=r.SystemLevel.AutoLogin;$("#winauth")[0].checked=r.SystemLevel.LoginMode;$("#mfilesauth")[0].checked=!r.SystemLevel.LoginMode;$("#txtUserName").val(r.SystemLevel.UserName);$("#txtPassword").val(r.SystemLevel.Password);$("#txtDomain").val(r.SystemLevel.Domain);$("#chkForceMFilesUserLogin")[0].checked=r.SystemLevel.ForceMFilesUserLogin;$("#txtPageTitle").val(r.SystemLevel.PageTitle);if($("#chkForceMFilesUserLogin").is(":checked")){$("#winauth").attr("disabled","disabled")}if($("#autoLogin").is(":checked")){$("#winauth").attr("disabled","");$("#mfilesauth").attr("disabled","");$("#txtUserName").attr("disabled","");$("#txtPassword").attr("disabled","");$("#txtDomain").attr("disabled","");$("#selectVaults").attr("disabled","")}else{$("#winauth").attr("disabled","disabled");$("#mfilesauth").attr("disabled","disabled");$("#txtUserName").attr("disabled","disabled");$("#txtPassword").attr("disabled","disabled");$("#txtDomain").attr("disabled","disabled");$("#selectVaults").attr("disabled","disabled")}if($("#chkForceMFilesUserLogin").is(":checked")||$("#mfilesauth").is(":checked")){$("#txtDomain").val("");$("#txtDomain").attr("disabled","disabled");$("#winauth")[0].checked=false;$("#mfilesauth")[0].checked=true;$("#winauth").attr("disabled","disabled");$("#mfilesauth").attr("disabled","")}else{$("#winauth").attr("disabled","");$("#txtDomain").attr("disabled","")}}else{if(l=="vault"){$("#lastModified").html(r.VaultLevel.ModifiedDate);$("#chkVaultAccess")[0].checked=r.VaultLevel.EnableVaultAccess;$("#ddlLayout").val(r.VaultLevel.LayOut);e.getGotoItems(k,function(v){var t='<optgroup label="'+d.GoTo+'">';var u=false;var w="";for(var s in v){if(v[s].Visible){w=(v[s].Title.length)?v[s].Title:d.Root;t+='<option value="'+v[s].TargetPath+'">'+w+"</option>";if(r.VaultLevel.DefaultView==v[s].TargetPath){u=true}}}t+='</optgroup><option value="other">'+j.Options.Text.Other_UNENCODED+"</option>";$("#gotoItemSel").html(t);$("#gotoItemSel").bind("change",b);if(u){$("#gotoItemSel").val(r.VaultLevel.DefaultView);$("#txtDefaultViewID").val("");$("#txtDefaultViewID").css("display","none")}else{if(r.VaultLevel.DefaultView.length){$("#gotoItemSel").val("other");$("#txtDefaultViewID").val(r.VaultLevel.DefaultView.replace("/V",""));$("#txtDefaultViewID").css("display","block")}else{$("#gotoItemSel").val("/");$("#txtDefaultViewID").val("");$("#txtDefaultViewID").css("display","none")}}})}}}}}},function(n){MFWA.Configurations.DisableConfigPage(n)})}});f.resizeConfig()},SaveChanges:function(k,l){e.getConfigurations(k,function(p){if(l=="Navigation"){p.Navigation.ShowTopMenu=$("#topMenuShow")[0].checked;p.Navigation.ShowBreadCrumb=$("#breadCrumbShow")[0].checked;a.setConfigurations(k,l,p,function(){g.ShowNotification(j.Message.SettingsSaved)})}else{if(l=="TaskPane"){p.TaskPane.ShowNew=$("#showNew")[0].checked;p.TaskPane.ShowWorkFlow=$("#showState")[0].checked;var n=$("#configTaskPane").find(".taskPaneItems input:radio");for(var m=0;m<n.length;m=m+2){p.TaskPane.ViewAndModifyOptions[n[m].name]=$("#show"+n[m].name)[0].checked}var o=$("#configTaskPane").find(".gotoItems input:radio");for(var m=0;m<o.length;m=m+2){p.TaskPane.GotoOptions[o[m].name]=$("#show"+o[m].name.replace("/","view"))[0].checked}a.setConfigurations(k,l,p,function(){g.ShowNotification(j.Message.SettingsSaved)})}else{if(l=="Controls"){p.Controls.CanSaveColumnSettings=$("#showAllowColumn")[0].checked;p.Controls.ShowDocumentCard=$("#showDocumentCard")[0].checked;p.Controls.ShowWorkFlowLinkInPropPane=$("#showWorkFlowLink")[0].checked;p.Controls.ShowContextMenu=$("#showContextMenu")[0].checked;p.Controls.ShowCheckoutDialog=$("#showCheckoutDlg")[0].checked;p.Controls.ShowAdvancedSearch=$("#showAdvancedSearch")[0].checked;p.Controls.ShowHiddenProperties=$("#showHiddenProp")[0].checked;a.setConfigurations(k,l,p,function(){g.ShowNotification(j.Message.SettingsSaved)})}else{if(l=="general"){p.SystemLevel.AutoLogin=$("#autoLogin")[0].checked;p.SystemLevel.LoginMode=$("#winauth")[0].checked;p.SystemLevel.UserName=$("#txtUserName").val();p.SystemLevel.Password=$("#txtPassword").val();p.SystemLevel.Domain=$("#txtDomain").val();p.SystemLevel.VaultGUID=$("#selectVaults").val();p.SystemLevel.ForceMFilesUserLogin=$("#chkForceMFilesUserLogin")[0].checked;if($("#restrictAccess").is(":checked")){p.SystemLevel.IpRange=$("#txtIpRange1").val()+"/"+$("#txtIpRange2").val()}else{p.SystemLevel.IpRange="";$("#txtIpRange1").val("");$("#txtIpRange2").val("")}p.SystemLevel.PageTitle=$("#txtPageTitle").val();a.setConfigurations(k,l,p,function(){g.ShowNotification(j.Message.SettingsSaved)})}else{if(l=="vault"){p.VaultLevel.EnableVaultAccess=$("#chkVaultAccess")[0].checked;p.VaultLevel.LayOut=$("#ddlLayout").val();if($("#gotoItemSel").val()=="other"){p.VaultLevel.DefaultView="/V"+$("#txtDefaultViewID").val()}else{p.VaultLevel.DefaultView=$("#gotoItemSel").val()}a.setConfigurations(k,l,p,function(){g.ShowNotification(j.Message.SettingsSaved)})}}}}}})}}});MFNamespace("MFWA.Java",function(){var callbacks={};var id=0;var alerts=MFNamespace("MFWA.Dialogs.Alerts");var data=MFNamespace("MFWA.Data.Ajax");var debug=MFNamespace("MFWA.Debug");var createErrorBasicHandler=function(){return function(xhr){if(xhr.Status==403){window.location="login.aspx"}else{alerts.ShowError(xhr)}}};var callJava=function(methodName,okCallback,errCallback){var cbId="";id++;cbId=id+"";var errCallbackWrap=function(errObject){data.handleError(errObject,errCallback)};callbacks[cbId]={ok:okCallback,err:errCallbackWrap};var jsonParams=new Array(arguments.length-3);for(var i=0;i<arguments.length-3;i++){jsonParams[i]=JSON.stringify(arguments[i+3])}document.MFiles.callJavaMethod(methodName,cbId,JSON.stringify(jsonParams))};return{init:function(){},interopCBEndpoint:function(callbackId,params){if(callbacks[callbackId+""].ok!=null){callbacks[callbackId+""].ok(eval("("+params+")"))}callbacks[callbackId+""]=null},interopCBErrEndpoint:function(callbackId,params){callbacks[callbackId+""].err(eval("("+params+")"));callbacks[callbackId+""]=null},callJavaCallback:function(callbackIndex,callbackType,params){document.MFiles.callJavaCallback(callbackIndex,callbackType,params)},setText:function(text,callback,error){callJava("setText",callback,error,text)},setTexts:function(text,texts,callback,error){callJava("setTexts",callback,error,text,texts)},openFile:function(objectVersion,objectFile,callback,error){callJava("openFile",callback,error,objectVersion,objectFile)},getLocalFileSize:function(objectSize,callback,error){callJava("getLocalFileSize",callback,error,objectSize)},checkOut:function(objectVersion,callback,error){callJava("checkOut",callback,error,objectVersion)},makeCopy:function(objectVersion,objectFile,targetVersion,callback,error){callJava("makeCopy",callback,error,objectVersion,targetVersion)},checkIn:function(objectVersion,callback,error){callJava("checkIn",callback,error,objectVersion)},undoCheckout:function(objectVersion,callback,error){callJava("undoCheckout",callback,error,objectVersion)},forceUndoCheckout:function(objectVersion,callback,error){callJava("forceUndoCheckout",callback,error,objectVersion)},deleteObject:function(objectVersion,callback,error){callJava("deleteObject",callback,error,objectVersion)},removeTemporaryFile:function(objectVersion,callback,error){callJava("removeTemporaryFile",callback,error,objectVersion)},deleteFile:function(objectVersion,objectFile,callback,error){callJava("deleteFile",callback,error,objectVersion,objectFile)},renameFile:function(objectVersion,objectFile,newTitle,callback,error){callJava("renameFile",callback,error,objectVersion,objectFile,newTitle)},renameObject:function(objectVersion,newTitle,callback,error){callJava("renameObject",callback,error,objectVersion,newTitle)},setSingleFileObject:function(objectVersion,convertToSFD,callback,error){callJava("setSingleFileObject",callback,error,objectVersion,convertToSFD)},testError:function(callback,error){callJava("errorful",callback,error)},setTextInClipboard:function(text,callback,error){callJava("setTextInClipboard",callback,error,text)}}});function MFWAInteropCallEndpoint(methodName,paramsJson,callbackIndex,callbacksDefined){var javaCB=MFNamespace("MFWA.Java");var objects=(methodName+"").split(".");var method=window;var parent=window;for(var i=0;i<objects.length;i++){parent=method;method=method[objects[i]]}var paramArray=eval("("+paramsJson+")");if(!paramArray){paramArray=[]}if(callbacksDefined==1){paramArray.push(function(value){var param=JSON.stringify(value);return javaCB.callJavaCallback(callbackIndex,1,param)});paramArray.push(function(value){javaCB.callJavaCallback(callbackIndex,2,JSON.stringify(value))})}try{return method.apply(parent,paramArray)}catch(e){javaCB.callJavaCallback(callbackIndex,3,JSON.stringify(e))}}function MFWAInteropCBEndpoint(a,b){MFWA.Java.interopCBEndpoint(a,b)}function MFWAInteropCBErrorEndpoint(a,b){MFWA.Java.interopCBErrEndpoint(a,b)}var JSON=JSON||{};(function(){function f(n){return n<10?"0"+n:n}function f4(n){return n<100?n<10?"000"+n:"00"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"."+f4(this.getUTCMilliseconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
/*
 * jQuery JavaScript Library v1.5.1
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Wed Feb 23 13:55:29 2011 -0500
 */
(function(aY,H){var al=aY.document;var a=(function(){var bn=function(bI,bJ){return new bn.fn.init(bI,bJ,bl)},bD=aY.jQuery,bp=aY.$,bl,bH=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,bv=/\S/,br=/^\s+/,bm=/\s+$/,bq=/\d/,bj=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bw=/^[\],:{}\s]*$/,bF=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,by=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bs=/(?:^|:|,)(?:\s*\[)+/g,bh=/(webkit)[ \/]([\w.]+)/,bA=/(opera)(?:.*version)?[ \/]([\w.]+)/,bz=/(msie) ([\w.]+)/,bB=/(mozilla)(?:.*? rv:([\w.]+))?/,bG=navigator.userAgent,bE,bC=false,bk,e="then done fail isResolved isRejected promise".split(" "),bd,bu=Object.prototype.toString,bo=Object.prototype.hasOwnProperty,bi=Array.prototype.push,bt=Array.prototype.slice,bx=String.prototype.trim,be=Array.prototype.indexOf,bg={};bn.fn=bn.prototype={constructor:bn,init:function(bI,bM,bL){var bK,bN,bJ,bO;if(!bI){return this}if(bI.nodeType){this.context=this[0]=bI;this.length=1;return this}if(bI==="body"&&!bM&&al.body){this.context=al;this[0]=al.body;this.selector="body";this.length=1;return this}if(typeof bI==="string"){bK=bH.exec(bI);if(bK&&(bK[1]||!bM)){if(bK[1]){bM=bM instanceof bn?bM[0]:bM;bO=(bM?bM.ownerDocument||bM:al);bJ=bj.exec(bI);if(bJ){if(bn.isPlainObject(bM)){bI=[al.createElement(bJ[1])];bn.fn.attr.call(bI,bM,true)}else{bI=[bO.createElement(bJ[1])]}}else{bJ=bn.buildFragment([bK[1]],[bO]);bI=(bJ.cacheable?bn.clone(bJ.fragment):bJ.fragment).childNodes}return bn.merge(this,bI)}else{bN=al.getElementById(bK[2]);if(bN&&bN.parentNode){if(bN.id!==bK[2]){return bL.find(bI)}this.length=1;this[0]=bN}this.context=al;this.selector=bI;return this}}else{if(!bM||bM.jquery){return(bM||bL).find(bI)}else{return this.constructor(bM).find(bI)}}}else{if(bn.isFunction(bI)){return bL.ready(bI)}}if(bI.selector!==H){this.selector=bI.selector;this.context=bI.context}return bn.makeArray(bI,this)},selector:"",jquery:"1.5.1",length:0,size:function(){return this.length},toArray:function(){return bt.call(this,0)},get:function(bI){return bI==null?this.toArray():(bI<0?this[this.length+bI]:this[bI])},pushStack:function(bJ,bL,bI){var bK=this.constructor();if(bn.isArray(bJ)){bi.apply(bK,bJ)}else{bn.merge(bK,bJ)}bK.prevObject=this;bK.context=this.context;if(bL==="find"){bK.selector=this.selector+(this.selector?" ":"")+bI}else{if(bL){bK.selector=this.selector+"."+bL+"("+bI+")"}}return bK},each:function(bJ,bI){return bn.each(this,bJ,bI)},ready:function(bI){bn.bindReady();bk.done(bI);return this},eq:function(bI){return bI===-1?this.slice(bI):this.slice(bI,+bI+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bt.apply(this,arguments),"slice",bt.call(arguments).join(","))},map:function(bI){return this.pushStack(bn.map(this,function(bK,bJ){return bI.call(bK,bJ,bK)}))},end:function(){return this.prevObject||this.constructor(null)},push:bi,sort:[].sort,splice:[].splice};bn.fn.init.prototype=bn.fn;bn.extend=bn.fn.extend=function(){var bR,bK,bI,bJ,bO,bP,bN=arguments[0]||{},bM=1,bL=arguments.length,bQ=false;if(typeof bN==="boolean"){bQ=bN;bN=arguments[1]||{};bM=2}if(typeof bN!=="object"&&!bn.isFunction(bN)){bN={}}if(bL===bM){bN=this;--bM}for(;bM<bL;bM++){if((bR=arguments[bM])!=null){for(bK in bR){bI=bN[bK];bJ=bR[bK];if(bN===bJ){continue}if(bQ&&bJ&&(bn.isPlainObject(bJ)||(bO=bn.isArray(bJ)))){if(bO){bO=false;bP=bI&&bn.isArray(bI)?bI:[]}else{bP=bI&&bn.isPlainObject(bI)?bI:{}}bN[bK]=bn.extend(bQ,bP,bJ)}else{if(bJ!==H){bN[bK]=bJ}}}}}return bN};bn.extend({noConflict:function(bI){aY.$=bp;if(bI){aY.jQuery=bD}return bn},isReady:false,readyWait:1,ready:function(bI){if(bI===true){bn.readyWait--}if(!bn.readyWait||(bI!==true&&!bn.isReady)){if(!al.body){return setTimeout(bn.ready,1)}bn.isReady=true;if(bI!==true&&--bn.readyWait>0){return}bk.resolveWith(al,[bn]);if(bn.fn.trigger){bn(al).trigger("ready").unbind("ready")}}},bindReady:function(){if(bC){return}bC=true;if(al.readyState==="complete"){return setTimeout(bn.ready,1)}if(al.addEventListener){al.addEventListener("DOMContentLoaded",bd,false);aY.addEventListener("load",bn.ready,false)}else{if(al.attachEvent){al.attachEvent("onreadystatechange",bd);aY.attachEvent("onload",bn.ready);var bI=false;try{bI=aY.frameElement==null}catch(bJ){}if(al.documentElement.doScroll&&bI){bf()}}}},isFunction:function(bI){return bn.type(bI)==="function"},isArray:Array.isArray||function(bI){return bn.type(bI)==="array"},isWindow:function(bI){return bI&&typeof bI==="object"&&"setInterval" in bI},isNaN:function(bI){return bI==null||!bq.test(bI)||isNaN(bI)},type:function(bI){return bI==null?String(bI):bg[bu.call(bI)]||"object"},isPlainObject:function(bJ){if(!bJ||bn.type(bJ)!=="object"||bJ.nodeType||bn.isWindow(bJ)){return false}if(bJ.constructor&&!bo.call(bJ,"constructor")&&!bo.call(bJ.constructor.prototype,"isPrototypeOf")){return false}var bI;for(bI in bJ){}return bI===H||bo.call(bJ,bI)},isEmptyObject:function(bJ){for(var bI in bJ){return false}return true},error:function(bI){throw bI},parseJSON:function(bI){if(typeof bI!=="string"||!bI){return null}bI=bn.trim(bI);if(bw.test(bI.replace(bF,"@").replace(by,"]").replace(bs,""))){return aY.JSON&&aY.JSON.parse?aY.JSON.parse(bI):(new Function("return "+bI))()}else{bn.error("Invalid JSON: "+bI)}},parseXML:function(bK,bI,bJ){if(aY.DOMParser){bJ=new DOMParser();bI=bJ.parseFromString(bK,"text/xml")}else{bI=new ActiveXObject("Microsoft.XMLDOM");bI.async="false";bI.loadXML(bK)}bJ=bI.documentElement;if(!bJ||!bJ.nodeName||bJ.nodeName==="parsererror"){bn.error("Invalid XML: "+bK)}return bI},noop:function(){},globalEval:function(bK){if(bK&&bv.test(bK)){var bJ=al.head||al.getElementsByTagName("head")[0]||al.documentElement,bI=al.createElement("script");if(bn.support.scriptEval()){bI.appendChild(al.createTextNode(bK))}else{bI.text=bK}bJ.insertBefore(bI,bJ.firstChild);bJ.removeChild(bI)}},nodeName:function(bJ,bI){return bJ.nodeName&&bJ.nodeName.toUpperCase()===bI.toUpperCase()},each:function(bL,bP,bK){var bJ,bM=0,bN=bL.length,bI=bN===H||bn.isFunction(bL);if(bK){if(bI){for(bJ in bL){if(bP.apply(bL[bJ],bK)===false){break}}}else{for(;bM<bN;){if(bP.apply(bL[bM++],bK)===false){break}}}}else{if(bI){for(bJ in bL){if(bP.call(bL[bJ],bJ,bL[bJ])===false){break}}}else{for(var bO=bL[0];bM<bN&&bP.call(bO,bM,bO)!==false;bO=bL[++bM]){}}}return bL},trim:bx?function(bI){return bI==null?"":bx.call(bI)}:function(bI){return bI==null?"":bI.toString().replace(br,"").replace(bm,"")},makeArray:function(bL,bJ){var bI=bJ||[];if(bL!=null){var bK=bn.type(bL);if(bL.length==null||bK==="string"||bK==="function"||bK==="regexp"||bn.isWindow(bL)){bi.call(bI,bL)}else{bn.merge(bI,bL)}}return bI},inArray:function(bK,bL){if(bL.indexOf){return bL.indexOf(bK)}for(var bI=0,bJ=bL.length;bI<bJ;bI++){if(bL[bI]===bK){return bI}}return -1},merge:function(bM,bK){var bL=bM.length,bJ=0;if(typeof bK.length==="number"){for(var bI=bK.length;bJ<bI;bJ++){bM[bL++]=bK[bJ]}}else{while(bK[bJ]!==H){bM[bL++]=bK[bJ++]}}bM.length=bL;return bM},grep:function(bJ,bO,bI){var bK=[],bN;bI=!!bI;for(var bL=0,bM=bJ.length;bL<bM;bL++){bN=!!bO(bJ[bL],bL);if(bI!==bN){bK.push(bJ[bL])}}return bK},map:function(bJ,bO,bI){var bK=[],bN;for(var bL=0,bM=bJ.length;bL<bM;bL++){bN=bO(bJ[bL],bL,bI);if(bN!=null){bK[bK.length]=bN}}return bK.concat.apply([],bK)},guid:1,proxy:function(bK,bJ,bI){if(arguments.length===2){if(typeof bJ==="string"){bI=bK;bK=bI[bJ];bJ=H}else{if(bJ&&!bn.isFunction(bJ)){bI=bJ;bJ=H}}}if(!bJ&&bK){bJ=function(){return bK.apply(bI||this,arguments)}}if(bK){bJ.guid=bK.guid=bK.guid||bJ.guid||bn.guid++}return bJ},access:function(bI,bQ,bO,bK,bN,bP){var bJ=bI.length;if(typeof bQ==="object"){for(var bL in bQ){bn.access(bI,bL,bQ[bL],bK,bN,bO)}return bI}if(bO!==H){bK=!bP&&bK&&bn.isFunction(bO);for(var bM=0;bM<bJ;bM++){bN(bI[bM],bQ,bK?bO.call(bI[bM],bM,bN(bI[bM],bQ)):bO,bP)}return bI}return bJ?bN(bI[0],bQ):H},now:function(){return(new Date()).getTime()},_Deferred:function(){var bL=[],bM,bJ,bK,bI={done:function(){if(!bK){var bO=arguments,bP,bS,bR,bQ,bN;if(bM){bN=bM;bM=0}for(bP=0,bS=bO.length;bP<bS;bP++){bR=bO[bP];bQ=bn.type(bR);if(bQ==="array"){bI.done.apply(bI,bR)}else{if(bQ==="function"){bL.push(bR)}}}if(bN){bI.resolveWith(bN[0],bN[1])}}return this},resolveWith:function(bO,bN){if(!bK&&!bM&&!bJ){bJ=1;try{while(bL[0]){bL.shift().apply(bO,bN)}}catch(bP){throw bP}finally{bM=[bO,bN];bJ=0}}return this},resolve:function(){bI.resolveWith(bn.isFunction(this.promise)?this.promise():this,arguments);return this},isResolved:function(){return !!(bJ||bM)},cancel:function(){bK=1;bL=[];return this}};return bI},Deferred:function(bJ){var bI=bn._Deferred(),bL=bn._Deferred(),bK;bn.extend(bI,{then:function(bN,bM){bI.done(bN).fail(bM);return this},fail:bL.done,rejectWith:bL.resolveWith,reject:bL.resolve,isRejected:bL.isResolved,promise:function(bN){if(bN==null){if(bK){return bK}bK=bN={}}var bM=e.length;while(bM--){bN[e[bM]]=bI[e[bM]]}return bN}});bI.done(bL.cancel).fail(bI.cancel);delete bI.cancel;if(bJ){bJ.call(bI,bI)}return bI},when:function(bJ){var bO=arguments.length,bI=bO<=1&&bJ&&bn.isFunction(bJ.promise)?bJ:bn.Deferred(),bM=bI.promise();if(bO>1){var bN=bt.call(arguments,0),bL=bO,bK=function(bP){return function(bQ){bN[bP]=arguments.length>1?bt.call(arguments,0):bQ;if(!(--bL)){bI.resolveWith(bM,bN)}}};while((bO--)){bJ=bN[bO];if(bJ&&bn.isFunction(bJ.promise)){bJ.promise().then(bK(bO),bI.reject)}else{--bL}}if(!bL){bI.resolveWith(bM,bN)}}else{if(bI!==bJ){bI.resolve(bJ)}}return bM},uaMatch:function(bJ){bJ=bJ.toLowerCase();var bI=bh.exec(bJ)||bA.exec(bJ)||bz.exec(bJ)||bJ.indexOf("compatible")<0&&bB.exec(bJ)||[];return{browser:bI[1]||"",version:bI[2]||"0"}},sub:function(){function bJ(bL,bM){return new bJ.fn.init(bL,bM)}bn.extend(true,bJ,this);bJ.superclass=this;bJ.fn=bJ.prototype=this();bJ.fn.constructor=bJ;bJ.subclass=this.subclass;bJ.fn.init=function bK(bL,bM){if(bM&&bM instanceof bn&&!(bM instanceof bJ)){bM=bJ(bM)}return bn.fn.init.call(this,bL,bM,bI)};bJ.fn.init.prototype=bJ.fn;var bI=bJ(al);return bJ},browser:{}});bk=bn._Deferred();bn.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(bJ,bI){bg["[object "+bI+"]"]=bI.toLowerCase()});bE=bn.uaMatch(bG);if(bE.browser){bn.browser[bE.browser]=true;bn.browser.version=bE.version}if(bn.browser.webkit){bn.browser.safari=true}if(be){bn.inArray=function(bI,bJ){return be.call(bJ,bI)}}if(bv.test("\xA0")){br=/^[\s\xA0]+/;bm=/[\s\xA0]+$/}bl=bn(al);if(al.addEventListener){bd=function(){al.removeEventListener("DOMContentLoaded",bd,false);bn.ready()}}else{if(al.attachEvent){bd=function(){if(al.readyState==="complete"){al.detachEvent("onreadystatechange",bd);bn.ready()}}}}function bf(){if(bn.isReady){return}try{al.documentElement.doScroll("left")}catch(bI){setTimeout(bf,1);return}bn.ready()}return bn})();(function(){a.support={};var bd=al.createElement("div");bd.style.display="none";bd.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var bm=bd.getElementsByTagName("*"),bk=bd.getElementsByTagName("a")[0],bl=al.createElement("select"),be=bl.appendChild(al.createElement("option")),bj=bd.getElementsByTagName("input")[0];if(!bm||!bm.length||!bk){return}a.support={leadingWhitespace:bd.firstChild.nodeType===3,tbody:!bd.getElementsByTagName("tbody").length,htmlSerialize:!!bd.getElementsByTagName("link").length,style:/red/.test(bk.getAttribute("style")),hrefNormalized:bk.getAttribute("href")==="/a",opacity:/^0.55$/.test(bk.style.opacity),cssFloat:!!bk.style.cssFloat,checkOn:bj.value==="on",optSelected:be.selected,deleteExpando:true,optDisabled:false,checkClone:false,noCloneEvent:true,noCloneChecked:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};bj.checked=true;a.support.noCloneChecked=bj.cloneNode(true).checked;bl.disabled=true;a.support.optDisabled=!be.disabled;var bf=null;a.support.scriptEval=function(){if(bf===null){var bo=al.documentElement,bp=al.createElement("script"),br="script"+a.now();try{bp.appendChild(al.createTextNode("window."+br+"=1;"))}catch(bq){}bo.insertBefore(bp,bo.firstChild);if(aY[br]){bf=true;delete aY[br]}else{bf=false}bo.removeChild(bp);bo=bp=br=null}return bf};try{delete bd.test}catch(bh){a.support.deleteExpando=false}if(!bd.addEventListener&&bd.attachEvent&&bd.fireEvent){bd.attachEvent("onclick",function bn(){a.support.noCloneEvent=false;bd.detachEvent("onclick",bn)});bd.cloneNode(true).fireEvent("onclick")}bd=al.createElement("div");bd.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var bg=al.createDocumentFragment();bg.appendChild(bd.firstChild);a.support.checkClone=bg.cloneNode(true).cloneNode(true).lastChild.checked;a(function(){var bp=al.createElement("div"),e=al.getElementsByTagName("body")[0];if(!e){return}bp.style.width=bp.style.paddingLeft="1px";e.appendChild(bp);a.boxModel=a.support.boxModel=bp.offsetWidth===2;if("zoom" in bp.style){bp.style.display="inline";bp.style.zoom=1;a.support.inlineBlockNeedsLayout=bp.offsetWidth===2;bp.style.display="";bp.innerHTML="<div style='width:4px;'></div>";a.support.shrinkWrapBlocks=bp.offsetWidth!==2}bp.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var bo=bp.getElementsByTagName("td");a.support.reliableHiddenOffsets=bo[0].offsetHeight===0;bo[0].style.display="";bo[1].style.display="none";a.support.reliableHiddenOffsets=a.support.reliableHiddenOffsets&&bo[0].offsetHeight===0;bp.innerHTML="";e.removeChild(bp).style.display="none";bp=bo=null});var bi=function(e){var bp=al.createElement("div");e="on"+e;if(!bp.attachEvent){return true}var bo=(e in bp);if(!bo){bp.setAttribute(e,"return;");bo=typeof bp[e]==="function"}bp=null;return bo};a.support.submitBubbles=bi("submit");a.support.changeBubbles=bi("change");bd=bm=bk=null})();var aE=/^(?:\{.*\}|\[.*\])$/;a.extend({cache:{},uuid:0,expando:"jQuery"+(a.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?a.cache[e[a.expando]]:e[a.expando];return !!e&&!P(e)},data:function(bf,bd,bh,bg){if(!a.acceptData(bf)){return}var bk=a.expando,bj=typeof bd==="string",bi,bl=bf.nodeType,e=bl?a.cache:bf,be=bl?bf[a.expando]:bf[a.expando]&&a.expando;if((!be||(bg&&be&&!e[be][bk]))&&bj&&bh===H){return}if(!be){if(bl){bf[a.expando]=be=++a.uuid}else{be=a.expando}}if(!e[be]){e[be]={};if(!bl){e[be].toJSON=a.noop}}if(typeof bd==="object"||typeof bd==="function"){if(bg){e[be][bk]=a.extend(e[be][bk],bd)}else{e[be]=a.extend(e[be],bd)}}bi=e[be];if(bg){if(!bi[bk]){bi[bk]={}}bi=bi[bk]}if(bh!==H){bi[bd]=bh}if(bd==="events"&&!bi[bd]){return bi[bk]&&bi[bk].events}return bj?bi[bd]:bi},removeData:function(bg,be,bh){if(!a.acceptData(bg)){return}var bj=a.expando,bk=bg.nodeType,bd=bk?a.cache:bg,bf=bk?bg[a.expando]:a.expando;if(!bd[bf]){return}if(be){var bi=bh?bd[bf][bj]:bd[bf];if(bi){delete bi[be];if(!P(bi)){return}}}if(bh){delete bd[bf][bj];if(!P(bd[bf])){return}}var e=bd[bf][bj];if(a.support.deleteExpando||bd!=aY){delete bd[bf]}else{bd[bf]=null}if(e){bd[bf]={};if(!bk){bd[bf].toJSON=a.noop}bd[bf][bj]=e}else{if(bk){if(a.support.deleteExpando){delete bg[a.expando]}else{if(bg.removeAttribute){bg.removeAttribute(a.expando)}else{bg[a.expando]=null}}}}},_data:function(bd,e,be){return a.data(bd,e,be,true)},acceptData:function(bd){if(bd.nodeName){var e=a.noData[bd.nodeName.toLowerCase()];if(e){return !(e===true||bd.getAttribute("classid")!==e)}}return true}});a.fn.extend({data:function(bg,bi){var bh=null;if(typeof bg==="undefined"){if(this.length){bh=a.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,be;for(var bf=0,bd=e.length;bf<bd;bf++){be=e[bf].name;if(be.indexOf("data-")===0){be=be.substr(5);aT(this[0],be,bh[be])}}}}return bh}else{if(typeof bg==="object"){return this.each(function(){a.data(this,bg)})}}var bj=bg.split(".");bj[1]=bj[1]?"."+bj[1]:"";if(bi===H){bh=this.triggerHandler("getData"+bj[1]+"!",[bj[0]]);if(bh===H&&this.length){bh=a.data(this[0],bg);bh=aT(this[0],bg,bh)}return bh===H&&bj[1]?this.data(bj[0]):bh}else{return this.each(function(){var bl=a(this),bk=[bj[0],bi];bl.triggerHandler("setData"+bj[1]+"!",bk);a.data(this,bg,bi);bl.triggerHandler("changeData"+bj[1]+"!",bk)})}},removeData:function(e){return this.each(function(){a.removeData(this,e)})}});function aT(be,bd,bf){if(bf===H&&be.nodeType===1){bf=be.getAttribute("data-"+bd);if(typeof bf==="string"){try{bf=bf==="true"?true:bf==="false"?false:bf==="null"?null:!a.isNaN(bf)?parseFloat(bf):aE.test(bf)?a.parseJSON(bf):bf}catch(bg){}a.data(be,bd,bf)}else{bf=H}}return bf}function P(bd){for(var e in bd){if(e!=="toJSON"){return false}}return true}a.extend({queue:function(bd,e,bf){if(!bd){return}e=(e||"fx")+"queue";var be=a._data(bd,e);if(!bf){return be||[]}if(!be||a.isArray(bf)){be=a._data(bd,e,a.makeArray(bf))}else{be.push(bf)}return be},dequeue:function(bf,be){be=be||"fx";var e=a.queue(bf,be),bd=e.shift();if(bd==="inprogress"){bd=e.shift()}if(bd){if(be==="fx"){e.unshift("inprogress")}bd.call(bf,function(){a.dequeue(bf,be)})}if(!e.length){a.removeData(bf,be+"queue",true)}}});a.fn.extend({queue:function(e,bd){if(typeof e!=="string"){bd=e;e="fx"}if(bd===H){return a.queue(this[0],e)}return this.each(function(bf){var be=a.queue(this,e,bd);if(e==="fx"&&be[0]!=="inprogress"){a.dequeue(this,e)}})},dequeue:function(e){return this.each(function(){a.dequeue(this,e)})},delay:function(bd,e){bd=a.fx?a.fx.speeds[bd]||bd:bd;e=e||"fx";return this.queue(e,function(){var be=this;setTimeout(function(){a.dequeue(be,e)},bd)})},clearQueue:function(e){return this.queue(e||"fx",[])}});var aC=/[\n\t\r]/g,a3=/\s+/,aG=/\r/g,a2=/^(?:href|src|style)$/,f=/^(?:button|input)$/i,C=/^(?:button|input|object|select|textarea)$/i,k=/^a(?:rea)?$/i,Q=/^(?:radio|checkbox)$/i;a.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};a.fn.extend({attr:function(e,bd){return a.access(this,e,bd,true,a.attr)},removeAttr:function(e,bd){return this.each(function(){a.attr(this,e,"");if(this.nodeType===1){this.removeAttribute(e)}})},addClass:function(bj){if(a.isFunction(bj)){return this.each(function(bm){var bl=a(this);bl.addClass(bj.call(this,bm,bl.attr("class")))})}if(bj&&typeof bj==="string"){var e=(bj||"").split(a3);for(var bf=0,be=this.length;bf<be;bf++){var bd=this[bf];if(bd.nodeType===1){if(!bd.className){bd.className=bj}else{var bg=" "+bd.className+" ",bi=bd.className;for(var bh=0,bk=e.length;bh<bk;bh++){if(bg.indexOf(" "+e[bh]+" ")<0){bi+=" "+e[bh]}}bd.className=a.trim(bi)}}}}return this},removeClass:function(bh){if(a.isFunction(bh)){return this.each(function(bl){var bk=a(this);bk.removeClass(bh.call(this,bl,bk.attr("class")))})}if((bh&&typeof bh==="string")||bh===H){var bi=(bh||"").split(a3);for(var be=0,bd=this.length;be<bd;be++){var bg=this[be];if(bg.nodeType===1&&bg.className){if(bh){var bf=(" "+bg.className+" ").replace(aC," ");for(var bj=0,e=bi.length;bj<e;bj++){bf=bf.replace(" "+bi[bj]+" "," ")}bg.className=a.trim(bf)}else{bg.className=""}}}}return this},toggleClass:function(bf,bd){var be=typeof bf,e=typeof bd==="boolean";if(a.isFunction(bf)){return this.each(function(bh){var bg=a(this);bg.toggleClass(bf.call(this,bh,bg.attr("class"),bd),bd)})}return this.each(function(){if(be==="string"){var bi,bh=0,bg=a(this),bj=bd,bk=bf.split(a3);while((bi=bk[bh++])){bj=e?bj:!bg.hasClass(bi);bg[bj?"addClass":"removeClass"](bi)}}else{if(be==="undefined"||be==="boolean"){if(this.className){a._data(this,"__className__",this.className)}this.className=this.className||bf===false?"":a._data(this,"__className__")||""}}})},hasClass:function(e){var bf=" "+e+" ";for(var be=0,bd=this.length;be<bd;be++){if((" "+this[be].className+" ").replace(aC," ").indexOf(bf)>-1){return true}}return false},val:function(bk){if(!arguments.length){var be=this[0];if(be){if(a.nodeName(be,"option")){var bd=be.attributes.value;return !bd||bd.specified?be.value:be.text}if(a.nodeName(be,"select")){var bi=be.selectedIndex,bl=[],bm=be.options,bh=be.type==="select-one";if(bi<0){return null}for(var bf=bh?bi:0,bj=bh?bi+1:bm.length;bf<bj;bf++){var bg=bm[bf];if(bg.selected&&(a.support.optDisabled?!bg.disabled:bg.getAttribute("disabled")===null)&&(!bg.parentNode.disabled||!a.nodeName(bg.parentNode,"optgroup"))){bk=a(bg).val();if(bh){return bk}bl.push(bk)}}if(bh&&!bl.length&&bm.length){return a(bm[bi]).val()}return bl}if(Q.test(be.type)&&!a.support.checkOn){return be.getAttribute("value")===null?"on":be.value}return(be.value||"").replace(aG,"")}return H}var e=a.isFunction(bk);return this.each(function(bp){var bo=a(this),bq=bk;if(this.nodeType!==1){return}if(e){bq=bk.call(this,bp,bo.val())}if(bq==null){bq=""}else{if(typeof bq==="number"){bq+=""}else{if(a.isArray(bq)){bq=a.map(bq,function(br){return br==null?"":br+""})}}}if(a.isArray(bq)&&Q.test(this.type)){this.checked=a.inArray(bo.val(),bq)>=0}else{if(a.nodeName(this,"select")){var bn=a.makeArray(bq);a("option",this).each(function(){this.selected=a.inArray(a(this).val(),bn)>=0});if(!bn.length){this.selectedIndex=-1}}else{this.value=bq}}})}});a.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bd,e,bi,bl){if(!bd||bd.nodeType===3||bd.nodeType===8||bd.nodeType===2){return H}if(bl&&e in a.attrFn){return a(bd)[e](bi)}var be=bd.nodeType!==1||!a.isXMLDoc(bd),bh=bi!==H;e=be&&a.props[e]||e;if(bd.nodeType===1){var bg=a2.test(e);if(e==="selected"&&!a.support.optSelected){var bj=bd.parentNode;if(bj){bj.selectedIndex;if(bj.parentNode){bj.parentNode.selectedIndex}}}if((e in bd||bd[e]!==H)&&be&&!bg){if(bh){if(e==="type"&&f.test(bd.nodeName)&&bd.parentNode){a.error("type property can't be changed")}if(bi===null){if(bd.nodeType===1){bd.removeAttribute(e)}}else{bd[e]=bi}}if(a.nodeName(bd,"form")&&bd.getAttributeNode(e)){return bd.getAttributeNode(e).nodeValue}if(e==="tabIndex"){var bk=bd.getAttributeNode("tabIndex");return bk&&bk.specified?bk.value:C.test(bd.nodeName)||k.test(bd.nodeName)&&bd.href?0:H}return bd[e]}if(!a.support.style&&be&&e==="style"){if(bh){bd.style.cssText=""+bi}return bd.style.cssText}if(bh){bd.setAttribute(e,""+bi)}if(!bd.attributes[e]&&(bd.hasAttribute&&!bd.hasAttribute(e))){return H}var bf=!a.support.hrefNormalized&&be&&bg?bd.getAttribute(e,2):bd.getAttribute(e);return bf===null?H:bf}if(bh){bd[e]=bi}return bd[e]}});var aP=/\.(.*)$/,a0=/^(?:textarea|input|select)$/i,K=/\./g,aa=/ /g,aw=/[^\w\s.|`]/g,E=function(e){return e.replace(aw,"\\$&")};a.event={add:function(bg,bk,br,bi){if(bg.nodeType===3||bg.nodeType===8){return}try{if(a.isWindow(bg)&&(bg!==aY&&!bg.frameElement)){bg=aY}}catch(bl){}if(br===false){br=a5}else{if(!br){return}}var be,bp;if(br.handler){be=br;br=be.handler}if(!br.guid){br.guid=a.guid++}var bm=a._data(bg);if(!bm){return}var bq=bm.events,bj=bm.handle;if(!bq){bm.events=bq={}}if(!bj){bm.handle=bj=function(){return typeof a!=="undefined"&&!a.event.triggered?a.event.handle.apply(bj.elem,arguments):H}}bj.elem=bg;bk=bk.split(" ");var bo,bh=0,bd;while((bo=bk[bh++])){bp=be?a.extend({},be):{handler:br,data:bi};if(bo.indexOf(".")>-1){bd=bo.split(".");bo=bd.shift();bp.namespace=bd.slice(0).sort().join(".")}else{bd=[];bp.namespace=""}bp.type=bo;if(!bp.guid){bp.guid=br.guid}var bf=bq[bo],bn=a.event.special[bo]||{};if(!bf){bf=bq[bo]=[];if(!bn.setup||bn.setup.call(bg,bi,bd,bj)===false){if(bg.addEventListener){bg.addEventListener(bo,bj,false)}else{if(bg.attachEvent){bg.attachEvent("on"+bo,bj)}}}}if(bn.add){bn.add.call(bg,bp);if(!bp.handler.guid){bp.handler.guid=br.guid}}bf.push(bp);a.event.global[bo]=true}bg=null},global:{},remove:function(br,bm,be,bi){if(br.nodeType===3||br.nodeType===8){return}if(be===false){be=a5}var bu,bh,bj,bo,bp=0,bf,bk,bn,bg,bl,e,bt,bq=a.hasData(br)&&a._data(br),bd=bq&&bq.events;if(!bq||!bd){return}if(bm&&bm.type){be=bm.handler;bm=bm.type}if(!bm||typeof bm==="string"&&bm.charAt(0)==="."){bm=bm||"";for(bh in bd){a.event.remove(br,bh+bm)}return}bm=bm.split(" ");while((bh=bm[bp++])){bt=bh;e=null;bf=bh.indexOf(".")<0;bk=[];if(!bf){bk=bh.split(".");bh=bk.shift();bn=new RegExp("(^|\\.)"+a.map(bk.slice(0).sort(),E).join("\\.(?:.*\\.)?")+"(\\.|$)")}bl=bd[bh];if(!bl){continue}if(!be){for(bo=0;bo<bl.length;bo++){e=bl[bo];if(bf||bn.test(e.namespace)){a.event.remove(br,bt,e.handler,bo);bl.splice(bo--,1)}}continue}bg=a.event.special[bh]||{};for(bo=bi||0;bo<bl.length;bo++){e=bl[bo];if(be.guid===e.guid){if(bf||bn.test(e.namespace)){if(bi==null){bl.splice(bo--,1)}if(bg.remove){bg.remove.call(br,e)}}if(bi!=null){break}}}if(bl.length===0||bi!=null&&bl.length===1){if(!bg.teardown||bg.teardown.call(br,bk)===false){a.removeEvent(br,bh,bq.handle)}bu=null;delete bd[bh]}}if(a.isEmptyObject(bd)){var bs=bq.handle;if(bs){bs.elem=null}delete bq.events;delete bq.handle;if(a.isEmptyObject(bq)){a.removeData(br,H,true)}}},trigger:function(bd,bi,bf){var bm=bd.type||bd,bh=arguments[3];if(!bh){bd=typeof bd==="object"?bd[a.expando]?bd:a.extend(a.Event(bm),bd):a.Event(bm);if(bm.indexOf("!")>=0){bd.type=bm=bm.slice(0,-1);bd.exclusive=true}if(!bf){bd.stopPropagation();if(a.event.global[bm]){a.each(a.cache,function(){var br=a.expando,bq=this[br];if(bq&&bq.events&&bq.events[bm]){a.event.trigger(bd,bi,bq.handle.elem)}})}}if(!bf||bf.nodeType===3||bf.nodeType===8){return H}bd.result=H;bd.target=bf;bi=a.makeArray(bi);bi.unshift(bd)}bd.currentTarget=bf;var bj=a._data(bf,"handle");if(bj){bj.apply(bf,bi)}var bo=bf.parentNode||bf.ownerDocument;try{if(!(bf&&bf.nodeName&&a.noData[bf.nodeName.toLowerCase()])){if(bf["on"+bm]&&bf["on"+bm].apply(bf,bi)===false){bd.result=false;bd.preventDefault()}}}catch(bn){}if(!bd.isPropagationStopped()&&bo){a.event.trigger(bd,bi,bo,true)}else{if(!bd.isDefaultPrevented()){var be,bk=bd.target,e=bm.replace(aP,""),bp=a.nodeName(bk,"a")&&e==="click",bl=a.event.special[e]||{};if((!bl._default||bl._default.call(bf,bd)===false)&&!bp&&!(bk&&bk.nodeName&&a.noData[bk.nodeName.toLowerCase()])){try{if(bk[e]){be=bk["on"+e];if(be){bk["on"+e]=null}a.event.triggered=true;bk[e]()}}catch(bg){}if(be){bk["on"+e]=be}a.event.triggered=false}}}},handle:function(e){var bl,be,bd,bn,bm,bh=[],bj=a.makeArray(arguments);e=bj[0]=a.event.fix(e||aY.event);e.currentTarget=this;bl=e.type.indexOf(".")<0&&!e.exclusive;if(!bl){bd=e.type.split(".");e.type=bd.shift();bh=bd.slice(0).sort();bn=new RegExp("(^|\\.)"+bh.join("\\.(?:.*\\.)?")+"(\\.|$)")}e.namespace=e.namespace||bh.join(".");bm=a._data(this,"events");be=(bm||{})[e.type];if(bm&&be){be=be.slice(0);for(var bg=0,bf=be.length;bg<bf;bg++){var bk=be[bg];if(bl||bn.test(bk.namespace)){e.handler=bk.handler;e.data=bk.data;e.handleObj=bk;var bi=bk.handler.apply(this,bj);if(bi!==H){e.result=bi;if(bi===false){e.preventDefault();e.stopPropagation()}}if(e.isImmediatePropagationStopped()){break}}}}return e.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(bf){if(bf[a.expando]){return bf}var bd=bf;bf=a.Event(bd);for(var be=this.props.length,bh;be;){bh=this.props[--be];bf[bh]=bd[bh]}if(!bf.target){bf.target=bf.srcElement||al}if(bf.target.nodeType===3){bf.target=bf.target.parentNode}if(!bf.relatedTarget&&bf.fromElement){bf.relatedTarget=bf.fromElement===bf.target?bf.toElement:bf.fromElement}if(bf.pageX==null&&bf.clientX!=null){var bg=al.documentElement,e=al.body;bf.pageX=bf.clientX+(bg&&bg.scrollLeft||e&&e.scrollLeft||0)-(bg&&bg.clientLeft||e&&e.clientLeft||0);bf.pageY=bf.clientY+(bg&&bg.scrollTop||e&&e.scrollTop||0)-(bg&&bg.clientTop||e&&e.clientTop||0)}if(bf.which==null&&(bf.charCode!=null||bf.keyCode!=null)){bf.which=bf.charCode!=null?bf.charCode:bf.keyCode}if(!bf.metaKey&&bf.ctrlKey){bf.metaKey=bf.ctrlKey}if(!bf.which&&bf.button!==H){bf.which=(bf.button&1?1:(bf.button&2?3:(bf.button&4?2:0)))}return bf},guid:100000000,proxy:a.proxy,special:{ready:{setup:a.bindReady,teardown:a.noop},live:{add:function(e){a.event.add(this,n(e.origType,e.selector),a.extend({},e,{handler:af,guid:e.handler.guid}))},remove:function(e){a.event.remove(this,n(e.origType,e.selector),e)}},beforeunload:{setup:function(be,bd,e){if(a.isWindow(this)){this.onbeforeunload=e}},teardown:function(bd,e){if(this.onbeforeunload===e){this.onbeforeunload=null}}}}};a.removeEvent=al.removeEventListener?function(bd,e,be){if(bd.removeEventListener){bd.removeEventListener(e,be,false)}}:function(bd,e,be){if(bd.detachEvent){bd.detachEvent("on"+e,be)}};a.Event=function(e){if(!this.preventDefault){return new a.Event(e)}if(e&&e.type){this.originalEvent=e;this.type=e.type;this.isDefaultPrevented=(e.defaultPrevented||e.returnValue===false||e.getPreventDefault&&e.getPreventDefault())?h:a5}else{this.type=e}this.timeStamp=a.now();this[a.expando]=true};function a5(){return false}function h(){return true}a.Event.prototype={preventDefault:function(){this.isDefaultPrevented=h;var bd=this.originalEvent;if(!bd){return}if(bd.preventDefault){bd.preventDefault()}else{bd.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=h;var bd=this.originalEvent;if(!bd){return}if(bd.stopPropagation){bd.stopPropagation()}bd.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=h;this.stopPropagation()},isDefaultPrevented:a5,isPropagationStopped:a5,isImmediatePropagationStopped:a5};var Z=function(be){var bd=be.relatedTarget;try{if(bd!==al&&!bd.parentNode){return}while(bd&&bd!==this){bd=bd.parentNode}if(bd!==this){be.type=be.data;a.event.handle.apply(this,arguments)}}catch(bf){}},aK=function(e){e.type=e.data;a.event.handle.apply(this,arguments)};a.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(bd,e){a.event.special[bd]={setup:function(be){a.event.add(this,e,be&&be.selector?aK:Z,bd)},teardown:function(be){a.event.remove(this,e,be&&be.selector?aK:Z)}}});if(!a.support.submitBubbles){a.event.special.submit={setup:function(bd,e){if(this.nodeName&&this.nodeName.toLowerCase()!=="form"){a.event.add(this,"click.specialSubmit",function(bg){var bf=bg.target,be=bf.type;if((be==="submit"||be==="image")&&a(bf).closest("form").length){aN("submit",this,arguments)}});a.event.add(this,"keypress.specialSubmit",function(bg){var bf=bg.target,be=bf.type;if((be==="text"||be==="password")&&a(bf).closest("form").length&&bg.keyCode===13){aN("submit",this,arguments)}})}else{return false}},teardown:function(e){a.event.remove(this,".specialSubmit")}}}if(!a.support.changeBubbles){var a6,j=function(bd){var e=bd.type,be=bd.value;if(e==="radio"||e==="checkbox"){be=bd.checked}else{if(e==="select-multiple"){be=bd.selectedIndex>-1?a.map(bd.options,function(bf){return bf.selected}).join("-"):""}else{if(bd.nodeName.toLowerCase()==="select"){be=bd.selectedIndex}}}return be},X=function X(bf){var bd=bf.target,be,bg;if(!a0.test(bd.nodeName)||bd.readOnly){return}be=a._data(bd,"_change_data");bg=j(bd);if(bf.type!=="focusout"||bd.type!=="radio"){a._data(bd,"_change_data",bg)}if(be===H||bg===be){return}if(be!=null||bg){bf.type="change";bf.liveFired=H;a.event.trigger(bf,arguments[1],bd)}};a.event.special.change={filters:{focusout:X,beforedeactivate:X,click:function(bf){var be=bf.target,bd=be.type;if(bd==="radio"||bd==="checkbox"||be.nodeName.toLowerCase()==="select"){X.call(this,bf)}},keydown:function(bf){var be=bf.target,bd=be.type;if((bf.keyCode===13&&be.nodeName.toLowerCase()!=="textarea")||(bf.keyCode===32&&(bd==="checkbox"||bd==="radio"))||bd==="select-multiple"){X.call(this,bf)}},beforeactivate:function(be){var bd=be.target;a._data(bd,"_change_data",j(bd))}},setup:function(be,bd){if(this.type==="file"){return false}for(var e in a6){a.event.add(this,e+".specialChange",a6[e])}return a0.test(this.nodeName)},teardown:function(e){a.event.remove(this,".specialChange");return a0.test(this.nodeName)}};a6=a.event.special.change.filters;a6.focus=a6.beforeactivate}function aN(bd,bf,e){var be=a.extend({},e[0]);be.type=bd;be.originalEvent={};be.liveFired=H;a.event.handle.call(bf,be);if(be.isDefaultPrevented()){e[0].preventDefault()}}if(al.addEventListener){a.each({focus:"focusin",blur:"focusout"},function(be,e){a.event.special[e]={setup:function(){this.addEventListener(be,bd,true)},teardown:function(){this.removeEventListener(be,bd,true)}};function bd(bf){bf=a.event.fix(bf);bf.type=e;return a.event.handle.call(this,bf)}})}a.each(["bind","one"],function(bd,e){a.fn[e]=function(bj,bk,bi){if(typeof bj==="object"){for(var bg in bj){this[e](bg,bk,bj[bg],bi)}return this}if(a.isFunction(bk)||bk===false){bi=bk;bk=H}var bh=e==="one"?a.proxy(bi,function(bl){a(this).unbind(bl,bh);return bi.apply(this,arguments)}):bi;if(bj==="unload"&&e!=="one"){this.one(bj,bk,bi)}else{for(var bf=0,be=this.length;bf<be;bf++){a.event.add(this[bf],bj,bh,bk)}}return this}});a.fn.extend({unbind:function(bg,bf){if(typeof bg==="object"&&!bg.preventDefault){for(var be in bg){this.unbind(be,bg[be])}}else{for(var bd=0,e=this.length;bd<e;bd++){a.event.remove(this[bd],bg,bf)}}return this},delegate:function(e,bd,bf,be){return this.live(bd,bf,be,e)},undelegate:function(e,bd,be){if(arguments.length===0){return this.unbind("live")}else{return this.die(bd,null,be,e)}},trigger:function(e,bd){return this.each(function(){a.event.trigger(e,bd,this)})},triggerHandler:function(e,be){if(this[0]){var bd=a.Event(e);bd.preventDefault();bd.stopPropagation();a.event.trigger(bd,be,this[0]);return bd.result}},toggle:function(be){var e=arguments,bd=1;while(bd<e.length){a.proxy(be,e[bd++])}return this.click(a.proxy(be,function(bf){var bg=(a._data(this,"lastToggle"+be.guid)||0)%bd;a._data(this,"lastToggle"+be.guid,bg+1);bf.preventDefault();return e[bg].apply(this,arguments)||false}))},hover:function(e,bd){return this.mouseenter(e).mouseleave(bd||e)}});var aH={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};a.each(["live","die"],function(bd,e){a.fn[e]=function(bn,bk,bp,bg){var bo,bl=0,bm,bf,br,bi=bg||this.selector,be=bg?this:a(this.context);if(typeof bn==="object"&&!bn.preventDefault){for(var bq in bn){be[e](bq,bk,bn[bq],bi)}return this}if(a.isFunction(bk)){bp=bk;bk=H}bn=(bn||"").split(" ");while((bo=bn[bl++])!=null){bm=aP.exec(bo);bf="";if(bm){bf=bm[0];bo=bo.replace(aP,"")}if(bo==="hover"){bn.push("mouseenter"+bf,"mouseleave"+bf);continue}br=bo;if(bo==="focus"||bo==="blur"){bn.push(aH[bo]+bf);bo=bo+bf}else{bo=(aH[bo]||bo)+bf}if(e==="live"){for(var bj=0,bh=be.length;bj<bh;bj++){a.event.add(be[bj],"live."+n(bo,bi),{data:bk,selector:bi,handler:bp,origType:bo,origHandler:bp,preType:br})}}else{be.unbind("live."+n(bo,bi),bp)}}return this}});function af(bn){var bk,bf,bt,bh,e,bp,bm,bo,bl,bs,bj,bi,br,bq=[],bg=[],bd=a._data(this,"events");if(bn.liveFired===this||!bd||!bd.live||bn.target.disabled||bn.button&&bn.type==="click"){return}if(bn.namespace){bi=new RegExp("(^|\\.)"+bn.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")}bn.liveFired=this;var be=bd.live.slice(0);for(bm=0;bm<be.length;bm++){e=be[bm];if(e.origType.replace(aP,"")===bn.type){bg.push(e.selector)}else{be.splice(bm--,1)}}bh=a(bn.target).closest(bg,bn.currentTarget);for(bo=0,bl=bh.length;bo<bl;bo++){bj=bh[bo];for(bm=0;bm<be.length;bm++){e=be[bm];if(bj.selector===e.selector&&(!bi||bi.test(e.namespace))&&!bj.elem.disabled){bp=bj.elem;bt=null;if(e.preType==="mouseenter"||e.preType==="mouseleave"){bn.type=e.preType;bt=a(bn.relatedTarget).closest(e.selector)[0]}if(!bt||bt!==bp){bq.push({elem:bp,handleObj:e,level:bj.level})}}}}for(bo=0,bl=bq.length;bo<bl;bo++){bh=bq[bo];if(bf&&bh.level>bf){break}bn.currentTarget=bh.elem;bn.data=bh.handleObj.data;bn.handleObj=bh.handleObj;br=bh.handleObj.origHandler.apply(bh.elem,arguments);if(br===false||bn.isPropagationStopped()){bf=bh.level;if(br===false){bk=false}if(bn.isImmediatePropagationStopped()){break}}}return bk}function n(bd,e){return(bd&&bd!=="*"?bd+".":"")+e.replace(K,"`").replace(aa,"&")}a.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error").split(" "),function(bd,e){a.fn[e]=function(bf,be){if(be==null){be=bf;bf=null}return arguments.length>0?this.bind(e,bf,be):this.trigger(e)};if(a.attrFn){a.attrFn[e]=true}});
/*
 * Sizzle CSS Selector Engine
 *  Copyright 2011, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var bn=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bo=0,br=Object.prototype.toString,bi=false,bh=true,bp=/\\/g,bv=/\W/;[0,0].sort(function(){bh=false;return 0});var bf=function(bA,e,bD,bE){bD=bD||[];e=e||al;var bG=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bA||typeof bA!=="string"){return bD}var bx,bI,bL,bw,bH,bK,bJ,bC,bz=true,by=bf.isXML(e),bB=[],bF=bA;do{bn.exec("");bx=bn.exec(bF);if(bx){bF=bx[3];bB.push(bx[1]);if(bx[2]){bw=bx[3];break}}}while(bx);if(bB.length>1&&bj.exec(bA)){if(bB.length===2&&bk.relative[bB[0]]){bI=bs(bB[0]+bB[1],e)}else{bI=bk.relative[bB[0]]?[e]:bf(bB.shift(),e);while(bB.length){bA=bB.shift();if(bk.relative[bA]){bA+=bB.shift()}bI=bs(bA,bI)}}}else{if(!bE&&bB.length>1&&e.nodeType===9&&!by&&bk.match.ID.test(bB[0])&&!bk.match.ID.test(bB[bB.length-1])){bH=bf.find(bB.shift(),e,by);e=bH.expr?bf.filter(bH.expr,bH.set)[0]:bH.set[0]}if(e){bH=bE?{expr:bB.pop(),set:bl(bE)}:bf.find(bB.pop(),bB.length===1&&(bB[0]==="~"||bB[0]==="+")&&e.parentNode?e.parentNode:e,by);bI=bH.expr?bf.filter(bH.expr,bH.set):bH.set;if(bB.length>0){bL=bl(bI)}else{bz=false}while(bB.length){bK=bB.pop();bJ=bK;if(!bk.relative[bK]){bK=""}else{bJ=bB.pop()}if(bJ==null){bJ=e}bk.relative[bK](bL,bJ,by)}}else{bL=bB=[]}}if(!bL){bL=bI}if(!bL){bf.error(bK||bA)}if(br.call(bL)==="[object Array]"){if(!bz){bD.push.apply(bD,bL)}else{if(e&&e.nodeType===1){for(bC=0;bL[bC]!=null;bC++){if(bL[bC]&&(bL[bC]===true||bL[bC].nodeType===1&&bf.contains(e,bL[bC]))){bD.push(bI[bC])}}}else{for(bC=0;bL[bC]!=null;bC++){if(bL[bC]&&bL[bC].nodeType===1){bD.push(bI[bC])}}}}}else{bl(bL,bD)}if(bw){bf(bw,bG,bD,bE);bf.uniqueSort(bD)}return bD};bf.uniqueSort=function(bw){if(bq){bi=bh;bw.sort(bq);if(bi){for(var e=1;e<bw.length;e++){if(bw[e]===bw[e-1]){bw.splice(e--,1)}}}}return bw};bf.matches=function(e,bw){return bf(e,null,null,bw)};bf.matchesSelector=function(e,bw){return bf(bw,null,null,[e]).length>0};bf.find=function(bC,e,bD){var bB;if(!bC){return[]}for(var by=0,bx=bk.order.length;by<bx;by++){var bz,bA=bk.order[by];if((bz=bk.leftMatch[bA].exec(bC))){var bw=bz[1];bz.splice(1,1);if(bw.substr(bw.length-1)!=="\\"){bz[1]=(bz[1]||"").replace(bp,"");bB=bk.find[bA](bz,e,bD);if(bB!=null){bC=bC.replace(bk.match[bA],"");break}}}}if(!bB){bB=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:bB,expr:bC}};bf.filter=function(bG,bF,bJ,bz){var bB,e,bx=bG,bL=[],bD=bF,bC=bF&&bF[0]&&bf.isXML(bF[0]);while(bG&&bF.length){for(var bE in bk.filter){if((bB=bk.leftMatch[bE].exec(bG))!=null&&bB[2]){var bK,bI,bw=bk.filter[bE],by=bB[1];e=false;bB.splice(1,1);if(by.substr(by.length-1)==="\\"){continue}if(bD===bL){bL=[]}if(bk.preFilter[bE]){bB=bk.preFilter[bE](bB,bD,bJ,bL,bz,bC);if(!bB){e=bK=true}else{if(bB===true){continue}}}if(bB){for(var bA=0;(bI=bD[bA])!=null;bA++){if(bI){bK=bw(bI,bB,bA,bD);var bH=bz^!!bK;if(bJ&&bK!=null){if(bH){e=true}else{bD[bA]=false}}else{if(bH){bL.push(bI);e=true}}}}}if(bK!==H){if(!bJ){bD=bL}bG=bG.replace(bk.match[bE],"");if(!e){return[]}break}}}if(bG===bx){if(e==null){bf.error(bG)}else{break}}bx=bG}return bD};bf.error=function(e){throw"Syntax error, unrecognized expression: "+e};var bk=bf.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(bB,bw){var by=typeof bw==="string",bA=by&&!bv.test(bw),bC=by&&!bA;if(bA){bw=bw.toLowerCase()}for(var bx=0,e=bB.length,bz;bx<e;bx++){if((bz=bB[bx])){while((bz=bz.previousSibling)&&bz.nodeType!==1){}bB[bx]=bC||bz&&bz.nodeName.toLowerCase()===bw?bz||false:bz===bw}}if(bC){bf.filter(bw,bB,true)}},">":function(bB,bw){var bA,bz=typeof bw==="string",bx=0,e=bB.length;if(bz&&!bv.test(bw)){bw=bw.toLowerCase();for(;bx<e;bx++){bA=bB[bx];if(bA){var by=bA.parentNode;bB[bx]=by.nodeName.toLowerCase()===bw?by:false}}}else{for(;bx<e;bx++){bA=bB[bx];if(bA){bB[bx]=bz?bA.parentNode:bA.parentNode===bw}}if(bz){bf.filter(bw,bB,true)}}},"":function(by,bw,bA){var bz,bx=bo++,e=bt;if(typeof bw==="string"&&!bv.test(bw)){bw=bw.toLowerCase();bz=bw;e=bd}e("parentNode",bw,bx,by,bz,bA)},"~":function(by,bw,bA){var bz,bx=bo++,e=bt;if(typeof bw==="string"&&!bv.test(bw)){bw=bw.toLowerCase();bz=bw;e=bd}e("previousSibling",bw,bx,by,bz,bA)}},find:{ID:function(bw,bx,by){if(typeof bx.getElementById!=="undefined"&&!by){var e=bx.getElementById(bw[1]);return e&&e.parentNode?[e]:[]}},NAME:function(bx,bA){if(typeof bA.getElementsByName!=="undefined"){var bw=[],bz=bA.getElementsByName(bx[1]);for(var by=0,e=bz.length;by<e;by++){if(bz[by].getAttribute("name")===bx[1]){bw.push(bz[by])}}return bw.length===0?null:bw}},TAG:function(e,bw){if(typeof bw.getElementsByTagName!=="undefined"){return bw.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(by,bw,bx,e,bB,bC){by=" "+by[1].replace(bp,"")+" ";if(bC){return by}for(var bz=0,bA;(bA=bw[bz])!=null;bz++){if(bA){if(bB^(bA.className&&(" "+bA.className+" ").replace(/[\t\n\r]/g," ").indexOf(by)>=0)){if(!bx){e.push(bA)}}else{if(bx){bw[bz]=false}}}}return false},ID:function(e){return e[1].replace(bp,"")},TAG:function(bw,e){return bw[1].replace(bp,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){bf.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bw=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bw[1]+(bw[2]||1))-0;e[3]=bw[3]-0}else{if(e[2]){bf.error(e[0])}}e[0]=bo++;return e},ATTR:function(bz,bw,bx,e,bA,bB){var by=bz[1]=bz[1].replace(bp,"");if(!bB&&bk.attrMap[by]){bz[1]=bk.attrMap[by]}bz[4]=(bz[4]||bz[5]||"").replace(bp,"");if(bz[2]==="~="){bz[4]=" "+bz[4]+" "}return bz},PSEUDO:function(bz,bw,bx,e,bA){if(bz[1]==="not"){if((bn.exec(bz[3])||"").length>1||/^\w/.test(bz[3])){bz[3]=bf(bz[3],null,null,bw)}else{var by=bf.filter(bz[3],bw,bx,true^bA);if(!bx){e.push.apply(e,by)}return false}}else{if(bk.match.POS.test(bz[0])||bk.match.CHILD.test(bz[0])){return true}}return bz},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bx,bw,e){return !!bf(e[3],bx).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.getAttribute("type")},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(bw,e){return e===0},last:function(bx,bw,e,by){return bw===by.length-1},even:function(bw,e){return e%2===0},odd:function(bw,e){return e%2===1},lt:function(bx,bw,e){return bw<e[3]-0},gt:function(bx,bw,e){return bw>e[3]-0},nth:function(bx,bw,e){return e[3]-0===bw},eq:function(bx,bw,e){return e[3]-0===bw}},filter:{PSEUDO:function(bx,bC,bB,bD){var e=bC[1],bw=bk.filters[e];if(bw){return bw(bx,bB,bC,bD)}else{if(e==="contains"){return(bx.textContent||bx.innerText||bf.getText([bx])||"").indexOf(bC[3])>=0}else{if(e==="not"){var by=bC[3];for(var bA=0,bz=by.length;bA<bz;bA++){if(by[bA]===bx){return false}}return true}else{bf.error(e)}}}},CHILD:function(e,by){var bB=by[1],bw=e;switch(bB){case"only":case"first":while((bw=bw.previousSibling)){if(bw.nodeType===1){return false}}if(bB==="first"){return true}bw=e;case"last":while((bw=bw.nextSibling)){if(bw.nodeType===1){return false}}return true;case"nth":var bx=by[2],bE=by[3];if(bx===1&&bE===0){return true}var bA=by[0],bD=e.parentNode;if(bD&&(bD.sizcache!==bA||!e.nodeIndex)){var bz=0;for(bw=bD.firstChild;bw;bw=bw.nextSibling){if(bw.nodeType===1){bw.nodeIndex=++bz}}bD.sizcache=bA}var bC=e.nodeIndex-bE;if(bx===0){return bC===0}else{return(bC%bx===0&&bC/bx>=0)}}},ID:function(bw,e){return bw.nodeType===1&&bw.getAttribute("id")===e},TAG:function(bw,e){return(e==="*"&&bw.nodeType===1)||bw.nodeName.toLowerCase()===e},CLASS:function(bw,e){return(" "+(bw.className||bw.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bA,by){var bx=by[1],e=bk.attrHandle[bx]?bk.attrHandle[bx](bA):bA[bx]!=null?bA[bx]:bA.getAttribute(bx),bB=e+"",bz=by[2],bw=by[4];return e==null?bz==="!=":bz==="="?bB===bw:bz==="*="?bB.indexOf(bw)>=0:bz==="~="?(" "+bB+" ").indexOf(bw)>=0:!bw?bB&&e!==false:bz==="!="?bB!==bw:bz==="^="?bB.indexOf(bw)===0:bz==="$="?bB.substr(bB.length-bw.length)===bw:bz==="|="?bB===bw||bB.substr(0,bw.length+1)===bw+"-":false},POS:function(bz,bw,bx,bA){var e=bw[2],by=bk.setFilters[e];if(by){return by(bz,bx,bw,bA)}}}};var bj=bk.match.POS,be=function(bw,e){return"\\"+(e-0+1)};for(var bg in bk.match){bk.match[bg]=new RegExp(bk.match[bg].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bk.leftMatch[bg]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bk.match[bg].source.replace(/\\(\d+)/g,be))}var bl=function(bw,e){bw=Array.prototype.slice.call(bw,0);if(e){e.push.apply(e,bw);return e}return bw};try{Array.prototype.slice.call(al.documentElement.childNodes,0)[0].nodeType}catch(bu){bl=function(bz,by){var bx=0,bw=by||[];if(br.call(bz)==="[object Array]"){Array.prototype.push.apply(bw,bz)}else{if(typeof bz.length==="number"){for(var e=bz.length;bx<e;bx++){bw.push(bz[bx])}}else{for(;bz[bx];bx++){bw.push(bz[bx])}}}return bw}}var bq,bm;if(al.documentElement.compareDocumentPosition){bq=function(bw,e){if(bw===e){bi=true;return 0}if(!bw.compareDocumentPosition||!e.compareDocumentPosition){return bw.compareDocumentPosition?-1:1}return bw.compareDocumentPosition(e)&4?-1:1}}else{bq=function(bD,bC){var bA,bw,bx=[],e=[],bz=bD.parentNode,bB=bC.parentNode,bE=bz;if(bD===bC){bi=true;return 0}else{if(bz===bB){return bm(bD,bC)}else{if(!bz){return -1}else{if(!bB){return 1}}}}while(bE){bx.unshift(bE);bE=bE.parentNode}bE=bB;while(bE){e.unshift(bE);bE=bE.parentNode}bA=bx.length;bw=e.length;for(var by=0;by<bA&&by<bw;by++){if(bx[by]!==e[by]){return bm(bx[by],e[by])}}return by===bA?bm(bD,e[by],-1):bm(bx[by],bC,1)};bm=function(bw,e,bx){if(bw===e){return bx}var by=bw.nextSibling;while(by){if(by===e){return -1}by=by.nextSibling}return 1}}bf.getText=function(e){var bw="",by;for(var bx=0;e[bx];bx++){by=e[bx];if(by.nodeType===3||by.nodeType===4){bw+=by.nodeValue}else{if(by.nodeType!==8){bw+=bf.getText(by.childNodes)}}}return bw};(function(){var bw=al.createElement("div"),bx="script"+(new Date()).getTime(),e=al.documentElement;bw.innerHTML="<a name='"+bx+"'/>";e.insertBefore(bw,e.firstChild);if(al.getElementById(bx)){bk.find.ID=function(bz,bA,bB){if(typeof bA.getElementById!=="undefined"&&!bB){var by=bA.getElementById(bz[1]);return by?by.id===bz[1]||typeof by.getAttributeNode!=="undefined"&&by.getAttributeNode("id").nodeValue===bz[1]?[by]:H:[]}};bk.filter.ID=function(bA,by){var bz=typeof bA.getAttributeNode!=="undefined"&&bA.getAttributeNode("id");return bA.nodeType===1&&bz&&bz.nodeValue===by}}e.removeChild(bw);e=bw=null})();(function(){var e=al.createElement("div");e.appendChild(al.createComment(""));if(e.getElementsByTagName("*").length>0){bk.find.TAG=function(bw,bA){var bz=bA.getElementsByTagName(bw[1]);if(bw[1]==="*"){var by=[];for(var bx=0;bz[bx];bx++){if(bz[bx].nodeType===1){by.push(bz[bx])}}bz=by}return bz}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bk.attrHandle.href=function(bw){return bw.getAttribute("href",2)}}e=null})();if(al.querySelectorAll){(function(){var e=bf,by=al.createElement("div"),bx="__sizzle__";by.innerHTML="<p class='TEST'></p>";if(by.querySelectorAll&&by.querySelectorAll(".TEST").length===0){return}bf=function(bJ,bA,bE,bI){bA=bA||al;if(!bI&&!bf.isXML(bA)){var bH=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(bJ);if(bH&&(bA.nodeType===1||bA.nodeType===9)){if(bH[1]){return bl(bA.getElementsByTagName(bJ),bE)}else{if(bH[2]&&bk.find.CLASS&&bA.getElementsByClassName){return bl(bA.getElementsByClassName(bH[2]),bE)}}}if(bA.nodeType===9){if(bJ==="body"&&bA.body){return bl([bA.body],bE)}else{if(bH&&bH[3]){var bD=bA.getElementById(bH[3]);if(bD&&bD.parentNode){if(bD.id===bH[3]){return bl([bD],bE)}}else{return bl([],bE)}}}try{return bl(bA.querySelectorAll(bJ),bE)}catch(bF){}}else{if(bA.nodeType===1&&bA.nodeName.toLowerCase()!=="object"){var bB=bA,bC=bA.getAttribute("id"),bz=bC||bx,bL=bA.parentNode,bK=/^\s*[+~]/.test(bJ);if(!bC){bA.setAttribute("id",bz)}else{bz=bz.replace(/'/g,"\\$&")}if(bK&&bL){bA=bA.parentNode}try{if(!bK||bL){return bl(bA.querySelectorAll("[id='"+bz+"'] "+bJ),bE)}}catch(bG){}finally{if(!bC){bB.removeAttribute("id")}}}}}return e(bJ,bA,bE,bI)};for(var bw in e){bf[bw]=e[bw]}by=null})()}(function(){var e=al.documentElement,bx=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector,bw=false;try{bx.call(al.documentElement,"[test!='']:sizzle")}catch(by){bw=true}if(bx){bf.matchesSelector=function(bz,bB){bB=bB.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!bf.isXML(bz)){try{if(bw||!bk.match.PSEUDO.test(bB)&&!/!=/.test(bB)){return bx.call(bz,bB)}}catch(bA){}}return bf(bB,null,null,[bz]).length>0}}})();(function(){var e=al.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bk.order.splice(1,0,"CLASS");bk.find.CLASS=function(bw,bx,by){if(typeof bx.getElementsByClassName!=="undefined"&&!by){return bx.getElementsByClassName(bw[1])}};e=null})();function bd(bw,bB,bA,bE,bC,bD){for(var by=0,bx=bE.length;by<bx;by++){var e=bE[by];if(e){var bz=false;e=e[bw];while(e){if(e.sizcache===bA){bz=bE[e.sizset];break}if(e.nodeType===1&&!bD){e.sizcache=bA;e.sizset=by}if(e.nodeName.toLowerCase()===bB){bz=e;break}e=e[bw]}bE[by]=bz}}}function bt(bw,bB,bA,bE,bC,bD){for(var by=0,bx=bE.length;by<bx;by++){var e=bE[by];if(e){var bz=false;e=e[bw];while(e){if(e.sizcache===bA){bz=bE[e.sizset];break}if(e.nodeType===1){if(!bD){e.sizcache=bA;e.sizset=by}if(typeof bB!=="string"){if(e===bB){bz=true;break}}else{if(bf.filter(bB,[e]).length>0){bz=e;break}}}e=e[bw]}bE[by]=bz}}}if(al.documentElement.contains){bf.contains=function(bw,e){return bw!==e&&(bw.contains?bw.contains(e):true)}}else{if(al.documentElement.compareDocumentPosition){bf.contains=function(bw,e){return !!(bw.compareDocumentPosition(e)&16)}}else{bf.contains=function(){return false}}}bf.isXML=function(e){var bw=(e?e.ownerDocument||e:0).documentElement;return bw?bw.nodeName!=="HTML":false};var bs=function(e,bC){var bA,by=[],bz="",bx=bC.nodeType?[bC]:bC;while((bA=bk.match.PSEUDO.exec(e))){bz+=bA[0];e=e.replace(bk.match.PSEUDO,"")}e=bk.relative[e]?e+"*":e;for(var bB=0,bw=bx.length;bB<bw;bB++){bf(e,bx[bB],by)}return bf.filter(bz,by)};a.find=bf;a.expr=bf.selectors;a.expr[":"]=a.expr.filters;a.unique=bf.uniqueSort;a.text=bf.getText;a.isXMLDoc=bf.isXML;a.contains=bf.contains})();var W=/Until$/,ai=/^(?:parents|prevUntil|prevAll)/,aW=/,/,a9=/^.[^:#\[\.,]*$/,M=Array.prototype.slice,F=a.expr.match.POS,ao={children:true,contents:true,next:true,prev:true};a.fn.extend({find:function(e){var be=this.pushStack("","find",e),bh=0;for(var bf=0,bd=this.length;bf<bd;bf++){bh=be.length;a.find(e,this[bf],be);if(bf>0){for(var bi=bh;bi<be.length;bi++){for(var bg=0;bg<bh;bg++){if(be[bg]===be[bi]){be.splice(bi--,1);break}}}}}return be},has:function(bd){var e=a(bd);return this.filter(function(){for(var bf=0,be=e.length;bf<be;bf++){if(a.contains(this,e[bf])){return true}}})},not:function(e){return this.pushStack(av(this,e,false),"not",e)},filter:function(e){return this.pushStack(av(this,e,true),"filter",e)},is:function(e){return !!e&&a.filter(e,this).length>0},closest:function(bm,bd){var bj=[],bg,be,bl=this[0];if(a.isArray(bm)){var bi,bf,bh={},e=1;if(bl&&bm.length){for(bg=0,be=bm.length;bg<be;bg++){bf=bm[bg];if(!bh[bf]){bh[bf]=a.expr.match.POS.test(bf)?a(bf,bd||this.context):bf}}while(bl&&bl.ownerDocument&&bl!==bd){for(bf in bh){bi=bh[bf];if(bi.jquery?bi.index(bl)>-1:a(bl).is(bi)){bj.push({selector:bf,elem:bl,level:e})}}bl=bl.parentNode;e++}}return bj}var bk=F.test(bm)?a(bm,bd||this.context):null;for(bg=0,be=this.length;bg<be;bg++){bl=this[bg];while(bl){if(bk?bk.index(bl)>-1:a.find.matchesSelector(bl,bm)){bj.push(bl);break}else{bl=bl.parentNode;if(!bl||!bl.ownerDocument||bl===bd){break}}}}bj=bj.length>1?a.unique(bj):bj;return this.pushStack(bj,"closest",bm)},index:function(e){if(!e||typeof e==="string"){return a.inArray(this[0],e?a(e):this.parent().children())}return a.inArray(e.jquery?e[0]:e,this)},add:function(e,bd){var bf=typeof e==="string"?a(e,bd):a.makeArray(e),be=a.merge(this.get(),bf);return this.pushStack(B(bf[0])||B(be[0])?be:a.unique(be))},andSelf:function(){return this.add(this.prevObject)}});function B(e){return !e||!e.parentNode||e.parentNode.nodeType===11}a.each({parent:function(bd){var e=bd.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return a.dir(e,"parentNode")},parentsUntil:function(bd,e,be){return a.dir(bd,"parentNode",be)},next:function(e){return a.nth(e,2,"nextSibling")},prev:function(e){return a.nth(e,2,"previousSibling")},nextAll:function(e){return a.dir(e,"nextSibling")},prevAll:function(e){return a.dir(e,"previousSibling")},nextUntil:function(bd,e,be){return a.dir(bd,"nextSibling",be)},prevUntil:function(bd,e,be){return a.dir(bd,"previousSibling",be)},siblings:function(e){return a.sibling(e.parentNode.firstChild,e)},children:function(e){return a.sibling(e.firstChild)},contents:function(e){return a.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:a.makeArray(e.childNodes)}},function(e,bd){a.fn[e]=function(bh,be){var bg=a.map(this,bd,bh),bf=M.call(arguments);if(!W.test(e)){be=bh}if(be&&typeof be==="string"){bg=a.filter(be,bg)}bg=this.length>1&&!ao[e]?a.unique(bg):bg;if((this.length>1||aW.test(be))&&ai.test(e)){bg=bg.reverse()}return this.pushStack(bg,e,bf.join(","))}});a.extend({filter:function(be,e,bd){if(bd){be=":not("+be+")"}return e.length===1?a.find.matchesSelector(e[0],be)?[e[0]]:[]:a.find.matches(be,e)},dir:function(be,bd,bg){var e=[],bf=be[bd];while(bf&&bf.nodeType!==9&&(bg===H||bf.nodeType!==1||!a(bf).is(bg))){if(bf.nodeType===1){e.push(bf)}bf=bf[bd]}return e},nth:function(bg,e,be,bf){e=e||1;var bd=0;for(;bg;bg=bg[be]){if(bg.nodeType===1&&++bd===e){break}}return bg},sibling:function(be,bd){var e=[];for(;be;be=be.nextSibling){if(be.nodeType===1&&be!==bd){e.push(be)}}return e}});function av(bf,be,e){if(a.isFunction(be)){return a.grep(bf,function(bh,bg){var bi=!!be.call(bh,bg,bh);return bi===e})}else{if(be.nodeType){return a.grep(bf,function(bh,bg){return(bh===be)===e})}else{if(typeof be==="string"){var bd=a.grep(bf,function(bg){return bg.nodeType===1});if(a9.test(be)){return a.filter(be,bd,!e)}else{be=a.filter(be,bd)}}}}return a.grep(bf,function(bh,bg){return(a.inArray(bh,be)>=0)===e})}var ab=/ jQuery\d+="(?:\d+|null)"/g,aj=/^\s+/,O=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,c=/<([\w:]+)/,v=/<tbody/i,T=/<|&#?\w+;/,L=/<(?:script|object|embed|option|style)/i,m=/checked\s*(?:[^=]|=\s*.checked.)/i,an={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};an.optgroup=an.option;an.tbody=an.tfoot=an.colgroup=an.caption=an.thead;an.th=an.td;if(!a.support.htmlSerialize){an._default=[1,"div<div>","</div>"]}a.fn.extend({text:function(e){if(a.isFunction(e)){return this.each(function(be){var bd=a(this);bd.text(e.call(this,be,bd.text()))})}if(typeof e!=="object"&&e!==H){return this.empty().append((this[0]&&this[0].ownerDocument||al).createTextNode(e))}return a.text(this)},wrapAll:function(e){if(a.isFunction(e)){return this.each(function(be){a(this).wrapAll(e.call(this,be))})}if(this[0]){var bd=a(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bd.insertBefore(this[0])}bd.map(function(){var be=this;while(be.firstChild&&be.firstChild.nodeType===1){be=be.firstChild}return be}).append(this)}return this},wrapInner:function(e){if(a.isFunction(e)){return this.each(function(bd){a(this).wrapInner(e.call(this,bd))})}return this.each(function(){var bd=a(this),be=bd.contents();if(be.length){be.wrapAll(e)}else{bd.append(e)}})},wrap:function(e){return this.each(function(){a(this).wrapAll(e)})},unwrap:function(){return this.parent().each(function(){if(!a.nodeName(this,"body")){a(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bd){this.parentNode.insertBefore(bd,this)})}else{if(arguments.length){var e=a(arguments[0]);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bd){this.parentNode.insertBefore(bd,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,a(arguments[0]).toArray());return e}}},remove:function(e,bf){for(var bd=0,be;(be=this[bd])!=null;bd++){if(!e||a.filter(e,[be]).length){if(!bf&&be.nodeType===1){a.cleanData(be.getElementsByTagName("*"));a.cleanData([be])}if(be.parentNode){be.parentNode.removeChild(be)}}}return this},empty:function(){for(var e=0,bd;(bd=this[e])!=null;e++){if(bd.nodeType===1){a.cleanData(bd.getElementsByTagName("*"))}while(bd.firstChild){bd.removeChild(bd.firstChild)}}return this},clone:function(bd,e){bd=bd==null?false:bd;e=e==null?bd:e;return this.map(function(){return a.clone(this,bd,e)})},html:function(bf){if(bf===H){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ab,""):null}else{if(typeof bf==="string"&&!L.test(bf)&&(a.support.leadingWhitespace||!aj.test(bf))&&!an[(c.exec(bf)||["",""])[1].toLowerCase()]){bf=bf.replace(O,"<$1></$2>");try{for(var be=0,bd=this.length;be<bd;be++){if(this[be].nodeType===1){a.cleanData(this[be].getElementsByTagName("*"));this[be].innerHTML=bf}}}catch(bg){this.empty().append(bf)}}else{if(a.isFunction(bf)){this.each(function(bh){var e=a(this);e.html(bf.call(this,bh,e.html()))})}else{this.empty().append(bf)}}}return this},replaceWith:function(e){if(this[0]&&this[0].parentNode){if(a.isFunction(e)){return this.each(function(bf){var be=a(this),bd=be.html();be.replaceWith(e.call(this,bf,bd))})}if(typeof e!=="string"){e=a(e).detach()}return this.each(function(){var be=this.nextSibling,bd=this.parentNode;a(this).remove();if(be){a(be).before(e)}else{a(bd).append(e)}})}else{return this.pushStack(a(a.isFunction(e)?e():e),"replaceWith",e)}},detach:function(e){return this.remove(e,true)},domManip:function(bj,bn,bm){var bf,bg,bi,bl,bk=bj[0],bd=[];if(!a.support.checkClone&&arguments.length===3&&typeof bk==="string"&&m.test(bk)){return this.each(function(){a(this).domManip(bj,bn,bm,true)})}if(a.isFunction(bk)){return this.each(function(bp){var bo=a(this);bj[0]=bk.call(this,bp,bn?bo.html():H);bo.domManip(bj,bn,bm)})}if(this[0]){bl=bk&&bk.parentNode;if(a.support.parentNode&&bl&&bl.nodeType===11&&bl.childNodes.length===this.length){bf={fragment:bl}}else{bf=a.buildFragment(bj,this,bd)}bi=bf.fragment;if(bi.childNodes.length===1){bg=bi=bi.firstChild}else{bg=bi.firstChild}if(bg){bn=bn&&a.nodeName(bg,"tr");for(var be=0,e=this.length,bh=e-1;be<e;be++){bm.call(bn?aX(this[be],bg):this[be],bf.cacheable||(e>1&&be<bh)?a.clone(bi,true,true):bi)}}if(bd.length){a.each(bd,a8)}}return this}});function aX(e,bd){return a.nodeName(e,"table")?(e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody"))):e}function s(e,bj){if(bj.nodeType!==1||!a.hasData(e)){return}var bi=a.expando,bf=a.data(e),bg=a.data(bj,bf);if((bf=bf[bi])){var bk=bf.events;bg=bg[bi]=a.extend({},bf);if(bk){delete bg.handle;bg.events={};for(var bh in bk){for(var be=0,bd=bk[bh].length;be<bd;be++){a.event.add(bj,bh+(bk[bh][be].namespace?".":"")+bk[bh][be].namespace,bk[bh][be],bk[bh][be].data)}}}}}function ac(bd,e){if(e.nodeType!==1){return}var be=e.nodeName.toLowerCase();e.clearAttributes();e.mergeAttributes(bd);if(be==="object"){e.outerHTML=bd.outerHTML}else{if(be==="input"&&(bd.type==="checkbox"||bd.type==="radio")){if(bd.checked){e.defaultChecked=e.checked=bd.checked}if(e.value!==bd.value){e.value=bd.value}}else{if(be==="option"){e.selected=bd.defaultSelected}else{if(be==="input"||be==="textarea"){e.defaultValue=bd.defaultValue}}}}e.removeAttribute(a.expando)}a.buildFragment=function(bh,bf,bd){var bg,e,be,bi=(bf&&bf[0]?bf[0].ownerDocument||bf[0]:al);if(bh.length===1&&typeof bh[0]==="string"&&bh[0].length<512&&bi===al&&bh[0].charAt(0)==="<"&&!L.test(bh[0])&&(a.support.checkClone||!m.test(bh[0]))){e=true;be=a.fragments[bh[0]];if(be){if(be!==1){bg=be}}}if(!bg){bg=bi.createDocumentFragment();a.clean(bh,bi,bg,bd)}if(e){a.fragments[bh[0]]=be?bg:1}return{fragment:bg,cacheable:e}};a.fragments={};a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,bd){a.fn[e]=function(be){var bh=[],bk=a(be),bj=this.length===1&&this[0].parentNode;if(bj&&bj.nodeType===11&&bj.childNodes.length===1&&bk.length===1){bk[bd](this[0]);return this}else{for(var bi=0,bf=bk.length;bi<bf;bi++){var bg=(bi>0?this.clone(true):this).get();a(bk[bi])[bd](bg);bh=bh.concat(bg)}return this.pushStack(bh,e,bk.selector)}}});function a1(e){if("getElementsByTagName" in e){return e.getElementsByTagName("*")}else{if("querySelectorAll" in e){return e.querySelectorAll("*")}else{return[]}}}a.extend({clone:function(bg,bi,be){var bh=bg.cloneNode(true),e,bd,bf;if((!a.support.noCloneEvent||!a.support.noCloneChecked)&&(bg.nodeType===1||bg.nodeType===11)&&!a.isXMLDoc(bg)){ac(bg,bh);e=a1(bg);bd=a1(bh);for(bf=0;e[bf];++bf){ac(e[bf],bd[bf])}}if(bi){s(bg,bh);if(be){e=a1(bg);bd=a1(bh);for(bf=0;e[bf];++bf){s(e[bf],bd[bf])}}}return bh},clean:function(be,bg,bn,bi){bg=bg||al;if(typeof bg.createElement==="undefined"){bg=bg.ownerDocument||bg[0]&&bg[0].ownerDocument||al}var bo=[];for(var bm=0,bh;(bh=be[bm])!=null;bm++){if(typeof bh==="number"){bh+=""}if(!bh){continue}if(typeof bh==="string"&&!T.test(bh)){bh=bg.createTextNode(bh)}else{if(typeof bh==="string"){bh=bh.replace(O,"<$1></$2>");var bp=(c.exec(bh)||["",""])[1].toLowerCase(),bf=an[bp]||an._default,bl=bf[0],bd=bg.createElement("div");bd.innerHTML=bf[1]+bh+bf[2];while(bl--){bd=bd.lastChild}if(!a.support.tbody){var e=v.test(bh),bk=bp==="table"&&!e?bd.firstChild&&bd.firstChild.childNodes:bf[1]==="<table>"&&!e?bd.childNodes:[];for(var bj=bk.length-1;bj>=0;--bj){if(a.nodeName(bk[bj],"tbody")&&!bk[bj].childNodes.length){bk[bj].parentNode.removeChild(bk[bj])}}}if(!a.support.leadingWhitespace&&aj.test(bh)){bd.insertBefore(bg.createTextNode(aj.exec(bh)[0]),bd.firstChild)}bh=bd.childNodes}}if(bh.nodeType){bo.push(bh)}else{bo=a.merge(bo,bh)}}if(bn){for(bm=0;bo[bm];bm++){if(bi&&a.nodeName(bo[bm],"script")&&(!bo[bm].type||bo[bm].type.toLowerCase()==="text/javascript")){bi.push(bo[bm].parentNode?bo[bm].parentNode.removeChild(bo[bm]):bo[bm])}else{if(bo[bm].nodeType===1){bo.splice.apply(bo,[bm+1,0].concat(a.makeArray(bo[bm].getElementsByTagName("script"))))}bn.appendChild(bo[bm])}}}return bo},cleanData:function(bd){var bg,be,e=a.cache,bl=a.expando,bj=a.event.special,bi=a.support.deleteExpando;for(var bh=0,bf;(bf=bd[bh])!=null;bh++){if(bf.nodeName&&a.noData[bf.nodeName.toLowerCase()]){continue}be=bf[a.expando];if(be){bg=e[be]&&e[be][bl];if(bg&&bg.events){for(var bk in bg.events){if(bj[bk]){a.event.remove(bf,bk)}else{a.removeEvent(bf,bk,bg.handle)}}if(bg.handle){bg.handle.elem=null}}if(bi){delete bf[a.expando]}else{if(bf.removeAttribute){bf.removeAttribute(a.expando)}}delete e[be]}}}});function a8(e,bd){if(bd.src){a.ajax({url:bd.src,async:false,dataType:"script"})}else{a.globalEval(bd.text||bd.textContent||bd.innerHTML||"")}if(bd.parentNode){bd.parentNode.removeChild(bd)}}var ae=/alpha\([^)]*\)/i,ak=/opacity=([^)]*)/,aM=/-([a-z])/ig,y=/([A-Z])/g,aZ=/^-?\d+(?:px)?$/i,a7=/^-?\d/,aV={position:"absolute",visibility:"hidden",display:"block"},ag=["Left","Right"],aR=["Top","Bottom"],U,ay,aL,l=function(e,bd){return bd.toUpperCase()};a.fn.css=function(e,bd){if(arguments.length===2&&bd===H){return this}return a.access(this,e,bd,true,function(bf,be,bg){return bg!==H?a.style(bf,be,bg):a.css(bf,be)})};a.extend({cssHooks:{opacity:{get:function(be,bd){if(bd){var e=U(be,"opacity","opacity");return e===""?"1":e}else{return be.style.opacity}}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,zoom:true,lineHeight:true},cssProps:{"float":a.support.cssFloat?"cssFloat":"styleFloat"},style:function(bf,be,bk,bg){if(!bf||bf.nodeType===3||bf.nodeType===8||!bf.style){return}var bj,bh=a.camelCase(be),bd=bf.style,bl=a.cssHooks[bh];be=a.cssProps[bh]||bh;if(bk!==H){if(typeof bk==="number"&&isNaN(bk)||bk==null){return}if(typeof bk==="number"&&!a.cssNumber[bh]){bk+="px"}if(!bl||!("set" in bl)||(bk=bl.set(bf,bk))!==H){try{bd[be]=bk}catch(bi){}}}else{if(bl&&"get" in bl&&(bj=bl.get(bf,false,bg))!==H){return bj}return bd[be]}},css:function(bh,bg,bd){var bf,be=a.camelCase(bg),e=a.cssHooks[be];bg=a.cssProps[be]||be;if(e&&"get" in e&&(bf=e.get(bh,true,bd))!==H){return bf}else{if(U){return U(bh,bg,be)}}},swap:function(bf,be,bg){var e={};for(var bd in be){e[bd]=bf.style[bd];bf.style[bd]=be[bd]}bg.call(bf);for(bd in be){bf.style[bd]=e[bd]}},camelCase:function(e){return e.replace(aM,l)}});a.curCSS=a.css;a.each(["height","width"],function(bd,e){a.cssHooks[e]={get:function(bg,bf,be){var bh;if(bf){if(bg.offsetWidth!==0){bh=o(bg,e,be)}else{a.swap(bg,aV,function(){bh=o(bg,e,be)})}if(bh<=0){bh=U(bg,e,e);if(bh==="0px"&&aL){bh=aL(bg,e,e)}if(bh!=null){return bh===""||bh==="auto"?"0px":bh}}if(bh<0||bh==null){bh=bg.style[e];return bh===""||bh==="auto"?"0px":bh}return typeof bh==="string"?bh:bh+"px"}},set:function(be,bf){if(aZ.test(bf)){bf=parseFloat(bf);if(bf>=0){return bf+"px"}}else{return bf}}}});if(!a.support.opacity){a.cssHooks.opacity={get:function(bd,e){return ak.test((e&&bd.currentStyle?bd.currentStyle.filter:bd.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(bf,bg){var be=bf.style;be.zoom=1;var e=a.isNaN(bg)?"":"alpha(opacity="+bg*100+")",bd=be.filter||"";be.filter=ae.test(bd)?bd.replace(ae,e):be.filter+" "+e}}}if(al.defaultView&&al.defaultView.getComputedStyle){ay=function(bh,e,bf){var be,bg,bd;bf=bf.replace(y,"-$1").toLowerCase();if(!(bg=bh.ownerDocument.defaultView)){return H}if((bd=bg.getComputedStyle(bh,null))){be=bd.getPropertyValue(bf);if(be===""&&!a.contains(bh.ownerDocument.documentElement,bh)){be=a.style(bh,bf)}}return be}}if(al.documentElement.currentStyle){aL=function(bg,be){var bh,bd=bg.currentStyle&&bg.currentStyle[be],e=bg.runtimeStyle&&bg.runtimeStyle[be],bf=bg.style;if(!aZ.test(bd)&&a7.test(bd)){bh=bf.left;if(e){bg.runtimeStyle.left=bg.currentStyle.left}bf.left=be==="fontSize"?"1em":(bd||0);bd=bf.pixelLeft+"px";bf.left=bh;if(e){bg.runtimeStyle.left=e}}return bd===""?"auto":bd}}U=ay||aL;function o(be,bd,e){var bg=bd==="width"?ag:aR,bf=bd==="width"?be.offsetWidth:be.offsetHeight;if(e==="border"){return bf}a.each(bg,function(){if(!e){bf-=parseFloat(a.css(be,"padding"+this))||0}if(e==="margin"){bf+=parseFloat(a.css(be,"margin"+this))||0}else{bf-=parseFloat(a.css(be,"border"+this+"Width"))||0}});return bf}if(a.expr&&a.expr.filters){a.expr.filters.hidden=function(be){var bd=be.offsetWidth,e=be.offsetHeight;return(bd===0&&e===0)||(!a.support.reliableHiddenOffsets&&(be.style.display||a.css(be,"display"))==="none")};a.expr.filters.visible=function(e){return !a.expr.filters.hidden(e)}}var i=/%20/g,ah=/\[\]$/,bc=/\r?\n/g,ba=/#.*$/,ar=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,aO=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,aB=/(?:^file|^widget|\-extension):$/,aD=/^(?:GET|HEAD)$/,b=/^\/\//,I=/\?/,aU=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,p=/^(?:select|textarea)/i,g=/\s+/,bb=/([?&])_=[^&]*/,R=/(^|\-)([a-z])/g,aJ=function(bd,e,be){return e+be.toUpperCase()},G=/^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,z=a.fn.load,V={},q={},au,r;try{au=al.location.href}catch(am){au=al.createElement("a");au.href="";au=au.href}r=G.exec(au.toLowerCase());function d(e){return function(bg,bi){if(typeof bg!=="string"){bi=bg;bg="*"}if(a.isFunction(bi)){var bf=bg.toLowerCase().split(g),be=0,bh=bf.length,bd,bj,bk;for(;be<bh;be++){bd=bf[be];bk=/^\+/.test(bd);if(bk){bd=bd.substr(1)||"*"}bj=e[bd]=e[bd]||[];bj[bk?"unshift":"push"](bi)}}}}function aI(bd,bm,bh,bl,bj,bf){bj=bj||bm.dataTypes[0];bf=bf||{};bf[bj]=true;var bi=bd[bj],be=0,e=bi?bi.length:0,bg=(bd===V),bk;for(;be<e&&(bg||!bk);be++){bk=bi[be](bm,bh,bl);if(typeof bk==="string"){if(!bg||bf[bk]){bk=H}else{bm.dataTypes.unshift(bk);bk=aI(bd,bm,bh,bl,bk,bf)}}}if((bg||!bk)&&!bf["*"]){bk=aI(bd,bm,bh,bl,"*",bf)}return bk}a.fn.extend({load:function(be,bh,bi){if(typeof be!=="string"&&z){return z.apply(this,arguments)}else{if(!this.length){return this}}var bg=be.indexOf(" ");if(bg>=0){var e=be.slice(bg,be.length);be=be.slice(0,bg)}var bf="GET";if(bh){if(a.isFunction(bh)){bi=bh;bh=H}else{if(typeof bh==="object"){bh=a.param(bh,a.ajaxSettings.traditional);bf="POST"}}}var bd=this;a.ajax({url:be,type:bf,dataType:"html",data:bh,complete:function(bk,bj,bl){bl=bk.responseText;if(bk.isResolved()){bk.done(function(bm){bl=bm});bd.html(e?a("<div>").append(bl.replace(aU,"")).find(e):bl)}if(bi){bd.each(bi,[bl,bj,bk])}}});return this},serialize:function(){return a.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?a.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||p.test(this.nodeName)||aO.test(this.type))}).map(function(e,bd){var be=a(this).val();return be==null?null:a.isArray(be)?a.map(be,function(bg,bf){return{name:bd.name,value:bg.replace(bc,"\r\n")}}):{name:bd.name,value:be.replace(bc,"\r\n")}}).get()}});a.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bd){a.fn[bd]=function(be){return this.bind(bd,be)}});a.each(["get","post"],function(e,bd){a[bd]=function(be,bg,bh,bf){if(a.isFunction(bg)){bf=bf||bh;bh=bg;bg=H}return a.ajax({type:bd,url:be,data:bg,success:bh,dataType:bf})}});a.extend({getScript:function(e,bd){return a.get(e,H,bd,"script")},getJSON:function(e,bd,be){return a.get(e,bd,be,"json")},ajaxSetup:function(be,e){if(!e){e=be;be=a.extend(true,a.ajaxSettings,e)}else{a.extend(true,be,a.ajaxSettings,e)}for(var bd in {context:1,url:1}){if(bd in e){be[bd]=e[bd]}else{if(bd in a.ajaxSettings){be[bd]=a.ajaxSettings[bd]}}}return be},ajaxSettings:{url:au,isLocal:aB.test(r[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":aY.String,"text html":true,"text json":a.parseJSON,"text xml":a.parseXML}},ajaxPrefilter:d(V),ajaxTransport:d(q),ajax:function(bh,bf){if(typeof bh==="object"){bf=bh;bh=H}bf=bf||{};var bl=a.ajaxSetup({},bf),bz=bl.context||bl,bo=bz!==bl&&(bz.nodeType||bz instanceof a)?a(bz):a.event,by=a.Deferred(),bv=a._Deferred(),bj=bl.statusCode||{},bk,bp={},bx,bg,bt,bm,bq,bi=0,be,bs,br={readyState:0,setRequestHeader:function(e,bA){if(!bi){bp[e.toLowerCase().replace(R,aJ)]=bA}return this},getAllResponseHeaders:function(){return bi===2?bx:null},getResponseHeader:function(bA){var e;if(bi===2){if(!bg){bg={};while((e=ar.exec(bx))){bg[e[1].toLowerCase()]=e[2]}}e=bg[bA.toLowerCase()]}return e===H?null:e},overrideMimeType:function(e){if(!bi){bl.mimeType=e}return this},abort:function(e){e=e||"abort";if(bt){bt.abort(e)}bn(0,e);return this}};function bn(bF,bD,bG,bC){if(bi===2){return}bi=2;if(bm){clearTimeout(bm)}bt=H;bx=bC||"";br.readyState=bF?4:0;var bA,bK,bJ,bE=bG?a4(bl,br,bG):H,bB,bI;if(bF>=200&&bF<300||bF===304){if(bl.ifModified){if((bB=br.getResponseHeader("Last-Modified"))){a.lastModified[bk]=bB}if((bI=br.getResponseHeader("Etag"))){a.etag[bk]=bI}}if(bF===304){bD="notmodified";bA=true}else{try{bK=D(bl,bE);bD="success";bA=true}catch(bH){bD="parsererror";bJ=bH}}}else{bJ=bD;if(!bD||bF){bD="error";if(bF<0){bF=0}}}br.status=bF;br.statusText=bD;if(bA){by.resolveWith(bz,[bK,bD,br])}else{by.rejectWith(bz,[br,bD,bJ])}br.statusCode(bj);bj=H;if(be){bo.trigger("ajax"+(bA?"Success":"Error"),[br,bl,bA?bK:bJ])}bv.resolveWith(bz,[br,bD]);if(be){bo.trigger("ajaxComplete",[br,bl]);if(!(--a.active)){a.event.trigger("ajaxStop")}}}by.promise(br);br.success=br.done;br.error=br.fail;br.complete=bv.done;br.statusCode=function(bA){if(bA){var e;if(bi<2){for(e in bA){bj[e]=[bj[e],bA[e]]}}else{e=bA[br.status];br.then(e,e)}}return this};bl.url=((bh||bl.url)+"").replace(ba,"").replace(b,r[1]+"//");bl.dataTypes=a.trim(bl.dataType||"*").toLowerCase().split(g);if(!bl.crossDomain){bq=G.exec(bl.url.toLowerCase());bl.crossDomain=!!(bq&&(bq[1]!=r[1]||bq[2]!=r[2]||(bq[3]||(bq[1]==="http:"?80:443))!=(r[3]||(r[1]==="http:"?80:443))))}if(bl.data&&bl.processData&&typeof bl.data!=="string"){bl.data=a.param(bl.data,bl.traditional)}aI(V,bl,bf,br);if(bi===2){return false}be=bl.global;bl.type=bl.type.toUpperCase();bl.hasContent=!aD.test(bl.type);if(be&&a.active++===0){a.event.trigger("ajaxStart")}if(!bl.hasContent){if(bl.data){bl.url+=(I.test(bl.url)?"&":"?")+bl.data}bk=bl.url;if(bl.cache===false){var bd=a.now(),bw=bl.url.replace(bb,"$1_="+bd);bl.url=bw+((bw===bl.url)?(I.test(bl.url)?"&":"?")+"_="+bd:"")}}if(bl.data&&bl.hasContent&&bl.contentType!==false||bf.contentType){bp["Content-Type"]=bl.contentType}if(bl.ifModified){bk=bk||bl.url;if(a.lastModified[bk]){bp["If-Modified-Since"]=a.lastModified[bk]}if(a.etag[bk]){bp["If-None-Match"]=a.etag[bk]}}bp.Accept=bl.dataTypes[0]&&bl.accepts[bl.dataTypes[0]]?bl.accepts[bl.dataTypes[0]]+(bl.dataTypes[0]!=="*"?", */*; q=0.01":""):bl.accepts["*"];for(bs in bl.headers){br.setRequestHeader(bs,bl.headers[bs])}if(bl.beforeSend&&(bl.beforeSend.call(bz,br,bl)===false||bi===2)){br.abort();return false}for(bs in {success:1,error:1,complete:1}){br[bs](bl[bs])}bt=aI(q,bl,bf,br);if(!bt){bn(-1,"No Transport")}else{br.readyState=1;if(be){bo.trigger("ajaxSend",[br,bl])}if(bl.async&&bl.timeout>0){bm=setTimeout(function(){br.abort("timeout")},bl.timeout)}try{bi=1;bt.send(bp,bn)}catch(bu){if(status<2){bn(-1,bu)}else{a.error(bu)}}}return br},param:function(e,be){var bd=[],bg=function(bh,bi){bi=a.isFunction(bi)?bi():bi;bd[bd.length]=encodeURIComponent(bh)+"="+encodeURIComponent(bi)};if(be===H){be=a.ajaxSettings.traditional}if(a.isArray(e)||(e.jquery&&!a.isPlainObject(e))){a.each(e,function(){bg(this.name,this.value)})}else{for(var bf in e){u(bf,e[bf],be,bg)}}return bd.join("&").replace(i,"+")}});function u(be,bg,bd,bf){if(a.isArray(bg)&&bg.length){a.each(bg,function(bi,bh){if(bd||ah.test(be)){bf(be,bh)}else{u(be+"["+(typeof bh==="object"||a.isArray(bh)?bi:"")+"]",bh,bd,bf)}})}else{if(!bd&&bg!=null&&typeof bg==="object"){if(a.isArray(bg)||a.isEmptyObject(bg)){bf(be,"")}else{for(var e in bg){u(be+"["+e+"]",bg[e],bd,bf)}}}else{bf(be,bg)}}}a.extend({active:0,lastModified:{},etag:{}});function a4(bl,bk,bh){var bd=bl.contents,bj=bl.dataTypes,be=bl.responseFields,bg,bi,bf,e;for(bi in be){if(bi in bh){bk[be[bi]]=bh[bi]}}while(bj[0]==="*"){bj.shift();if(bg===H){bg=bl.mimeType||bk.getResponseHeader("content-type")}}if(bg){for(bi in bd){if(bd[bi]&&bd[bi].test(bg)){bj.unshift(bi);break}}}if(bj[0] in bh){bf=bj[0]}else{for(bi in bh){if(!bj[0]||bl.converters[bi+" "+bj[0]]){bf=bi;break}if(!e){e=bi}}bf=bf||e}if(bf){if(bf!==bj[0]){bj.unshift(bf)}return bh[bf]}}function D(bp,bh){if(bp.dataFilter){bh=bp.dataFilter(bh,bp.dataType)}var bl=bp.dataTypes,bo={},bi,bm,be=bl.length,bj,bk=bl[0],bf,bg,bn,bd,e;for(bi=1;bi<be;bi++){if(bi===1){for(bm in bp.converters){if(typeof bm==="string"){bo[bm.toLowerCase()]=bp.converters[bm]}}}bf=bk;bk=bl[bi];if(bk==="*"){bk=bf}else{if(bf!=="*"&&bf!==bk){bg=bf+" "+bk;bn=bo[bg]||bo["* "+bk];if(!bn){e=H;for(bd in bo){bj=bd.split(" ");if(bj[0]===bf||bj[0]==="*"){e=bo[bj[1]+" "+bk];if(e){bd=bo[bd];if(bd===true){bn=e}else{if(e===true){bn=bd}}break}}}}if(!(bn||e)){a.error("No conversion from "+bg.replace(" "," to "))}if(bn!==true){bh=bn?bn(bh):e(bd(bh))}}}}return bh}var aq=a.now(),t=/(\=)\?(&|$)|()\?\?()/i;a.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return a.expando+"_"+(aq++)}});a.ajaxPrefilter("json jsonp",function(bm,bi,bl){var bk=(typeof bm.data==="string");if(false){var bj,be=bm.jsonpCallback=a.isFunction(bm.jsonpCallback)?bm.jsonpCallback():bm.jsonpCallback,bh=aY[be],e=bm.url,bg=bm.data,bd="$1"+be+"$2",bf=function(){aY[be]=bh;if(bj&&a.isFunction(bh)){aY[be](bj[0])}};if(bm.jsonp!==false){e=e.replace(t,bd);if(bm.url===e){if(bk){bg=bg.replace(t,bd)}if(bm.data===bg){e+=(/\?/.test(e)?"&":"?")+bm.jsonp+"="+be}}}bm.url=e;bm.data=bg;aY[be]=function(bn){bj=[bn]};bl.then(bf,bf);bm.converters["script json"]=function(){if(!bj){a.error(be+" was not called")}return bj[0]};bm.dataTypes[0]="json";return"script"}});a.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){a.globalEval(e);return e}}});a.ajaxPrefilter("script",function(e){if(e.cache===H){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});a.ajaxTransport("script",function(be){if(be.crossDomain){var e,bd=al.head||al.getElementsByTagName("head")[0]||al.documentElement;return{send:function(bf,bg){e=al.createElement("script");e.async="async";if(be.scriptCharset){e.charset=be.scriptCharset}e.src=be.url;e.onload=e.onreadystatechange=function(bi,bh){if(!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;if(bd&&e.parentNode){bd.removeChild(e)}e=H;if(!bh){bg(200,"success")}}};bd.insertBefore(e,bd.firstChild)},abort:function(){if(e){e.onload(0,1)}}}}});var x=a.now(),J,at;function A(){a(aY).unload(function(){for(var e in J){J[e](0,1)}})}function aA(){try{return new aY.XMLHttpRequest()}catch(bd){}}function ad(){try{return new aY.ActiveXObject("Microsoft.XMLHTTP")}catch(bd){}}a.ajaxSettings.xhr=aY.ActiveXObject?function(){return !this.isLocal&&aA()||ad()}:aA;at=a.ajaxSettings.xhr();a.support.ajax=!!at;a.support.cors=at&&("withCredentials" in at);at=H;if(a.support.ajax){a.ajaxTransport(function(e){if(!e.crossDomain||a.support.cors){var bd;return{send:function(bj,be){var bi=e.xhr(),bh,bg;if(e.username){bi.open(e.type,e.url,e.async,e.username,e.password)}else{bi.open(e.type,e.url,e.async)}if(e.xhrFields){for(bg in e.xhrFields){bi[bg]=e.xhrFields[bg]}}if(e.mimeType&&bi.overrideMimeType){bi.overrideMimeType(e.mimeType)}if(!(e.crossDomain&&!e.hasContent)&&!bj["X-Requested-With"]){bj["X-Requested-With"]="XMLHttpRequest"}try{for(bg in bj){bi.setRequestHeader(bg,bj[bg])}}catch(bf){}bi.send((e.hasContent&&e.data)||null);bd=function(bs,bm){var bn,bl,bk,bq,bp;try{if(bd&&(bm||bi.readyState===4)){bd=H;if(bh){bi.onreadystatechange=a.noop;delete J[bh]}if(bm){if(bi.readyState!==4){bi.abort()}}else{bn=bi.status;bk=bi.getAllResponseHeaders();bq={};bp=bi.responseXML;if(bp&&bp.documentElement){bq.xml=bp}bq.text=bi.responseText;try{bl=bi.statusText}catch(br){bl=""}if(!bn&&e.isLocal&&!e.crossDomain){bn=bq.text?200:404}else{if(bn===1223){bn=204}}}}}catch(bo){if(!bm){be(-1,bo)}}if(bq){be(bn,bl,bq,bk)}};if(!e.async||bi.readyState===4){bd()}else{if(!J){J={};A()}bh=x++;bi.onreadystatechange=J[bh]=bd}},abort:function(){if(bd){bd(0,1)}}}}})}var N={},ap=/^(?:toggle|show|hide)$/,aF=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,aS,ax=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];a.fn.extend({show:function(bf,bi,bh){var be,bg;if(bf||bf===0){return this.animate(aQ("show",3),bf,bi,bh)}else{for(var bd=0,e=this.length;bd<e;bd++){be=this[bd];bg=be.style.display;if(!a._data(be,"olddisplay")&&bg==="none"){bg=be.style.display=""}if(bg===""&&a.css(be,"display")==="none"){a._data(be,"olddisplay",w(be.nodeName))}}for(bd=0;bd<e;bd++){be=this[bd];bg=be.style.display;if(bg===""||bg==="none"){be.style.display=a._data(be,"olddisplay")||""}}return this}},hide:function(be,bh,bg){if(be||be===0){return this.animate(aQ("hide",3),be,bh,bg)}else{for(var bd=0,e=this.length;bd<e;bd++){var bf=a.css(this[bd],"display");if(bf!=="none"&&!a._data(this[bd],"olddisplay")){a._data(this[bd],"olddisplay",bf)}}for(bd=0;bd<e;bd++){this[bd].style.display="none"}return this}},_toggle:a.fn.toggle,toggle:function(be,bd,bf){var e=typeof be==="boolean";if(a.isFunction(be)&&a.isFunction(bd)){this._toggle.apply(this,arguments)}else{if(be==null||e){this.each(function(){var bg=e?be:a(this).is(":hidden");a(this)[bg?"show":"hide"]()})}else{this.animate(aQ("toggle",3),be,bd,bf)}}return this},fadeTo:function(e,bf,be,bd){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:bf},e,be,bd)},animate:function(bg,bd,bf,be){var e=a.speed(bd,bf,be);if(a.isEmptyObject(bg)){return this.each(e.complete)}return this[e.queue===false?"each":"queue"](function(){var bj=a.extend({},e),bn,bk=this.nodeType===1,bl=bk&&a(this).is(":hidden"),bh=this;for(bn in bg){var bi=a.camelCase(bn);if(bn!==bi){bg[bi]=bg[bn];delete bg[bn];bn=bi}if(bg[bn]==="hide"&&bl||bg[bn]==="show"&&!bl){return bj.complete.call(this)}if(bk&&(bn==="height"||bn==="width")){bj.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(a.css(this,"display")==="inline"&&a.css(this,"float")==="none"){if(!a.support.inlineBlockNeedsLayout){this.style.display="inline-block"}else{var bm=w(this.nodeName);if(bm==="inline"){this.style.display="inline-block"}else{this.style.display="inline";this.style.zoom=1}}}}if(a.isArray(bg[bn])){(bj.specialEasing=bj.specialEasing||{})[bn]=bg[bn][1];bg[bn]=bg[bn][0]}}if(bj.overflow!=null){this.style.overflow="hidden"}bj.curAnim=a.extend({},bg);a.each(bg,function(bp,bt){var bs=new a.fx(bh,bj,bp);if(ap.test(bt)){bs[bt==="toggle"?bl?"show":"hide":bt](bg)}else{var br=aF.exec(bt),bu=bs.cur();if(br){var bo=parseFloat(br[2]),bq=br[3]||(a.cssNumber[bp]?"":"px");if(bq!=="px"){a.style(bh,bp,(bo||1)+bq);bu=((bo||1)/bs.cur())*bu;a.style(bh,bp,bu+bq)}if(br[1]){bo=((br[1]==="-="?-1:1)*bo)+bu}bs.custom(bu,bo,bq)}else{bs.custom(bu,bt,"")}}});return true})},stop:function(bd,e){var be=a.timers;if(bd){this.queue([])}this.each(function(){for(var bf=be.length-1;bf>=0;bf--){if(be[bf].elem===this){if(e){be[bf](true)}be.splice(bf,1)}}});if(!e){this.dequeue()}return this}});function aQ(bd,e){var be={};a.each(ax.concat.apply([],ax.slice(0,e)),function(){be[this]=bd});return be}a.each({slideDown:aQ("show",1),slideUp:aQ("hide",1),slideToggle:aQ("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,bd){a.fn[e]=function(be,bg,bf){return this.animate(bd,be,bg,bf)}});a.extend({speed:function(be,bf,bd){var e=be&&typeof be==="object"?a.extend({},be):{complete:bd||!bd&&bf||a.isFunction(be)&&be,duration:be,easing:bd&&bf||bf&&!a.isFunction(bf)&&bf};e.duration=a.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in a.fx.speeds?a.fx.speeds[e.duration]:a.fx.speeds._default;e.old=e.complete;e.complete=function(){if(e.queue!==false){a(this).dequeue()}if(a.isFunction(e.old)){e.old.call(this)}};return e},easing:{linear:function(be,bf,e,bd){return e+bd*be},swing:function(be,bf,e,bd){return((-Math.cos(be*Math.PI)/2)+0.5)*bd+e}},timers:[],fx:function(bd,e,be){this.options=e;this.elem=bd;this.prop=be;if(!e.orig){e.orig={}}}});a.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(a.fx.step[this.prop]||a.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var e,bd=a.css(this.elem,this.prop);return isNaN(e=parseFloat(bd))?!bd||bd==="auto"?0:bd:e},custom:function(bh,bg,bf){var e=this,be=a.fx;this.startTime=a.now();this.start=bh;this.end=bg;this.unit=bf||this.unit||(a.cssNumber[this.prop]?"":"px");this.now=this.start;this.pos=this.state=0;function bd(bi){return e.step(bi)}bd.elem=this.elem;if(bd()&&a.timers.push(bd)&&!aS){aS=setInterval(be.tick,be.interval)}},show:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());a(this.elem).show()},hide:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(bf){var bk=a.now(),bg=true;if(bf||bk>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var bh in this.options.curAnim){if(this.options.curAnim[bh]!==true){bg=false}}if(bg){if(this.options.overflow!=null&&!a.support.shrinkWrapBlocks){var be=this.elem,bl=this.options;a.each(["","X","Y"],function(bm,bn){be.style["overflow"+bn]=bl.overflow[bm]})}if(this.options.hide){a(this.elem).hide()}if(this.options.hide||this.options.show){for(var e in this.options.curAnim){a.style(this.elem,e,this.options.orig[e])}}this.options.complete.call(this.elem)}return false}else{var bd=bk-this.startTime;this.state=bd/this.options.duration;var bi=this.options.specialEasing&&this.options.specialEasing[this.prop];var bj=this.options.easing||(a.easing.swing?"swing":"linear");this.pos=a.easing[bi||bj](this.state,bd,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};a.extend(a.fx,{tick:function(){var bd=a.timers;for(var e=0;e<bd.length;e++){if(!bd[e]()){bd.splice(e--,1)}}if(!bd.length){a.fx.stop()}},interval:13,stop:function(){clearInterval(aS);aS=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){a.style(e.elem,"opacity",e.now)},_default:function(e){if(e.elem.style&&e.elem.style[e.prop]!=null){e.elem.style[e.prop]=(e.prop==="width"||e.prop==="height"?Math.max(0,e.now):e.now)+e.unit}else{e.elem[e.prop]=e.now}}}});if(a.expr&&a.expr.filters){a.expr.filters.animated=function(e){return a.grep(a.timers,function(bd){return e===bd.elem}).length}}function w(be){if(!N[be]){var e=a("<"+be+">").appendTo("body"),bd=e.css("display");e.remove();if(bd==="none"||bd===""){bd="block"}N[be]=bd}return N[be]}var S=/^t(?:able|d|h)$/i,Y=/^(?:body|html)$/i;if("getBoundingClientRect" in al.documentElement){a.fn.offset=function(bq){var bg=this[0],bj;if(bq){return this.each(function(e){a.offset.setOffset(this,bq,e)})}if(!bg||!bg.ownerDocument){return null}if(bg===bg.ownerDocument.body){return a.offset.bodyOffset(bg)}try{bj=bg.getBoundingClientRect()}catch(bn){}var bp=bg.ownerDocument,be=bp.documentElement;if(!bj||!a.contains(be,bg)){return bj?{top:bj.top,left:bj.left}:{top:0,left:0}}var bk=bp.body,bl=az(bp),bi=be.clientTop||bk.clientTop||0,bm=be.clientLeft||bk.clientLeft||0,bd=(bl.pageYOffset||a.support.boxModel&&be.scrollTop||bk.scrollTop),bh=(bl.pageXOffset||a.support.boxModel&&be.scrollLeft||bk.scrollLeft),bo=bj.top+bd-bi,bf=bj.left+bh-bm;return{top:bo,left:bf}}}else{a.fn.offset=function(bn){var bh=this[0];if(bn){return this.each(function(bo){a.offset.setOffset(this,bn,bo)})}if(!bh||!bh.ownerDocument){return null}if(bh===bh.ownerDocument.body){return a.offset.bodyOffset(bh)}a.offset.initialize();var bk,be=bh.offsetParent,bd=bh,bm=bh.ownerDocument,bf=bm.documentElement,bi=bm.body,bj=bm.defaultView,e=bj?bj.getComputedStyle(bh,null):bh.currentStyle,bl=bh.offsetTop,bg=bh.offsetLeft;while((bh=bh.parentNode)&&bh!==bi&&bh!==bf){if(a.offset.supportsFixedPosition&&e.position==="fixed"){break}bk=bj?bj.getComputedStyle(bh,null):bh.currentStyle;bl-=bh.scrollTop;bg-=bh.scrollLeft;if(bh===be){bl+=bh.offsetTop;bg+=bh.offsetLeft;if(a.offset.doesNotAddBorder&&!(a.offset.doesAddBorderForTableAndCells&&S.test(bh.nodeName))){bl+=parseFloat(bk.borderTopWidth)||0;bg+=parseFloat(bk.borderLeftWidth)||0}bd=be;be=bh.offsetParent}if(a.offset.subtractsBorderForOverflowNotVisible&&bk.overflow!=="visible"){bl+=parseFloat(bk.borderTopWidth)||0;bg+=parseFloat(bk.borderLeftWidth)||0}e=bk}if(e.position==="relative"||e.position==="static"){bl+=bi.offsetTop;bg+=bi.offsetLeft}if(a.offset.supportsFixedPosition&&e.position==="fixed"){bl+=Math.max(bf.scrollTop,bi.scrollTop);bg+=Math.max(bf.scrollLeft,bi.scrollLeft)}return{top:bl,left:bg}}}a.offset={initialize:function(){var e=al.body,bd=al.createElement("div"),bg,bi,bh,bj,be=parseFloat(a.css(e,"marginTop"))||0,bf="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.extend(bd.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});bd.innerHTML=bf;e.insertBefore(bd,e.firstChild);bg=bd.firstChild;bi=bg.firstChild;bj=bg.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(bi.offsetTop!==5);this.doesAddBorderForTableAndCells=(bj.offsetTop===5);bi.style.position="fixed";bi.style.top="20px";this.supportsFixedPosition=(bi.offsetTop===20||bi.offsetTop===15);bi.style.position=bi.style.top="";bg.style.overflow="hidden";bg.style.position="relative";this.subtractsBorderForOverflowNotVisible=(bi.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(e.offsetTop!==be);e.removeChild(bd);e=bd=bg=bi=bh=bj=null;a.offset.initialize=a.noop},bodyOffset:function(e){var be=e.offsetTop,bd=e.offsetLeft;a.offset.initialize();if(a.offset.doesNotIncludeMarginInBodyOffset){be+=parseFloat(a.css(e,"marginTop"))||0;bd+=parseFloat(a.css(e,"marginLeft"))||0}return{top:be,left:bd}},setOffset:function(bf,bo,bi){var bj=a.css(bf,"position");if(bj==="static"){bf.style.position="relative"}var bh=a(bf),bd=bh.offset(),e=a.css(bf,"top"),bm=a.css(bf,"left"),bn=(bj==="absolute"&&a.inArray("auto",[e,bm])>-1),bl={},bk={},be,bg;if(bn){bk=bh.position()}be=bn?bk.top:parseInt(e,10)||0;bg=bn?bk.left:parseInt(bm,10)||0;if(a.isFunction(bo)){bo=bo.call(bf,bi,bd)}if(bo.top!=null){bl.top=(bo.top-bd.top)+be}if(bo.left!=null){bl.left=(bo.left-bd.left)+bg}if("using" in bo){bo.using.call(bf,bl)}else{bh.css(bl)}}};a.fn.extend({position:function(){if(!this[0]){return null}var be=this[0],bd=this.offsetParent(),bf=this.offset(),e=Y.test(bd[0].nodeName)?{top:0,left:0}:bd.offset();bf.top-=parseFloat(a.css(be,"marginTop"))||0;bf.left-=parseFloat(a.css(be,"marginLeft"))||0;e.top+=parseFloat(a.css(bd[0],"borderTopWidth"))||0;e.left+=parseFloat(a.css(bd[0],"borderLeftWidth"))||0;return{top:bf.top-e.top,left:bf.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||al.body;while(e&&(!Y.test(e.nodeName)&&a.css(e,"position")==="static")){e=e.offsetParent}return e})}});a.each(["Left","Top"],function(bd,e){var be="scroll"+e;a.fn[be]=function(bh){var bf=this[0],bg;if(!bf){return null}if(bh!==H){return this.each(function(){bg=az(this);if(bg){bg.scrollTo(!bd?bh:a(bg).scrollLeft(),bd?bh:a(bg).scrollTop())}else{this[be]=bh}})}else{bg=az(bf);return bg?("pageXOffset" in bg)?bg[bd?"pageYOffset":"pageXOffset"]:a.support.boxModel&&bg.document.documentElement[be]||bg.document.body[be]:bf[be]}}});function az(e){return a.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}a.each(["Height","Width"],function(bd,e){var be=e.toLowerCase();a.fn["inner"+e]=function(){return this[0]?parseFloat(a.css(this[0],be,"padding")):null};a.fn["outer"+e]=function(bf){return this[0]?parseFloat(a.css(this[0],be,bf?"margin":"border")):null};a.fn[be]=function(bg){var bh=this[0];if(!bh){return bg==null?null:this}if(a.isFunction(bg)){return this.each(function(bl){var bk=a(this);bk[be](bg.call(this,bl,bk[be]()))})}if(a.isWindow(bh)){var bi=bh.document.documentElement["client"+e];return bh.document.compatMode==="CSS1Compat"&&bi||bh.document.body["client"+e]||bi}else{if(bh.nodeType===9){return Math.max(bh.documentElement["client"+e],bh.body["scroll"+e],bh.documentElement["scroll"+e],bh.body["offset"+e],bh.documentElement["offset"+e])}else{if(bg===H){var bj=a.css(bh,be),bf=parseFloat(bj);return a.isNaN(bf)?bj:bf}else{return this.css(be,typeof bg==="string"?bg:bg+"px")}}}}});aY.jQuery=aY.$=a})(window);
/*
 * Metadata - jQuery plugin for parsing metadata from elements
 *
 * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
 *
 * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
 */
(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata"}var data=$.data(elem,settings.single);if(data){return data}data="{}";var getData=function(data){if(typeof data!="string"){return data}if(data.indexOf("{")<0){data=eval("("+data+")")}};var getObject=function(data){if(typeof data!="string"){return data}data=eval("("+data+")");return data};if(settings.type=="html5"){var object={};$(elem.attributes).each(function(){var name=this.nodeName;if(name.match(/^data-/)){name=name.replace(/^data-/,"")}else{return true}object[name]=getObject(this.nodeValue)})}else{if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1]}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML)}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr}}}}object=getObject(data.indexOf("{")<0?"{"+data+"}":data)}$.data(elem,settings.single,object);return object}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts)}})(jQuery);
/*
 * jQuery UI 1.8.10
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(a,c){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.10",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({_focus:a.fn.focus,focus:function(d,e){return typeof d==="number"?this.each(function(){var f=this;setTimeout(function(){a(f).focus();if(e){e.call(f)}},d)}):this._focus.apply(this,arguments)},scrollParent:function(){var d;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){d=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{d=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!d.length?a(document):d},zIndex:function(g){if(g!==c){return this.css("zIndex",g)}if(this.length){var e=a(this[0]),d,f;while(e.length&&e[0]!==document){d=e.css("position");if(d==="absolute"||d==="relative"||d==="fixed"){f=parseInt(e.css("zIndex"),10);if(!isNaN(f)&&f!==0){return f}}e=e.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(d){d.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(f,d){var e=d==="Width"?["Left","Right"]:["Top","Bottom"],g=d.toLowerCase(),j={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function h(l,k,i,m){a.each(e,function(){k-=parseFloat(a.curCSS(l,"padding"+this,true))||0;if(i){k-=parseFloat(a.curCSS(l,"border"+this+"Width",true))||0}if(m){k-=parseFloat(a.curCSS(l,"margin"+this,true))||0}});return k}a.fn["inner"+d]=function(i){if(i===c){return j["inner"+d].call(this)}return this.each(function(){a(this).css(g,h(this,i)+"px")})};a.fn["outer"+d]=function(i,k){if(typeof i!=="number"){return j["outer"+d].call(this,i)}return this.each(function(){a(this).css(g,h(this,i,true,k)+"px")})}});function b(d){return !a(d).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(f,e,d){return !!a.data(f,d[3])},focusable:function(f){var i=f.nodeName.toLowerCase(),d=a.attr(f,"tabindex");if("area"===i){var h=f.parentNode,g=h.name,e;if(!f.href||!g||h.nodeName.toLowerCase()!=="map"){return false}e=a("img[usemap=#"+g+"]")[0];return !!e&&b(e)}return(/input|select|textarea|button|object/.test(i)?!f.disabled:"a"==i?f.href||!isNaN(d):!isNaN(d))&&b(f)},tabbable:function(e){var d=a.attr(e,"tabindex");return(isNaN(d)||d>=0)&&a(e).is(":focusable")}});a(function(){var d=document.body,e=d.appendChild(e=document.createElement("div"));a.extend(e.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=e.offsetHeight===100;a.support.selectstart="onselectstart" in e;d.removeChild(e).style.display="none"});a.extend(a.ui,{plugin:{add:function(e,f,h){var g=a.ui[e].prototype;for(var d in h){g.plugins[d]=g.plugins[d]||[];g.plugins[d].push([f,h[d]])}},call:function(d,f,e){var h=d.plugins[f];if(!h||!d.element[0].parentNode){return}for(var g=0;g<h.length;g++){if(d.options[h[g][0]]){h[g][1].apply(d.element,e)}}}},contains:function(e,d){return document.compareDocumentPosition?e.compareDocumentPosition(d)&16:e!==d&&e.contains(d)},hasScroll:function(g,e){if(a(g).css("overflow")==="hidden"){return false}var d=(e&&e==="left")?"scrollLeft":"scrollTop",f=false;if(g[d]>0){return true}g[d]=1;f=(g[d]>0);g[d]=0;return f},isOverAxis:function(e,d,f){return(e>d)&&(e<(d+f))},isOver:function(i,e,h,g,d,f){return a.ui.isOverAxis(i,h,d)&&a.ui.isOverAxis(e,g,f)}})})(jQuery);
/*
 * jQuery UI Widget 1.8.10
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(e){for(var f=0,g;(g=e[f])!=null;f++){b(g).triggerHandler("remove")}c(e)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(f,g,h){var k=this.options[f];g=b.Event(g);g.type=(f===this.widgetEventPrefix?f:this.widgetEventPrefix+f).toLowerCase();h=h||{};if(g.originalEvent){for(var e=b.event.props.length,j;e;){j=b.event.props[--e];g[j]=g.originalEvent[j]}}this.element.trigger(g,h);return !(b.isFunction(k)&&k.call(this.element[0],g,h)===false||g.isDefaultPrevented())}}})(jQuery);
/*
 * jQuery UI Mouse 1.8.10
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(a,b){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(d){return c._mouseDown(d)}).bind("click."+this.widgetName,function(d){if(true===a.data(d.target,c.widgetName+".preventClickEvent")){a.removeData(d.target,c.widgetName+".preventClickEvent");d.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(e){e.originalEvent=e.originalEvent||{};if(e.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(e));this._mouseDownEvent=e;var d=this,f=(e.which==1),c=(typeof this.options.cancel=="string"?a(e.target).parents().add(e.target).filter(this.options.cancel).length:false);if(!f||c||!this._mouseCapture(e)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(e)!==false);if(!this._mouseStarted){e.preventDefault();return true}}this._mouseMoveDelegate=function(g){return d._mouseMove(g)};this._mouseUpDelegate=function(g){return d._mouseUp(g)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);e.preventDefault();e.originalEvent.mouseHandled=true;return true},_mouseMove:function(c){if(a.browser.msie&&!(document.documentMode>=9)&&!c.button){return this._mouseUp(c)}if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,c)!==false);(this._mouseStarted?this._mouseDrag(c):this._mouseUp(c))}return !this._mouseStarted},_mouseUp:function(c){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(c.target==this._mouseDownEvent.target){a.data(c.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return(Math.max(Math.abs(this._mouseDownEvent.pageX-c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance)},_mouseDelayMet:function(c){return this.mouseDelayMet},_mouseStart:function(c){},_mouseDrag:function(c){},_mouseStop:function(c){},_mouseCapture:function(c){return true}})})(jQuery);(function(f,g){f.ui=f.ui||{};var d=/left|center|right/,e=/top|center|bottom/,a="center",b=f.fn.position,c=f.fn.offset;f.fn.position=function(i){if(!i||!i.of){return b.apply(this,arguments)}i=f.extend({},i);var m=f(i.of),l=m[0],o=(i.collision||"flip").split(" "),n=i.offset?i.offset.split(" "):[0,0],k,h,j;if(l.nodeType===9){k=m.width();h=m.height();j={top:0,left:0}}else{if(l.setTimeout){k=m.width();h=m.height();j={top:m.scrollTop(),left:m.scrollLeft()}}else{if(l.preventDefault){i.at="left top";k=h=0;j={top:i.of.pageY,left:i.of.pageX}}else{k=m.outerWidth();h=m.outerHeight();j=m.offset()}}}f.each(["my","at"],function(){var p=(i[this]||"").split(" ");if(p.length===1){p=d.test(p[0])?p.concat([a]):e.test(p[0])?[a].concat(p):[a,a]}p[0]=d.test(p[0])?p[0]:a;p[1]=e.test(p[1])?p[1]:a;i[this]=p});if(o.length===1){o[1]=o[0]}n[0]=parseInt(n[0],10)||0;if(n.length===1){n[1]=n[0]}n[1]=parseInt(n[1],10)||0;if(i.at[0]==="right"){j.left+=k}else{if(i.at[0]===a){j.left+=k/2}}if(i.at[1]==="bottom"){j.top+=h}else{if(i.at[1]===a){j.top+=h/2}}j.left+=n[0];j.top+=n[1];return this.each(function(){var s=f(this),u=s.outerWidth(),r=s.outerHeight(),t=parseInt(f.curCSS(this,"marginLeft",true))||0,q=parseInt(f.curCSS(this,"marginTop",true))||0,w=u+t+(parseInt(f.curCSS(this,"marginRight",true))||0),x=r+q+(parseInt(f.curCSS(this,"marginBottom",true))||0),v=f.extend({},j),p;if(i.my[0]==="right"){v.left-=u}else{if(i.my[0]===a){v.left-=u/2}}if(i.my[1]==="bottom"){v.top-=r}else{if(i.my[1]===a){v.top-=r/2}}v.left=Math.round(v.left);v.top=Math.round(v.top);p={left:v.left-t,top:v.top-q};f.each(["left","top"],function(z,y){if(f.ui.position[o[z]]){f.ui.position[o[z]][y](v,{targetWidth:k,targetHeight:h,elemWidth:u,elemHeight:r,collisionPosition:p,collisionWidth:w,collisionHeight:x,offset:n,my:i.my,at:i.at})}});if(f.fn.bgiframe){s.bgiframe()}s.offset(f.extend(v,{using:i.using}))})};f.ui.position={fit:{left:function(h,i){var k=f(window),j=i.collisionPosition.left+i.collisionWidth-k.width()-k.scrollLeft();h.left=j>0?h.left-j:Math.max(h.left-i.collisionPosition.left,h.left)},top:function(h,i){var k=f(window),j=i.collisionPosition.top+i.collisionHeight-k.height()-k.scrollTop();h.top=j>0?h.top-j:Math.max(h.top-i.collisionPosition.top,h.top)}},flip:{left:function(i,k){if(k.at[0]===a){return}var m=f(window),l=k.collisionPosition.left+k.collisionWidth-m.width()-m.scrollLeft(),h=k.my[0]==="left"?-k.elemWidth:k.my[0]==="right"?k.elemWidth:0,j=k.at[0]==="left"?k.targetWidth:-k.targetWidth,n=-2*k.offset[0];i.left+=k.collisionPosition.left<0?h+j+n:l>0?h+j+n:0},top:function(i,k){if(k.at[1]===a){return}var m=f(window),l=k.collisionPosition.top+k.collisionHeight-m.height()-m.scrollTop(),h=k.my[1]==="top"?-k.elemHeight:k.my[1]==="bottom"?k.elemHeight:0,j=k.at[1]==="top"?k.targetHeight:-k.targetHeight,n=-2*k.offset[1];i.top+=k.collisionPosition.top<0?h+j+n:l>0?h+j+n:0}}};if(!f.offset.setOffset){f.offset.setOffset=function(l,i){if(/static/.test(f.curCSS(l,"position"))){l.style.position="relative"}var k=f(l),n=k.offset(),h=parseInt(f.curCSS(l,"top",true),10)||0,m=parseInt(f.curCSS(l,"left",true),10)||0,j={top:(i.top-n.top)+h,left:(i.left-n.left)+m};if("using" in i){i.using.call(l,j)}else{k.css(j)}};f.fn.offset=function(h){var i=this[0];if(!i||!i.ownerDocument){return null}if(h){return this.each(function(){f.offset.setOffset(this,h)})}return c.call(this)}}}(jQuery));(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(c){var d=this.options;if(this.helper||d.disabled||a(c.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(c);if(!this.handle){return false}return true},_mouseStart:function(c){var d=this.options;this.helper=this._createHelper(c);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;(d.cursorAt&&this._adjustOffsetFromHelper(d.cursorAt));if(d.containment){this._setContainment()}if(this._trigger("start",c)===false){this._clear();return false}this._cacheHelperProportions();if(a.ui.ddmanager&&!d.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,c)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(c,true);return true},_mouseDrag:function(c,e){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");if(!e){var d=this._uiHash();if(this._trigger("drag",c,d)===false){this._mouseUp({});return false}this.position=d.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,c)}return false},_mouseStop:function(d){var e=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){e=a.ui.ddmanager.drop(this,d)}if(this.dropped){e=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return false}if((this.options.revert=="invalid"&&!e)||(this.options.revert=="valid"&&e)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,e))){var c=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(c._trigger("stop",d)!==false){c._clear()}})}else{if(this._trigger("stop",d)!==false){this._clear()}}return false},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(c){var d=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==c.target){d=true}});return d},_createHelper:function(d){var e=this.options;var c=a.isFunction(e.helper)?a(e.helper.apply(this.element[0],[d])):(e.helper=="clone"?this.element.clone():this.element);if(!c.parents("body").length){c.appendTo((e.appendTo=="parent"?this.element[0].parentNode:e.appendTo))}if(c[0]!=this.element[0]&&!(/(fixed|absolute)/).test(c.css("position"))){c.css("position","absolute")}return c},_adjustOffsetFromHelper:function(c){if(typeof c=="string"){c=c.split(" ")}if(a.isArray(c)){c={left:+c[0],top:+c[1]||0}}if("left" in c){this.offset.click.left=c.left+this.margins.left}if("right" in c){this.offset.click.left=this.helperProportions.width-c.right+this.margins.left}if("top" in c){this.offset.click.top=c.top+this.margins.top}if("bottom" in c){this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){c={top:0,left:0}}return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.element.position();return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var f=this.options;if(f.containment=="parent"){f.containment=this.helper[0].parentNode}if(f.containment=="document"||f.containment=="window"){this.containment=[(f.containment=="document"?0:a(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(f.containment=="document"?0:a(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(f.containment=="document"?0:a(window).scrollLeft())+a(f.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(f.containment=="document"?0:a(window).scrollTop())+(a(f.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(f.containment)&&f.containment.constructor!=Array){var d=a(f.containment)[0];if(!d){return}var e=a(f.containment).offset();var c=(a(d).css("overflow")!="hidden");this.containment=[e.left+(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0)-this.margins.top,e.left+(c?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(c?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(f.containment.constructor==Array){this.containment=f.containment}}},_convertPositionTo:function(g,i){if(!i){i=this.position}var e=g=="absolute"?1:-1;var f=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=(/(html|body)/i).test(c[0].tagName);return{top:(i.top+this.offset.relative.top*e+this.offset.parent.top*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(h?0:c.scrollTop()))*e)),left:(i.left+this.offset.relative.left*e+this.offset.parent.left*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:c.scrollLeft())*e))}},_generatePosition:function(f){var i=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,j=(/(html|body)/i).test(c[0].tagName);var e=f.pageX;var d=f.pageY;if(this.originalPosition){if(this.containment){if(f.pageX-this.offset.click.left<this.containment[0]){e=this.containment[0]+this.offset.click.left}if(f.pageY-this.offset.click.top<this.containment[1]){d=this.containment[1]+this.offset.click.top}if(f.pageX-this.offset.click.left>this.containment[2]){e=this.containment[2]+this.offset.click.left}if(f.pageY-this.offset.click.top>this.containment[3]){d=this.containment[3]+this.offset.click.top}}if(i.grid){var h=this.originalPageY+Math.round((d-this.originalPageY)/i.grid[1])*i.grid[1];d=this.containment?(!(h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3])?h:(!(h-this.offset.click.top<this.containment[1])?h-i.grid[1]:h+i.grid[1])):h;var g=this.originalPageX+Math.round((e-this.originalPageX)/i.grid[0])*i.grid[0];e=this.containment?(!(g-this.offset.click.left<this.containment[0]||g-this.offset.click.left>this.containment[2])?g:(!(g-this.offset.click.left<this.containment[0])?g-i.grid[0]:g+i.grid[0])):g}}return{top:(d-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(j?0:c.scrollTop())))),left:(e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():j?0:c.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(c,d,e){e=e||this._uiHash();a.ui.plugin.call(this,c,[d,e]);if(c=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.Widget.prototype._trigger.call(this,c,d,e)},plugins:{},_uiHash:function(c){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.10"});a.ui.plugin.add("draggable","connectToSortable",{start:function(d,f){var e=a(this).data("draggable"),g=e.options,c=a.extend({},f,{item:e.element});e.sortables=[];a(g.connectToSortable).each(function(){var h=a.data(this,"sortable");if(h&&!h.options.disabled){e.sortables.push({instance:h,shouldRevert:h.options.revert});h._refreshItems();h._trigger("activate",d,c)}})},stop:function(d,f){var e=a(this).data("draggable"),c=a.extend({},f,{item:e.element});a.each(e.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;e.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(d);this.instance.options.helper=this.instance.options._helper;if(e.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",d,c)}})},drag:function(d,g){var f=a(this).data("draggable"),c=this;var e=function(j){var p=this.offset.click.top,n=this.offset.click.left;var h=this.positionAbs.top,l=this.positionAbs.left;var k=j.height,m=j.width;var q=j.top,i=j.left;return a.ui.isOver(h+p,l+n,q,i,k,m)};a.each(f.sortables,function(h){this.instance.positionAbs=f.positionAbs;this.instance.helperProportions=f.helperProportions;this.instance.offset.click=f.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(c).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return g.helper[0]};d.target=this.instance.currentItem[0];this.instance._mouseCapture(d,true);this.instance._mouseStart(d,true,true);this.instance.offset.click.top=f.offset.click.top;this.instance.offset.click.left=f.offset.click.left;this.instance.offset.parent.left-=f.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=f.offset.parent.top-this.instance.offset.parent.top;f._trigger("toSortable",d);f.dropped=this.instance.element;f.currentItem=f.element;this.instance.fromOutside=f}if(this.instance.currentItem){this.instance._mouseDrag(d)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",d,this.instance._uiHash(this.instance));this.instance._mouseStop(d,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}f._trigger("fromSortable",d);f.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(d,e){var c=a("body"),f=a(this).data("draggable").options;if(c.css("cursor")){f._cursor=c.css("cursor")}c.css("cursor",f.cursor)},stop:function(c,d){var e=a(this).data("draggable").options;if(e._cursor){a("body").css("cursor",e._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(c,d){var e=a(this).data("draggable").options;a(e.iframeFix===true?"iframe":e.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(c,d){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(d,e){var c=a(e.helper),f=a(this).data("draggable").options;if(c.css("opacity")){f._opacity=c.css("opacity")}c.css("opacity",f.opacity)},stop:function(c,d){var e=a(this).data("draggable").options;if(e._opacity){a(d.helper).css("opacity",e._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(d,e){var c=a(this).data("draggable");if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){c.overflowOffset=c.scrollParent.offset()}},drag:function(e,f){var d=a(this).data("draggable"),g=d.options,c=false;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!g.axis||g.axis!="x"){if((d.overflowOffset.top+d.scrollParent[0].offsetHeight)-e.pageY<g.scrollSensitivity){d.scrollParent[0].scrollTop=c=d.scrollParent[0].scrollTop+g.scrollSpeed}else{if(e.pageY-d.overflowOffset.top<g.scrollSensitivity){d.scrollParent[0].scrollTop=c=d.scrollParent[0].scrollTop-g.scrollSpeed}}}if(!g.axis||g.axis!="y"){if((d.overflowOffset.left+d.scrollParent[0].offsetWidth)-e.pageX<g.scrollSensitivity){d.scrollParent[0].scrollLeft=c=d.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(e.pageX-d.overflowOffset.left<g.scrollSensitivity){d.scrollParent[0].scrollLeft=c=d.scrollParent[0].scrollLeft-g.scrollSpeed}}}}else{if(!g.axis||g.axis!="x"){if(e.pageY-a(document).scrollTop()<g.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(e.pageY-a(document).scrollTop())<g.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}}if(!g.axis||g.axis!="y"){if(e.pageX-a(document).scrollLeft()<g.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(e.pageX-a(document).scrollLeft())<g.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}}if(c!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(d,e)}}});a.ui.plugin.add("draggable","snap",{start:function(d,e){var c=a(this).data("draggable"),f=c.options;c.snapElements=[];a(f.snap.constructor!=String?(f.snap.items||":data(draggable)"):f.snap).each(function(){var h=a(this);var g=h.offset();if(this!=c.element[0]){c.snapElements.push({item:this,width:h.outerWidth(),height:h.outerHeight(),top:g.top,left:g.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(d,e){var g=a(this).data("draggable").options;var f=a.makeArray(a(g.stack)).sort(function(i,h){return(parseInt(a(i).css("zIndex"),10)||0)-(parseInt(a(h).css("zIndex"),10)||0)});if(!f.length){return}var c=parseInt(f[0].style.zIndex)||0;a(f).each(function(h){this.style.zIndex=c+h});this[0].style.zIndex=c+f.length}});a.ui.plugin.add("draggable","zIndex",{start:function(d,e){var c=a(e.helper),f=a(this).data("draggable").options;if(c.css("zIndex")){f._zIndex=c.css("zIndex")}c.css("zIndex",f.zIndex)},stop:function(c,d){var e=a(this).data("draggable").options;if(e._zIndex){a(d.helper).css("zIndex",e._zIndex)}}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g<l.length;g++){var j=c.trim(l[g]),e="ui-resizable-"+j;var h=c('<div class="ui-resizable-handle '+e+'"></div>');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}if(c.browser.opera&&(/relative/).test(e.css("position"))){e.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateCache:function(e){var f=this.options;this.offset=this.helper.offset();if(a(e.left)){this.position.left=e.left}if(a(e.top)){this.position.top=e.top}if(a(e.height)){this.size.height=e.height}if(a(e.width)){this.size.width=e.width}},_updateRatio:function(h,g){var i=this.options,j=this.position,f=this.size,e=this.axis;if(h.height){h.width=(f.height*this.aspectRatio)}else{if(h.width){h.height=(f.width/this.aspectRatio)}}if(e=="sw"){h.left=j.left+(f.width-h.width);h.top=null}if(e=="nw"){h.top=j.top+(f.height-h.height);h.left=j.left+(f.width-h.width)}return h},_respectSize:function(l,g){var j=this.helper,i=this.options,r=this._aspectRatio||g.shiftKey,q=this.axis,t=a(l.width)&&i.maxWidth&&(i.maxWidth<l.width),m=a(l.height)&&i.maxHeight&&(i.maxHeight<l.height),h=a(l.width)&&i.minWidth&&(i.minWidth>l.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f<this._proportionallyResizeElements.length;f++){var h=this._proportionallyResizeElements[f];if(!this.borderDif){var e=[h.css("borderTopWidth"),h.css("borderRightWidth"),h.css("borderBottomWidth"),h.css("borderLeftWidth")],j=[h.css("paddingTop"),h.css("paddingRight"),h.css("paddingBottom"),h.css("paddingLeft")];this.borderDif=c.map(e,function(l,n){var m=parseInt(l,10)||0,o=parseInt(j[n],10)||0;return m+o})}if(c.browser.msie&&!(!(c(g).is(":hidden")||c(g).parents(":hidden").length))){continue}h.css({height:(g.height()-this.borderDif[0]-this.borderDif[2])||0,width:(g.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var f=this.element,i=this.options;this.elementOffset=f.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,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}}});c.extend(c.ui.resizable,{version:"1.8.10"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10),position:k.css("position")})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});if(c.browser.opera&&/relative/.test(q.css("position"))){f._revertToRelativePosition=true;q.css({position:"absolute",top:"auto",left:"auto"})}q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(g,h){var f=c(this).data("resizable"),i=f.options;var e=function(j){c(j).each(function(){var k=c(this);k.css({position:k.data("resizable-alsoresize").position})})};if(f._revertToRelativePosition){f._revertToRelativePosition=false;if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(j){e(j)})}else{e(i.alsoResize)}}c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var d;this.refresh=function(){d=a(c.options.filter,c.element[0]);d.each(function(){var e=a(this);var f=e.offset();a.data(this,"selectable-item",{element:this,$element:e,left:f.left,top:f.top,right:f.left+e.outerWidth(),bottom:f.top+e.outerHeight(),startselected:false,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})};this.refresh();this.selectees=d.addClass("ui-selectee");this._mouseInit();this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(e){var c=this;this.opos=[e.pageX,e.pageY];if(this.options.disabled){return}var d=this.options;this.selectees=a(d.filter,this.element[0]);this._trigger("start",e);a(d.appendTo).append(this.helper);this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0});if(d.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var f=a.data(this,"selectable-item");f.startselected=true;if(!e.metaKey){f.$element.removeClass("ui-selected");f.selected=false;f.$element.addClass("ui-unselecting");f.unselecting=true;c._trigger("unselecting",e,{unselecting:f.element})}});a(e.target).parents().andSelf().each(function(){var g=a.data(this,"selectable-item");if(g){var f=!e.metaKey||!g.$element.hasClass("ui-selected");g.$element.removeClass(f?"ui-unselecting":"ui-selected").addClass(f?"ui-selecting":"ui-unselecting");g.unselecting=!f;g.selecting=f;g.selected=f;if(f){c._trigger("selecting",e,{selecting:g.element})}else{c._trigger("unselecting",e,{unselecting:g.element})}return false}})},_mouseDrag:function(j){var d=this;this.dragged=true;if(this.options.disabled){return}var f=this.options;var e=this.opos[0],i=this.opos[1],c=j.pageX,h=j.pageY;if(e>c){var g=c;c=e;e=g}if(i>h){var g=h;h=i;i=g}this.helper.css({left:e,top:i,width:c-e,height:h-i});this.selectees.each(function(){var k=a.data(this,"selectable-item");if(!k||k.element==d.element[0]){return}var l=false;if(f.tolerance=="touch"){l=(!(k.left>c||k.right<e||k.top>h||k.bottom<i))}else{if(f.tolerance=="fit"){l=(k.left>e&&k.right<c&&k.top>i&&k.bottom<h)}}if(l){if(k.selected){k.$element.removeClass("ui-selected");k.selected=false}if(k.unselecting){k.$element.removeClass("ui-unselecting");k.unselecting=false}if(!k.selecting){k.$element.addClass("ui-selecting");k.selecting=true;d._trigger("selecting",j,{selecting:k.element})}}else{if(k.selecting){if(j.metaKey&&k.startselected){k.$element.removeClass("ui-selecting");k.selecting=false;k.$element.addClass("ui-selected");k.selected=true}else{k.$element.removeClass("ui-selecting");k.selecting=false;if(k.startselected){k.$element.addClass("ui-unselecting");k.unselecting=true}d._trigger("unselecting",j,{unselecting:k.element})}}if(k.selected){if(!j.metaKey&&!k.startselected){k.$element.removeClass("ui-selected");k.selected=false;k.$element.addClass("ui-unselecting");k.unselecting=true;d._trigger("unselecting",j,{unselecting:k.element})}}}});return false},_mouseStop:function(e){var c=this;this.dragged=false;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var f=a.data(this,"selectable-item");f.$element.removeClass("ui-unselecting");f.unselecting=false;f.startselected=false;c._trigger("unselected",e,{unselected:f.element})});a(".ui-selecting",this.element[0]).each(function(){var f=a.data(this,"selectable-item");f.$element.removeClass("ui-selecting").addClass("ui-selected");f.selecting=false;f.selected=true;f.startselected=true;c._trigger("selected",e,{selected:f.element})});this._trigger("stop",e);this.helper.remove();return false}});a.extend(a.ui.selectable,{version:"1.8.10"})})(jQuery);(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000},_create:function(){var c=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var c=this.items.length-1;c>=0;c--){this.items[c].item.removeData("sortable-item")}return this},_setOption:function(c,d){if(c==="disabled"){this.options[c]=d;this.widget()[d?"addClass":"removeClass"]("ui-sortable-disabled")}else{a.Widget.prototype._setOption.apply(this,arguments)}},_mouseCapture:function(f,g){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(f);var e=null,d=this,c=a(f.target).parents().each(function(){if(a.data(this,"sortable-item")==d){e=a(this);return false}});if(a.data(f.target,"sortable-item")==d){e=a(f.target)}if(!e){return false}if(this.options.handle&&!g){var h=false;a(this.options.handle,e).find("*").andSelf().each(function(){if(this==f.target){h=true}});if(!h){return false}}this.currentItem=e;this._removeCurrentsFromItems();return true},_mouseStart:function(f,g,c){var h=this.options,d=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(f);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};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:f.pageX-this.offset.left,top:f.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(f);this.originalPageX=f.pageX;this.originalPageY=f.pageY;(h.cursorAt&&this._adjustOffsetFromHelper(h.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(h.containment){this._setContainment()}if(h.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",h.cursor)}if(h.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",h.opacity)}if(h.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",h.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",f,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!c){for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("activate",f,d._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!h.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(f);return true},_mouseDrag:function(g){this.position=this._generatePosition(g);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var h=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-g.pageY<h.scrollSensitivity){this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+h.scrollSpeed}else{if(g.pageY-this.overflowOffset.top<h.scrollSensitivity){this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-h.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-g.pageX<h.scrollSensitivity){this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+h.scrollSpeed}else{if(g.pageX-this.overflowOffset.left<h.scrollSensitivity){this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-h.scrollSpeed}}}else{if(g.pageY-a(document).scrollTop()<h.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()-h.scrollSpeed)}else{if(a(window).height()-(g.pageY-a(document).scrollTop())<h.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()+h.scrollSpeed)}}if(g.pageX-a(document).scrollLeft()<h.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()-h.scrollSpeed)}else{if(a(window).width()-(g.pageX-a(document).scrollLeft())<h.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()+h.scrollSpeed)}}}if(c!==false&&a.ui.ddmanager&&!h.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,g)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],d=f.item[0],j=this._intersectsWithPointer(f);if(!j){continue}if(d!=this.currentItem[0]&&this.placeholder[j==1?"next":"prev"]()[0]!=d&&!a.ui.contains(this.placeholder[0],d)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],d):true)){this.direction=j==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f)){this._rearrange(g,f)}else{break}this._trigger("change",g,this._uiHash());break}}this._contactContainers(g);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,g)}this._trigger("sort",g,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(d,e){if(!d){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,d)}if(this.options.revert){var c=this;var f=c.placeholder.offset();c.reverting=true;a(this.helper).animate({left:f.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:f.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(d)})}else{this._clear(d,e)}return false},cancel:function(){var c=this;if(this.dragging){this._mouseUp({target:null});if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("deactivate",null,c._uiHash(this));if(this.containers[d].containerCache.over){this.containers[d]._trigger("out",null,c._uiHash(this));this.containers[d].containerCache.over=0}}}if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(e){var c=this._getItemsAsjQuery(e&&e.connected);var d=[];e=e||{};a(c).each(function(){var f=(a(e.item||this).attr(e.attribute||"id")||"").match(e.expression||(/(.+)[-=_](.+)/));if(f){d.push((e.key||f[1]+"[]")+"="+(e.key&&e.expression?f[1]:f[2]))}});if(!d.length&&e.key){d.push(e.key+"=")}return d.join("&")},toArray:function(e){var c=this._getItemsAsjQuery(e&&e.connected);var d=[];e=e||{};c.each(function(){d.push(a(e.item||this).attr(e.attribute||"id")||"")});return d},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)<i&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>m[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&n<k+(this.helperProportions.height/2)&&j-(this.helperProportions.height/2)<i)}},_intersectsWithPointer:function(e){var f=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),h=f&&d,c=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!h){return false}return this.floating?(((g&&g=="right")||c=="down")?2:1):(c&&(c=="down"?2:1))},_intersectsWithSides:function(f){var d=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,f.top+(f.height/2),f.height),e=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,f.left+(f.width/2),f.width),c=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(this.floating&&g){return((g=="right"&&e)||(g=="left"&&!e))}else{return c&&((c=="down"&&d)||(c=="up"&&!d))}},_getDragVerticalDirection:function(){var c=this.positionAbs.top-this.lastPositionAbs.top;return c!=0&&(c>0?"down":"up")},_getDragHorizontalDirection:function(){var c=this.positionAbs.left-this.lastPositionAbs.left;return c!=0&&(c>0?"right":"left")},refresh:function(c){this._refreshItems(c);this.refreshPositions();return this},_connectWith:function(){var c=this.options;return c.connectWith.constructor==String?[c.connectWith]:c.connectWith},_getItemsAsjQuery:function(c){var m=this;var h=[];var f=[];var k=this._connectWith();if(k&&c){for(var e=k.length-1;e>=0;e--){var l=a(k[e]);for(var d=l.length-1;d>=0;d--){var g=a.data(l[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element):a(g.options.items,g.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),g])}}}}f.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var e=f.length-1;e>=0;e--){f[e][0].each(function(){h.push(this)})}return a(h)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data(sortable-item)");for(var d=0;d<this.items.length;d++){for(var c=0;c<e.length;c++){if(e[c]==this.items[d].item[0]){this.items.splice(d,1)}}}},_refreshItems:function(c){this.items=[];this.containers=[this];var k=this.items;var q=this;var g=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],c,{item:this.currentItem}):a(this.options.items,this.element),this]];var m=this._connectWith();if(m){for(var f=m.length-1;f>=0;f--){var n=a(m[f]);for(var e=n.length-1;e>=0;e--){var h=a.data(n[e],"sortable");if(h&&h!=this&&!h.options.disabled){g.push([a.isFunction(h.options.items)?h.options.items.call(h.element[0],c,{item:this.currentItem}):a(h.options.items,h.element),h]);this.containers.push(h)}}}}for(var f=g.length-1;f>=0;f--){var l=g[f][1];var d=g[f][0];for(var e=0,o=d.length;e<o;e++){var p=a(d[e]);p.data("sortable-item",l);k.push({item:p,instance:l,width:0,height:0,left:0,top:0})}}},refreshPositions:function(c){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var e=this.items.length-1;e>=0;e--){var f=this.items[e];var d=this.options.toleranceElement?a(this.options.toleranceElement,f.item):f.item;if(!c){f.width=d.outerWidth();f.height=d.outerHeight()}var g=d.offset();f.left=g.left;f.top=g.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var e=this.containers.length-1;e>=0;e--){var g=this.containers[e].element.offset();this.containers[e].containerCache.left=g.left;this.containers[e].containerCache.top=g.top;this.containers[e].containerCache.width=this.containers[e].element.outerWidth();this.containers[e].containerCache.height=this.containers[e].element.outerHeight()}}return this},_createPlaceholder:function(e){var c=e||this,f=c.options;if(!f.placeholder||f.placeholder.constructor==String){var d=f.placeholder;f.placeholder={element:function(){var g=a(document.createElement(c.currentItem[0].nodeName)).addClass(d||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!d){g.style.visibility="hidden"}return g},update:function(g,h){if(d&&!f.forcePlaceholderSize){return}if(!h.height()){h.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10))}if(!h.width()){h.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}}c.placeholder=a(f.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);f.placeholder.update(c,c.placeholder)},_contactContainers:function(c){var e=null,l=null;for(var g=this.containers.length-1;g>=0;g--){if(a.ui.contains(this.currentItem[0],this.containers[g].element[0])){continue}if(this._intersectsWith(this.containers[g].containerCache)){if(e&&a.ui.contains(this.containers[g].element[0],e.element[0])){continue}e=this.containers[g];l=g}else{if(this.containers[g].containerCache.over){this.containers[g]._trigger("out",c,this._uiHash(this));this.containers[g].containerCache.over=0}}}if(!e){return}if(this.containers.length===1){this.containers[l]._trigger("over",c,this._uiHash(this));this.containers[l].containerCache.over=1}else{if(this.currentContainer!=this.containers[l]){var k=10000;var h=null;var d=this.positionAbs[this.containers[l].floating?"left":"top"];for(var f=this.items.length-1;f>=0;f--){if(!a.ui.contains(this.containers[l].element[0],this.items[f].item[0])){continue}var m=this.items[f][this.containers[l].floating?"left":"top"];if(Math.abs(m-d)<k){k=Math.abs(m-d);h=this.items[f]}}if(!h&&!this.options.dropOnEmpty){return}this.currentContainer=this.containers[l];h?this._rearrange(c,h,null,true):this._rearrange(c,null,this.containers[l].element,true);this._trigger("change",c,this._uiHash());this.containers[l]._trigger("change",c,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[l]._trigger("over",c,this._uiHash(this));this.containers[l].containerCache.over=1}}},_createHelper:function(d){var e=this.options;var c=a.isFunction(e.helper)?a(e.helper.apply(this.element[0],[d,this.currentItem])):(e.helper=="clone"?this.currentItem.clone():this.currentItem);if(!c.parents("body").length){a(e.appendTo!="parent"?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(c[0])}if(c[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")}}if(c[0].style.width==""||e.forceHelperSize){c.width(this.currentItem.width())}if(c[0].style.height==""||e.forceHelperSize){c.height(this.currentItem.height())}return c},_adjustOffsetFromHelper:function(c){if(typeof c=="string"){c=c.split(" ")}if(a.isArray(c)){c={left:+c[0],top:+c[1]||0}}if("left" in c){this.offset.click.left=c.left+this.margins.left}if("right" in c){this.offset.click.left=this.helperProportions.width-c.right+this.margins.left}if("top" in c){this.offset.click.top=c.top+this.margins.top}if("bottom" in c){this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){c={top:0,left:0}}return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.currentItem.position();return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{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 f=this.options;if(f.containment=="parent"){f.containment=this.helper[0].parentNode}if(f.containment=="document"||f.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(f.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(f.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(f.containment)){var d=a(f.containment)[0];var e=a(f.containment).offset();var c=(a(d).css("overflow")!="hidden");this.containment=[e.left+(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0)-this.margins.top,e.left+(c?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(c?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(g,i){if(!i){i=this.position}var e=g=="absolute"?1:-1;var f=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=(/(html|body)/i).test(c[0].tagName);return{top:(i.top+this.offset.relative.top*e+this.offset.parent.top*e-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(h?0:c.scrollTop()))*e)),left:(i.left+this.offset.relative.left*e+this.offset.parent.left*e-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:c.scrollLeft())*e))}},_generatePosition:function(f){var i=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,j=(/(html|body)/i).test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var e=f.pageX;var d=f.pageY;if(this.originalPosition){if(this.containment){if(f.pageX-this.offset.click.left<this.containment[0]){e=this.containment[0]+this.offset.click.left}if(f.pageY-this.offset.click.top<this.containment[1]){d=this.containment[1]+this.offset.click.top}if(f.pageX-this.offset.click.left>this.containment[2]){e=this.containment[2]+this.offset.click.left}if(f.pageY-this.offset.click.top>this.containment[3]){d=this.containment[3]+this.offset.click.top}}if(i.grid){var h=this.originalPageY+Math.round((d-this.originalPageY)/i.grid[1])*i.grid[1];d=this.containment?(!(h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3])?h:(!(h-this.offset.click.top<this.containment[1])?h-i.grid[1]:h+i.grid[1])):h;var g=this.originalPageX+Math.round((e-this.originalPageX)/i.grid[0])*i.grid[0];e=this.containment?(!(g-this.offset.click.left<this.containment[0]||g-this.offset.click.left>this.containment[2])?g:(!(g-this.offset.click.left<this.containment[0])?g-i.grid[0]:g+i.grid[0])):g}}return{top:(d-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(j?0:c.scrollTop())))),left:(e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():j?0:c.scrollLeft())))}},_rearrange:function(h,g,d,f){d?d[0].appendChild(this.placeholder[0]):g.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?g.item[0]:g.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var e=this,c=this.counter;window.setTimeout(function(){if(c==e.counter){e.refreshPositions(!f)}},0)},_clear:function(e,f){this.reverting=false;var g=[],c=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var d in this._storedCSS){if(this._storedCSS[d]=="auto"||this._storedCSS[d]=="static"){this._storedCSS[d]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!f){g.push(function(h){this._trigger("receive",h,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!f){g.push(function(h){this._trigger("update",h,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!f){g.push(function(h){this._trigger("remove",h,this._uiHash())})}for(var d=this.containers.length-1;d>=0;d--){if(a.ui.contains(this.containers[d].element[0],this.currentItem[0])&&!f){g.push((function(h){return function(i){h._trigger("receive",i,this._uiHash(this))}}).call(this,this.containers[d]));g.push((function(h){return function(i){h._trigger("update",i,this._uiHash(this))}}).call(this,this.containers[d]))}}}for(var d=this.containers.length-1;d>=0;d--){if(!f){g.push((function(h){return function(i){h._trigger("deactivate",i,this._uiHash(this))}}).call(this,this.containers[d]))}if(this.containers[d].containerCache.over){g.push((function(h){return function(i){h._trigger("out",i,this._uiHash(this))}}).call(this,this.containers[d]));this.containers[d].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!f){this._trigger("beforeStop",e,this._uiHash());for(var d=0;d<g.length;d++){g[d].call(this,e)}this._trigger("stop",e,this._uiHash())}return false}if(!f){this._trigger("beforeStop",e,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!f){for(var d=0;d<g.length;d++){g[d].call(this,e)}this._trigger("stop",e,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(d){var c=d||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:d?d.element:null}}});a.extend(a.ui.sortable,{version:"1.8.10"})})(jQuery);(function(e,h){var c,b="ui-button ui-widget ui-state-default ui-corner-all",g="ui-state-hover ui-state-active ",f="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",d=function(i){e(":ui-button",i.target.form).each(function(){var j=e(this).data("button");setTimeout(function(){j.refresh()},1)})},a=function(j){var i=j.name,k=j.form,l=e([]);if(i){if(k){l=e(k).find("[name='"+i+"']")}else{l=e("[name='"+i+"']",j.ownerDocument).filter(function(){return !this.form})}}return l};e.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",d);if(typeof this.options.disabled!=="boolean"){this.options.disabled=this.element.attr("disabled")}this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var i=this,k=this.options,l=this.type==="checkbox"||this.type==="radio",m="ui-state-hover"+(!l?" ui-state-active":""),j="ui-state-focus";if(k.label===null){k.label=this.buttonElement.html()}if(this.element.is(":disabled")){k.disabled=true}this.buttonElement.addClass(b).attr("role","button").bind("mouseenter.button",function(){if(k.disabled){return}e(this).addClass("ui-state-hover");if(this===c){e(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){if(k.disabled){return}e(this).removeClass(m)}).bind("focus.button",function(){e(this).addClass(j)}).bind("blur.button",function(){e(this).removeClass(j)});if(l){this.element.bind("change.button",function(){i.refresh()})}if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(k.disabled){return false}e(this).toggleClass("ui-state-active");i.buttonElement.attr("aria-pressed",i.element[0].checked)})}else{if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(k.disabled){return false}e(this).addClass("ui-state-active");i.buttonElement.attr("aria-pressed",true);var n=i.element[0];a(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)})}else{this.buttonElement.bind("mousedown.button",function(){if(k.disabled){return false}e(this).addClass("ui-state-active");c=this;e(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(k.disabled){return false}e(this).removeClass("ui-state-active")}).bind("keydown.button",function(n){if(k.disabled){return false}if(n.keyCode==e.ui.keyCode.SPACE||n.keyCode==e.ui.keyCode.ENTER){e(this).addClass("ui-state-active")}}).bind("keyup.button",function(){e(this).removeClass("ui-state-active")});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(n){if(n.keyCode===e.ui.keyCode.SPACE){e(this).click()}})}}}this._setOption("disabled",k.disabled)},_determineButtonType:function(){if(this.element.is(":checkbox")){this.type="checkbox"}else{if(this.element.is(":radio")){this.type="radio"}else{if(this.element.is("input")){this.type="input"}else{this.type="button"}}}if(this.type==="checkbox"||this.type==="radio"){this.buttonElement=this.element.parents().last().find("label[for="+this.element.attr("id")+"]");this.element.addClass("ui-helper-hidden-accessible");var i=this.element.is(":checked");if(i){this.buttonElement.addClass("ui-state-active")}this.buttonElement.attr("aria-pressed",i)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(b+" "+g+" "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title")}e.Widget.prototype.destroy.call(this)},_setOption:function(i,j){e.Widget.prototype._setOption.apply(this,arguments);if(i==="disabled"){if(j){this.element.attr("disabled",true)}else{this.element.removeAttr("disabled")}}this._resetButton()},refresh:function(){var i=this.element.is(":disabled");if(i!==this.options.disabled){this._setOption("disabled",i)}if(this.type==="radio"){a(this.element[0]).each(function(){if(e(this).is(":checked")){e(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true)}else{e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)}})}else{if(this.type==="checkbox"){if(this.element.is(":checked")){this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true)}else{this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)}}}},_resetButton:function(){if(this.type==="input"){if(this.options.label){this.element.val(this.options.label)}return}var m=this.buttonElement.removeClass(f),k=e("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(m.empty()).text(),j=this.options.icons,i=j.primary&&j.secondary,l=[];if(j.primary||j.secondary){l.push("ui-button-text-icon"+(i?"s":(j.primary?"-primary":"-secondary")));if(j.primary){m.prepend("<span class='ui-button-icon-primary ui-icon "+j.primary+"'></span>")}if(j.secondary){m.append("<span class='ui-button-icon-secondary ui-icon "+j.secondary+"'></span>")}if(!this.options.text){l.push(i?"ui-button-icons-only":"ui-button-icon-only");m.removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary");if(!this.hasTitle){m.attr("title",k)}}}else{l.push("ui-button-text-only")}m.addClass(l.join(" "))}});e.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(i,j){if(i==="disabled"){this.buttons.button("option",i,j)}e.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");e.Widget.prototype.destroy.call(this)}})}(jQuery));(function(d,e){var b="ui-dialog ui-widget ui-widget-content ui-corner-all ",a={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},c={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};d.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(g){var f=d(this).css(g).offset().top;if(f<0){d(this).css("top",g.top-f)}}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string"){this.originalTitle=""}this.options.title=this.options.title||this.originalTitle;var n=this,o=n.options,l=o.title||"&#160;",g=d.ui.dialog.getTitleId(n.element),m=(n.uiDialog=d("<div></div>")).appendTo(document.body).hide().addClass(b+o.dialogClass).css({zIndex:o.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(p){if(o.closeOnEscape&&p.keyCode&&p.keyCode===d.ui.keyCode.ESCAPE){n.close(p);p.preventDefault()}}).attr({role:"dialog","aria-labelledby":g}).mousedown(function(p){n.moveToTop(false,p)}),i=n.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(m),h=(n.uiDialogTitlebar=d("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(m),k=d('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){k.addClass("ui-state-hover")},function(){k.removeClass("ui-state-hover")}).focus(function(){k.addClass("ui-state-focus")}).blur(function(){k.removeClass("ui-state-focus")}).click(function(p){n.close(p);return false}).appendTo(h),j=(n.uiDialogTitlebarCloseText=d("<span></span>")).addClass("ui-icon ui-icon-closethick").text(o.closeText).appendTo(k),f=d("<span></span>").addClass("ui-dialog-title").attr("id",g).html(l).prependTo(h);if(d.isFunction(o.beforeclose)&&!d.isFunction(o.beforeClose)){o.beforeClose=o.beforeclose}h.find("*").add(h).disableSelection();if(o.draggable&&d.fn.draggable){n._makeDraggable()}if(o.resizable&&d.fn.resizable){n._makeResizable()}n._createButtons(o.buttons);n._isOpen=false;if(d.fn.bgiframe){m.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var f=this;if(f.overlay){f.overlay.destroy()}f.uiDialog.hide();f.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");f.uiDialog.remove();if(f.originalTitle){f.element.attr("title",f.originalTitle)}return f},widget:function(){return this.uiDialog},close:function(i){var f=this,h,g;if(false===f._trigger("beforeClose",i)){return}if(f.overlay){f.overlay.destroy()}f.uiDialog.unbind("keypress.ui-dialog");f._isOpen=false;if(f.options.hide){f.uiDialog.hide(f.options.hide,function(){f._trigger("close",i)})}else{f.uiDialog.hide();f._trigger("close",i)}d.ui.dialog.overlay.resize();if(f.options.modal){h=0;d(".ui-dialog").each(function(){if(this!==f.uiDialog[0]){g=d(this).css("z-index");if(!isNaN(g)){h=Math.max(h,g)}}});d.ui.dialog.maxZ=h}return f},isOpen:function(){return this._isOpen},moveToTop:function(j,i){var f=this,h=f.options,g;if((h.modal&&!j)||(!h.stack&&!h.modal)){return f._trigger("focus",i)}if(h.zIndex>d.ui.dialog.maxZ){d.ui.dialog.maxZ=h.zIndex}if(f.overlay){d.ui.dialog.maxZ+=1;f.overlay.$el.css("z-index",d.ui.dialog.overlay.maxZ=d.ui.dialog.maxZ)}g={scrollTop:f.element.attr("scrollTop"),scrollLeft:f.element.attr("scrollLeft")};d.ui.dialog.maxZ+=1;f.uiDialog.css("z-index",d.ui.dialog.maxZ);f.element.attr(g);f._trigger("focus",i);return f},open:function(){if(this._isOpen){return}var g=this,h=g.options,f=g.uiDialog;g.overlay=h.modal?new d.ui.dialog.overlay(g):null;g._size();g._position(h.position);f.show(h.show);g.moveToTop(true);if(h.modal){f.bind("keypress.ui-dialog",function(k){if(k.keyCode!==d.ui.keyCode.TAB){return}var j=d(":tabbable",this),l=j.filter(":first"),i=j.filter(":last");if(k.target===i[0]&&!k.shiftKey){l.focus(1);return false}else{if(k.target===l[0]&&k.shiftKey){i.focus(1);return false}}})}d(g.element.find(":tabbable").get().concat(f.find(".ui-dialog-buttonpane :tabbable").get().concat(f.get()))).eq(0).focus();g._isOpen=true;g._trigger("open");return g},_createButtons:function(i){var h=this,f=false,g=d("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),j=d("<div></div>").addClass("ui-dialog-buttonset").appendTo(g);h.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof i==="object"&&i!==null){d.each(i,function(){return !(f=true)})}if(f){d.each(i,function(k,m){m=d.isFunction(m)?{click:m,text:k}:m;var l=d('<button type="button"></button>').attr(m,true).unbind("click").click(function(){m.click.apply(h.element[0],arguments)}).appendTo(j);if(d.fn.button){l.button()}});g.appendTo(h.uiDialog)}},_makeDraggable:function(){var f=this,i=f.options,j=d(document),h;function g(k){return{position:k.position,offset:k.offset}}f.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(k,l){h=i.height==="auto"?"auto":d(this).height();d(this).height(d(this).height()).addClass("ui-dialog-dragging");f._trigger("dragStart",k,g(l))},drag:function(k,l){f._trigger("drag",k,g(l))},stop:function(k,l){i.position=[l.position.left-j.scrollLeft(),l.position.top-j.scrollTop()];d(this).removeClass("ui-dialog-dragging").height(h);f._trigger("dragStop",k,g(l));d.ui.dialog.overlay.resize()}})},_makeResizable:function(k){k=(k===e?this.options.resizable:k);var g=this,j=g.options,f=g.uiDialog.css("position"),i=(typeof k==="string"?k:"n,e,s,w,se,sw,ne,nw");function h(l){return{originalPosition:l.originalPosition,originalSize:l.originalSize,position:l.position,size:l.size}}g.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:g.element,maxWidth:j.maxWidth,maxHeight:j.maxHeight,minWidth:j.minWidth,minHeight:g._minHeight(),handles:i,start:function(l,m){d(this).addClass("ui-dialog-resizing");g._trigger("resizeStart",l,h(m))},resize:function(l,m){g._trigger("resize",l,h(m))},stop:function(l,m){d(this).removeClass("ui-dialog-resizing");j.height=d(this).height();j.width=d(this).width();g._trigger("resizeStop",l,h(m));d.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var f=this.options;if(f.height==="auto"){return f.minHeight}else{return Math.min(f.minHeight,f.height)}},_position:function(g){var h=[],i=[0,0],f;if(g){if(typeof g==="string"||(typeof g==="object"&&"0" in g)){h=g.split?g.split(" "):[g[0],g[1]];if(h.length===1){h[1]=h[0]}d.each(["left","top"],function(k,j){if(+h[k]===h[k]){i[k]=h[k];h[k]=j}});g={my:h.join(" "),at:h.join(" "),offset:i.join(" ")}}g=d.extend({},d.ui.dialog.prototype.options.position,g)}else{g=d.ui.dialog.prototype.options.position}f=this.uiDialog.is(":visible");if(!f){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position(d.extend({of:window},g));if(!f){this.uiDialog.hide()}},_setOptions:function(i){var g=this,f={},h=false;d.each(i,function(j,k){g._setOption(j,k);if(j in a){h=true}if(j in c){f[j]=k}});if(h){this._size()}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option",f)}},_setOption:function(i,j){var g=this,f=g.uiDialog;switch(i){case"beforeclose":i="beforeClose";break;case"buttons":g._createButtons(j);break;case"closeText":g.uiDialogTitlebarCloseText.text(""+j);break;case"dialogClass":f.removeClass(g.options.dialogClass).addClass(b+j);break;case"disabled":if(j){f.addClass("ui-dialog-disabled")}else{f.removeClass("ui-dialog-disabled")}break;case"draggable":var h=f.is(":data(draggable)");if(h&&!j){f.draggable("destroy")}if(!h&&j){g._makeDraggable()}break;case"position":g._position(j);break;case"resizable":var k=f.is(":data(resizable)");if(k&&!j){f.resizable("destroy")}if(k&&typeof j==="string"){f.resizable("option","handles",j)}if(!k&&j!==false){g._makeResizable(j)}break;case"title":d(".ui-dialog-title",g.uiDialogTitlebar).html(""+(j||"&#160;"));break}d.Widget.prototype._setOption.apply(g,arguments)},_size:function(){var j=this.options,g,i,f=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(j.minWidth>j.width){j.width=j.minWidth}g=this.uiDialog.css({height:"auto",width:j.width}).height();i=Math.max(0,j.minHeight-g);if(j.height==="auto"){if(d.support.minHeight){this.element.css({minHeight:i,height:"auto"})}else{this.uiDialog.show();var h=this.element.css("height","auto").height();if(!f){this.uiDialog.hide()}this.element.height(Math.max(h,i))}}else{this.element.height(Math.max(j.height-g,0))}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});d.extend(d.ui.dialog,{version:"1.8.10",uuid:0,maxZ:0,getTitleId:function(f){var g=f.attr("id");if(!g){this.uuid+=1;g=this.uuid}return"ui-dialog-title-"+g},overlay:function(f){this.$el=d.ui.dialog.overlay.create(f)}});d.extend(d.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:d.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(f){return f+".dialog-overlay"}).join(" "),create:function(g){if(this.instances.length===0){setTimeout(function(){if(d.ui.dialog.overlay.instances.length){d(document).bind(d.ui.dialog.overlay.events,function(h){if(d(h.target).zIndex()<d.ui.dialog.overlay.maxZ){return false}})}},1);d(document).bind("keydown.dialog-overlay",function(h){if(g.options.closeOnEscape&&h.keyCode&&h.keyCode===d.ui.keyCode.ESCAPE){g.close(h);h.preventDefault()}});d(window).bind("resize.dialog-overlay",d.ui.dialog.overlay.resize)}var f=(this.oldInstances.pop()||d("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});if(d.fn.bgiframe){f.bgiframe()}this.instances.push(f);return f},destroy:function(f){var g=d.inArray(f,this.instances);if(g!=-1){this.oldInstances.push(this.instances.splice(g,1)[0])}if(this.instances.length===0){d([document,window]).unbind(".dialog-overlay")}f.remove();var h=0;d.each(this.instances,function(){h=Math.max(h,this.css("z-index"))});this.maxZ=h},height:function(){var g,f;if(d.browser.msie&&d.browser.version<7){g=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);f=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(g<f){return d(window).height()+"px"}else{return g+"px"}}else{return d(document).height()+"px"}},width:function(){var f,g;if(d.browser.msie&&d.browser.version<7){f=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);g=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(f<g){return d(window).width()+"px"}else{return f+"px"}}else{return d(document).width()+"px"}},resize:function(){var f=d([]);d.each(d.ui.dialog.overlay.instances,function(){f=f.add(this)});f.css({width:0,height:0}).css({width:d.ui.dialog.overlay.width(),height:d.ui.dialog.overlay.height()})}});d.extend(d.ui.dialog.overlay.prototype,{destroy:function(){d.ui.dialog.overlay.destroy(this.$el)}})}(jQuery));(function($,undefined){$.extend($.ui,{datepicker:{version:"1.8.10"}});var PROP_NAME="datepicker";var dpuuid=new Date().getTime();function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){this.uuid+=1;target.id="dp"+this.uuid}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(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?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}this._attachments(input,inst);input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});this._autoSize(inst);$.data(target,PROP_NAME,inst)},_attachments:function(input,inst){var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(inst.append){inst.append.remove()}if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}input.unbind("focus",this._showDatepicker);if(inst.trigger){inst.trigger.remove()}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var 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==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==input[0]){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(input[0])}return false})}},_autoSize:function(inst){if(this._get(inst,"autoSize")&&!inst.inline){var date=new Date(2009,12-1,20);var dateFormat=this._get(inst,"dateFormat");if(dateFormat.match(/[DM]/)){var findMax=function(names){var max=0;var maxI=0;for(var i=0;i<names.length;i++){if(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);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst),true);this._updateDatepicker(inst);this._updateAlternate(inst);inst.dpDiv.show()},_dialogDatepicker:function(input,date,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){this.uuid+=1;var id="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+id+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}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);if(!this._pos){var browserWidth=document.documentElement.clientWidth;var browserHeight=document.documentElement.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var 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=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){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)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker()}var date=this._getDateDatepicker(target,true);extendRemove(inst.settings,settings);this._attachments($(target),inst);this._autoSize(inst);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date){var inst=this._getInst(target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst,noDefault)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:var sel=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker()}return false;break;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:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||event.metaKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_doKeyUp:function(event){var inst=$.datepicker._getInst(event.target);if(inst.input.val()!=inst.lastVal){try{var date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),(inst.input?inst.input.val():null),$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst)}}catch(event){$.datepicker.log(event)}}return true},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);if($.datepicker._curInst&&$.datepicker._curInst!=inst){$.datepicker._curInst.dpDiv.stop(true,true)}var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var 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"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim");var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;var cover=inst.dpDiv.find("iframe.ui-datepicker-cover");if(!!cover.length){var borders=$.datepicker._getBorders(inst.dpDiv);cover.css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()})}};inst.dpDiv.zIndex($(input).zIndex()+1);if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim||"show"]((showAnim?duration:null),postProcess)}if(!showAnim||!duration){postProcess()}if(inst.input.is(":visible")&&!inst.input.is(":disabled")){inst.input.focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var self=this;var borders=$.datepicker._getBorders(inst.dpDiv);inst.dpDiv.empty().append(this._generateHTML(inst));var cover=inst.dpDiv.find("iframe.ui-datepicker-cover");if(!!cover.length){cover.css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()})}inst.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst==$.datepicker._curInst&&$.datepicker._datepickerShowing&&inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&inst.input[0]!=document.activeElement){inst.input.focus()}if(inst.yearshtml){var origyearshtml=inst.yearshtml;setTimeout(function(){if(origyearshtml===inst.yearshtml){inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml)}origyearshtml=inst.yearshtml=null},0)}},_getBorders:function(elem){var convert=function(value){return{thin:1,medium:2,thick:3}[value]||value};return[parseFloat(convert(elem.css("border-left-width"))),parseFloat(convert(elem.css("border-top-width")))]},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=document.documentElement.clientWidth+$(document).scrollLeft();var viewHeight=document.documentElement.clientHeight+$(document).scrollTop();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);return offset},_findPos:function(obj){var inst=this._getInst(obj);var isRTL=this._get(inst,"isRTL");while(obj&&(obj.type=="hidden"||obj.nodeType!=1||$.expr.filters.hidden(obj))){obj=obj[isRTL?"previousSibling":"nextSibling"]}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(this._datepickerShowing){var showAnim=this._get(inst,"showAnim");var duration=this._get(inst,"duration");var postProcess=function(){$.datepicker._tidyDialog(inst);this._curInst=null};if($.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide"))]((showAnim?duration:null),postProcess)}if(!showAnim){postProcess()}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if($target[0].id!=$.datepicker._mainDivId&&$target.parents("#"+$.datepicker._mainDivId).length==0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker()}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var 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);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear){setTimeout(function(){inst.input.focus()},0)}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var 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);var inst=this._getInst(target[0]);this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{this._hideDatepicker();this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input.focus()}this._lastInput=null}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);var dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));var time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){var isDoubled=lookAhead(match);var size=(match=="@"?14:(match=="!"?20:(match=="y"&&isDoubled?4:(match=="o"?3:2))));var digits=new RegExp("^\\d{1,"+size+"}");var num=value.substring(iValue).match(digits);if(!num){throw"Missing number at position "+iValue}iValue+=num[0].length;return parseInt(num[0],10)};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);for(var i=0;i<names.length;i++){if(value.substr(iValue,names[i].length).toLowerCase()==names[i].toLowerCase()){iValue+=names[i].length;return i+1}}throw"Unknown name at position "+iValue};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}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"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"!":var date=new Date((getNumber("!")-this._ticksTo1970)/10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(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:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}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",(date.getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000,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+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst,noDefault){if(inst.input.val()==inst.lastVal){return}var dateFormat=this._get(inst,"dateFormat");var dates=inst.lastVal=inst.input?inst.input.val():null;var date,defaultDate;date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(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();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst))}catch(e){}var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;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));break}matches=pattern.exec(offset)}return new Date(year,month,day)};var newDate=(date==null||date===""?defaultDate:(typeof date=="string"?offsetString(date):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):new Date(date.getTime()))));newDate=(newDate&&newDate.toString()=="Invalid Date"?defaultDate:newDate);if(newDate){newDate.setHours(0);newDate.setMinutes(0);newDate.setSeconds(0);newDate.setMilliseconds(0)}return this._daylightSavingAdjust(newDate)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,noChange){var clear=!date;var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;var 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();if((origMonth!=inst.selectedMonth||origYear!=inst.selectedYear)&&!noChange){this._notifyChange(inst)}this._adjustInstDate(inst);if(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},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+inst.id+"', -"+stepMonths+", 'M');\" 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>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+inst.id+"', +"+stepMonths+", 'M');\" 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>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var 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" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var showWeek=this._get(inst,"showWeek");var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var selectOtherMonths=this._get(inst,"selectOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group';if(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="";break}}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead=(showWeek?'<th class="ui-datepicker-week-col">'+this._get(inst,"weekHeader")+"</th>":"");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody=(!showWeek?"":'<td class="ui-datepicker-week-col">'+this._get(inst,"calculateWeek")(printDate)+"</td>");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(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]+'"':"")+(unselectable?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+inst.id+"',"+printDate.getMonth()+","+printDate.getFullYear()+', this);return false;"')+">"+(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++;if(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}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span>"}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+inst.id+"', this, 'M');\" onclick=\"DP_jQuery_"+dpuuid+".datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!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(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var thisYear=new Date().getFullYear();var 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)};var year=determineYear(years[0]);var 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" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+dpuuid+".datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){inst.yearshtml+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}inst.yearshtml+="</select>";if(!$.browser.mozilla){html+=inst.yearshtml;inst.yearshtml=null}else{html+='<select class="ui-datepicker-year"><option value="'+drawYear+'" selected="selected">'+drawYear+"</option></select>"}}html+=this._get(inst,"yearSuffix");if(showMonthAfterYear){html+=(secondary||!(changeMonth&&changeYear)?"&#xa0;":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var 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();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");var newDate=(minDate&&date<minDate?minDate:date);newDate=(maxDate&&newDate>maxDate?maxDate:newDate);return newDate},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(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(numMonths==null?[1,1]:(typeof numMonths=="number"?[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);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime()))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{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){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?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))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!this.length){return this}if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate"||options=="widget")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.8.10";window["DP_jQuery_"+dpuuid]=$})(jQuery);jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
/*
 * jQuery.splitter.js - two-pane splitter window plugin
 *
 * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php 
 */
(function(a){a.fn.splitter=function(b){b=b||{};return this.each(function(){var n;function i(s){o.trigger("resizeStart");if(c.outline){n=n||m.clone(false).insertAfter(g)}o.css("-webkit-user-select","none");m.addClass(c.activeClass);g._posSplit=g[0][c.pxSplit]-s[c.eventPos];a(document).bind("mousemove",k).bind("mouseup",q)}function k(s){var t=g._posSplit+s[c.eventPos];if(c.outline){t=Math.max(0,Math.min(t,d._DA-m._DA));m.css(c.origin,t)}else{l(t)}}function q(s){m.removeClass(c.activeClass);var t=g._posSplit+s[c.eventPos];if(c.outline){n.remove();n=null;l(t)}o.css("-webkit-user-select","text");a(document).unbind("mousemove",k).unbind("mouseup",q);o.trigger("resizeEnd")}function l(s){s=Math.max(g._min,d._DA-f._max,Math.min(s,g._max,d._DA-m._DA-f._min));if(s<0||d._DF<0||s+m._DA<0||d._DA-m._DA-s<0||d._DF<0){return}m._DA=m[0][c.pxSplit];m.css(c.origin,s).css(c.fixed,d._DF);g.css(c.origin,0).css(c.split,s).css(c.fixed,d._DF);f.css(c.origin,s+m._DA).css(c.split,d._DA-m._DA-s).css(c.fixed,d._DF);o.trigger("resize")}function p(v,u){var t=0;for(var s=1;s<arguments.length;s++){t+=Math.max(parseInt(v.css(arguments[s]))||0,0)}return t}var j=(b.splitHorizontal?"h":b.splitVertical?"v":b.type)||"v";var c=a.extend({activeClass:"active",pxPerKey:8,tabIndex:0,accessKey:""},{v:{keyLeft:39,keyRight:37,cursor:"e-resize",splitbarClass:"vsplitbar",outlineClass:"voutline",type:"v",eventPos:"pageX",origin:"left",split:"width",pxSplit:"offsetWidth",side1:"Left",side2:"Right",fixed:"height",pxFixed:"offsetHeight",side3:"Top",side4:"Bottom"},h:{keyTop:40,keyBottom:38,cursor:"n-resize",splitbarClass:"hsplitbar",outlineClass:"houtline",type:"h",eventPos:"pageY",origin:"top",split:"height",pxSplit:"offsetHeight",side1:"Top",side2:"Bottom",fixed:"width",pxFixed:"offsetWidth",side3:"Left",side4:"Right"}}[j],b);var d=a(this).css({position:"relative"});var o=a(">*",d[0]).css({position:"absolute","z-index":"1","-moz-outline-style":"none"});var g=a(o[0]);var f=a(o[1]);var e=a('<a href="javascript:void(0)"></a>').attr({accessKey:c.accessKey,tabIndex:c.tabIndex,title:c.splitbarClass}).bind(a.browser.opera?"click":"focus",function(){this.focus();m.addClass(c.activeClass)}).bind("keydown",function(u){var t=u.which||u.keyCode;var s=t==c["key"+c.side1]?1:t==c["key"+c.side2]?-1:0;if(s){l(g[0][c.pxSplit]+s*c.pxPerKey,false)}}).bind("blur",function(){m.removeClass(c.activeClass)});var m=a(o[2]||"<div></div>").insertAfter(g).css("z-index","100").append(e).attr({"class":c.splitbarClass,unselectable:"on"}).css({position:"absolute","user-select":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none"}).bind("mousedown",i);if(/^(auto|default|)$/.test(m.css("cursor"))){m.css("cursor",c.cursor)}m._DA=m[0][c.pxSplit];d._PBF=a.boxModel?p(d,"border"+c.side3+"Width","border"+c.side4+"Width"):0;d._PBA=a.boxModel?p(d,"border"+c.side1+"Width","border"+c.side2+"Width"):0;g._pane=c.side1;f._pane=c.side2;a.each([g,f],function(){this._min=c["min"+this._pane]||p(this,"min-"+c.split);this._max=c["max"+this._pane]||p(this,"max-"+c.split)||9999;this._init=c["size"+this._pane]===true?parseInt(a.curCSS(this[0],c.split)):c["size"+this._pane]});var r=g._init;if(!isNaN(f._init)){r=d[0][c.pxSplit]-d._PBA-f._init-m._DA}if(c.cookie){if(!a.cookie){alert("jQuery.splitter(): jQuery cookie plugin required")}var h=parseInt(a.cookie(c.cookie));if(!isNaN(h)){r=h}a(window).bind("unload",function(){var s=String(m.css(c.origin));a.cookie(c.cookie,s,{expires:c.cookieExpires||365,path:c.cookiePath||document.location.pathname})})}if(isNaN(r)){r=Math.round((d[0][c.pxSplit]-d._PBA-m._DA)/2)}if(c.anchorToWindow){d._hadjust=p(d,"borderTopWidth","borderBottomWidth","marginBottom");d._hmin=Math.max(p(d,"minHeight"),20);a(window).bind("resize",function(){var t=d.offset().top;var s=a(window).height();d.css("height",Math.max(s-t-d._hadjust,d._hmin)+"px");d.trigger("resize")}).trigger("resize")}else{if(c.resizeToWidth){a(window).bind("resize",function(){d.trigger("resize")})}}d.bind("resize",function(t,s){if(t.target!=this){return}d._DF=d[0][c.pxFixed]-d._PBF;d._DA=d[0][c.pxSplit]-d._PBA;if(d._DF<=0||d._DA<=0){return}l(!isNaN(s)?s:(!(c.sizeRight||c.sizeBottom)?g[0][c.pxSplit]:d._DA-f[0][c.pxSplit]-m._DA))}).trigger("resize",[r])})}})(jQuery);"use strict";(function(){if(jQuery&&jQuery.jstree){return}var c=false,b=false,a=false;(function(g){g.vakata={};g.vakata.css={get_css:function(n,k,l){n=n.toLowerCase();var m=l.cssRules||l.rules,i=0;do{if(m.length&&i>m.length+5){return false}if(m[i].selectorText&&m[i].selectorText.toLowerCase()==n){if(k===true){if(l.removeRule){l.removeRule(i)}if(l.deleteRule){l.deleteRule(i)}return true}else{return m[i]}}}while(m[++i]);return false},add_css:function(j,i){if(g.jstree.css.get_css(j,false,i)){return false}if(i.insertRule){i.insertRule(j+" { }",0)}else{i.addRule(j,null,0)}return g.vakata.css.get_css(j)},remove_css:function(j,i){return g.vakata.css.get_css(j,true,i)},add_sheet:function(j){var i=false,l=true;if(j.str){if(j.title){i=g("style[id='"+j.title+"-stylesheet']")[0]}if(i){l=false}else{i=document.createElement("style");i.setAttribute("type","text/css");if(j.title){i.setAttribute("id",j.title+"-stylesheet")}}if(i.styleSheet){if(l){document.getElementsByTagName("head")[0].appendChild(i);i.styleSheet.cssText=j.str}else{i.styleSheet.cssText=i.styleSheet.cssText+" "+j.str}}else{i.appendChild(document.createTextNode(j.str));document.getElementsByTagName("head")[0].appendChild(i)}return i.sheet||i.styleSheet}if(j.url){if(document.createStyleSheet){try{i=document.createStyleSheet(j.url)}catch(k){}}else{i=document.createElement("link");i.rel="stylesheet";i.type="text/css";i.media="all";i.href=j.url;document.getElementsByTagName("head")[0].appendChild(i);return i.styleSheet}}}};var h=[],f=-1,e={},d={};g.fn.jstree=function(l){var i=(typeof l=="string"),j=Array.prototype.slice.call(arguments,1),k=this;if(i){if(l.substring(0,1)=="_"){return k}this.each(function(){var m=h[g.data(this,"jstree-instance-id")],n=(m&&g.isFunction(m[l]))?m[l].apply(m,j):m;if(typeof n!=="undefined"&&(l.indexOf("is_")===0||(n!==true&&n!==false))){k=n;return false}})}else{this.each(function(){var q=g.data(this,"jstree-instance-id"),n=[],m=l?g.extend({},true,l):{},r=g(this),p=false,o=[];n=n.concat(j);if(r.data("jstree")){n.push(r.data("jstree"))}m=n.length?g.extend.apply(null,[true,m].concat(n)):m;if(typeof q!=="undefined"&&h[q]){h[q].destroy()}q=parseInt(h.push({}),10)-1;g.data(this,"jstree-instance-id",q);m.plugins=g.isArray(m.plugins)?m.plugins:g.jstree.defaults.plugins.slice();m.plugins.unshift("core");m.plugins=m.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");p=g.extend(true,{},g.jstree.defaults,m);p.plugins=m.plugins;g.each(e,function(s,t){if(g.inArray(s,p.plugins)===-1){p[s]=null;delete p[s]}else{o.push(s)}});p.plugins=o;h[q]=new g.jstree._instance(q,g(this).addClass("jstree jstree-"+q),p);g.each(h[q]._get_settings().plugins,function(s,t){h[q].data[t]={}});g.each(h[q]._get_settings().plugins,function(s,t){if(e[t]){e[t].__init.apply(h[q])}});setTimeout(function(){h[q].init()},0)})}return k};g.jstree={defaults:{plugins:[]},_focused:function(){return h[f]||null},_reference:function(i){if(h[i]){return h[i]}var j=g(i);if(!j.length&&typeof i==="string"){j=g("#"+i)}if(!j.length){return null}return h[j.closest(".jstree").data("jstree-instance-id")]||null},_instance:function(j,i,k){this.data={core:{}};this.get_settings=function(){return g.extend(true,{},k)};this._get_settings=function(){return k};this.get_index=function(){return j};this.get_container=function(){return i};this.get_container_ul=function(){return i.children("ul:eq(0)")};this._set_settings=function(l){k=g.extend(true,{},k,l)}},_fn:{},plugin:function(i,j){j=g.extend({},{__init:g.noop,__destroy:g.noop,_fn:{},defaults:false},j);e[i]=j;g.jstree.defaults[i]=j.defaults;g.each(j._fn,function(k,l){l.plugin=i;l.old=g.jstree._fn[k];g.jstree._fn[k]=function(){var m,o=l,n=Array.prototype.slice.call(arguments),q=new g.Event("before.jstree"),p=false;if(this.data.core.locked===true&&k!=="unlock"&&k!=="is_locked"){return}do{if(o&&o.plugin&&g.inArray(o.plugin,this._get_settings().plugins)!==-1){break}o=o.old}while(o);if(!o){return}if(k.indexOf("_")===0){m=o.apply(this,n)}else{m=this.get_container().triggerHandler(q,{func:k,inst:this,args:n,plugin:o.plugin});if(m===false){return}if(typeof m!=="undefined"){n=m}m=o.apply(g.extend({},this,{__callback:function(r){this.get_container().triggerHandler(k+".jstree",{inst:this,args:n,rslt:r,rlbk:p})},__rollback:function(){p=this.get_rollback();return p},__call_old:function(r){return o.old.apply(this,(r?Array.prototype.slice.call(arguments,1):n))}}),n)}return m};g.jstree._fn[k].old=l.old;g.jstree._fn[k].plugin=i})},rollback:function(i){if(i){if(!g.isArray(i)){i=[i]}g.each(i,function(j,k){h[k.i].set_rollback(k.h,k.d)})}}};g.jstree._fn=g.jstree._instance.prototype={};g(function(){var k=navigator.userAgent.toLowerCase(),j=(k.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],i=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";if(/msie/.test(k)&&parseInt(j,10)==6){c=true;try{document.execCommand("BackgroundImageCache",false,true)}catch(l){}i+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } "}if(/msie/.test(k)&&parseInt(j,10)==7){b=true;i+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "}if(!/compatible/.test(k)&&/mozilla/.test(k)&&parseFloat(j,10)<1.9){a=true;i+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } "}g.vakata.css.add_sheet({str:i,title:"jstree"})});g.jstree.plugin("core",{__init:function(){this.data.core.locked=false;this.data.core.to_open=this.get_settings().core.initially_open;this.data.core.to_load=this.get_settings().core.initially_load},defaults:{html_titles:false,animation:500,initially_open:[],initially_load:[],open_parents:true,notify_plugins:true,rtl:false,load_open:false,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection"}},_fn:{init:function(){this.set_focus();if(this._get_settings().core.rtl){this.get_container().addClass("jstree-rtl").css("direction","rtl")}this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>"+this._get_string("loading")+"</a></li></ul>");this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",g.proxy(function(j){var i=g(j.target);if(i.is("ins")&&j.pageY-i.offset().top<this.data.core.li_height){this.toggle_node(i)}},this)).bind("mousedown.jstree",g.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(j){var k;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){k=window.getSelection();try{k.removeAllRanges();k.collapse()}catch(i){}}}});if(this._get_settings().core.notify_plugins){this.get_container().bind("load_node.jstree",g.proxy(function(k,j){var l=this._get_node(j.rslt.obj),i=this;if(l===-1){l=this.get_container_ul()}if(!l.length){return}l.find("li").each(function(){var m=g(this);if(m.data("jstree")){g.each(m.data("jstree"),function(o,n){if(i.data[o]&&g.isFunction(i["_"+o+"_notify"])){i["_"+o+"_notify"].call(i,m,n)}})}})},this))}if(this._get_settings().core.load_open){this.get_container().bind("load_node.jstree",g.proxy(function(k,j){var l=this._get_node(j.rslt.obj),i=this;if(l===-1){l=this.get_container_ul()}if(!l.length){return}l.find("li.jstree-open:not(:has(ul))").each(function(){i.load_node(this,g.noop,g.noop)})},this))}this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes()})},destroy:function(){var j,m=this.get_index(),k=this._get_settings(),l=this;g.each(k.plugins,function(n,p){try{e[p].__destroy.apply(l)}catch(o){}});this.__callback();if(this.is_focused()){for(j in h){if(h.hasOwnProperty(j)&&j!=m){h[j].set_focus();break}}}if(m===f){f=-1}this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree-instance-id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});g(document).unbind(".jstree-"+m).undelegate(".jstree-"+m);h[m]=null;delete h[m]},_core_notify:function(j,i){if(i.opened){this.open_node(j,false,true)}},lock:function(){this.data.core.locked=true;this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");this.__callback({})},unlock:function(){this.data.core.locked=false;this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");this.__callback({})},is_locked:function(){return this.data.core.locked},save_opened:function(){var i=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){if(this.id){i.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(i.data.core.to_open)},save_loaded:function(){},reload_nodes:function(j){var m=this,i=true,l=[],k=[];if(!j){this.data.core.reopen=false;this.data.core.refreshing=true;this.data.core.to_open=g.map(g.makeArray(this.data.core.to_open),function(o){return"#"+o.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.data.core.to_load=g.map(g.makeArray(this.data.core.to_load),function(o){return"#"+o.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});if(this.data.core.to_open.length){this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open)}}if(this.data.core.to_load.length){g.each(this.data.core.to_load,function(n,o){if(o=="#"){return true}if(g(o).length){l.push(o)}else{k.push(o)}});if(l.length){this.data.core.to_load=k;g.each(l,function(n,o){if(!m._is_loaded(o)){m.load_node(o,function(){m.reload_nodes(true)},function(){m.reload_nodes(true)});i=false}})}}if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(n,o){m.open_node(o,false,true)})}if(i){if(this.data.core.reopen){clearTimeout(this.data.core.reopen)}this.data.core.reopen=setTimeout(function(){m.__callback({},m)},50);this.data.core.refreshing=false;this.reopen()}},reopen:function(){var i=this;if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(j,k){i.open_node(k,false,true)})}this.__callback({})},refresh:function(i){var j=this;this.save_opened();if(!i){i=-1}i=this._get_node(i);if(!i){i=-1}if(i!==-1){i.children("UL").remove()}else{this.get_container_ul().empty()}this.load_node(i,function(){j.__callback({obj:i});j.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(this.is_focused()){return}var i=g.jstree._focused();if(i){i.unset_focus()}this.get_container().addClass("jstree-focused");f=this.get_index();this.__callback()},is_focused:function(){return f==this.get_index()},unset_focus:function(){if(this.is_focused()){this.get_container().removeClass("jstree-focused");f=-1}this.__callback()},_get_node:function(i){var j=g(i,this.get_container());if(j.is(".jstree")||i==-1){return -1}j=j.closest("li",this.get_container());return j.length?j:false},_get_next:function(j,i){j=this._get_node(j);if(j===-1){return this.get_container().find("> ul > li:first-child")}if(!j.length){return false}if(i){return(j.nextAll("li").size()>0)?j.nextAll("li:eq(0)"):false}if(j.hasClass("jstree-open")){return j.find("li:eq(0)")}else{if(j.nextAll("li").size()>0){return j.nextAll("li:eq(0)")}else{return j.parentsUntil(".jstree","li").next("li").eq(0)}}},_get_prev:function(j,i){j=this._get_node(j);if(j===-1){return this.get_container().find("> ul > li:last-child")}if(!j.length){return false}if(i){return(j.prevAll("li").length>0)?j.prevAll("li:eq(0)"):false}if(j.prev("li").length){j=j.prev("li").eq(0);while(j.hasClass("jstree-open")){j=j.children("ul:eq(0)").children("li:last")}return j}else{var k=j.parentsUntil(".jstree","li:eq(0)");return k.length?k:false}},_get_parent:function(i){i=this._get_node(i);if(i==-1||!i.length){return false}var j=i.parentsUntil(".jstree","li:eq(0)");return j.length?j:-1},_get_children:function(i){i=this._get_node(i);if(i===-1){return this.get_container().children("ul:eq(0)").children("li")}if(!i.length){return false}return i.children("ul:eq(0)").children("li")},get_path:function(k,i){var j=[],l=this;k=this._get_node(k);if(k===-1||!k||!k.length){return false}k.parentsUntil(".jstree","li").each(function(){j.push(i?this.id:l.get_text(this))});j.reverse();j.push(i?k.attr("id"):this.get_text(k));return j},_get_string:function(i){return this._get_settings().core.strings[i]||i},is_open:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-open")},is_closed:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-closed")},is_leaf:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-leaf")},correct_state:function(i){i=this._get_node(i);if(!i||i===-1){return false}i.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:i})},open_node:function(l,m,j){l=this._get_node(l);if(!l.length){return false}if(!l.hasClass("jstree-closed")){if(m){m.call()}return false}var k=j||c?0:this._get_settings().core.animation,i=this;if(!this._is_loaded(l)){l.children("a").addClass("jstree-loading");this.load_node(l,function(){i.open_node(l,m,j)},m)}else{if(this._get_settings().core.open_parents){l.parentsUntil(".jstree",".jstree-closed").each(function(){i.open_node(this,false,true)})}if(k){l.children("ul").css("display","none")}l.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");if(k){l.children("ul").stop(true,true).slideDown(k,function(){this.style.display="";i.after_open(l)})}else{i.after_open(l)}this.__callback({obj:l});if(m){m.call()}}},after_open:function(i){this.__callback({obj:i})},close_node:function(l,j){l=this._get_node(l);var k=j||c?0:this._get_settings().core.animation,i=this;if(!l.length||!l.hasClass("jstree-open")){return false}if(k){l.children("ul").attr("style","display:block !important")}l.removeClass("jstree-open").addClass("jstree-closed");if(k){l.children("ul").stop(true,true).slideUp(k,function(){this.style.display="";i.after_close(l)})}else{i.after_close(l)}this.__callback({obj:l})},after_close:function(i){this.__callback({obj:i})},toggle_node:function(i){i=this._get_node(i);if(i.hasClass("jstree-closed")){return this.open_node(i)}if(i.hasClass("jstree-open")){return this.close_node(i)}},open_all:function(k,j,i){k=k?this._get_node(k):-1;if(!k||k===-1){k=this.get_container_ul()}if(i){k=k.find("li.jstree-closed")}else{i=k;if(k.is(".jstree-closed")){k=k.find("li.jstree-closed").andSelf()}else{k=k.find("li.jstree-closed")}}var l=this;k.each(function(){var m=this;if(!l._is_loaded(this)){l.open_node(this,function(){l.open_all(m,j,i)},!j)}else{l.open_node(this,false,!j)}});if(i.find("li.jstree-closed").length===0){this.__callback({obj:i})}},close_all:function(j,i){var k=this;j=j?this._get_node(j):this.get_container();if(!j||j===-1){j=this.get_container_ul()}j.find("li.jstree-open").andSelf().each(function(){k.close_node(this,!i)});this.__callback({obj:j})},clean_node:function(i){i=i&&i!=-1?g(i):this.get_container_ul();i=i.is("li")?i.find("li").andSelf():i.find("li");i.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");i.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:i})},get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(true),d:this.data}},set_rollback:function(i,j){this.get_container().empty().append(i);this.data=j;this.__callback()},load_node:function(k,i,j){this.__callback({obj:k})},_is_loaded:function(i){return true},create_node:function(n,i,m,p,j){n=this._get_node(n);i=typeof i==="undefined"?"last":i;var o=g("<li />"),l=this._get_settings().core,k;if(n!==-1&&!n.length){return false}if(!j&&!this._is_loaded(n)){this.load_node(n,function(){this.create_node(n,i,m,p,true)});return false}this.__rollback();if(typeof m==="string"){m={data:m}}if(!m){m={}}if(m.attr){o.attr(m.attr)}if(m.metadata){o.data(m.metadata)}if(m.state){o.addClass("jstree-"+m.state)}if(!m.data){m.data=this._get_string("new_node")}if(!g.isArray(m.data)){k=m.data;m.data=[];m.data.push(k)}g.each(m.data,function(r,q){k=g("<a />");if(g.isFunction(q)){q=q.call(this,m)}if(typeof q=="string"){k.attr("href","#")[l.html_titles?"html":"text"](q)}else{if(!q.attr){q.attr={}}if(!q.attr.href){q.attr.href="#"}k.attr(q.attr)[l.html_titles?"html":"text"](q.title);if(q.language){k.addClass(q.language)}}k.prepend("<ins class='jstree-icon'>&#160;</ins>");if(q.icon){if(q.icon.indexOf("/")===-1){k.children("ins").addClass(q.icon)}else{k.children("ins").css("background","url('"+q.icon+"') center center no-repeat")}}o.append(k)});o.prepend("<ins class='jstree-icon'>&#160;</ins>");if(n===-1){n=this.get_container();if(i==="before"){i="first"}if(i==="after"){i="last"}}switch(i){case"before":n.before(o);k=this._get_parent(n);break;case"after":n.after(o);k=this._get_parent(n);break;case"inside":case"first":if(!n.children("ul").length){n.append("<ul />")}n.children("ul").prepend(o);k=n;break;case"last":if(!n.children("ul").length){n.append("<ul />")}n.children("ul").append(o);k=n;break;default:if(!n.children("ul").length){n.append("<ul />")}if(!i){i=0}k=n.children("ul").children("li").eq(i);if(k.length){k.before(o)}else{n.children("ul").append(o)}k=n;break}if(k===-1||k.get(0)===this.get_container().get(0)){k=-1}this.clean_node(k);this.__callback({obj:o,parent:k});if(p){p.call(this,o)}return o},get_text:function(j){j=this._get_node(j);if(!j.length){return false}var i=this._get_settings().core.html_titles;j=j.children("a:eq(0)");if(i){j=j.clone();j.children("INS").remove();return j.html()}else{j=j.contents().filter(function(){return this.nodeType==3})[0];return j.nodeValue}},set_text:function(j,k){j=this._get_node(j);if(!j.length){return false}j=j.children("a:eq(0)");if(this._get_settings().core.html_titles){var i=j.children("INS").clone();j.html(k).prepend(i);this.__callback({obj:j,name:k});return true}else{j=j.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:j,name:k});return(j.nodeValue=k)}},rename_node:function(i,j){i=this._get_node(i);this.__rollback();if(i&&i.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))){this.__callback({obj:i,name:j})}},delete_node:function(l){l=this._get_node(l);if(!l.length){return false}this.__rollback();var k=this._get_parent(l),j=g([]),i=this;l.each(function(){j=j.add(i._get_prev(this))});l=l.detach();if(k!==-1&&k.find("> ul > li").length===0){k.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}this.clean_node(k);this.__callback({obj:l,prev:j,parent:k});return l},prepare_move:function(m,k,n,i,j){var l={};l.ot=g.jstree._reference(m)||this;l.o=l.ot._get_node(m);l.r=k===-1?-1:this._get_node(k);l.p=(typeof n==="undefined"||n===false)?"last":n;if(!j&&d.o&&d.o[0]===l.o[0]&&d.r[0]===l.r[0]&&d.p===l.p){this.__callback(d);if(i){i.call(this,d)}return}l.ot=g.jstree._reference(l.o)||this;l.rt=g.jstree._reference(l.r)||this;if(l.r===-1||!l.r){l.cr=-1;switch(l.p){case"first":case"before":case"inside":l.cp=0;break;case"after":case"last":l.cp=l.rt.get_container().find(" > ul > li").length;break;default:l.cp=l.p;break}}else{if(!/^(before|after)$/.test(l.p)&&!this._is_loaded(l.r)){return this.load_node(l.r,function(){this.prepare_move(m,k,n,i,true)})}switch(l.p){case"before":l.cp=l.r.index();l.cr=l.rt._get_parent(l.r);break;case"after":l.cp=l.r.index()+1;l.cr=l.rt._get_parent(l.r);break;case"inside":case"first":l.cp=0;l.cr=l.r;break;case"last":l.cp=l.r.find(" > ul > li").length;l.cr=l.r;break;default:l.cp=l.p;l.cr=l.r;break}}l.np=l.cr==-1?l.rt.get_container():l.cr;l.op=l.ot._get_parent(l.o);l.cop=l.o.index();if(l.op===-1){l.op=l.ot?l.ot.get_container():this.get_container()}if(!/^(before|after)$/.test(l.p)&&l.op&&l.np&&l.op[0]===l.np[0]&&l.o.index()<l.cp){l.cp++}l.or=l.np.find(" > ul > li:nth-child("+(l.cp+1)+")");d=l;this.__callback(d);if(i){i.call(this,d)}},check_move:function(){var k=d,i=true,j=k.r===-1?this.get_container():k.r;if(!k||!k.o||k.or[0]===k.o[0]){return false}if(k.op&&k.np&&k.op[0]===k.np[0]&&k.cp-1===k.o.index()){return false}k.o.each(function(){if(j.parentsUntil(".jstree","li").andSelf().index(this)!==-1){i=false;return false}});return i},move_node:function(p,l,i,k,j,n){if(!j){return this.prepare_move(p,l,i,function(o){this.move_node(o,false,false,k,true,n)})}if(k){d.cy=true}if(!n&&!this.check_move()){return false}this.__rollback();var q=false;if(k){q=p.o.clone(true);q.find("*[id]").andSelf().each(function(){if(this.id){this.id="copy_"+this.id}})}else{q=p.o}if(p.or.length){p.or.before(q)}else{if(!p.np.children("ul").length){g("<ul />").appendTo(p.np)}p.np.children("ul:eq(0)").append(q)}try{p.ot.clean_node(p.op);p.rt.clean_node(p.np);if(!p.op.find("> ul > li").length){p.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}}catch(m){}if(k){d.cy=true;d.oc=q}this.__callback(d);return d},_get_move:function(){return d}}})})(jQuery);(function(d){var g,f,e;d(function(){if(/msie/.test(navigator.userAgent.toLowerCase())){f=d('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1000,left:0}).appendTo("body");e=d('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1000,left:0}).appendTo("body");g=f.width()-e.width();f.add(e).remove()}else{f=d("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:0}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200});g=100-f.width();f.parent().remove()}});d.jstree.plugin("ui",{__init:function(){this.data.ui.selected=d();this.data.ui.last_selected=false;this.data.ui.hovered=null;this.data.ui.to_select=this.get_settings().ui.initially_select;this.get_container().delegate("a","click.jstree",d.proxy(function(h){h.preventDefault();h.currentTarget.blur();if(!d(h.currentTarget).hasClass("jstree-loading")){this.select_node(h.currentTarget,true,h)}},this)).delegate("a","mouseenter.jstree",d.proxy(function(h){if(!d(h.currentTarget).hasClass("jstree-loading")){this.hover_node(h.target)}},this)).delegate("a","mouseleave.jstree",d.proxy(function(h){if(!d(h.currentTarget).hasClass("jstree-loading")){this.dehover_node(h.target)}},this)).bind("reopen.jstree",d.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",d.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",d.proxy(function(){this.reselect()},this)).bind("close_node.jstree",d.proxy(function(i,j){var h=this._get_settings().ui,k=this._get_node(j.rslt.obj),l=(k&&k.length)?k.children("ul").find("a.jstree-clicked"):d(),m=this;if(h.selected_parent_close===false||!l.length){return}l.each(function(){m.deselect_node(this);if(h.selected_parent_close==="select_parent"){m.select_node(k)}})},this)).bind("delete_node.jstree",d.proxy(function(i,j){var h=this._get_settings().ui.select_prev_on_delete,k=this._get_node(j.rslt.obj),l=(k&&k.length)?k.find("a.jstree-clicked"):[],m=this;l.each(function(){m.deselect_node(this)});if(h&&l.length){j.rslt.prev.each(function(){if(this.parentNode){m.select_node(this);return false}})}},this)).bind("move_node.jstree",d.proxy(function(h,i){if(i.rslt.cy){i.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked")}},this))},defaults:{select_limit:-1,select_multiple_modifier:"ctrl",select_range_modifier:"shift",selected_parent_close:"select_parent",selected_parent_open:true,select_prev_on_delete:true,disable_selecting_children:false,initially_select:[]},_fn:{_get_node:function(h,i){if(typeof h==="undefined"||h===null){return i?this.data.ui.selected:this.data.ui.last_selected}var j=d(h,this.get_container());if(j.is(".jstree")||h==-1){return -1}j=j.closest("li",this.get_container());return j.length?j:false},_ui_notify:function(i,h){if(h.selected){this.select_node(i,false)}},save_selected:function(){var h=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){if(this.id){h.data.ui.to_select.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(this.data.ui.to_select)},reselect:function(){var i=this,h=this.data.ui.to_select;h=d.map(d.makeArray(h),function(j){return"#"+j.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});d.each(h,function(j,k){if(k&&k!=="#"){i.select_node(k)}});this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode});this.__callback()},refresh:function(h){this.save_selected();return this.__call_old()},hover_node:function(h){h=this._get_node(h);if(!h.length){return false}if(!h.hasClass("jstree-hovered")){this.dehover_node()}this.data.ui.hovered=h.children("a").addClass("jstree-hovered").parent();this._fix_scroll(h);this.__callback({obj:h})},dehover_node:function(){var i=this.data.ui.hovered,h;if(!i||!i.length){return false}h=i.children("a").removeClass("jstree-hovered").parent();if(this.data.ui.hovered[0]===h[0]){this.data.ui.hovered=null}this.__callback({obj:i})},select_node:function(k,h,l){k=this._get_node(k);if(k==-1||!k||!k.length){return false}var p=this._get_settings().ui,n=(p.select_multiple_modifier=="on"||(p.select_multiple_modifier!==false&&l&&l[p.select_multiple_modifier+"Key"])),i=(p.select_range_modifier!==false&&l&&l[p.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==k[0]&&this.data.ui.last_selected.parent()[0]===k.parent()[0]),j=this.is_selected(k),m=true,o=this;if(h){if(p.disable_selecting_children&&n&&((k.parentsUntil(".jstree","li").children("a.jstree-clicked").length)||(k.children("ul").find("a.jstree-clicked:eq(0)").length))){return false}m=false;switch(!0){case (i):this.data.ui.last_selected.addClass("jstree-last-selected");k=k[k.index()<this.data.ui.last_selected.index()?"nextUntil":"prevUntil"](".jstree-last-selected").andSelf();if(p.select_limit==-1||k.length<p.select_limit){this.data.ui.last_selected.removeClass("jstree-last-selected");this.data.ui.selected.each(function(){if(this!==o.data.ui.last_selected[0]){o.deselect_node(this)}});j=false;m=true}else{m=false}break;case (j&&!n):this.deselect_all();j=false;m=true;break;case (!j&&!n):if(p.select_limit==-1||p.select_limit>0){this.deselect_all();m=true}break;case (j&&n):this.deselect_node(k);break;case (!j&&n):if(p.select_limit==-1||this.data.ui.selected.length+1<=p.select_limit){m=true}break}}if(m&&!j){if(!i){this.data.ui.last_selected=k}k.children("a").addClass("jstree-clicked");if(p.selected_parent_open){k.parents(".jstree-closed").each(function(){o.open_node(this,false,true)})}this.data.ui.selected=this.data.ui.selected.add(k);this._fix_scroll(k.eq(0));this.__callback({obj:k,e:l})}},_fix_scroll:function(i){var j=this.get_container()[0],h;if(j.scrollHeight>j.offsetHeight){i=this._get_node(i);if(!i||i===-1||!i.length||!i.is(":visible")){return}h=i.offset().top-this.get_container().offset().top;if(h<0){j.scrollTop=j.scrollTop+h-1}if(h+this.data.core.li_height+(j.scrollWidth>j.offsetWidth?g:0)>j.offsetHeight){j.scrollTop=j.scrollTop+(h-j.offsetHeight+this.data.core.li_height+1+(j.scrollWidth>j.offsetWidth?g:0))}}},deselect_node:function(h){h=this._get_node(h);if(!h.length){return false}if(this.is_selected(h)){h.children("a").removeClass("jstree-clicked");this.data.ui.selected=this.data.ui.selected.not(h);if(this.data.ui.last_selected.get(0)===h.get(0)){this.data.ui.last_selected=this.data.ui.selected.eq(0)}this.__callback({obj:h})}},toggle_select:function(h){h=this._get_node(h);if(!h.length){return false}if(this.is_selected(h)){this.deselect_node(h)}else{this.select_node(h)}},is_selected:function(h){return this.data.ui.selected.index(this._get_node(h))>=0},get_selected:function(h){return h?d(h).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(i){var h=i?d(i).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();h.children("a.jstree-clicked").removeClass("jstree-clicked");this.data.ui.selected=d([]);this.data.ui.last_selected=false;this.__callback({obj:h})}}});d.jstree.defaults.plugins.push("ui")})(jQuery);(function(d){d.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",d.proxy(function(h,g){if(this._get_settings().crrm.move.open_onmove){var f=this;g.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function(){f.open_node(this,false,true)})}},this))},defaults:{input_width_limit:200,move:{always_copy:false,open_onmove:true,default_position:"last",check_move:function(e){return true}}},_fn:{_show_input:function(e,l){e=this._get_node(e);var j=this._get_settings().core.rtl,k=this._get_settings().crrm.input_width_limit,g=e.children("ins").width(),f=e.find("> a:visible > ins").width()*e.find("> a:visible > ins").length,m=this.get_text(e),i=d("<div />",{css:{position:"absolute",top:"-200px",left:(j?"0px":"-1000px"),visibility:"hidden"}}).appendTo("body"),h=e.css("position","relative").append(d("<input />",{value:m,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:(j?"auto":(g+f+4)+"px"),right:(j?(g+f+4)+"px":"auto"),top:"0px",height:(this.data.core.li_height-2)+"px",lineHeight:(this.data.core.li_height-2)+"px",width:"150px"},blur:d.proxy(function(){var o=e.children(".jstree-rename-input"),n=o.val();if(n===""){n=m}i.remove();o.remove();this.set_text(e,m);this.rename_node(e,n);l.call(this,e,n,m);e.css("position","")},this),keyup:function(o){var n=o.keyCode||o.which;if(n==27){this.value=m;this.blur();return}else{if(n==13){this.blur();return}else{h.width(Math.min(i.text("pW"+this.value).width(),k))}}},keypress:function(o){var n=o.keyCode||o.which;if(n==13){return false}}})).children(".jstree-rename-input");this.set_text(e,"");i.css({fontFamily:h.css("fontFamily")||"",fontSize:h.css("fontSize")||"",fontWeight:h.css("fontWeight")||"",fontStyle:h.css("fontStyle")||"",fontStretch:h.css("fontStretch")||"",fontVariant:h.css("fontVariant")||"",letterSpacing:h.css("letterSpacing")||"",wordSpacing:h.css("wordSpacing")||""});h.width(Math.min(i.text("pW"+h[0].value).width(),k))[0].select()},rename:function(g){g=this._get_node(g);this.__rollback();var e=this.__callback;this._show_input(g,function(i,h,f){e.call(this,{obj:i,new_name:h,old_name:f})})},create:function(i,f,h,k,e){var g,j=this;i=this._get_node(i);if(!i){i=-1}this.__rollback();g=this.create_node(i,f,h,function(l){var m=this._get_parent(l),n=d(l).index();if(k){k.call(this,l)}if(m.length&&m.hasClass("jstree-closed")){this.open_node(m,false,true)}if(!e){this._show_input(l,function(q,p,o){j.__callback({obj:q,name:p,parent:m,position:n})})}else{j.__callback({obj:l,name:this.get_text(l),parent:m,position:n})}});return g},remove:function(g){g=this._get_node(g,true);var f=this._get_parent(g),e=this._get_prev(g);this.__rollback();g=this.delete_node(g);if(g!==false){this.__callback({obj:g,prev:e,parent:f})}},check_move:function(){if(!this.__call_old()){return false}var e=this._get_settings().crrm.move;if(!e.check_move.call(this,this._get_move())){return false}return true},move_node:function(k,i,e,g,f,j){var h=this._get_settings().crrm.move;if(!f){if(typeof e==="undefined"){e=h.default_position}if(e==="inside"&&!h.default_position.match(/^(before|after)$/)){e=h.default_position}return this.__call_old(true,k,i,e,g,false,j)}if(h.always_copy===true||(h.always_copy==="multitree"&&k.rt.get_index()!==k.ot.get_index())){g=true}this.__call_old(true,k,i,e,g,true,j)},cut:function(e){e=this._get_node(e,true);if(!e||!e.length){return false}this.data.crrm.cp_nodes=false;this.data.crrm.ct_nodes=e;this.__callback({obj:e})},copy:function(e){e=this._get_node(e,true);if(!e||!e.length){return false}this.data.crrm.ct_nodes=false;this.data.crrm.cp_nodes=e;this.__callback({obj:e})},paste:function(f){f=this._get_node(f);if(!f||!f.length){return false}var e=this.data.crrm.ct_nodes?this.data.crrm.ct_nodes:this.data.crrm.cp_nodes;if(!this.data.crrm.ct_nodes&&!this.data.crrm.cp_nodes){return false}if(this.data.crrm.ct_nodes){this.move_node(this.data.crrm.ct_nodes,f);this.data.crrm.ct_nodes=false}if(this.data.crrm.cp_nodes){this.move_node(this.data.crrm.cp_nodes,f,false,true)}this.__callback({obj:f,nodes:e})}}})})(jQuery);(function(d){var e=[];d.jstree._themes=false;d.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",d.proxy(function(){var f=this._get_settings().themes;this.data.themes.dots=f.dots;this.data.themes.icons=f.icons;this.set_theme(f.theme,f.url)},this)).bind("loaded.jstree",d.proxy(function(){if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}},this))},defaults:{theme:"default",url:false,dots:true,icons:true},_fn:{set_theme:function(g,f){if(!g){return false}if(!f){f=d.jstree._themes+g+"/style.css"}if(d.inArray(f,e)==-1){d.vakata.css.add_sheet({url:f});e.push(f)}if(this.data.themes.theme!=g){this.get_container().removeClass("jstree-"+this.data.themes.theme);this.data.themes.theme=g}this.get_container().addClass("jstree-"+g);if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}this.__callback()},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=true;this.get_container().children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this.data.themes.dots=false;this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){if(this.data.themes.dots){this.hide_dots()}else{this.show_dots()}},show_icons:function(){this.data.themes.icons=true;this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=false;this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){if(this.data.themes.icons){this.hide_icons()}else{this.show_icons()}}}});d(function(){if(d.jstree._themes===false){d("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)){d.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/";return false}})}if(d.jstree._themes===false){d.jstree._themes="themes/"}});d.jstree.defaults.plugins.push("themes")})(jQuery);(function(f){var e=[];function d(h,j){var k=f.jstree._focused(),g;if(k&&k.data&&k.data.hotkeys&&k.data.hotkeys.enabled){g=k._get_settings().hotkeys[h];if(g){return g.call(k,j)}}}f.jstree.plugin("hotkeys",{__init:function(){if(typeof f.hotkeys==="undefined"){throw"jsTree hotkeys: jQuery hotkeys plugin not included."}if(!this.data.ui){throw"jsTree hotkeys: jsTree UI plugin not included."}f.each(this._get_settings().hotkeys,function(h,g){if(g!==false&&f.inArray(h,e)==-1){f(document).bind("keydown",h,function(i){return d(h,i)});e.push(h)}});this.get_container().bind("lock.jstree",f.proxy(function(){if(this.data.hotkeys.enabled){this.data.hotkeys.enabled=false;this.data.hotkeys.revert=true}},this)).bind("unlock.jstree",f.proxy(function(){if(this.data.hotkeys.revert){this.data.hotkeys.enabled=true}},this));this.enable_hotkeys()},defaults:{up:function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(g));return false},"ctrl+up":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(g));return false},"shift+up":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(g));return false},down:function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(g));return false},"ctrl+down":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(g));return false},"shift+down":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(g));return false},left:function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g){if(g.hasClass("jstree-open")){this.close_node(g)}else{this.hover_node(this._get_prev(g))}}return false},"ctrl+left":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g){if(g.hasClass("jstree-open")){this.close_node(g)}else{this.hover_node(this._get_prev(g))}}return false},"shift+left":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g){if(g.hasClass("jstree-open")){this.close_node(g)}else{this.hover_node(this._get_prev(g))}}return false},right:function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g&&g.length){if(g.hasClass("jstree-closed")){this.open_node(g)}else{this.hover_node(this._get_next(g))}}return false},"ctrl+right":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g&&g.length){if(g.hasClass("jstree-closed")){this.open_node(g)}else{this.hover_node(this._get_next(g))}}return false},"shift+right":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g&&g.length){if(g.hasClass("jstree-closed")){this.open_node(g)}else{this.hover_node(this._get_next(g))}}return false},space:function(){if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").click()}return false},"ctrl+space":function(g){g.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(g)}return false},"shift+space":function(g){g.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(g)}return false},f2:function(){this.rename(this.data.ui.hovered||this.data.ui.last_selected)},del:function(){this.remove(this.data.ui.hovered||this._get_node(null))}},_fn:{enable_hotkeys:function(){this.data.hotkeys.enabled=true},disable_hotkeys:function(){this.data.hotkeys.enabled=false}}})})(jQuery);(function(d){d.jstree.plugin("json_data",{__init:function(){var e=this._get_settings().json_data;if(e.progressive_unload){this.get_container().bind("after_close.jstree",function(g,f){f.rslt.obj.children("ul").remove()})}},defaults:{data:false,ajax:false,correct_state:true,progressive_render:false,progressive_unload:false},_fn:{load_node:function(g,e,f){var h=this;this.load_node_json(g,function(){h.__callback({obj:h._get_node(g)});e.call(this)},f)},_is_loaded:function(f){var e=this._get_settings().json_data;f=this._get_node(f);return f==-1||!f||(!e.ajax&&!e.progressive_render&&!d.isFunction(e.data))||f.is(".jstree-open, .jstree-leaf")||f.children("ul").children("li").length>0},refresh:function(f){f=this._get_node(f);var e=this._get_settings().json_data;if(f&&f!==-1&&e.progressive_unload&&(d.isFunction(e.data)||!!e.ajax)){f.removeData("jstree-children")}return this.__call_old()},load_node_json:function(i,e,g){var h=this.get_settings().json_data,k,f=function(){},j=function(){};i=this._get_node(i);if(i&&i!==-1&&(h.progressive_render||h.progressive_unload)&&!i.is(".jstree-open, .jstree-leaf")&&i.children("ul").children("li").length===0&&i.data("jstree-children")){k=this._parse_json(i.data("jstree-children"),i);if(k){i.append(k);if(!h.progressive_unload){i.removeData("jstree-children")}}this.clean_node(i);if(e){e.call(this)}return}if(i&&i!==-1){if(i.data("jstree-is-loading")){return}else{i.data("jstree-is-loading",true)}}switch(!0){case (!h.data&&!h.ajax):throw"Neither data nor ajax settings supplied.";case (d.isFunction(h.data)):h.data.call(this,i,d.proxy(function(l){l=this._parse_json(l,i);if(!l){if(i===-1||!i){if(h.correct_state){this.get_container().children("ul").empty()}}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading");if(h.correct_state){this.correct_state(i)}}if(g){g.call(this)}}else{if(i===-1||!i){this.get_container().children("ul").empty().append(l.children())}else{i.append(l).children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading")}this.clean_node(i);if(e){e.call(this)}}},this));break;case (!!h.data&&!h.ajax)||(!!h.data&&!!h.ajax&&(!i||i===-1)):if(!i||i==-1){k=this._parse_json(h.data,i);if(k){this.get_container().children("ul").empty().append(k.children());this.clean_node()}else{if(h.correct_state){this.get_container().children("ul").empty()}}}if(e){e.call(this)}break;case (!h.data&&!!h.ajax)||(!!h.data&&!!h.ajax&&i&&i!==-1):f=function(m,n,o){var l=this.get_settings().json_data.ajax.error;if(l){l.call(this,m,n,o)}if(i!=-1&&i.length){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading");if(n==="success"&&h.correct_state){this.correct_state(i)}}else{if(n==="success"&&h.correct_state){this.get_container().children("ul").empty()}}if(g){g.call(this)}};j=function(o,m,l){var n=this.get_settings().json_data.ajax.success;if(n){o=n.call(this,o,m,l)||o}if(o===""||(o&&o.toString&&o.toString().replace(/^[\s\n]+$/,"")==="")||(!d.isArray(o)&&!d.isPlainObject(o))){return f.call(this,l,m,"")}o=this._parse_json(o,i);if(o){if(i===-1||!i){this.get_container().children("ul").empty().append(o.children())}else{i.append(o).children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading")}this.clean_node(i);if(e){e.call(this)}}else{if(i===-1||!i){if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading");if(h.correct_state){this.correct_state(i);if(e){e.call(this)}}}}};h.ajax.context=this;h.ajax.error=f;h.ajax.success=j;if(!h.ajax.dataType){h.ajax.dataType="json"}if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,i)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,i)}d.ajax(h.ajax);break}},_parse_json:function(e,k,q){var m=false,f=this._get_settings(),u=f.json_data,r=f.core.html_titles,l,h,g,o,n;if(!e){return m}if(u.progressive_unload&&k&&k!==-1){k.data("jstree-children",m)}if(d.isArray(e)){m=d();if(!e.length){return false}for(h=0,g=e.length;h<g;h++){l=this._parse_json(e[h],k,true);if(l.length){m=m.add(l)}}}else{if(typeof e=="string"){e={data:e}}if(!e.data&&e.data!==""){return m}m=d("<li />");if(e.attr){m.attr(e.attr)}if(e.metadata){m.data(e.metadata)}if(e.state){m.addClass("jstree-"+e.state)}if(!d.isArray(e.data)){l=e.data;e.data=[];e.data.push(l)}d.each(e.data,function(p,j){l=d("<a />");if(d.isFunction(j)){j=j.call(this,e)}if(typeof j=="string"){l.attr("href","#")[r?"html":"text"](j)}else{if(!j.attr){j.attr={}}if(!j.attr.href){j.attr.href="#"}l.attr(j.attr)[r?"html":"text"](j.title);if(j.language){l.addClass(j.language)}}l.prepend("<ins class='jstree-icon'>&#160;</ins>");if(!j.icon&&e.icon){j.icon=e.icon}if(j.icon){if(j.icon.indexOf("/")===-1){l.children("ins").addClass(j.icon)}else{l.children("ins").css("background","url('"+j.icon+"') center center no-repeat")}}m.append(l)});m.prepend("<ins class='jstree-icon'>&#160;</ins>");if(e.children){if(u.progressive_render&&e.state!=="open"){m.addClass("jstree-closed").data("jstree-children",e.children)}else{if(u.progressive_unload){m.data("jstree-children",e.children)}if(d.isArray(e.children)&&e.children.length){l=this._parse_json(e.children,k,true);if(l.length){n=d("<ul />");n.append(l);m.append(n)}}}}}if(!q){o=d("<ul />");o.append(m);m=o}return m},get_json:function(j,g,e,n){var q=[],p=this._get_settings(),k=this,i,h,m,l,o,f;j=this._get_node(j);if(!j||j===-1){j=this.get_container().find("> ul > li")}g=d.isArray(g)?g:["id","class"];if(!n&&this.data.types){g.push(p.types.type_attr)}e=d.isArray(e)?e:[];j.each(function(){m=d(this);i={data:[]};if(g.length){i.attr={}}d.each(g,function(s,r){h=m.attr(r);if(h&&h.length&&h.replace(/jstree[^ ]*/ig,"").length){i.attr[r]=(" "+h).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}});if(m.hasClass("jstree-open")){i.state="open"}if(m.hasClass("jstree-closed")){i.state="closed"}if(m.data()){i.metadata=m.data()}l=m.children("a");l.each(function(){o=d(this);if(e.length||d.inArray("languages",p.plugins)!==-1||o.children("ins").get(0).style.backgroundImage.length||(o.children("ins").get(0).className&&o.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length)){f=false;if(d.inArray("languages",p.plugins)!==-1&&d.isArray(p.languages)&&p.languages.length){d.each(p.languages,function(r,s){if(o.hasClass(s)){f=s;return false}})}h={attr:{},title:k.get_text(o,f)};d.each(e,function(r,s){h.attr[s]=(" "+(o.attr(s)||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")});if(d.inArray("languages",p.plugins)!==-1&&d.isArray(p.languages)&&p.languages.length){d.each(p.languages,function(r,s){if(o.hasClass(s)){h.language=s;return true}})}if(o.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length){h.icon=o.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}if(o.children("ins").get(0).style.backgroundImage.length){h.icon=o.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")}}else{h=k.get_text(o)}if(l.length>1){i.data.push(h)}else{i.data=h}});m=m.find("> ul > li");if(m.length){i.children=k.get_json(m,g,e,true)}q.push(i)});return q}}})})(jQuery);(function(d){d.jstree.plugin("languages",{__init:function(){this._load_css()},defaults:[],_fn:{set_lang:function(g){var h=this._get_settings().languages,f=false,e=".jstree-"+this.get_index()+" a";if(!d.isArray(h)||h.length===0){return false}if(d.inArray(g,h)==-1){if(!!h[g]){g=h[g]}else{return false}}if(g==this.data.languages.current_language){return true}f=d.vakata.css.get_css(e+"."+this.data.languages.current_language,false,this.data.languages.language_css);if(f!==false){f.style.display="none"}f=d.vakata.css.get_css(e+"."+g,false,this.data.languages.language_css);if(f!==false){f.style.display=""}this.data.languages.current_language=g;this.__callback(g);return true},get_lang:function(){return this.data.languages.current_language},_get_string:function(e,h){var g=this._get_settings().languages,f=this._get_settings().core.strings;if(d.isArray(g)&&g.length){h=(h&&d.inArray(h,g)!=-1)?h:this.data.languages.current_language}if(f[h]&&f[h][e]){return f[h][e]}if(f[e]){return f[e]}return e},get_text:function(g,h){g=this._get_node(g)||this.data.ui.last_selected;if(!g.size()){return false}var f=this._get_settings().languages,e=this._get_settings().core.html_titles;if(d.isArray(f)&&f.length){h=(h&&d.inArray(h,f)!=-1)?h:this.data.languages.current_language;g=g.children("a."+h)}else{g=g.children("a:eq(0)")}if(e){g=g.clone();g.children("INS").remove();return g.html()}else{g=g.contents().filter(function(){return this.nodeType==3})[0];return g.nodeValue}},set_text:function(h,j,i){h=this._get_node(h)||this.data.ui.last_selected;if(!h.size()){return false}var g=this._get_settings().languages,f=this._get_settings().core.html_titles,e;if(d.isArray(g)&&g.length){i=(i&&d.inArray(i,g)!=-1)?i:this.data.languages.current_language;h=h.children("a."+i)}else{h=h.children("a:eq(0)")}if(f){e=h.children("INS").clone();h.html(j).prepend(e);this.__callback({obj:h,name:j,lang:i});return true}else{h=h.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:h,name:j,lang:i});return(h.nodeValue=j)}},_load_css:function(){var g=this._get_settings().languages,h="/* languages css */",e=".jstree-"+this.get_index()+" a",f;if(d.isArray(g)&&g.length){this.data.languages.current_language=g[0];for(f=0;f<g.length;f++){h+=e+"."+g[f]+" {";if(g[f]!=this.data.languages.current_language){h+=" display:none; "}h+=" } "}this.data.languages.language_css=d.vakata.css.add_sheet({str:h,title:"jstree-languages"})}},create_node:function(h,e,g,i){var f=this.__call_old(true,h,e,g,function(k){var m=this._get_settings().languages,j=k.children("a"),l;if(d.isArray(m)&&m.length){for(l=0;l<m.length;l++){if(!j.is("."+m[l])){k.append(j.eq(0).clone().removeClass(m.join(" ")).addClass(m[l]))}}j.not("."+m.join(", .")).remove()}if(i){i.call(this,k)}});return f}}})})(jQuery);(function(d){d.jstree.plugin("cookies",{__init:function(){if(typeof d.cookie==="undefined"){throw"jsTree cookie: jQuery cookie plugin not included."}var f=this._get_settings().cookies,e;if(!!f.save_loaded){e=d.cookie(f.save_loaded);if(e&&e.length){this.data.core.to_load=e.split(",")}}if(!!f.save_opened){e=d.cookie(f.save_opened);if(e&&e.length){this.data.core.to_open=e.split(",")}}if(!!f.save_selected){e=d.cookie(f.save_selected);if(e&&e.length&&this.data.ui){this.data.ui.to_select=e.split(",")}}this.get_container().one((this.data.ui?"reselect":"reopen")+".jstree",d.proxy(function(){this.get_container().bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree",d.proxy(function(g){if(this._get_settings().cookies.auto_save){this.save_cookie((g.handleObj.namespace+g.handleObj.type).replace("jstree",""))}},this))},this))},defaults:{save_loaded:"jstree_load",save_opened:"jstree_open",save_selected:"jstree_select",auto_save:true,cookie_options:{}},_fn:{save_cookie:function(f){if(this.data.core.refreshing){return}var e=this._get_settings().cookies;if(!f){if(e.save_loaded){this.save_loaded();d.cookie(e.save_loaded,this.data.core.to_load.join(","),e.cookie_options)}if(e.save_opened){this.save_opened();d.cookie(e.save_opened,this.data.core.to_open.join(","),e.cookie_options)}if(e.save_selected&&this.data.ui){this.save_selected();d.cookie(e.save_selected,this.data.ui.to_select.join(","),e.cookie_options)}return}switch(f){case"open_node":case"close_node":if(!!e.save_opened){this.save_opened();d.cookie(e.save_opened,this.data.core.to_open.join(","),e.cookie_options)}if(!!e.save_loaded){this.save_loaded();d.cookie(e.save_loaded,this.data.core.to_load.join(","),e.cookie_options)}break;case"select_node":case"deselect_node":if(!!e.save_selected&&this.data.ui){this.save_selected();d.cookie(e.save_selected,this.data.ui.to_select.join(","),e.cookie_options)}break}}}})})(jQuery);(function(d){d.jstree.plugin("sort",{__init:function(){this.get_container().bind("load_node.jstree",d.proxy(function(h,f){var g=this._get_node(f.rslt.obj);g=g===-1?this.get_container().children("ul"):g.children("ul");this.sort(g)},this)).bind("rename_node.jstree create_node.jstree create.jstree",d.proxy(function(g,f){this.sort(f.rslt.obj.parent())},this)).bind("move_node.jstree",d.proxy(function(h,g){var f=g.rslt.np==-1?this.get_container():g.rslt.np;this.sort(f.children("ul"))},this))},defaults:function(f,e){return this.get_text(f)>this.get_text(e)?1:-1},_fn:{sort:function(g){var f=this._get_settings().sort,e=this;g.append(d.makeArray(g.children("li")).sort(d.proxy(f,e)));g.find("> li > ul").each(function(){e.sort(d(this))});this.clean_node(g)}}})})(jQuery);(function(j){var f=false,d=false,g=false,h=false,k=false,e=false,n=false,l=false,i=false;j.vakata.dnd={is_down:false,is_drag:false,helper:false,scroll_spd:10,init_x:0,init_y:0,threshold:5,helper_left:5,helper_top:10,user_data:{},drag_start:function(q,p,m){if(j.vakata.dnd.is_drag){j.vakata.drag_stop({})}try{q.currentTarget.unselectable="on";q.currentTarget.onselectstart=function(){return false};if(q.currentTarget.style){q.currentTarget.style.MozUserSelect="none"}}catch(o){}j.vakata.dnd.init_x=q.pageX;j.vakata.dnd.init_y=q.pageY;j.vakata.dnd.user_data=p;j.vakata.dnd.is_down=true;j.vakata.dnd.helper=j("<div id='vakata-dragged' />").html(m);j(document).bind("mousemove",j.vakata.dnd.drag);j(document).bind("mouseup",j.vakata.dnd.drag_stop);return false},drag:function(p){if(!j.vakata.dnd.is_down){return}if(!j.vakata.dnd.is_drag){if(Math.abs(p.pageX-j.vakata.dnd.init_x)>5||Math.abs(p.pageY-j.vakata.dnd.init_y)>5){j.vakata.dnd.helper.appendTo("body");j.vakata.dnd.is_drag=true;j(document).triggerHandler("drag_start.vakata",{event:p,data:j.vakata.dnd.user_data})}else{return}}if(p.type==="mousemove"){var q=j(document),o=q.scrollTop(),m=q.scrollLeft();if(p.pageY-o<20){if(e&&n==="down"){clearInterval(e);e=false}if(!e){n="up";e=setInterval(function(){j(document).scrollTop(j(document).scrollTop()-j.vakata.dnd.scroll_spd)},150)}}else{if(e&&n==="up"){clearInterval(e);e=false}}if(j(window).height()-(p.pageY-o)<20){if(e&&n==="up"){clearInterval(e);e=false}if(!e){n="down";e=setInterval(function(){j(document).scrollTop(j(document).scrollTop()+j.vakata.dnd.scroll_spd)},150)}}else{if(e&&n==="down"){clearInterval(e);e=false}}if(p.pageX-m<20){if(k&&l==="right"){clearInterval(k);k=false}if(!k){l="left";k=setInterval(function(){j(document).scrollLeft(j(document).scrollLeft()-j.vakata.dnd.scroll_spd)},150)}}else{if(k&&l==="left"){clearInterval(k);k=false}}if(j(window).width()-(p.pageX-m)<20){if(k&&l==="left"){clearInterval(k);k=false}if(!k){l="right";k=setInterval(function(){j(document).scrollLeft(j(document).scrollLeft()+j.vakata.dnd.scroll_spd)},150)}}else{if(k&&l==="right"){clearInterval(k);k=false}}}j.vakata.dnd.helper.css({left:(p.pageX+j.vakata.dnd.helper_left)+"px",top:(p.pageY+j.vakata.dnd.helper_top)+"px"});j(document).triggerHandler("drag.vakata",{event:p,data:j.vakata.dnd.user_data})},drag_stop:function(m){if(k){clearInterval(k)}if(e){clearInterval(e)}j(document).unbind("mousemove",j.vakata.dnd.drag);j(document).unbind("mouseup",j.vakata.dnd.drag_stop);j(document).triggerHandler("drag_stop.vakata",{event:m,data:j.vakata.dnd.user_data});j.vakata.dnd.helper.remove();j.vakata.dnd.init_x=0;j.vakata.dnd.init_y=0;j.vakata.dnd.user_data={};j.vakata.dnd.is_down=false;j.vakata.dnd.is_drag=false}};j(function(){var m="#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ";j.vakata.css.add_sheet({str:m,title:"vakata"})});j.jstree.plugin("dnd",{__init:function(){this.data.dnd={active:false,after:false,inside:false,before:false,off:false,prepared:false,w:0,to1:false,to2:false,cof:false,cw:false,ch:false,i1:false,i2:false,mto:false};this.get_container().bind("mouseenter.jstree",j.proxy(function(q){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(this.data.themes){g.attr("class","jstree-"+this.data.themes.theme);if(h){h.attr("class","jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}if(q.currentTarget===q.target&&j.vakata.dnd.user_data.obj&&j(j.vakata.dnd.user_data.obj).length&&j(j.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==q.target){var p=j.jstree._reference(q.target),o;if(p.data.dnd.foreign){o=p._get_settings().dnd.drag_check.call(this,{o:f,r:p.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}else{p.prepare_move(f,p.get_container(),"last");if(p.check_move()){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}}}},this)).bind("mouseup.jstree",j.proxy(function(q){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree&&q.currentTarget===q.target&&j.vakata.dnd.user_data.obj&&j(j.vakata.dnd.user_data.obj).length&&j(j.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==q.target){var p=j.jstree._reference(q.currentTarget),o;if(p.data.dnd.foreign){o=p._get_settings().dnd.drag_check.call(this,{o:f,r:p.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){p._get_settings().dnd.drag_finish.call(this,{o:f,r:p.get_container(),is_root:true})}}else{p.move_node(f,p.get_container(),"last",q[p._get_settings().dnd.copy_modifier+"Key"])}}},this)).bind("mouseleave.jstree",j.proxy(function(o){if(o.relatedTarget&&o.relatedTarget.id&&o.relatedTarget.id==="jstree-marker-line"){return false}if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(j.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}}},this)).bind("mousemove.jstree",j.proxy(function(p){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){var o=this.get_container()[0];if(p.pageX+24>this.data.dnd.cof.left+this.data.dnd.cw){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}this.data.dnd.i1=setInterval(j.proxy(function(){this.scrollLeft+=j.vakata.dnd.scroll_spd},o),100)}else{if(p.pageX-24<this.data.dnd.cof.left){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}this.data.dnd.i1=setInterval(j.proxy(function(){this.scrollLeft-=j.vakata.dnd.scroll_spd},o),100)}else{if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}}}if(p.pageY+24>this.data.dnd.cof.top+this.data.dnd.ch){if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.i2=setInterval(j.proxy(function(){this.scrollTop+=j.vakata.dnd.scroll_spd},o),100)}else{if(p.pageY-24<this.data.dnd.cof.top){if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.i2=setInterval(j.proxy(function(){this.scrollTop-=j.vakata.dnd.scroll_spd},o),100)}else{if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}}}}},this)).bind("scroll.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree&&g&&h){g.hide();h.hide()}},this)).delegate("a","mousedown.jstree",j.proxy(function(o){if(o.which===1){this.start_drag(o.currentTarget,o);return false}},this)).delegate("a","mouseenter.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){this.dnd_enter(o.currentTarget)}},this)).delegate("a","mousemove.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(!d||!d.length||d.children("a")[0]!==o.currentTarget){this.dnd_enter(o.currentTarget)}if(typeof this.data.dnd.off.top==="undefined"){this.data.dnd.off=j(o.target).offset()}this.data.dnd.w=(o.pageY-(this.data.dnd.off.top||0))%this.data.core.li_height;if(this.data.dnd.w<0){this.data.dnd.w+=this.data.core.li_height}this.dnd_show()}},this)).delegate("a","mouseleave.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(o.relatedTarget&&o.relatedTarget.id&&o.relatedTarget.id==="jstree-marker-line"){return false}if(g){g.hide()}if(h){h.hide()}this.data.dnd.mto=setTimeout((function(p){return function(){p.dnd_leave(o)}})(this),0)}},this)).delegate("a","mouseup.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){this.dnd_finish(o)}},this));j(document).bind("drag_stop.vakata",j.proxy(function(){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.after=false;this.data.dnd.before=false;this.data.dnd.inside=false;this.data.dnd.off=false;this.data.dnd.prepared=false;this.data.dnd.w=false;this.data.dnd.to1=false;this.data.dnd.to2=false;this.data.dnd.i1=false;this.data.dnd.i2=false;this.data.dnd.active=false;this.data.dnd.foreign=false;if(g){g.css({top:"-2000px"})}if(h){h.css({top:"-2000px"})}},this)).bind("drag_start.vakata",j.proxy(function(q,o){if(o.data.jstree){var p=j(o.event.target);if(p.closest(".jstree").hasClass("jstree-"+this.get_index())){this.dnd_enter(p)}}},this));var m=this._get_settings().dnd;if(m.drag_target){j(document).delegate(m.drag_target,"mousedown.jstree-"+this.get_index(),j.proxy(function(p){f=p.target;j.vakata.dnd.drag_start(p,{jstree:true,obj:p.target},"<ins class='jstree-icon'></ins>"+j(p.target).text());if(this.data.themes){if(g){g.attr("class","jstree-"+this.data.themes.theme)}if(h){h.attr("class","jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");var o=this.get_container();this.data.dnd.cof=o.offset();this.data.dnd.cw=parseInt(o.width(),10);this.data.dnd.ch=parseInt(o.height(),10);this.data.dnd.foreign=true;p.preventDefault()},this))}if(m.drop_target){j(document).delegate(m.drop_target,"mouseenter.jstree-"+this.get_index(),j.proxy(function(o){if(this.data.dnd.active&&this._get_settings().dnd.drop_check.call(this,{o:f,r:j(o.target),e:o})){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}},this)).delegate(m.drop_target,"mouseleave.jstree-"+this.get_index(),j.proxy(function(o){if(this.data.dnd.active){j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}},this)).delegate(m.drop_target,"mouseup.jstree-"+this.get_index(),j.proxy(function(o){if(this.data.dnd.active&&j.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){this._get_settings().dnd.drop_finish.call(this,{o:f,r:j(o.target),e:o})}},this))}},defaults:{copy_modifier:"ctrl",check_timeout:100,open_timeout:500,drop_target:".jstree-drop",drop_check:function(m){return true},drop_finish:j.noop,drag_target:".jstree-draggable",drag_finish:j.noop,drag_check:function(m){return{after:false,before:false,inside:true}}},_fn:{dnd_prepare:function(){if(!d||!d.length){return}this.data.dnd.off=d.offset();if(this._get_settings().core.rtl){this.data.dnd.off.right=this.data.dnd.off.left+d.width()}if(this.data.dnd.foreign){var m=this._get_settings().dnd.drag_check.call(this,{o:f,r:d});this.data.dnd.after=m.after;this.data.dnd.before=m.before;this.data.dnd.inside=m.inside;this.data.dnd.prepared=true;return this.dnd_show()}this.prepare_move(f,d,"before");this.data.dnd.before=this.check_move();this.prepare_move(f,d,"after");this.data.dnd.after=this.check_move();if(this._is_loaded(d)){this.prepare_move(f,d,"inside");this.data.dnd.inside=this.check_move()}else{this.data.dnd.inside=false}this.data.dnd.prepared=true;return this.dnd_show()},dnd_show:function(){if(!this.data.dnd.prepared){return}var q=["before","inside","after"],m=false,p=this._get_settings().core.rtl,s;if(this.data.dnd.w<this.data.core.li_height/3){q=["before","inside","after"]}else{if(this.data.dnd.w<=this.data.core.li_height*2/3){q=this.data.dnd.w<this.data.core.li_height/2?["inside","before","after"]:["inside","after","before"]}else{q=["after","inside","before"]}}j.each(q,j.proxy(function(o,r){if(this.data.dnd[r]){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok");m=r;return false}},this));if(m===false){j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}s=p?(this.data.dnd.off.right-18):(this.data.dnd.off.left+10);switch(m){case"before":g.css({left:s+"px",top:(this.data.dnd.off.top-6)+"px"}).show();if(h){h.css({left:(s+8)+"px",top:(this.data.dnd.off.top-1)+"px"}).show()}break;case"after":g.css({left:s+"px",top:(this.data.dnd.off.top+this.data.core.li_height-6)+"px"}).show();if(h){h.css({left:(s+8)+"px",top:(this.data.dnd.off.top+this.data.core.li_height-1)+"px"}).show()}break;case"inside":g.css({left:s+(p?-4:4)+"px",top:(this.data.dnd.off.top+this.data.core.li_height/2-5)+"px"}).show();if(h){h.hide()}break;default:g.hide();if(h){h.hide()}break}i=m;return m},dnd_open:function(){this.data.dnd.to2=false;this.open_node(d,j.proxy(this.dnd_prepare,this),true)},dnd_finish:function(m){if(this.data.dnd.foreign){if(this.data.dnd.after||this.data.dnd.before||this.data.dnd.inside){this._get_settings().dnd.drag_finish.call(this,{o:f,r:d,p:i})}}else{this.dnd_prepare();this.move_node(f,d,i,m[this._get_settings().dnd.copy_modifier+"Key"])}f=false;d=false;g.hide();if(h){h.hide()}},dnd_enter:function(o){if(this.data.dnd.mto){clearTimeout(this.data.dnd.mto);this.data.dnd.mto=false}var m=this._get_settings().dnd;this.data.dnd.prepared=false;d=this._get_node(o);if(m.check_timeout){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}this.data.dnd.to1=setTimeout(j.proxy(this.dnd_prepare,this),m.check_timeout)}else{this.dnd_prepare()}if(m.open_timeout){if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(d&&d.length&&d.hasClass("jstree-closed")){this.data.dnd.to2=setTimeout(j.proxy(this.dnd_open,this),m.open_timeout)}}else{if(d&&d.length&&d.hasClass("jstree-closed")){this.dnd_open()}}},dnd_leave:function(m){this.data.dnd.after=false;this.data.dnd.before=false;this.data.dnd.inside=false;j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");g.hide();if(h){h.hide()}if(d&&d[0]===m.target.parentNode){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1);this.data.dnd.to1=false}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2);this.data.dnd.to2=false}}},start_drag:function(q,p){f=this._get_node(q);if(this.data.ui&&this.is_selected(f)){f=this._get_node(null,true)}var o=f.length>1?this._get_string("multiple_selection"):this.get_text(f),m=this.get_container();if(!this._get_settings().core.html_titles){o=o.replace(/</ig,"&lt;").replace(/>/ig,"&gt;")}j.vakata.dnd.drag_start(p,{jstree:true,obj:f},"<ins class='jstree-icon'></ins>"+o);if(this.data.themes){if(g){g.attr("class","jstree-"+this.data.themes.theme)}if(h){h.attr("class","jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}this.data.dnd.cof=m.offset();this.data.dnd.cw=parseInt(m.width(),10);this.data.dnd.ch=parseInt(m.height(),10);this.data.dnd.active=true}}});j(function(){var m="#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px;  -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; } #vakata-dragged .jstree-ok { background:green; } #vakata-dragged .jstree-invalid { background:red; } #jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } #jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43;  cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666;  -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; }";j.vakata.css.add_sheet({str:m,title:"jstree"});g=j("<div />").attr({id:"jstree-marker"}).hide().html("&raquo;").bind("mouseleave mouseenter",function(o){g.hide();h.hide();o.preventDefault();o.stopImmediatePropagation();return false}).appendTo("body");h=j("<div />").attr({id:"jstree-marker-line"}).hide().bind("mouseup",function(o){if(d&&d.length){d.children("a").trigger(o);o.preventDefault();o.stopImmediatePropagation();return false}}).bind("mouseleave",function(p){var o=j(p.relatedTarget);if(o.is(".jstree")||o.closest(".jstree").length===0){if(d&&d.length){d.children("a").trigger(p);g.hide();h.hide();p.preventDefault();p.stopImmediatePropagation();return false}}}).appendTo("body");j(document).bind("drag_start.vakata",function(p,o){if(o.data.jstree){g.show();if(h){h.show()}}});j(document).bind("drag_stop.vakata",function(p,o){if(o.data.jstree){g.hide();if(h){h.hide()}}})})})(jQuery);(function(d){d.jstree.plugin("checkbox",{__init:function(){this.data.checkbox.noui=this._get_settings().checkbox.override_ui;if(this.data.ui&&this.data.checkbox.noui){this.select_node=this.deselect_node=this.deselect_all=d.noop;this.get_selected=this.get_checked}this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",d.proxy(function(g,f){this._prepare_checkboxes(f.rslt.obj)},this)).bind("loaded.jstree",d.proxy(function(f){this._prepare_checkboxes()},this)).delegate((this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox"),"click.jstree",d.proxy(function(f){f.preventDefault();if(this._get_node(f.target).hasClass("jstree-checked")){this.uncheck_node(f.target)}else{this.check_node(f.target)}if(this.data.ui&&this.data.checkbox.noui){this.save_selected();if(this.data.cookies){this.save_cookie("select_node")}}else{f.stopImmediatePropagation();return false}},this))},defaults:{override_ui:false,two_state:false,real_checkboxes:false,checked_parent_open:true,real_checkboxes_names:function(e){return[("check_"+(e[0].id||Math.ceil(Math.random()*10000))),1]}},__destroy:function(){this.get_container().find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end().find("ins.jstree-checkbox").remove()},_fn:{_checkbox_notify:function(f,e){if(e.checked){this.check_node(f,false)}},_prepare_checkboxes:function(i){i=!i||i==-1?this.get_container().find("> ul > li"):this._get_node(i);if(i===false){return}var k,j=this,e,g=this._get_settings().checkbox.two_state,h=this._get_settings().checkbox.real_checkboxes,f=this._get_settings().checkbox.real_checkboxes_names;i.each(function(){e=d(this);k=e.is("li")&&(e.hasClass("jstree-checked")||(h&&e.children(":checked").length))?"jstree-checked":"jstree-unchecked";e.find("li").andSelf().each(function(){var m=d(this),l;m.children("a"+(j.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(g?"jstree-unchecked":k);if(h){if(!m.children(":checkbox").length){l=f.call(j,m);m.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+l[0]+"' name='"+l[0]+"' value='"+l[1]+"' />")}else{m.children(":checkbox").addClass("jstree-real-checkbox")}if(k==="jstree-checked"){m.children(":checkbox").attr("checked","checked")}}if(k==="jstree-checked"&&!g){m.find("li").addClass("jstree-checked")}})});if(!g){if(i.length===1&&i.is("li")){this._repair_state(i)}if(i.is("li")){i.each(function(){j._repair_state(this)})}else{i.find("> ul > li").each(function(){j._repair_state(this)})}i.find(".jstree-checked").parent().parent().each(function(){j._repair_state(this)})}},change_state:function(h,g){h=this._get_node(h);var e=false,f=this._get_settings().checkbox.real_checkboxes;if(!h||h===-1){return false}g=(g===false||g===true)?g:h.hasClass("jstree-checked");if(this._get_settings().checkbox.two_state){if(g){h.removeClass("jstree-checked").addClass("jstree-unchecked");if(f){h.children(":checkbox").removeAttr("checked")}}else{h.removeClass("jstree-unchecked").addClass("jstree-checked");if(f){h.children(":checkbox").attr("checked","checked")}}}else{if(g){e=h.find("li").andSelf();if(!e.filter(".jstree-checked, .jstree-undetermined").length){return false}e.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(f){e.children(":checkbox").removeAttr("checked")}}else{e=h.find("li").andSelf();if(!e.filter(".jstree-unchecked, .jstree-undetermined").length){return false}e.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(f){e.children(":checkbox").attr("checked","checked")}if(this.data.ui){this.data.ui.last_selected=h}this.data.checkbox.last_selected=h}h.parentsUntil(".jstree","li").each(function(){var i=d(this);if(g){if(i.children("ul").children("li.jstree-checked, li.jstree-undetermined").length){i.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(f){i.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked")}return false}else{i.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(f){i.children(":checkbox").removeAttr("checked")}}}else{if(i.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length){i.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(f){i.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked")}return false}else{i.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(f){i.children(":checkbox").attr("checked","checked")}}}})}if(this.data.ui&&this.data.checkbox.noui){this.data.ui.selected=this.get_checked()}this.__callback(h);return true},check_node:function(f){if(this.change_state(f,false)){f=this._get_node(f);if(this._get_settings().checkbox.checked_parent_open){var e=this;f.parents(".jstree-closed").each(function(){e.open_node(this,false,true)})}this.__callback({obj:f})}},uncheck_node:function(e){if(this.change_state(e,true)){this.__callback({obj:this._get_node(e)})}},check_all:function(){var f=this,e=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");e.each(function(){f.change_state(this,false)});this.__callback()},uncheck_all:function(){var f=this,e=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");e.each(function(){f.change_state(this,true)});this.__callback()},is_checked:function(e){e=this._get_node(e);return e.length?e.is(".jstree-checked"):false},get_checked:function(f,e){f=!f||f===-1?this.get_container():this._get_node(f);return e||this._get_settings().checkbox.two_state?f.find(".jstree-checked"):f.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(f,e){f=!f||f===-1?this.get_container():this._get_node(f);return e||this._get_settings().checkbox.two_state?f.find(".jstree-unchecked"):f.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(h){h=this._get_node(h);if(!h.length){return}var g=this._get_settings().checkbox.real_checkboxes,f=h.find("> ul > .jstree-checked").length,e=h.find("> ul > .jstree-undetermined").length,i=h.find("> ul > li").length;if(i===0){if(h.hasClass("jstree-undetermined")){this.change_state(h,false)}}else{if(f===0&&e===0){this.change_state(h,true)}else{if(f===i){this.change_state(h,false)}else{h.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(g){h.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked")}}}}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var f=this,e=this.data.ui.to_select;e=d.map(d.makeArray(e),function(g){return"#"+g.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.deselect_all();d.each(e,function(g,h){f.check_node(h)});this.__callback()}else{this.__call_old()}},save_loaded:function(){var e=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){if(this.id){e.data.core.to_load.push("#"+this.id)}})}}});d(function(){var e=".jstree .jstree-real-checkbox { display:none; } ";d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(f){f.vakata.xslt=function(i,j,n){var g="",m,h,l,k;if(document.recalc){m=document.createElement("xml");h=document.createElement("xml");m.innerHTML=i;h.innerHTML=j;f("body").append(m).append(h);setTimeout((function(p,o,q){return function(){q.call(null,p.transformNode(o.XMLDocument));setTimeout((function(s,r){return function(){f(s).remove();f(r).remove()}})(p,o),200)}})(m,h,n),100);return true}if(typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor==="undefined"){i=new DOMParser().parseFromString(i,"text/xml");j=new DOMParser().parseFromString(j,"text/xml")}if(typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor!=="undefined"){l=new XSLTProcessor();k=f.isFunction(l.transformDocument)?(typeof window.XMLSerializer!=="undefined"):true;if(!k){return false}i=new DOMParser().parseFromString(i,"text/xml");j=new DOMParser().parseFromString(j,"text/xml");if(f.isFunction(l.transformDocument)){g=document.implementation.createDocument("","",null);l.transformDocument(i,j,g,null);n.call(null,new XMLSerializer().serializeToString(g));return true}else{l.importStylesheet(j);g=l.transformToFragment(i,document);n.call(null,f("<div />").append(g).html());return true}}return false};var e={nest:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" /><xsl:template match="/">	<xsl:call-template name="nodes">		<xsl:with-param name="node" select="/root" />	</xsl:call-template></xsl:template><xsl:template name="nodes">	<xsl:param name="node" />	<ul>	<xsl:for-each select="$node/item">		<xsl:variable name="children" select="count(./item) &gt; 0" />		<li>			<xsl:attribute name="class">				<xsl:if test="position() = last()">jstree-last </xsl:if>				<xsl:choose>					<xsl:when test="@state = \'open\'">jstree-open </xsl:when>					<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>					<xsl:otherwise>jstree-leaf </xsl:otherwise>				</xsl:choose>				<xsl:value-of select="@class" />			</xsl:attribute>			<xsl:for-each select="@*">				<xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">					<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>				</xsl:if>			</xsl:for-each>	<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>			<xsl:for-each select="content/name">				<a>				<xsl:attribute name="href">					<xsl:choose>					<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>					<xsl:otherwise>#</xsl:otherwise>					</xsl:choose>				</xsl:attribute>				<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>				<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>				<xsl:for-each select="@*">					<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">						<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>					</xsl:if>				</xsl:for-each>					<ins>						<xsl:attribute name="class">jstree-icon 							<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>						</xsl:attribute>						<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>						<xsl:text>&#xa0;</xsl:text>					</ins>					<xsl:copy-of select="./child::node()" />				</a>			</xsl:for-each>			<xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>		</li>	</xsl:for-each>	</ul></xsl:template></xsl:stylesheet>',flat:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" /><xsl:template match="/">	<ul>	<xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">		<xsl:call-template name="nodes">			<xsl:with-param name="node" select="." />			<xsl:with-param name="is_last" select="number(position() = last())" />		</xsl:call-template>	</xsl:for-each>	</ul></xsl:template><xsl:template name="nodes">	<xsl:param name="node" />	<xsl:param name="is_last" />	<xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />	<li>	<xsl:attribute name="class">		<xsl:if test="$is_last = true()">jstree-last </xsl:if>		<xsl:choose>			<xsl:when test="@state = \'open\'">jstree-open </xsl:when>			<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>			<xsl:otherwise>jstree-leaf </xsl:otherwise>		</xsl:choose>		<xsl:value-of select="@class" />	</xsl:attribute>	<xsl:for-each select="@*">		<xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">		<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>		</xsl:if>	</xsl:for-each>	<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>	<xsl:for-each select="content/name">		<a>		<xsl:attribute name="href">			<xsl:choose>			<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>			<xsl:otherwise>#</xsl:otherwise>			</xsl:choose>		</xsl:attribute>		<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>		<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>		<xsl:for-each select="@*">			<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">				<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>			</xsl:if>		</xsl:for-each>			<ins>				<xsl:attribute name="class">jstree-icon 					<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>				</xsl:attribute>				<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>				<xsl:text>&#xa0;</xsl:text>			</ins>			<xsl:copy-of select="./child::node()" />		</a>	</xsl:for-each>	<xsl:if test="$children">		<ul>		<xsl:for-each select="//item[@parent_id=$node/attribute::id]">			<xsl:call-template name="nodes">				<xsl:with-param name="node" select="." />				<xsl:with-param name="is_last" select="number(position() = last())" />			</xsl:call-template>		</xsl:for-each>		</ul>	</xsl:if>	</li></xsl:template></xsl:stylesheet>'},d=function(g){return g.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")};f.jstree.plugin("xml_data",{defaults:{data:false,ajax:false,xsl:"flat",clean_node:false,correct_state:true,get_skip_empty:false,get_include_preamble:true},_fn:{load_node:function(i,g,h){var j=this;this.load_node_xml(i,function(){j.__callback({obj:j._get_node(i)});g.call(this)},h)},_is_loaded:function(h){var g=this._get_settings().xml_data;h=this._get_node(h);return h==-1||!h||(!g.ajax&&!f.isFunction(g.data))||h.is(".jstree-open, .jstree-leaf")||h.children("ul").children("li").size()>0},load_node_xml:function(k,g,i){var j=this.get_settings().xml_data,h=function(){},l=function(){};k=this._get_node(k);if(k&&k!==-1){if(k.data("jstree-is-loading")){return}else{k.data("jstree-is-loading",true)}}switch(!0){case (!j.data&&!j.ajax):throw"Neither data nor ajax settings supplied.";case (f.isFunction(j.data)):j.data.call(this,k,f.proxy(function(m){this.parse_xml(m,f.proxy(function(n){if(n){n=n.replace(/ ?xmlns="[^"]*"/ig,"");if(n.length>10){n=f(n);if(k===-1||!k){this.get_container().children("ul").empty().append(n.children())}else{k.children("a.jstree-loading").removeClass("jstree-loading");k.append(n);k.removeData("jstree-is-loading")}if(j.clean_node){this.clean_node(k)}if(g){g.call(this)}}else{if(k&&k!==-1){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree-is-loading");if(j.correct_state){this.correct_state(k);if(g){g.call(this)}}}else{if(j.correct_state){this.get_container().children("ul").empty();if(g){g.call(this)}}}}}},this))},this));break;case (!!j.data&&!j.ajax)||(!!j.data&&!!j.ajax&&(!k||k===-1)):if(!k||k==-1){this.parse_xml(j.data,f.proxy(function(m){if(m){m=m.replace(/ ?xmlns="[^"]*"/ig,"");if(m.length>10){m=f(m);this.get_container().children("ul").empty().append(m.children());if(j.clean_node){this.clean_node(k)}if(g){g.call(this)}}}else{if(j.correct_state){this.get_container().children("ul").empty();if(g){g.call(this)}}}},this))}break;case (!j.data&&!!j.ajax)||(!!j.data&&!!j.ajax&&k&&k!==-1):h=function(n,o,p){var m=this.get_settings().xml_data.ajax.error;if(m){m.call(this,n,o,p)}if(k!==-1&&k.length){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree-is-loading");if(o==="success"&&j.correct_state){this.correct_state(k)}}else{if(o==="success"&&j.correct_state){this.get_container().children("ul").empty()}}if(i){i.call(this)}};l=function(p,n,m){p=m.responseText;var o=this.get_settings().xml_data.ajax.success;if(o){p=o.call(this,p,n,m)||p}if(p===""||(p&&p.toString&&p.toString().replace(/^[\s\n]+$/,"")==="")){return h.call(this,m,n,"")}this.parse_xml(p,f.proxy(function(q){if(q){q=q.replace(/ ?xmlns="[^"]*"/ig,"");if(q.length>10){q=f(q);if(k===-1||!k){this.get_container().children("ul").empty().append(q.children())}else{k.children("a.jstree-loading").removeClass("jstree-loading");k.append(q);k.removeData("jstree-is-loading")}if(j.clean_node){this.clean_node(k)}if(g){g.call(this)}}else{if(k&&k!==-1){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree-is-loading");if(j.correct_state){this.correct_state(k);if(g){g.call(this)}}}else{if(j.correct_state){this.get_container().children("ul").empty();if(g){g.call(this)}}}}}},this))};j.ajax.context=this;j.ajax.error=h;j.ajax.success=l;if(!j.ajax.dataType){j.ajax.dataType="xml"}if(f.isFunction(j.ajax.url)){j.ajax.url=j.ajax.url.call(this,k)}if(f.isFunction(j.ajax.data)){j.ajax.data=j.ajax.data.call(this,k)}f.ajax(j.ajax);break}},parse_xml:function(g,i){var h=this._get_settings().xml_data;f.vakata.xslt(g,e[h.xsl],i)},get_xml:function(o,l,i,g,q){var t="",r=this._get_settings(),m=this,k,j,p,n,h;if(!o){o="flat"}if(!q){q=0}l=this._get_node(l);if(!l||l===-1){l=this.get_container().find("> ul > li")}i=f.isArray(i)?i:["id","class"];if(!q&&this.data.types&&f.inArray(r.types.type_attr,i)===-1){i.push(r.types.type_attr)}g=f.isArray(g)?g:[];if(!q){if(r.xml_data.get_include_preamble){t+='<?xml version="1.0" encoding="UTF-8"?>'}t+="<root>"}l.each(function(){t+="<item";p=f(this);f.each(i,function(w,s){var u=p.attr(s);if(!r.xml_data.get_skip_empty||typeof u!=="undefined"){t+=" "+s+'="'+d((" "+(u||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'}});if(p.hasClass("jstree-open")){t+=' state="open"'}if(p.hasClass("jstree-closed")){t+=' state="closed"'}if(o==="flat"){t+=' parent_id="'+d(q)+'"'}t+=">";t+="<content>";n=p.children("a");n.each(function(){k=f(this);h=false;t+="<name";if(f.inArray("languages",r.plugins)!==-1){f.each(r.languages,function(s,u){if(k.hasClass(u)){t+=' lang="'+d(u)+'"';h=u;return false}})}if(g.length){f.each(g,function(s,v){var u=k.attr(v);if(!r.xml_data.get_skip_empty||typeof u!=="undefined"){t+=" "+v+'="'+d((" "+u||"").replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'}})}if(k.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length){t+=' icon="'+d(k.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'}if(k.children("ins").get(0).style.backgroundImage.length){t+=' icon="'+d(k.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,""))+'"'}t+=">";t+="<![CDATA["+m.get_text(k,h)+"]]>";t+="</name>"});t+="</content>";j=p[0].id||true;p=p.find("> ul > li");if(p.length){j=m.get_xml(o,p,i,g,j)}else{j=""}if(o=="nest"){t+=j}t+="</item>";if(o=="flat"){t+=j}});if(!q){t+="</root>"}return t}}})})(jQuery);(function(d){d.expr[":"].jstree_contains=function(f,g,e){return(f.textContent||f.innerText||"").toLowerCase().indexOf(e[3].toLowerCase())>=0};d.expr[":"].jstree_title_contains=function(f,g,e){return(f.getAttribute("title")||"").toLowerCase().indexOf(e[3].toLowerCase())>=0};d.jstree.plugin("search",{__init:function(){this.data.search.str="";this.data.search.result=d();if(this._get_settings().search.show_only_matches){this.get_container().bind("search.jstree",function(g,f){d(this).children("ul").find("li").hide().removeClass("jstree-last");f.rslt.nodes.parentsUntil(".jstree").andSelf().show().filter("ul").each(function(){d(this).children("li:visible").eq(-1).addClass("jstree-last")})}).bind("clear_search.jstree",function(){d(this).children("ul").find("li").css("display","").end().end().jstree("clean_node",-1)})}},defaults:{ajax:false,search_method:"jstree_contains",show_only_matches:false},_fn:{search:function(j,e){if(d.trim(j)===""){this.clear_search();return}var h=this.get_settings().search,g=this,f=function(){},i=function(){};this.data.search.str=j;if(!e&&h.ajax!==false&&this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length>0){this.search.supress_callback=true;f=function(){};i=function(n,l,k){var m=this.get_settings().search.ajax.success;if(m){n=m.call(this,n,l,k)||n}this.data.search.to_open=n;this._search_open()};h.ajax.context=this;h.ajax.error=f;h.ajax.success=i;if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,j)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,j)}if(!h.ajax.data){h.ajax.data={search_string:j}}if(!h.ajax.dataType||/^json/.exec(h.ajax.dataType)){h.ajax.dataType="json"}d.ajax(h.ajax);return}if(this.data.search.result.length){this.clear_search()}this.data.search.result=this.get_container().find("a"+(this.data.languages?"."+this.get_lang():"")+":"+(h.search_method)+"("+this.data.search.str+")");this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function(){g.open_node(this,false,true)});this.__callback({nodes:this.data.search.result,str:j})},clear_search:function(e){this.data.search.result.removeClass("jstree-search");this.__callback(this.data.search.result);this.data.search.result=d()},_search_open:function(f){var i=this,e=true,h=[],g=[];if(this.data.search.to_open.length){d.each(this.data.search.to_open,function(j,k){if(k=="#"){return true}if(d(k).length&&d(k).is(".jstree-closed")){h.push(k)}else{g.push(k)}});if(h.length){this.data.search.to_open=g;d.each(h,function(j,k){i.open_node(k,function(){i._search_open(true)})});e=false}}if(e){this.search(this.data.search.str,true)}}}})})(jQuery);(function(d){d.vakata.context={hide_on_mouseleave:false,cnt:d("<div id='vakata-contextmenu' />"),vis:false,tgt:false,par:false,func:false,data:false,rtl:false,show:function(o,n,l,j,i,e,k){d.vakata.context.rtl=!!k;var g=d.vakata.context.parse(o),f,m;if(!g){return}d.vakata.context.vis=true;d.vakata.context.tgt=n;d.vakata.context.par=e||n||null;d.vakata.context.data=i||null;d.vakata.context.cnt.html(g).css({visibility:"hidden",display:"block",left:0,top:0});if(d.vakata.context.hide_on_mouseleave){d.vakata.context.cnt.one("mouseleave",function(h){d.vakata.context.hide()})}f=d.vakata.context.cnt.height();m=d.vakata.context.cnt.width();if(l+m>d(document).width()){l=d(document).width()-(m+5);d.vakata.context.cnt.find("li > ul").addClass("right")}if(j+f>d(document).height()){j=j-(f+n[0].offsetHeight);d.vakata.context.cnt.find("li > ul").addClass("bottom")}d.vakata.context.cnt.css({left:l,top:j}).find("li:has(ul)").bind("mouseenter",function(s){var p=d(document).width(),r=d(document).height(),q=d(this).children("ul").show();if(p!==d(document).width()){q.toggleClass("right")}if(r!==d(document).height()){q.toggleClass("bottom")}}).bind("mouseleave",function(h){d(this).children("ul").hide()}).end().css({visibility:"visible"}).show();d(document).triggerHandler("context_show.vakata")},hide:function(){d.vakata.context.vis=false;d.vakata.context.cnt.attr("class","").css({visibility:"hidden"});d(document).triggerHandler("context_hide.vakata")},parse:function(h,g){if(!h){return false}var i="",f=false,e=true;if(!g){d.vakata.context.func={}}i+="<ul>";d.each(h,function(j,k){if(!k){return true}d.vakata.context.func[j]=k.action;if(!e&&k.separator_before){i+="<li class='vakata-separator vakata-separator-before'></li>"}e=false;i+="<li class='"+(k._class||"")+(k._disabled?" jstree-contextmenu-disabled ":"")+"'><ins ";if(k.icon&&k.icon.indexOf("/")===-1){i+=" class='"+k.icon+"' "}if(k.icon&&k.icon.indexOf("/")!==-1){i+=" style='background:url("+k.icon+") center center no-repeat;' "}i+=">&#160;</ins><a href='#' rel='"+j+"'>";if(k.submenu){i+="<span style='float:"+(d.vakata.context.rtl?"left":"right")+";'>&raquo;</span>"}i+=k.label+"</a>";if(k.submenu){f=d.vakata.context.parse(k.submenu,true);if(f){i+=f}}i+="</li>";if(k.separator_after){i+="<li class='vakata-separator vakata-separator-after'></li>";e=true}});i=i.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");i+="</ul>";d(document).triggerHandler("context_parse.vakata");return i.length>10?i:false},exec:function(e){if(d.isFunction(d.vakata.context.func[e])){d.vakata.context.func[e].call(d.vakata.context.data,d.vakata.context.par);return true}else{return false}}};d(function(){var e="#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } #vakata-contextmenu ul { min-width:180px; *width:180px; } #vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } #vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } #vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } #vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } #vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } #vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } #vakata-contextmenu .right { right:100%; left:auto; } #vakata-contextmenu .bottom { bottom:-1px; top:auto; } #vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ";d.vakata.css.add_sheet({str:e,title:"vakata"});d.vakata.context.cnt.delegate("a","click",function(f){f.preventDefault()}).delegate("a","mouseup",function(f){if(!d(this).parent().hasClass("jstree-contextmenu-disabled")&&d.vakata.context.exec(d(this).attr("rel"))){d.vakata.context.hide()}else{d(this).blur()}}).delegate("a","mouseover",function(){d.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");d(document).bind("mousedown",function(f){if(d.vakata.context.vis&&!d.contains(d.vakata.context.cnt[0],f.target)){d.vakata.context.hide()}});if(typeof d.hotkeys!=="undefined"){d(document).bind("keydown","up",function(f){if(d.vakata.context.vis){var g=d.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();if(!g.length){g=d.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last()}g.addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","down",function(f){if(d.vakata.context.vis){var g=d.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();if(!g.length){g=d.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first()}g.addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","right",function(f){if(d.vakata.context.vis){d.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","left",function(f){if(d.vakata.context.vis){d.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","esc",function(f){d.vakata.context.hide();f.preventDefault()}).bind("keydown","space",function(f){d.vakata.context.cnt.find(".vakata-hover").last().children("a").click();f.preventDefault()})}});d.jstree.plugin("contextmenu",{__init:function(){this.get_container().delegate("a","contextmenu.jstree",d.proxy(function(f){f.preventDefault();if(!d(f.currentTarget).hasClass("jstree-loading")){this.show_contextmenu(f.currentTarget,f.pageX,f.pageY)}},this)).delegate("a","click.jstree",d.proxy(function(f){if(this.data.contextmenu){d.vakata.context.hide()}},this)).bind("destroy.jstree",d.proxy(function(){if(this.data.contextmenu){d.vakata.context.hide()}},this));d(document).bind("context_hide.vakata",d.proxy(function(){this.data.contextmenu=false},this))},defaults:{select_node:false,show_at_node:true,items:{create:{separator_before:false,separator_after:true,label:"Create",action:function(e){this.create(e)}},rename:{separator_before:false,separator_after:false,label:"Rename",action:function(e){this.rename(e)}},remove:{separator_before:false,icon:false,separator_after:false,label:"Delete",action:function(e){if(this.is_selected(e)){this.remove()}else{this.remove(e)}}},ccp:{separator_before:true,icon:false,separator_after:false,label:"Edit",action:false,submenu:{cut:{separator_before:false,separator_after:false,label:"Cut",action:function(e){this.cut(e)}},copy:{separator_before:false,icon:false,separator_after:false,label:"Copy",action:function(e){this.copy(e)}},paste:{separator_before:false,icon:false,separator_after:false,label:"Paste",action:function(e){this.paste(e)}}}}}},_fn:{show_contextmenu:function(j,e,l){j=this._get_node(j);var h=this.get_settings().contextmenu,f=j.children("a:visible:eq(0)"),k=false,g=false;if(h.select_node&&this.data.ui&&!this.is_selected(j)){this.deselect_all();this.select_node(j,true)}if(h.show_at_node||typeof e==="undefined"||typeof l==="undefined"){k=f.offset();e=k.left;l=k.top+this.data.core.li_height}g=j.data("jstree")&&j.data("jstree").contextmenu?j.data("jstree").contextmenu:h.items;if(d.isFunction(g)){g=g.call(this,j)}this.data.contextmenu=true;d.vakata.context.show(g,f,e,l,this,j,this._get_settings().core.rtl);if(this.data.themes){d.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}}})})(jQuery);(function(d){d.jstree.plugin("types",{__init:function(){var e=this._get_settings().types;this.data.types.attach_to=[];this.get_container().bind("init.jstree",d.proxy(function(){var h=e.types,g=e.type_attr,f="",i=this;d.each(h,function(j,k){d.each(k,function(m,l){if(!/^(max_depth|max_children|icon|valid_children)$/.test(m)){i.data.types.attach_to.push(m)}});if(!k.icon){return true}if(k.icon.image||k.icon.position){if(j=="default"){f+=".jstree-"+i.get_index()+" a > .jstree-icon { "}else{f+=".jstree-"+i.get_index()+" li["+g+'="'+j+'"] > a > .jstree-icon { '}if(k.icon.image){f+=" background-image:url("+k.icon.image+"); "}if(k.icon.position){f+=" background-position:"+k.icon.position+"; "}else{f+=" background-position:0 0; "}f+="} "}});if(f!==""){d.vakata.css.add_sheet({str:f,title:"jstree-types"})}},this)).bind("before.jstree",d.proxy(function(i,h){var g,f,k=this._get_settings().types.use_data?this._get_node(h.args[0]):false,j=k&&k!==-1&&k.length?k.data("jstree"):false;if(j&&j.types&&j.types[h.func]===false){i.stopImmediatePropagation();return false}if(d.inArray(h.func,this.data.types.attach_to)!==-1){if(!h.args[0]||(!h.args[0].tagName&&!h.args[0].jquery)){return}g=this._get_settings().types.types;f=this._get_type(h.args[0]);if(((g[f]&&typeof g[f][h.func]!=="undefined")||(g["default"]&&typeof g["default"][h.func]!=="undefined"))&&this._check(h.func,h.args[0])===false){i.stopImmediatePropagation();return false}}},this));if(c){this.get_container().bind("load_node.jstree set_type.jstree",d.proxy(function(i,h){var g=h&&h.rslt&&h.rslt.obj&&h.rslt.obj!==-1?this._get_node(h.rslt.obj).parent():this.get_container_ul(),j=false,f=this._get_settings().types;d.each(f.types,function(k,l){if(l.icon&&(l.icon.image||l.icon.position)){j=k==="default"?g.find("li > a > .jstree-icon"):g.find("li["+f.type_attr+"='"+k+"'] > a > .jstree-icon");if(l.icon.image){j.css("backgroundImage","url("+l.icon.image+")")}j.css("backgroundPosition",l.icon.position||"0 0")}})},this))}},defaults:{max_children:-1,max_depth:-1,valid_children:"all",use_data:false,type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_types_notify:function(f,e){if(e.type&&this._get_settings().types.use_data){this.set_type(e.type,f)}},_get_type:function(e){e=this._get_node(e);return(!e||!e.length)?false:e.attr(this._get_settings().types.type_attr)||"default"},set_type:function(g,f){f=this._get_node(f);var e=(!f.length||!g)?false:f.attr(this._get_settings().types.type_attr,g);if(e){this.__callback({obj:f,type:g})}return e},_check:function(j,g,e){g=this._get_node(g);var k=false,l=this._get_type(g),i=0,h=this,m=this._get_settings().types,f=false;if(g===-1){if(!!m[j]){k=m[j]}else{return}}else{if(l===false){return}f=m.use_data?g.data("jstree"):false;if(f&&f.types&&typeof f.types[j]!=="undefined"){k=f.types[j]}else{if(!!m.types[l]&&typeof m.types[l][j]!=="undefined"){k=m.types[l][j]}else{if(!!m.types["default"]&&typeof m.types["default"][j]!=="undefined"){k=m.types["default"][j]}}}}if(d.isFunction(k)){k=k.call(this,g)}if(j==="max_depth"&&g!==-1&&e!==false&&m.max_depth!==-2&&k!==0){g.children("a:eq(0)").parentsUntil(".jstree","li").each(function(n){if(m.max_depth!==-1&&m.max_depth-(n+1)<=0){k=0;return false}i=(n===0)?k:h._check(j,this,false);if(i!==-1&&i-(n+1)<=0){k=0;return false}if(i>=0&&(i-(n+1)<k||k<0)){k=i-(n+1)}if(m.max_depth>=0&&(m.max_depth-(n+1)<k||k<0)){k=m.max_depth-(n+1)}})}return k},check_move:function(){if(!this.__call_old()){return false}var e=this._get_move(),i=e.rt._get_settings().types,k=e.rt._check("max_children",e.cr),j=e.rt._check("max_depth",e.cr),g=e.rt._check("valid_children",e.cr),h=0,l=1,f;if(g==="none"){return false}if(d.isArray(g)&&e.ot&&e.ot._get_type){e.o.each(function(){if(d.inArray(e.ot._get_type(this),g)===-1){l=false;return false}});if(l===false){return false}}if(i.max_children!==-2&&k!==-1){h=e.cr===-1?this.get_container().find("> ul > li").not(e.o).length:e.cr.find("> ul > li").not(e.o).length;if(h+e.o.length>k){return false}}if(i.max_depth!==-2&&j!==-1){l=0;if(j===0){return false}if(typeof e.o.d==="undefined"){f=e.o;while(f.length>0){f=f.find("> ul > li");l++}e.o.d=l}if(j-e.o.d<0){return false}}return true},create_node:function(h,i,f,o,k,n){if(!n&&(k||this._is_loaded(h))){var g=(typeof i=="string"&&i.match(/^before|after$/i)&&h!==-1)?this._get_parent(h):this._get_node(h),q=this._get_settings().types,m=this._check("max_children",g),l=this._check("max_depth",g),j=this._check("valid_children",g),e;if(typeof f==="string"){f={data:f}}if(!f){f={}}if(j==="none"){return false}if(d.isArray(j)){if(!f.attr||!f.attr[q.type_attr]){if(!f.attr){f.attr={}}f.attr[q.type_attr]=j[0]}else{if(d.inArray(f.attr[q.type_attr],j)===-1){return false}}}if(q.max_children!==-2&&m!==-1){e=g===-1?this.get_container().find("> ul > li").length:g.find("> ul > li").length;if(e+1>m){return false}}if(q.max_depth!==-2&&l!==-1&&(l-1)<0){return false}}return this.__call_old(true,h,i,f,o,k,n)}}})})(jQuery);(function(d){d.jstree.plugin("html_data",{__init:function(){this.data.html_data.original_container_html=this.get_container().find(" > ul > li").clone(true);this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function(){return this.nodeType==3}).remove()},defaults:{data:false,ajax:false,correct_state:true},_fn:{load_node:function(g,e,f){var h=this;this.load_node_html(g,function(){h.__callback({obj:h._get_node(g)});e.call(this)},f)},_is_loaded:function(e){e=this._get_node(e);return e==-1||!e||(!this._get_settings().html_data.ajax&&!d.isFunction(this._get_settings().html_data.data))||e.is(".jstree-open, .jstree-leaf")||e.children("ul").children("li").size()>0},load_node_html:function(i,e,g){var k,h=this.get_settings().html_data,f=function(){},j=function(){};i=this._get_node(i);if(i&&i!==-1){if(i.data("jstree-is-loading")){return}else{i.data("jstree-is-loading",true)}}switch(!0){case (d.isFunction(h.data)):h.data.call(this,i,d.proxy(function(l){if(l&&l!==""&&l.toString&&l.toString().replace(/^[\s\n]+$/,"")!==""){l=d(l);if(!l.is("ul")){l=d("<ul />").append(l)}if(i==-1||!i){this.get_container().children("ul").empty().append(l.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon")}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.append(l).children("ul").find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");i.removeData("jstree-is-loading")}this.clean_node(i);if(e){e.call(this)}}else{if(i&&i!==-1){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading");if(h.correct_state){this.correct_state(i);if(e){e.call(this)}}}else{if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}}},this));break;case (!h.data&&!h.ajax):if(!i||i==-1){this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(e){e.call(this)}break;case (!!h.data&&!h.ajax)||(!!h.data&&!!h.ajax&&(!i||i===-1)):if(!i||i==-1){k=d(h.data);if(!k.is("ul")){k=d("<ul />").append(k)}this.get_container().children("ul").empty().append(k.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(e){e.call(this)}break;case (!h.data&&!!h.ajax)||(!!h.data&&!!h.ajax&&i&&i!==-1):i=this._get_node(i);f=function(m,n,o){var l=this.get_settings().html_data.ajax.error;if(l){l.call(this,m,n,o)}if(i!=-1&&i.length){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading");if(n==="success"&&h.correct_state){this.correct_state(i)}}else{if(n==="success"&&h.correct_state){this.get_container().children("ul").empty()}}if(g){g.call(this)}};j=function(o,m,l){var n=this.get_settings().html_data.ajax.success;if(n){o=n.call(this,o,m,l)||o}if(o===""||(o&&o.toString&&o.toString().replace(/^[\s\n]+$/,"")==="")){return f.call(this,l,m,"")}if(o){o=d(o);if(!o.is("ul")){o=d("<ul />").append(o)}if(i==-1||!i){this.get_container().children("ul").empty().append(o.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon")}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.append(o).children("ul").find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");i.removeData("jstree-is-loading")}this.clean_node(i);if(e){e.call(this)}}else{if(i&&i!==-1){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading");if(h.correct_state){this.correct_state(i);if(e){e.call(this)}}}else{if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}}};h.ajax.context=this;h.ajax.error=f;h.ajax.success=j;if(!h.ajax.dataType){h.ajax.dataType="html"}if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,i)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,i)}d.ajax(h.ajax);break}}}});d.jstree.defaults.plugins.push("html_data")})(jQuery);(function(d){d.jstree.plugin("themeroller",{__init:function(){var e=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").addClass("jstree-themeroller").delegate("a","mouseenter.jstree",function(f){if(!d(f.currentTarget).hasClass("jstree-loading")){d(this).addClass(e.item_h)}}).delegate("a","mouseleave.jstree",function(){d(this).removeClass(e.item_h)}).bind("init.jstree",d.proxy(function(g,f){f.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");this._themeroller(f.inst.get_container().find("> ul > li"))},this)).bind("open_node.jstree create_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",d.proxy(function(f){this._themeroller()},this)).bind("close_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.obj)},this)).bind("delete_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.parent)},this)).bind("correct_state.jstree",d.proxy(function(g,f){f.rslt.obj.children("ins.jstree-icon").removeClass(e.opened+" "+e.closed+" ui-icon").end().find("> a > ins.ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_open+" "+e.item_clsd).addClass(e.item_leaf||"jstree-no-icon")},this)).bind("select_node.jstree",d.proxy(function(g,f){f.rslt.obj.children("a").addClass(e.item_a)},this)).bind("deselect_node.jstree deselect_all.jstree",d.proxy(function(g,f){this.get_container().find("a."+e.item_a).removeClass(e.item_a).end().find("a.jstree-clicked").addClass(e.item_a)},this)).bind("dehover_node.jstree",d.proxy(function(g,f){f.rslt.obj.children("a").removeClass(e.item_h)},this)).bind("hover_node.jstree",d.proxy(function(g,f){this.get_container().find("a."+e.item_h).not(f.rslt.obj).removeClass(e.item_h);f.rslt.obj.children("a").addClass(e.item_h)},this)).bind("move_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.o);this._themeroller(f.rslt.op)},this))},__destroy:function(){var e=this._get_settings().themeroller,f=["ui-icon"];d.each(e,function(h,g){g=g.split(" ");if(g.length){f=f.concat(g)}});this.get_container().removeClass("ui-widget-content").find("."+f.join(", .")).removeClass(f.join(" "))},_fn:{_themeroller:function(f){var e=this._get_settings().themeroller;f=!f||f==-1?this.get_container_ul():this._get_node(f).parent();f.find("li.jstree-closed").children("ins.jstree-icon").removeClass(e.opened).addClass("ui-icon "+e.closed).end().children("a").addClass(e.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_leaf+" "+e.item_open).addClass(e.item_clsd||"jstree-no-icon").end().end().end().end().find("li.jstree-open").children("ins.jstree-icon").removeClass(e.closed).addClass("ui-icon "+e.opened).end().children("a").addClass(e.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_leaf+" "+e.item_clsd).addClass(e.item_open||"jstree-no-icon").end().end().end().end().find("li.jstree-leaf").children("ins.jstree-icon").removeClass(e.closed+" ui-icon "+e.opened).end().children("a").addClass(e.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_clsd+" "+e.item_open).addClass(e.item_leaf||"jstree-no-icon")}},defaults:{opened:"ui-icon-triangle-1-se",closed:"ui-icon-triangle-1-e",item:"ui-state-default",item_h:"ui-state-hover",item_a:"ui-state-active",item_open:"ui-icon-folder-open",item_clsd:"ui-icon-folder-collapsed",item_leaf:"ui-icon-document"}});d(function(){var e=".jstree-themeroller .ui-icon { overflow:visible; } .jstree-themeroller a { padding:0 2px; } .jstree-themeroller .jstree-no-icon { display:none; }";d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(d){d.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",d.proxy(function(k,i){var f=[],h=true,j,g;if(i.func=="move_node"){if(i.args[4]===true){if(i.args[0].o&&i.args[0].o.length){i.args[0].o.children("a").each(function(){f.push(d(this).text().replace(/^\s+/g,""))});h=this._check_unique(f,i.args[0].np.find("> ul > li").not(i.args[0].o),"move_node")}}}if(i.func=="create_node"){if(i.args[4]||this._is_loaded(i.args[0])){j=this._get_node(i.args[0]);if(i.args[1]&&(i.args[1]==="before"||i.args[1]==="after")){j=this._get_parent(i.args[0]);if(!j||j===-1){j=this.get_container()}}if(typeof i.args[2]==="string"){f.push(i.args[2])}else{if(!i.args[2]||!i.args[2].data){f.push(this._get_string("new_node"))}else{f.push(i.args[2].data)}}h=this._check_unique(f,j.find("> ul > li"),"create_node")}}if(i.func=="rename_node"){f.push(i.args[1]);g=this._get_node(i.args[0]);j=this._get_parent(g);if(!j||j===-1){j=this.get_container()}h=this._check_unique(f,j.find("> ul > li").not(g),"rename_node")}if(!h){k.stopPropagation();return false}},this))},defaults:{error_callback:d.noop},_fn:{_check_unique:function(f,h,g){var e=[];h.children("a").each(function(){e.push(d(this).text().replace(/^\s+/g,""))});if(!e.length||!f.length){return true}e=e.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");if((e.length+f.length)!=e.concat(f).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length){this._get_settings().unique.error_callback.call(null,f,h,g);return false}return true},check_move:function(){if(!this.__call_old()){return false}var f=this._get_move(),e=[];if(f.o&&f.o.length){f.o.children("a").each(function(){e.push(d(this).text().replace(/^\s+/g,""))});return this._check_unique(e,f.np.find("> ul > li").not(f.o),"check_move")}return true}}})})(jQuery);(function(d){d.jstree.plugin("wholerow",{__init:function(){if(!this.data.ui){throw"jsTree wholerow: jsTree UI plugin not included."}this.data.wholerow.html=false;this.data.wholerow.to=false;this.get_container().bind("init.jstree",d.proxy(function(g,f){this._get_settings().core.animation=0},this)).bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree",d.proxy(function(g,f){this._prepare_wholerow_span(f&&f.rslt&&f.rslt.obj?f.rslt.obj:-1)},this)).bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree",d.proxy(function(g,f){if(this.data.to){clearTimeout(this.data.to)}this.data.to=setTimeout((function(e,h){return function(){e._prepare_wholerow_ul(h)}})(this,f&&f.rslt&&f.rslt.obj?f.rslt.obj:-1),0)},this)).bind("deselect_all.jstree",d.proxy(function(g,f){this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked "+(this.data.themeroller?this._get_settings().themeroller.item_a:""))},this)).bind("select_node.jstree deselect_node.jstree ",d.proxy(function(g,f){f.rslt.obj.each(function(){var e=f.inst.get_container().find(" > .jstree-wholerow li:visible:eq("+(parseInt(((d(this).offset().top-f.inst.get_container().offset().top+f.inst.get_container()[0].scrollTop)/f.inst.data.core.li_height),10))+")");e.children("a").attr("class",f.rslt.obj.children("a").attr("class"))})},this)).bind("hover_node.jstree dehover_node.jstree",d.proxy(function(h,g){this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered "+(this.data.themeroller?this._get_settings().themeroller.item_h:""));if(h.type==="hover_node"){var f=this.get_container().find(" > .jstree-wholerow li:visible:eq("+(parseInt(((g.rslt.obj.offset().top-this.get_container().offset().top+this.get_container()[0].scrollTop)/this.data.core.li_height),10))+")");f.children("a").attr("class",g.rslt.obj.children(".jstree-hovered").attr("class"))}},this)).delegate(".jstree-wholerow-span, ins.jstree-icon, li","click.jstree",function(f){var g=d(f.currentTarget);if(f.target.tagName==="A"||(f.target.tagName==="INS"&&g.closest("li").is(".jstree-open, .jstree-closed"))){return}g.closest("li").children("a:visible:eq(0)").click();f.stopImmediatePropagation()}).delegate("li","mouseover.jstree",d.proxy(function(f){f.stopImmediatePropagation();if(d(f.currentTarget).children(".jstree-hovered, .jstree-clicked").length){return false}this.hover_node(f.currentTarget);return false},this)).delegate("li","mouseleave.jstree",d.proxy(function(f){if(d(f.currentTarget).children("a").hasClass("jstree-hovered").length){return}this.dehover_node(f.currentTarget)},this));if(b||c){d.vakata.css.add_sheet({str:".jstree-"+this.get_index()+" { position:relative; } ",title:"jstree"})}},defaults:{},__destroy:function(){this.get_container().children(".jstree-wholerow").remove();this.get_container().find(".jstree-wholerow-span").remove()},_fn:{_prepare_wholerow_span:function(e){e=!e||e==-1?this.get_container().find("> ul > li"):this._get_node(e);if(e===false){return}e.each(function(){d(this).find("li").andSelf().each(function(){var f=d(this);if(f.children(".jstree-wholerow-span").length){return true}f.prepend("<span class='jstree-wholerow-span' style='width:"+(f.parentsUntil(".jstree","li").length*18)+"px;'>&#160;</span>")})})},_prepare_wholerow_ul:function(){var f=this.get_container().children("ul").eq(0),e=f.html();f.addClass("jstree-wholerow-real");if(this.data.wholerow.last_html!==e){this.data.wholerow.last_html=e;this.get_container().children(".jstree-wholerow").remove();this.get_container().append(f.clone().removeClass("jstree-wholerow-real").wrapAll("<div class='jstree-wholerow' />").parent().width(f.parent()[0].scrollWidth).css("top",(f.height()+(b?5:0))*-1).find("li[id]").each(function(){this.removeAttribute("id")}).end())}}}});d(function(){var e=".jstree .jstree-wholerow-real { position:relative; z-index:1; } .jstree .jstree-wholerow-real li { cursor:pointer; } .jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } .jstree .jstree-wholerow { position:relative; z-index:0; height:0; } .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } .jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }";if(a){e+=".jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } .jstree .jstree-wholerow-real a { border-color:transparent !important; } "}if(b||c){e+=".jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } .jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } "}d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(d){var e=["getChildren","getChildrenCount","getAttr","getName","getProps"],f=function(i,g){var h=true;i=i||{};g=[].concat(g);d.each(g,function(k,j){if(!d.isFunction(i[j])){h=false;return false}});return h};d.jstree.plugin("model",{__init:function(){if(!this.data.json_data){throw"jsTree model: jsTree json_data plugin not included."}this._get_settings().json_data.data=function(i,g){var h=(i==-1)?this._get_settings().model.object:i.data("jstree_model");if(!f(h,e)){return g.call(null,false)}if(this._get_settings().model.async){h.getChildren(d.proxy(function(j){this.model_done(j,g)},this))}else{this.model_done(h.getChildren(),g)}}},defaults:{object:false,id_prefix:false,async:false},_fn:{model_done:function(i,k){var g=[],h=this._get_settings(),j=this;if(!d.isArray(i)){i=[i]}d.each(i,function(l,n){var m=n.getProps()||{};m.attr=n.getAttr()||{};if(n.getChildrenCount()){m.state="closed"}m.data=n.getName();if(!d.isArray(m.data)){m.data=[m.data]}if(j.data.types&&d.isFunction(n.getType)){m.attr[h.types.type_attr]=n.getType()}if(m.attr.id&&h.model.id_prefix){m.attr.id=h.model.id_prefix+m.attr.id}if(!m.metadata){m.metadata={}}m.metadata.jstree_model=n;g.push(m)});k.call(null,g)}}})})(jQuery)})();
/*
 * jQuery Menu plugin
 *
 * Copyright (c) 2007 Roman Weich http://p.sohei.org
 *
 * Licensed under the MIT license http://www.opensource.org/licenses/mit-license.php
 */
(function(f){var j=false;var e=[],m=[],k=activeItem=null,c=f('<div class="menu-div outerbox" style="position:absolute;top:0;left:0;display:none;"><div class="shadowbox1"></div><div class="shadowbox2"></div><div class="shadowbox3"></div></div>')[0],b=f('<ul class="menu-ul innerbox"></ul>')[0],l=f('<li style="position:relative;"><div class="menu-item"></div></li>')[0],i=f('<img class="menu-item-arrow" />')[0],h=f('<div id="root-menu-div" style="position:absolute;top:0;left:0;"></div>'),d={showDelay:200,hideDelay:200,hoverOpenDelay:0,offsetTop:0,offsetLeft:0,minWidth:0,onOpen:null,onClose:null,onClick:null,arrowSrc:null,addExpando:false,copyClassAttr:false};f(function(){h.appendTo("body")});f.extend({MenuCollection:function(n){this.menus=[];this.init(n)}});f.extend(f.MenuCollection,{prototype:{init:function(n){if(n&&n.length){for(var o=0;o<n.length;o++){this.addMenu(n[o]);n[o].menuCollection=this}}},addMenu:function(o){if(o instanceof f.Menu){this.menus.push(o)}o.menuCollection=this;var n=this;f(o.target).hover(function(){if(o.visible){return}for(var p=0;p<n.menus.length;p++){if(n.menus[p].visible){n.menus[p].hide();o.show();return}}},function(){})}}});f.extend({Menu:function(p,n,o){this.menuItems=[];this.subMenus=[];this.visible=false;this.active=false;this.parentMenuItem=null;this.settings=f.extend({},d,o);this.target=p;this.$eDIV=null;this.$eUL=null;this.timer=null;this.menuCollection=null;this.openTimer=null;this.init();if(n&&n.constructor==Array){this.addItems(n)}}});f.extend(f.Menu,{checkMouse:function(o){var n=o.target;if(m.length&&n==m[0].target){return}while(n.parentNode&&n.parentNode!=h[0]){n=n.parentNode}if(!f(m).filter(function(){return this.$eDIV[0]==n}).length){f.Menu.closeAll()}},checkKey:function(s){switch(s.keyCode){case 13:if(activeItem){activeItem.click(s,activeItem.$eLI[0])}break;case 27:f.Menu.closeAll();break;case 37:if(!k){k=m[0]}var o=k;if(o&&o.parentMenuItem){var q=o.parentMenuItem;q.$eLI.unbind("mouseout").unbind("mouseover");o.hide();q.hoverIn(true);setTimeout(function(){q.bindHover()})}else{if(o&&o.menuCollection){var t,p=o.menuCollection.menus;if((t=f.inArray(o,p))>-1){if(--t<0){t=p.length-1}f.Menu.closeAll();p[t].show();p[t].setActive();if(p[t].menuItems.length){p[t].menuItems[0].hoverIn(true)}}}}break;case 38:if(k){k.selectNextItem(-1)}break;case 39:if(!k){k=m[0]}var n,o=k,r=activeItem?activeItem.subMenu:null;if(o){if(r&&r.menuItems.length){r.show();r.menuItems[0].hoverIn()}else{if((o=o.inMenuCollection())){var t,p=o.menuCollection.menus;if((t=f.inArray(o,p))>-1){if(++t>=p.length){t=0}f.Menu.closeAll();p[t].show();p[t].setActive();if(p[t].menuItems.length){p[t].menuItems[0].hoverIn(true)}}}}}break;case 40:if(!k){if(m.length&&m[0].menuItems.length){m[0].menuItems[0].hoverIn()}}else{k.selectNextItem()}break}if(s.keyCode>36&&s.keyCode<41){return false}},closeAll:function(){f("#menuFrame").css("display","none");f("#contextMenuFrame").css("display","none");f("#subMenuFrame").css("display","none");f("#menuSubOperations").css("display","none");f("#insertColumnFrame").css("display","none");while(m.length){m[0].hide()}},isActive:function(){return(m!=null&&m.length>0)},setDefaults:function(n){f.extend(d,n)},prototype:{init:function(){var n=this;if(!this.target){return}else{if(this.target instanceof f.MenuItem){this.parentMenuItem=this.target;this.target.addSubMenu(this);this.target=this.target.$eLI}}e.push(this);this.$eDIV=f(c.cloneNode(1));this.$eUL=f(b.cloneNode(1));this.$eDIV[0].appendChild(this.$eUL[0]);h[0].appendChild(this.$eDIV[0]);if(!this.parentMenuItem){f(this.target).click(function(o){n.onClick(o)}).hover(function(o){n.setActive();if(n.settings.hoverOpenDelay){n.openTimer=setTimeout(function(){if(!n.visible){n.onClick(o)}},n.settings.hoverOpenDelay)}},function(){if(!n.visible){f(this).removeClass("activetarget")}if(n.openTimer){clearTimeout(n.openTimer)}})}else{this.$eDIV.hover(function(){n.setActive()},function(){})}},setActive:function(){if(!this.parentMenuItem){f(this.target).addClass("activetarget")}else{this.active=true}},addItem:function(n){if(n instanceof f.MenuItem){if(f.inArray(n,this.menuItems)==-1){this.$eUL.append(n.$eLI);this.menuItems.push(n);n.parentMenu=this;if(n.subMenu){this.subMenus.push(n.subMenu)}}}else{this.addItem(new f.MenuItem(n,this.settings))}},addItems:function(n){for(var o=0;o<n.length;o++){this.addItem(n[o])}},removeItem:function(n){var o=f.inArray(n,this.menuItems);if(o>-1){this.menuItems.splice(o,1)}n.parentMenu=null},hide:function(){if(!this.visible){return}var n,o=f.inArray(this,m);this.$eDIV.hide();if(o>=0){m.splice(o,1)}this.visible=this.active=false;f(this.target).removeClass("activetarget");for(n=0;n<this.subMenus.length;n++){this.subMenus[n].hide()}for(n=0;n<this.menuItems.length;n++){if(this.menuItems[n].active){this.menuItems[n].setInactive()}}if(!m.length){f(document).unbind("mousedown",f.Menu.checkMouse).unbind("keydown",f.Menu.checkKey)}if(k==this){k=null}if(this.settings.onClose){this.settings.onClose.call(this)}},show:function(p){if(this.visible){return}var o,n=this.parentMenuItem;f("#menuFrame").css("display","block");if(this.menuItems.length){if(n){o=parseInt(n.parentMenu.$eDIV.css("z-index"));this.$eDIV.css("z-index",(isNaN(o)?1:o+1))}this.$eDIV.css({visibility:"hidden",display:"block"});if(this.settings.minWidth){if(this.$eDIV.width()<this.settings.minWidth){this.$eDIV.css("width",this.settings.minWidth);f("#menuFrame").css("width",this.settings.minWidth);f("#subMenuFrame").css("width",this.settings.minWidth)}}this.setPosition();this.$eDIV.css({display:"none",visibility:""}).show();if(f.browser.msie){this.$eUL.css("width",this.$eUL.width());f("#menuFrame").css("width",this.$eUL.width())}if(!n){f("#menuFrame").css("height",(this.$eDIV[0].offsetHeight));j=false}else{if(j){f("#insertColumnFrame").css("height",(this.$eDIV[0].offsetHeight));f("#insertColumnFrame").css("display","block")}else{f("#subMenuFrame").css("height",(this.$eDIV[0].offsetHeight));j=true;f("#subMenuFrame").css("display","block")}}if(this.settings.onOpen){this.settings.onOpen.call(this)}}if(m.length==0){f(document).bind("mousedown",f.Menu.checkMouse).bind("keydown",f.Menu.checkKey)}this.visible=true;m.push(this)},setPosition:function(){var u,s,q,n,x,y,t,v=f(window).width(),p=f(window).height(),z=this.parentMenuItem,A=this.$eDIV[0].clientHeight,r=this.$eDIV[0].clientWidth,w;if(z){s=z.$eLI.offset();q=s.left+z.$eLI.width();n=s.top}else{u=f(this.target);s=u.offset();q=s.left+this.settings.offsetLeft;n=s.top+u.height()+this.settings.offsetTop}if(f.fn.scrollTop){y=f(window).scrollTop();if(p<A){}else{if(p+y<n+A){if(z){x=z.parentMenu.$eDIV.offset();w=z.parentMenu.$eDIV[0].clientHeight;if(A<=w){n=x.top+w-A}else{n=x.top}if(p+y<n+A){n-=n+A-(p+y)}}else{n-=n+A-(p+y)}}}}if(f.fn.scrollLeft){t=f(window).scrollLeft();if(v+t<q+r){if(z){q-=z.$eLI.width()+r;if(q<t){q=t}}else{q-=q+r-(v+t)}}}this.$eDIV.css({left:q,top:n});if(!z){f("#menuFrame").css({left:q,top:n})}else{if(j){f("#insertColumnFrame").css({left:q,top:n})}else{f("#subMenuFrame").css({left:q,top:n})}}},onClick:function(n){if(this.visible){this.hide();this.setActive()}else{f.Menu.closeAll();this.show(n)}},addTimer:function(p,o){var n=this;this.timer=setTimeout(function(){p.call(n);n.timer=null},o)},removeTimer:function(){if(this.timer){clearTimeout(this.timer);this.timer=null}},selectNextItem:function(r){var n,s=0,p=this.menuItems.length,q=r||1;for(n=0;n<p;n++){if(this.menuItems[n].active){s=n;break}}this.menuItems[s].hoverOut();do{s+=q;if(s>=p){s=0}else{if(s<0){s=p-1}}}while(this.menuItems[s].separator);this.menuItems[s].hoverIn(true)},inMenuCollection:function(){var n=this;while(n.parentMenuItem){n=n.parentMenuItem.parentMenu}return n.menuCollection?n:null},destroy:function(){var o,n;this.hide();if(!this.parentMenuItem){f(this.target).unbind("click").unbind("mouseover").unbind("mouseout")}else{this.$eDIV.unbind("mouseover").unbind("mouseout")}while(this.menuItems.length){n=this.menuItems[0];n.destroy();delete n}if((o=f.inArray(this,e))>-1){e.splice(o,1)}if(this.menuCollection){if((o=f.inArray(this,this.menuCollection.menus))>-1){this.menuCollection.menus.splice(o,1)}}this.$eDIV.remove()}}});f.extend({MenuItem:function(o,n){if(typeof o=="string"){o={src:o}}this.src=o.src||"";this.url=o.url||null;this.urlTarget=o.target||null;this.addClass=o.addClass||null;this.data=o.data||null;this.$eLI=null;this.parentMenu=null;this.subMenu=null;this.settings=f.extend({},d,n);this.active=false;this.enabled=true;this.separator=false;this.init();if(o.subMenu){new f.Menu(this,o.subMenu,n)}}});f.extend(f.MenuItem,{prototype:{init:function(){var p,o,q=this.src,n=this;this.$eLI=f(l.cloneNode(1));if(this.addClass){this.$eLI[0].setAttribute("class",this.addClass)}if(this.settings.addExpando&&this.data){this.$eLI[0].menuData=this.data}if(q==""){this.$eLI.addClass("menu-separator");this.separator=true}else{o=typeof q=="string";if(o&&this.url){q=f('<a href="'+this.url+'"'+(this.urlTarget?'target="'+this.urlTarget+'"':"")+">"+q+"</a>")}else{if(o||!q.length){q=[q]}}for(p=0;p<q.length;p++){if(typeof q[p]=="string"){elem=document.createElement("span");elem.innerHTML=q[p];this.$eLI[0].firstChild.appendChild(elem)}else{this.$eLI[0].firstChild.appendChild(q[p].cloneNode(1))}}}this.$eLI.click(function(r){n.click(r,this)});this.bindHover()},click:function(o,n){if(this.enabled&&this.settings.onClick){this.settings.onClick.call(n,o,this)}},bindHover:function(){var n=this;this.$eLI.hover(function(){n.hoverIn()},function(){n.hoverOut()})},hoverIn:function(o){this.removeTimer();var p,r=this.parentMenu.subMenus,q=this.parentMenu.menuItems,n=this;if(this.parentMenu.timer){this.parentMenu.removeTimer()}if(!this.enabled){return}for(p=0;p<q.length;p++){if(q[p].active){q[p].setInactive()}}this.setActive();k=this.parentMenu;for(p=0;p<r.length;p++){if(r[p].visible&&r[p]!=this.subMenu&&!r[p].timer){r[p].addTimer(function(){this.hide()},r[p].settings.hideDelay)}}if(this.subMenu&&!o){this.subMenu.addTimer(function(){this.show()},this.subMenu.settings.showDelay)}},hoverOut:function(){this.removeTimer();if(!this.enabled){return}if(!this.subMenu||!this.subMenu.visible){this.setInactive()}},removeTimer:function(){if(this.subMenu){this.subMenu.removeTimer()}},setActive:function(){this.active=true;this.$eLI.addClass("active");var n=this.parentMenu.parentMenuItem;if(n&&!n.active){n.setActive()}activeItem=this},setInactive:function(){this.active=false;this.$eLI.removeClass("active");if(this==activeItem){activeItem=null}},enable:function(){this.$eLI.removeClass("disabled");this.enabled=true},disable:function(){this.$eLI.addClass("disabled");this.enabled=false},destroy:function(){this.removeTimer();this.$eLI.remove();this.$eLI.unbind("mouseover").unbind("mouseout").unbind("click");if(this.subMenu){this.subMenu.destroy();delete this.subMenu}this.parentMenu.removeItem(this)},addSubMenu:function(o){if(this.subMenu){return}this.subMenu=o;if(this.parentMenu&&f.inArray(o,this.parentMenu.subMenus)==-1){this.parentMenu.subMenus.push(o)}if(this.settings.arrowSrc){var n=i.cloneNode(0);n.setAttribute("src",this.settings.arrowSrc);this.$eLI[0].firstChild.appendChild(n)}}}});f.extend(f.fn,{menuFromElement:function(o,q,p){var n=function(y){var u=[],w,t,B,z,v,A,s,x,r=null;B=g(y,"LI");for(v=0;v<B.length;v++){w=[];if(!B[v].childNodes.length){u.push(new f.MenuItem("",o));continue}if((A=a(B[v],"UL"))){w=n(A);f(A).remove()}z=f(B[v]);if(z[0].childNodes.length==1&&z[0].childNodes[0].nodeType==3){x=z[0].childNodes[0].nodeValue}else{x=z[0].childNodes}if(o&&o.copyClassAttr){r=z.attr("class")}t=new f.MenuItem({src:x,addClass:r},o);u.push(t);if(w.length){new f.Menu(t,w,o)}}return u};return this.each(function(){var s,r;if(q||(s=a(this,"UL"))){s=q?f(q).clone(true)[0]:s;menuItems=n(s);if(menuItems.length){r=new f.Menu(this,menuItems,o);if(p){p.addMenu(r)}}f(s).hide()}})},menuBarFromUL:function(n){return this.each(function(){var p,o=g(this,"LI");if(o.length){bar=new f.MenuCollection();for(p=0;p<o.length;p++){f(o[p]).menuFromElement(n,null,bar)}}})},menu:function(o,n){return this.each(function(){if(n&&n.constructor==Array){new f.Menu(this,n,o)}else{if(this.nodeName.toUpperCase()=="UL"){f(this).menuBarFromUL(o)}else{f(this).menuFromElement(o,n)}}})}});var a=function(p,o){if(!p){return null}var q=p.firstChild;for(;q;q=q.nextSibling){if(q.nodeType==1&&q.nodeName.toUpperCase()==o){return q}}return null};var g=function(q,o){if(!q){return[]}var p=[],s=q.firstChild;for(;s;s=s.nextSibling){if(s.nodeType==1&&s.nodeName.toUpperCase()==o){p[p.length]=s}}return p}})(jQuery);(function(d){function b(){this.hasTextHighlighted=false;this._disabledInputs=[];this.regional=[];this.regional[""]={show24Hours:false,separator:":",ampmPrefix:"",ampmNames:["AM","PM"],spinnerTexts:["Now","Previous field","Next field","Increment","Decrement"]};this._defaults={appendText:"",showSeconds:false,timeSteps:[1,1,1],initialField:0,useMouseWheel:true,defaultTime:null,minTime:null,maxTime:null,spinnerImage:"spinnerDefault.png",spinnerSize:[20,20,8],spinnerBigImage:"",spinnerBigSize:[40,40,16],spinnerIncDecOnly:false,spinnerRepeat:[500,250],beforeShow:null,beforeSetTime:null};d.extend(this._defaults,this.regional[""])}var f="timeEntry";var e;d.extend(b.prototype,{markerClassName:"hasTimeEntry",setDefaults:function(g){a(this._defaults,g||{});return this},_connectTimeEntry:function(j,o){var m=d(j);if(m.hasClass(this.markerClassName)){return}var i={};i.options=d.extend({},o);i._selectedHour=0;i._selectedMinute=0;i._selectedSecond=0;i._field=0;i.input=d(j);d.data(j,f,i);var g=this._get(i,"spinnerImage");var k=this._get(i,"spinnerText");var l=this._get(i,"spinnerSize");var h=this._get(i,"appendText");var n=(!g?null:d('<span class="timeEntry_control" style="display: inline-block; background: url(\''+g+"') 0 0 no-repeat; width: "+l[0]+"px; height: "+l[1]+"px;"+(d.browser.mozilla&&d.browser.version<"1.9"?" padding-left: "+l[0]+"px; padding-bottom: "+(l[1]-18)+"px;":"")+'"></span>'));m.wrap('<span class="timeEntry_wrap"></span>').after(h?'<span class="timeEntry_append">'+h+"</span>":"").after(n||"");m.addClass(this.markerClassName).bind("focus.timeEntry",this._doFocus).bind("blur.timeEntry",this._doBlur).bind("click.timeEntry",this._doClick).bind("mouseover.timeEntry",this._doMouseOver).bind("mouseout.timeEntry",this._doMouseOut).bind("keydown.timeEntry",this._doKeyDown).bind("keypress.timeEntry",this._doKeyPress);if(d.browser.mozilla){m.bind("input.timeEntry",function(p){d.timeEntry._parseTime(i)})}if(d.browser.msie){m.bind("paste.timeEntry",function(p){setTimeout(function(){d.timeEntry._parseTime(i)},1)})}if(this._get(i,"useMouseWheel")&&d.fn.mousewheel){m.mousewheel(this._doMouseWheel)}if(n){n.mousedown(this._handleSpinner).mouseup(this._endSpinner).mouseover(this._expandSpinner).mouseout(this._endSpinner).mousemove(this._describeSpinner)}},_enableTimeEntry:function(g){this._enableDisable(g,false)},_disableTimeEntry:function(g){this._enableDisable(g,true)},_enableDisable:function(g,h){var i=d.data(g,f);if(!i){return}g.disabled=h;if(g.nextSibling&&g.nextSibling.nodeName.toLowerCase()=="span"){d.timeEntry._changeSpinner(i,g.nextSibling,(h?5:-1))}d.timeEntry._disabledInputs=d.map(d.timeEntry._disabledInputs,function(j){return(j==g?null:j)});if(h){d.timeEntry._disabledInputs.push(g)}},_isDisabledTimeEntry:function(g){return d.inArray(g,this._disabledInputs)>-1},_changeTimeEntry:function(g,i,l){var k=d.data(g,f);if(k){if(typeof i=="string"){var h=i;i={};i[h]=l}var j=this._extractTime(k);a(k.options,i||{});if(j){this._setTime(k,new Date(0,0,0,j[0],j[1],j[2]))}}d.data(g,f,k)},_destroyTimeEntry:function(g){$input=d(g);if(!$input.hasClass(this.markerClassName)){return}$input.removeClass(this.markerClassName).unbind(".timeEntry");if(d.fn.mousewheel){$input.unmousewheel()}this._disabledInputs=d.map(this._disabledInputs,function(h){return(h==g?null:h)});$input.parent().replaceWith($input);d.removeData(g,f)},_setTimeTimeEntry:function(g,i){var h=d.data(g,f);if(h){this._setTime(h,i?(typeof i=="object"?new Date(i.getTime()):i):null)}},_getTimeTimeEntry:function(g){var i=d.data(g,f);var h=(i?this._extractTime(i):null);return(!h?null:new Date(0,0,0,h[0],h[1],h[2]))},_getOffsetTimeEntry:function(g){var i=d.data(g,f);var h=(i?this._extractTime(i):null);return(!h?0:(h[0]*3600+h[1]*60+h[2])*1000)},_doFocus:function(i){var g=(i.nodeName&&i.nodeName.toLowerCase()=="input"?i:this);if(d.timeEntry._lastInput==g||d.timeEntry._isDisabledTimeEntry(g)){d.timeEntry._focussed=false;return}var h=d.data(g,f);d.timeEntry._focussed=true;d.timeEntry._lastInput=g;d.timeEntry._blurredInput=null;var j=d.timeEntry._get(h,"beforeShow");a(h.options,(j?j.apply(g,[g]):{}));d.data(g,f,h);d.timeEntry._parseTime(h);setTimeout(function(){d.timeEntry._showField(h)},10)},_doBlur:function(g){d.timeEntry._blurredInput=d.timeEntry._lastInput;d.timeEntry._lastInput=null;d.timeEntryhasTextHighlighted=false},_doMouseOver:function(g){if(!d(".time_check").attr("checked")){return}if(g.target.selectionStart!=null){e=document.activeElement;d.timeEntry._doFocus(g.target)}},_doMouseOut:function(g){if(!d(".time_check").attr("checked")){return}if(g.target==e){return}if(g.target.selectionStart!=null){d(e).focus()}},_doClick:function(h){e=h.target;var o=h.target;var k=d.data(o,f);d.timeEntry._focussed=false;if(!d.timeEntry._focussed){var p=d.timeEntry._get(k,"separator").length+2;k._field=0;if(o.selectionStart!=null){for(var n=0;n<=Math.max(1,k._secondField,k._ampmField);n++){var i=(n!=k._ampmField?(n*p)+2:(k._ampmField*p)+d.timeEntry._get(k,"ampmPrefix").length+d.timeEntry._get(k,"ampmNames")[0].length);k._field=n;if(o.selectionStart<i){break}}}else{if(o.createTextRange){var g=d(h.srcElement);var l=o.createTextRange();var m=function(q){return{thin:2,medium:4,thick:6}[q]||q};var j=h.clientX+document.documentElement.scrollLeft-(g.offset().left+parseInt(m(g.css("border-left-width")),10))-l.offsetLeft;for(var n=0;n<=Math.max(1,k._secondField,k._ampmField);n++){var i=(n!=k._ampmField?(n*p)+2:(k._ampmField*p)+d.timeEntry._get(k,"ampmPrefix").length+d.timeEntry._get(k,"ampmNames")[0].length);l.collapse();l.moveEnd("character",i);k._field=n;if(j<l.boundingWidth){break}}}}}d.data(o,f,k);d.timeEntry._showField(k);d.timeEntry._focussed=false},_doKeyDown:function(g){if(g.keyCode>=48){return true}var h=d.data(g.target,f);switch(g.keyCode){case 9:return(g.shiftKey?d.timeEntry._changeField(h,-1,true):d.timeEntry._changeField(h,+1,true));case 35:h._field=Math.max(1,h._secondField,h._ampmField);d.timeEntry._adjustField(h,0);break;case 36:if(g.ctrlKey){d.timeEntry._setTime(h)}else{h._field=0;d.timeEntry._adjustField(h,0)}break;case 37:d.timeEntry._changeField(h,-1,false);break;case 38:d.timeEntry._adjustField(h,+1);break;case 39:d.timeEntry._changeField(h,+1,false);break;case 40:d.timeEntry._adjustField(h,-1);break;case 46:d.timeEntry._setValue(h,"");break}return false},_doKeyPress:function(h){var g=String.fromCharCode(h.charCode==undefined?h.keyCode:h.charCode);if(g<" "){return true}var i=d.data(h.target,f);d.timeEntry._handleKeyPress(i,g);return false},_doMouseWheel:function(g,i){if(d.timeEntry._isDisabledTimeEntry(g.target)){return}i=(d.browser.opera?-i/Math.abs(i):(d.browser.safari?i/Math.abs(i):i));var h=d.data(g.target,f);h.input.focus();if(!h.input.val()){d.timeEntry._parseTime(h)}d.timeEntry._adjustField(h,i);g.preventDefault()},_expandSpinner:function(j){var n=d.timeEntry._getSpinnerTarget(j);var l=d.data(d.timeEntry._getInput(n),f);var i=d.timeEntry._get(l,"spinnerBigImage");if(i){l._expanded=true;var m=d(n).offset();var k=null;d(n).parents().each(function(){var o=d(this);if(o.css("position")=="relative"||o.css("position")=="absolute"){k=o.offset()}return !k});var h=d.timeEntry._get(l,"spinnerSize");var g=d.timeEntry._get(l,"spinnerBigSize");d('<div class="timeEntry_expand" style="position: absolute; left: '+(m.left-(g[0]-h[0])/2-(k?k.left:0))+"px; top: "+(m.top-(g[1]-h[1])/2-(k?k.top:0))+"px; width: "+g[0]+"px; height: "+g[1]+"px; background: transparent url("+i+') no-repeat 0px 0px; z-index: 10;"></div>').mousedown(d.timeEntry._handleSpinner).mouseup(d.timeEntry._endSpinner).mouseout(d.timeEntry._endExpand).mousemove(d.timeEntry._describeSpinner).insertAfter(n)}},_getInput:function(g){return d(g).siblings("."+d.timeEntry.markerClassName)[0]},_describeSpinner:function(g){var i=d.timeEntry._getSpinnerTarget(g);var h=d.data(d.timeEntry._getInput(i),f);i.title=d.timeEntry._get(h,"spinnerTexts")[d.timeEntry._getSpinnerRegion(h,g)]},_handleSpinner:function(h){if((!d(".time_check").attr("checked"))||(!d.timeEntryhasTextHighlighted)){return}var l=d.timeEntry._getSpinnerTarget(h);var g=d.timeEntry._getInput(l);if(d.timeEntry._isDisabledTimeEntry(g)){return}if(g==d.timeEntry._blurredInput){d.timeEntry._lastInput=g;d.timeEntry._blurredInput=null}var j=d.data(g,f);d.timeEntry._doFocus(g);var k=d.timeEntry._getSpinnerRegion(j,h);d.timeEntry._changeSpinner(j,l,k);d.timeEntry._actionSpinner(j,k);d.timeEntry._timer=null;d.timeEntry._handlingSpinner=true;var i=d.timeEntry._get(j,"spinnerRepeat");if(k>=3&&i[0]){d.timeEntry._timer=setTimeout(function(){d.timeEntry._repeatSpinner(j,k)},i[0]);d(l).one("mouseout",d.timeEntry._releaseSpinner).one("mouseup",d.timeEntry._releaseSpinner)}},_actionSpinner:function(g,h){if(!g.input.val()){d.timeEntry._parseTime(g)}switch(h){case 0:this._setTime(g);break;case 1:this._changeField(g,-1,false);break;case 2:this._changeField(g,+1,false);break;case 3:this._adjustField(g,+1);break;case 4:this._adjustField(g,-1);break}},_repeatSpinner:function(g,h){if(!d.timeEntry._timer){return}d.timeEntry._lastInput=d.timeEntry._blurredInput;this._actionSpinner(g,h);this._timer=setTimeout(function(){d.timeEntry._repeatSpinner(g,h)},this._get(g,"spinnerRepeat")[1])},_releaseSpinner:function(g){clearTimeout(d.timeEntry._timer);d.timeEntry._timer=null},_endExpand:function(h){d.timeEntry._timer=null;var j=d.timeEntry._getSpinnerTarget(h);var g=d.timeEntry._getInput(j);var i=d.data(g,f);d(j).remove();i._expanded=false},_endSpinner:function(h){d.timeEntry._timer=null;var j=d.timeEntry._getSpinnerTarget(h);var g=d.timeEntry._getInput(j);var i=d.data(g,f);if(!d.timeEntry._isDisabledTimeEntry(g)){d.timeEntry._changeSpinner(i,j,-1)}if(d.timeEntry._handlingSpinner){d.timeEntry._lastInput=d.timeEntry._blurredInput}if(d.timeEntry._lastInput&&d.timeEntry._handlingSpinner){d.timeEntry._showField(i)}d.timeEntry._handlingSpinner=false},_getSpinnerTarget:function(g){return g.target||g.srcElement},_getSpinnerRegion:function(m,i){var r=this._getSpinnerTarget(i);var o=(d.browser.opera||d.browser.safari?d.timeEntry._findPos(r):d(r).offset());var j=(d.browser.safari?d.timeEntry._findScroll(r):[document.documentElement.scrollLeft||document.body.scrollLeft,document.documentElement.scrollTop||document.body.scrollTop]);var h=this._get(m,"spinnerIncDecOnly");var k=(h?99:i.clientX+j[0]-o.left-(d.browser.msie?2:0));var p=i.clientY+j[1]-o.top-(d.browser.msie?2:0);var n=this._get(m,(m._expanded?"spinnerBigSize":"spinnerSize"));var q=(h?99:n[0]-1-k);var g=n[1]-1-p;if(n[2]>0&&Math.abs(k-q)<=n[2]&&Math.abs(p-g)<=n[2]){return 0}var l=Math.min(k,p,q,g);return(l==k?1:(l==q?2:(l==p?3:4)))},_changeSpinner:function(g,i,h){d(i).css("background-position","-"+((h+1)*this._get(g,(g._expanded?"spinnerBigSize":"spinnerSize"))[0])+"px 0px")},_findPos:function(i){var h=curTop=0;if(i.offsetParent){h=i.offsetLeft;curTop=i.offsetTop;while(i=i.offsetParent){var g=h;h+=i.offsetLeft;if(h<0){h=g}curTop+=i.offsetTop}}return{left:h,top:curTop}},_findScroll:function(i){var h=false;d(i).parents().each(function(){h|=d(this).css("position")=="fixed"});if(h){return[0,0]}var j=i.scrollLeft;var g=i.scrollTop;while(i=i.parentNode){j+=i.scrollLeft||0;g+=i.scrollTop||0}return[j,g]},_get:function(h,g){return(h.options[g]!=null?h.options[g]:d.timeEntry._defaults[g])},_parseTime:function(j){var i=this._extractTime(j);var h=this._get(j,"showSeconds");if(i){j._selectedHour=i[0];j._selectedMinute=i[1];j._selectedSecond=i[2]}else{var g=this._constrainTime(j);j._selectedHour=g[0];j._selectedMinute=g[1];j._selectedSecond=(h?g[2]:0)}j._secondField=(h?2:-1);j._ampmField=(this._get(j,"show24Hours")?-1:(h?3:2));j._lastChr="";j._field=Math.max(0,Math.min(Math.max(1,j._secondField,j._ampmField),this._get(j,"initialField")));if(j.input.val()!=""){this._showTime(j)}},_extractTime:function(n,q){q=q||n.input.val();var m=this._get(n,"separator");var h=q.split(m);if(m==""&&q!=""){h[0]=q.substring(0,2);h[1]=q.substring(2,4);h[2]=q.substring(4,6)}var g=this._get(n,"ampmNames");var p=this._get(n,"show24Hours");if(h.length>=2){var o=!p&&(q.indexOf(g[0])>-1);var l=!p&&(q.indexOf(g[1])>-1);var k=parseInt(h[0],10);k=(isNaN(k)?0:k);k=((o||l)&&k==12?0:k)+(l?12:0);var j=parseInt(h[1],10);j=(isNaN(j)?0:j);var i=(h.length>=3?parseInt(h[2],10):0);i=(isNaN(i)||!this._get(n,"showSeconds")?0:i);return this._constrainTime(n,[k,j,i])}return null},_constrainTime:function(n,h){var m=(h!=null);if(!m){var j=this._determineTime(n,this._get(n,"defaultTime"))||new Date();h=[j.getHours(),j.getMinutes(),j.getSeconds()]}var l=false;var g=this._get(n,"timeSteps");for(var k=0;k<g.length;k++){if(l){h[k]=0}else{if(g[k]>1){h[k]=Math.round(h[k]/g[k])*g[k];l=true}}}return h},_showTime:function(i){var g=this._get(i,"show24Hours");var j=this._get(i,"separator");var h=(this._formatNumber(g?i._selectedHour:((i._selectedHour+11)%12)+1)+j+this._formatNumber(i._selectedMinute)+(this._get(i,"showSeconds")?j+this._formatNumber(i._selectedSecond):"")+(g?"":this._get(i,"ampmPrefix")+this._get(i,"ampmNames")[(i._selectedHour<12?0:1)]));this._setValue(i,h);this._showField(i)},_showField:function(k){var j=k.input[0];if(k.input.is(":hidden")||d.timeEntry._lastInput!=j){return}var l=this._get(k,"separator");var g=l.length+2;var m=(k._field!=k._ampmField?(k._field*g):(k._ampmField*g)-l.length+this._get(k,"ampmPrefix").length);var h=m+(k._field!=k._ampmField?2:this._get(k,"ampmNames")[0].length);if(j.setSelectionRange){d.timeEntryhasTextHighlighted=true;j.setSelectionRange(m,h)}else{if(j.createTextRange){d.timeEntryhasTextHighlighted=true;var i=j.createTextRange();i.moveStart("character",m);i.moveEnd("character",h-k.input.val().length);i.select()}}if(!j.disabled){j.focus()}},_formatNumber:function(g){return(g<10?"0":"")+g},_setValue:function(h,g){if(g!=h.input.val()){h.input.val(g).trigger("change")}},_changeField:function(h,j,i){var g=(h.input.val()==""||h._field==(j==-1?0:Math.max(1,h._secondField,h._ampmField)));if(!g){h._field+=j}else{h._field=(j<0)?3:0}this._showField(h);h._lastChr="";d.data(h.input[0],f,h);return(g&&i)},_adjustField:function(h,i){if(h.input.val()==""){i=0}var g=this._get(h,"timeSteps");this._setTime(h,new Date(0,0,0,h._selectedHour+(h._field==0?i*g[0]:0)+(h._field==h._ampmField?i*12:0),h._selectedMinute+(h._field==1?i*g[1]:0),h._selectedSecond+(h._field==h._secondField?i*g[2]:0)))},_setTime:function(k,l){l=this._determineTime(k,l);var g=this._constrainTime(k,l?[l.getHours(),l.getMinutes(),l.getSeconds()]:null);l=new Date(0,0,0,g[0],g[1],g[2]);var l=this._normaliseTime(l);var h=this._normaliseTime(this._determineTime(k,this._get(k,"minTime")));var j=this._normaliseTime(this._determineTime(k,this._get(k,"maxTime")));l=(h&&l<h?h:(j&&l>j?j:l));var i=this._get(k,"beforeSetTime");if(i){l=i.apply(k.input[0],[this._getTimeTimeEntry(k.input[0]),l,h,j])}k._selectedHour=l.getHours();k._selectedMinute=l.getMinutes();k._selectedSecond=l.getSeconds();this._showTime(k);d.data(k.input[0],f,k)},_normaliseTime:function(g){if(!g){return null}g.setFullYear(1900);g.setMonth(0);g.setDate(0);return g},_determineTime:function(j,i){var h=function(l){var k=new Date();k.setTime(k.getTime()+l*1000);return k};var g=function(r){var k=d.timeEntry._extractTime(j,r);var p=new Date();var l=(k?k[0]:p.getHours());var q=(k?k[1]:p.getMinutes());var m=(k?k[2]:p.getSeconds());if(!k){var o=/([+-]?[0-9]+)\s*(s|S|m|M|h|H)?/g;var n=o.exec(r);while(n){switch(n[2]||"s"){case"s":case"S":m+=parseInt(n[1],10);break;case"m":case"M":q+=parseInt(n[1],10);break;case"h":case"H":l+=parseInt(n[1],10);break}n=o.exec(r)}}p=new Date(0,0,10,l,q,m,0);if(/^!/.test(r)){if(p.getDate()>10){p=new Date(0,0,10,23,59,59)}else{if(p.getDate()<10){p=new Date(0,0,10,0,0,0)}}}return p};return(i?(typeof i=="string"?g(i):(typeof i=="number"?h(i):i)):null)},_handleKeyPress:function(l,k){if(k==this._get(l,"separator")){this._changeField(l,+1,false)}else{if(k>="0"&&k<="9"){var p=parseInt(k,10);var o=parseInt(l._lastChr+k,10);var n=this._get(l,"show24Hours");var j=(l._field!=0?l._selectedHour:(n?(o<24?o:p):(o>=1&&o<=12?o:(p>0?p:l._selectedHour))%12+(l._selectedHour>=12?12:0)));var i=(l._field!=1?l._selectedMinute:(o<60?o:p));var h=(l._field!=l._secondField?l._selectedSecond:(o<60?o:p));var m=this._constrainTime(l,[j,i,h]);this._setTime(l,new Date(0,0,0,m[0],m[1],m[2]));l._lastChr=k}else{if(!this._get(l,"show24Hours")){k=k.toLowerCase();var g=this._get(l,"ampmNames");if((k==g[0].substring(0,1).toLowerCase()&&l._selectedHour>=12)||(k==g[1].substring(0,1).toLowerCase()&&l._selectedHour<12)){var q=l._field;l._field=l._ampmField;this._adjustField(l,+1);l._field=q;this._showField(l)}}}}}});function a(i,h){d.extend(i,h);for(var g in h){if(h[g]==null){i[g]=null}}return i}var c=["getOffset","getTime","isDisabled"];d.fn.timeEntry=function(h){var g=Array.prototype.slice.call(arguments,1);if(typeof h=="string"&&d.inArray(h,c)>-1){return d.timeEntry["_"+h+"TimeEntry"].apply(d.timeEntry,[this[0]].concat(g))}return this.each(function(){var j=this.nodeName.toLowerCase();if(j=="input"){if(typeof h=="string"){d.timeEntry["_"+h+"TimeEntry"].apply(d.timeEntry,[this].concat(g))}else{var i=(d.fn.metadata?d(this).metadata():{});d.timeEntry._connectTimeEntry(this,d.extend(i,h))}}})};d.timeEntry=new b()})(jQuery);(function(e){var j={};var c={};var i={};var d;jQuery.fn.jBreadCrumb=function(l){j=e.extend({},e.fn.jBreadCrumb.defaults,l);return this.each(function(){c=e(this);g()})};function g(){if(typeof(jQuery.easing)=="object"){d="easeOutQuad"}else{d="swing"}i=jQuery(c).find("li");jQuery(c).find("ul").width(5000);if(i.length>0){jQuery(i[i.length-1]).addClass("last");jQuery(i[0]).addClass("first");k()}}function b(m){var l=0;if(e.browser.msie){e(i).each(function(){l+=e(this).outerWidth(true)});l+=e("#breadCrumb_ul").offset().left+80}else{l=m.width()+m.offset().left}return l}function k(){var o=c.width();var l=jQuery("body").width();var q=jQuery(i[i.length-1]);var p=b(q);var n=1;while((p>l)&&(n<(i.length))){var m=jQuery(i[n]);f(n,m);p=b(q);n++}}function f(o,p){var n=jQuery(p);n.find("a").wrap('<span style="float:left;position:relative;" onmousedown="return false;" onselectstart="return false;" ></span>').width(n.find("a").width()+10);n.append(jQuery('<div class="'+j.overlayClass+'" onmousedown="return false;" onselectstart="return false;" ></div>').css({display:"block"}));var m={id:o,width:n.width(),listElement:n.find("span"),isAnimating:false,element:n.find("span"),text:n.find("a").text()};n.bind("mouseover",m,h).bind("mouseout",m,a);n.find("a").unbind("mouseover",h).unbind("mouseout",a);elementSpan=n.find("span");var l=elementSpan.find("a");l.text(m.text.substr(0,1)+"...");elementSpan.width(j.previewWidth)}function h(n){var l=n.data.id;var o=n.data.width;var m=n.data.element.find("a");m.text(n.data.text);jQuery(n.data.element).stop();jQuery(n.data.element).animate({width:o},{duration:j.timeExpansionAnimation,easing:j.easing,queue:false});return false}function a(m){var l=m.data.id;jQuery(m.data.element).stop();jQuery(m.data.element).animate({width:j.previewWidth},{duration:j.timeCompressionAnimation,easing:j.easing,queue:false,complete:function(){var n=m.data.element.find("a");n.text(m.data.text.substr(0,1)+"...")}});return false}jQuery.fn.jBreadCrumb.defaults={timeExpansionAnimation:800,timeCompressionAnimation:500,easing:d,overlayClass:"chevronOverlay",previewWidth:15}})(jQuery);
/*
 * jQuery blockUI plugin
 * Version 2.38 (29-MAR-2011)
 * @requires jQuery v1.2.3 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2010 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */
(function(i){if(/1\.(0|1|2)\.(0|1|2)/.test(i.fn.jquery)||/^1.1/.test(i.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+i.fn.jquery);return}i.fn._fadeIn=i.fn.fadeIn;var c=function(){};var j=document.documentMode||0;var e=i.browser.msie&&((i.browser.version<8&&!j)||j<8);var f=i.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!j;i.blockUI=function(p){d(window,p)};i.unblockUI=function(p){h(window,p)};i.growlUI=function(t,r,s,p){var q=i('<div class="growlUI"></div>');if(t){q.append("<h1>"+t+"</h1>")}if(r){q.append("<h2>"+r+"</h2>")}if(s==undefined){s=3000}i.blockUI({message:q,fadeIn:700,fadeOut:1000,centerY:false,timeout:s,showOverlay:false,onUnblock:p,css:i.blockUI.defaults.growlCSS})};i.fn.block=function(p){return this.unblock({fadeOut:0}).each(function(){if(i.css(this,"position")=="static"){this.style.position="relative"}if(i.browser.msie){this.style.zoom=1}d(this,p)})};i.fn.unblock=function(p){return this.each(function(){h(this,p)})};i.blockUI.version=2.38;i.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var b=null;var g=[];function d(r,F){var A=(r==window);var w=F&&F.message!==undefined?F.message:undefined;F=i.extend({},i.blockUI.defaults,F||{});F.overlayCSS=i.extend({},i.blockUI.defaults.overlayCSS,F.overlayCSS||{});var C=i.extend({},i.blockUI.defaults.css,F.css||{});var N=i.extend({},i.blockUI.defaults.themedCSS,F.themedCSS||{});w=w===undefined?F.message:w;if(A&&b){h(window,{fadeOut:0})}if(w&&typeof w!="string"&&(w.parentNode||w.jquery)){var I=w.jquery?w[0]:w;var P={};i(r).data("blockUI.history",P);P.el=I;P.parent=I.parentNode;P.display=I.style.display;P.position=I.style.position;if(P.parent){P.parent.removeChild(I)}}var B=F.baseZ;var M=(i.browser.msie||F.forceIframe)?i('<iframe class="blockUI" style="z-index:'+(B++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+F.iframeSrc+'"></iframe>'):i('<div class="blockUI" style="display:none"></div>');var L=F.theme?i('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+(B++)+';display:none"></div>'):i('<div class="blockUI blockOverlay" style="z-index:'+(B++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var K,G;if(F.theme&&A){G='<div class="blockUI '+F.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+B+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(F.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(F.theme){G='<div class="blockUI '+F.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+B+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(F.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(A){G='<div class="blockUI '+F.blockMsgClass+' blockPage" style="z-index:'+B+';display:none;position:fixed"></div>'}else{G='<div class="blockUI '+F.blockMsgClass+' blockElement" style="z-index:'+B+';display:none;position:absolute"></div>'}}}K=i(G);if(w){if(F.theme){K.css(N);K.addClass("ui-widget-content")}else{K.css(C)}}if(!F.theme&&(!F.applyPlatformOpacityRules||!(i.browser.mozilla&&/Linux/.test(navigator.platform)))){L.css(F.overlayCSS)}L.css("position",A?"fixed":"absolute");if(i.browser.msie||F.forceIframe){M.css("opacity",0)}var y=[M,L,K],O=A?i("body"):i(r);i.each(y,function(){this.appendTo(O)});if(F.theme&&F.draggable&&i.fn.draggable){K.draggable({handle:".ui-dialog-titlebar",cancel:"li"})}var v=e&&(!i.boxModel||i("object,embed",A?null:r).length>0);if(f||v){if(A&&F.allowBodyStretch&&i.boxModel){i("html,body").css("height","100%")}if((f||!i.boxModel)&&!A){var E=m(r,"borderTopWidth"),J=m(r,"borderLeftWidth");var x=E?"(0 - "+E+")":0;var D=J?"(0 - "+J+")":0}i.each([M,L,K],function(t,S){var z=S[0].style;z.position="absolute";if(t<2){A?z.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+F.quirksmodeOffsetHack+') + "px"'):z.setExpression("height",'this.parentNode.offsetHeight + "px"');A?z.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):z.setExpression("width",'this.parentNode.offsetWidth + "px"');if(D){z.setExpression("left",D)}if(x){z.setExpression("top",x)}}else{if(F.centerY){if(A){z.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}z.marginTop=0}else{if(!F.centerY&&A){var Q=(F.css&&F.css.top)?parseInt(F.css.top):0;var R="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+Q+') + "px"';z.setExpression("top",R)}}}})}if(w){if(F.theme){K.find(".ui-widget-content").append(w)}else{K.append(w)}if(w.jquery||w.nodeType){i(w).show()}}if((i.browser.msie||F.forceIframe)&&F.showOverlay){M.show()}if(F.fadeIn){var H=F.onBlock?F.onBlock:c;var q=(F.showOverlay&&!w)?H:c;var p=w?H:c;if(F.showOverlay){L._fadeIn(F.fadeIn,q)}if(w){K._fadeIn(F.fadeIn,p)}}else{if(F.showOverlay){L.show()}if(w){K.show()}if(F.onBlock){F.onBlock()}}l(1,r,F);if(A){b=K[0];g=i(":input:enabled:visible",b);if(F.focusInput){setTimeout(o,20)}}else{a(K[0],F.centerX,F.centerY)}if(F.timeout){var u=setTimeout(function(){A?i.unblockUI(F):i(r).unblock(F)},F.timeout);i(r).data("blockUI.timeout",u)}}function h(s,t){var r=(s==window);var q=i(s);var u=q.data("blockUI.history");var v=q.data("blockUI.timeout");if(v){clearTimeout(v);q.removeData("blockUI.timeout")}t=i.extend({},i.blockUI.defaults,t||{});l(0,s,t);var p;if(r){p=i("body").children().filter(".blockUI").add("body > .blockUI")}else{p=i(".blockUI",s)}if(r){b=g=null}if(t.fadeOut){p.fadeOut(t.fadeOut);setTimeout(function(){k(p,u,t,s)},t.fadeOut)}else{k(p,u,t,s)}}function k(p,s,r,q){p.each(function(t,u){if(this.parentNode){this.parentNode.removeChild(this)}});if(s&&s.el){s.el.style.display=s.display;s.el.style.position=s.position;if(s.parent){s.parent.appendChild(s.el)}i(q).removeData("blockUI.history")}if(typeof r.onUnblock=="function"){r.onUnblock(q,r)}}function l(p,t,u){var s=t==window,r=i(t);if(!p&&(s&&!b||!s&&!r.data("blockUI.isBlocked"))){return}if(!s){r.data("blockUI.isBlocked",p)}if(!u.bindEvents||(p&&!u.showOverlay)){return}var q="mousedown mouseup keydown keypress";p?i(document).bind(q,u,n):i(document).unbind(q,n)}function n(t){if(t.keyCode&&t.keyCode==9){if(b&&t.data.constrainTabKey){var r=g;var q=!t.shiftKey&&t.target===r[r.length-1];var p=t.shiftKey&&t.target===r[0];if(q||p){setTimeout(function(){o(p)},10);return false}}}var s=t.data;if(i(t.target).parents("div."+s.blockMsgClass).length>0){return true}return i(t.target).parents().children().filter("div.blockUI").length==0}function o(p){if(!g){return}var q=g[p===true?g.length-1:0];if(q){q.focus()}}function a(w,q,A){var z=w.parentNode,v=w.style;var r=((z.offsetWidth-w.offsetWidth)/2)-m(z,"borderLeftWidth");var u=((z.offsetHeight-w.offsetHeight)/2)-m(z,"borderTopWidth");if(q){v.left=r>0?(r+"px"):"0"}if(A){v.top=u>0?(u+"px"):"0"}}function m(q,r){return parseInt(i.css(q,r))||0}})(jQuery);(function(b){jQuery.browser.mobile=/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(b)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(b.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);MFNamespace("MFWA.Utils",function(c){var b=MFNamespace("MFWA.Debug.Assert");var a=0;var d="";return{currentUrl:"",extend:function(e,g){for(var f in g.prototype){e.prototype[f]=g.prototype[f]}e.prototype.base=g},unique:function(e){return e+a++},extractPath:function(h,f){h=h.split(".");var g=f;for(var e in h){if(!g){break}var j=h[e];g=g[j]}return g},getUTCTime:function(f){var e=f.getTimezoneOffset();f.setTime(f.getTime()-e*60*1000);return f},strToDate:function(j,f){var h=/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)\.?(\d{0,3}d?)\d*\s*(.*)/;var l=h.exec(j);b.exists(l,"Invalid date "+j);b.isTrue(l[8]=="Z","Date must be UTC but instead is '"+l[8]+"'");var e=l[7];while(e.length<3){e+=0}var g=new Date(+l[1],+l[2]-1,+l[3],+l[4],+l[5],+l[6],+l[7]);if(!f){var k=g.getTime();var m=g.getTimezoneOffset()*60000;var i=k-m;g.setTime(i)}return g},dateToStr:function(e){return e.toJSON()},copyLocalToUTCDate:function(e){var f=new Date();f.setUTCDate(e.getDate());f.setUTCMonth(e.getMonth());f.setUTCFullYear(e.getFullYear());f.setUTCHours(e.getHours());f.setUTCMinutes(e.getMinutes());f.setUTCSeconds(e.getSeconds());f.setUTCMilliseconds(e.getMilliseconds());return f},copyUTCToLocalDate:function(f){var e=new Date();e.setDate(f.getUTCDate());e.setMonth(f.getUTCMonth());e.setFullYear(f.getUTCFullYear());e.setHours(f.getUTCHours());e.setMinutes(f.getUTCMinutes());e.setSeconds(f.getUTCSeconds());e.setMilliseconds(f.getUTCMilliseconds());return e},is24HourClock:function(){var f=new Date();f.setHours(23,0,0,0);var e=f.toLocaleTimeString();if(e.substr(0,2)=="23"){return true}else{return false}},format:function(g){var f=/\{\d+\}/g;var e=arguments;return g.replace(f,function(h){return e[h.match(/\d+/)*1+1]})},formatSize:function(n){var j={K:Math.pow(1024,1),M:Math.pow(1024,2),G:Math.pow(1024,3),T:Math.pow(1024,4)};var g="",f=1;for(var k in j){var l=j[k];if(l>f&&n/l>1){f=l;g=k}}var i=n/f;var h=0;if(i<100&&f!=1){h++}if(i<10&&f!=1){h++}var m=1;if(h>0){m=10*h}i=Math.round(i*m)/m;i=i+"";while(h>0&&i.length<4){if(i.indexOf(".")==-1){i=i+"."}i=i+"0"}return i+" "+g+"B"},copy:function(e){if(typeof e==="object"&&e!==null&&e.constructor!=Date){var g;if(e.constructor===Array){g=[]}else{g={}}for(var f in e){g[f]=c.copy(e[f])}return g}else{return e}},escape:function(h){if(!h){return null}var e=new Array(h.length);for(var f=0;f<h.length;f++){var j=h.charAt(f);if(j=="<"){e[f]="&lt;"}else{if(j==">"){e[f]="&gt;"}else{if(j=="&"){e[f]="&amp;"}else{if(j=='"'){e[f]="&quot;"}else{e[f]=j}}}}}var g=e.join("");return g},encodeURIPart:function(h){if(h=="$0"){return h}var g=encodeURIComponent(h);var e="";for(var f=0;f<g.length;f++){switch(g.charAt(f)){case"_":e=e.concat("_u");break;case"%":e=e.concat("_p");break;case"*":e=e.concat("_a");break;case".":e=e.concat("_s");break;case"'":e=e.concat("_q");break;default:e=e.concat(g.charAt(f));break}}return e},getBrowserLocale:function(){if(navigator){var f=navigator.language;var h=navigator.browserLanguage;var g=navigator.systemLanguage;var e=navigator.userLanguage;if(f){return f}else{if(h){return h}else{if(g){return g}else{if(e){return e}}}}}return""},getBrowserTimeZoneOffset:function(){var e=new Date();var f=e.getTimezoneOffset()*60000;return f},typedValueExists:function(e){if(e){if(e.Value||e.Value===0||e.Value===false||e.Lookup||e.Lookups){return true}else{return false}}return false},ACLequals:function(e,g){if(!e||!g){return false}if(e.length!=g.length){return false}if(e.length>1){e.sort(function(i,h){return i.UserOrGroupID-h.UserOrGroupID})}if(g.length>1){g.sort(function(i,h){return i.UserOrGroupID-h.UserOrGroupID})}for(var f=0;f<e.length;++f){if((e[f].UserOrGroupID!=g[f].UserOrGroupID)||(e[f].IsGroup!=g[f].IsGroup)||(e[f].ChangePermissionsPermission!=g[f].ChangePermissionsPermission)||(e[f].EditPermission!=g[f].EditPermission)||(e[f].ReadPermission!=g[f].ReadPermission)){return false}}return true},getSearchResultLimit:function(){var f=MFWA.Utils.getBrowserVersion();var e=500;if(f.msie){if(f.realIEversion=="IE7"){e=200}else{e=300}}return e},getBrowserVersion:function(){var e={realIEversion:null};if($.browser.msie){if($.browser.version<8&&!/Trident/.exec(navigator.userAgent)){e.realIEversion="IE7"}else{if($.browser.version<9){e.realIEversion="IE8"}else{e.realIEversion="IEnew"}}}return $.extend({},$.browser,e)},roundToTwoDecimal:function(f,e){if(MFWA.Validator.isSignedRealNumber(f)){if(!e){e=2}return f.toFixed(e)}else{return f}},validateSignedNumberRange:function(e){if(MFWA.Validator.isSignedNumber(e)){if(e>2147483647){return 2147483647}else{if(e<-2147483648){return -2147483648}else{return e}}}else{return e}},getTextWidth:function(g){if(!g){return 0}var e=$("<span style='font-size:12px;'>"+this.escape(g)+"</span>");$("body").append(e);var f=e.width();e.remove();return f},listProperties:function(f){var e="";for(var g in f){if(f.hasOwnProperty(g)){e+=g+" : "+f[g]+"\n"}}return e},validateURL:function(f){var e=new RegExp("^(http://www.|https://www.|ftp://www.|www.){1}([0-9A-Za-z]+.)");return e.test(f)},replaceAll:function(g,e,f){if(g){return g.replace(new RegExp(e,"g"),f)}},isNumber:function(f){if(!f){return false}f=f.toString();if(f.length==0){return false}var e=/^[-]?\d*\.?\d*$/;return f.match(e)}}});MFNamespace("MFWA.StringBuilder",function(){return{StringBuilder:function(a){var b=0;var c=new Array(a);this.append=function(d){if(b<a){c[b]=d;b++}else{c.push(d);b++}return this};this.toString=function(){return c.join("")}}}});MFNamespace("MFWA",{Timer:function(b){var a=0;var c;this.start=function(){c=new Date().getTime()};this.pause=function(){a+=new Date().getTime()-c;c=null};this.reset=function(){a=0};this.getValue=function(){return a};this.report=function(){if(c){var d=new Date().getTime();a+=d-c;c=d}b(this.getValue())}}});MFNamespace("MFWA.Observable",function(c){var b=MFNamespace("MFWA.Debug.Assert");var d=function(){return this.value};var g=function(k){this.value=k;for(var j in this.observers){var h=this.observers[j];try{h.callback.call(h.observer,k)}catch(l){b.fail("Exception in observer: "+l)}}};var f=function(h){for(var k=0;k<this.observers.length;k++){var j=this.observers[k];if(j.observer==h){this.observers.splice(k,1);k--}}};var a=function(){var j=this.observable;var k=j.observers;for(var h=0;h<k.length;h++){if(k[h]===this){k.splice(h,1);h--}}};var e=function(h,j){var i={observable:this,observer:h,callback:j,remove:a};this.observers.push(i);return i};return{Observable:function(h){var i={value:h,observers:[],get:d,set:g,observe:e,unobserve:f};return i}}});MFNamespace("MFWA.Model",function(j){var a=MFNamespace("MFWA.Observable");var b=MFNamespace("MFWA.History");var e=function(k){return{set:function(l){alert("Set '"+k+"' to '"+l+"'")},get:function(){alert("Get '"+k+"'")},observe:function(){alert("Observe '"+k+"'")}}};var g=a.Observable();var d=a.Observable();var f=e("currentView");var i=e("searchCriteria");var h=e("objectHistory");var c=function(k){k._set=k.set;k.set=function(o){var n=this.get();var m=this;var l=false;if((o)&&(o.searchCriteria!=null)){l=true}if((n)&&(o.viewPath)&&(o.viewPath==n.viewPath)&&(!l)){var p=MFNamespace("MFWA.MFWA");p.refreshListing();return}b.save(function(){m._set(o)},function(){m._set(n)})}};c(g);return{view:g,selectedItem:d,currentView:f,searchCriteria:i,objectHistory:h}});MFNamespace("MFWA.Nulls",{Lookup:-1,Workflow:0,Class:-1,ClearFilter:-2});MFNamespace("MFWA.Consts",{ViewItem:{ItemType:{View:0,PropertyFolder:1,TraditionalFolder:2,ObjectVersion:3}}});MFNamespace("MFWA.Enumerations",{MFDataType:{ReadOnly:-10,Automatic:-11},MFFolderContentItemType:{ObjectFile:-1}});var profiling=false;MFNamespace("MFWA.Debug",function(a){var c;var b;return{init:function(){c=$('<div style="display:none;overflow:auto;position:absolute;bottom:30px;right:30px;width:40%;height:40%;z-index:3142;background:white;border:solid 2px;padding:4px;display:none"></div>');var d=$('<div style="display:none;font-size:4pt;position:absolute;bottom:10px;right:10px;z-index:3142;background:black;color:white;padding:1px;text-align:center;width:10px;">&pi;</div>').click(function(){c.toggle()});$("body").append(d);$("body").append(c);c.append('<span style="font-weight:bold">Debug log:</span>');b=$('<div style="font-family:monospace">');c.append(b);a.write("Debug initialized")},write:function(d){if(b){b.append(Date()+": ");b.append(d).append("<br>")}}}});MFNamespace("MFWA.Debug.Assert",{doesNotHaveValue:function(c,b,a){if(c[b]){this.promptAssert(a)}},hasValue:function(c,b,a){if(!c[b]){this.promptAssert(a)}},exists:function(b,a){this.isTrue(b,a)},doesNotExist:function(b,a){this.isFalse(b,a)},equals:function(c,b,a){if(c!=b){this.promptAssert(a)}},isTrue:function(a,b){if(!a){this.promptAssert(b)}},isFalse:function(a,b){if(a){this.promptAssert(b)}},fail:function(a){this.promptAssert(a)},promptAssert:function(a){if(!a){a="Assertion failure"}if(!confirm("Error: "+a+"\nContinue?")){throw a}}});MFNamespace("MFWA.Pooling",function(){var a={};return{get:function(d,b){if(!a[d]){a[d]=[]}if(a[d].length>0){return a[d].pop()}else{var c;var f=function(){a[d].push(c)};c=b({dispose:f});if(c.dispose){var e=c.dispose;c.dispose=function(){e.call(c);f()}}else{c.dispose=f}return c}},dispose:function(c,b){a[c].push(c)}}});MFNamespace("MFWA.Status",function(){var b;var a=true;return{init:function(){$("a").live("mouseover",function(){a=false}).live("mouseout",function(){a=true;if(b){window.status=b}})},setStatus:function(c){b=c;if(a){window.status=b}}}});MFNamespace("MFWA.MFWA",function(g){var d,b,i,h,c,e,f,a;return{setListing:function(j){d=j},setMenu:function(j){b=j},setTree:function(j){i=j},setSearch:function(j){h=j},setPropPane:function(j){c=j},setTaskPane:function(j){e=j},updateObject:function(k,m,j,l){d.updateObject(k,m,j,l);if(l.objectVersion){d.updateReferedObject(m,l,j)}else{d.updateReferedObject(m,l.parent,j)}},updateHistoryObject:function(k,m,j,l){d.updateHistoryObject(k,m,j,l)},getItemFromObjectVersion:function(j){return d.getItemFromObjectVersion(j)},addItem:function(j){$("#dvemptyMsg").remove();return d.addItem(j)},updateItem:function(j,k){d.updateItem(j,k)},updatePending:function(j,k){d.updatePending(j,k);d.updatePendingToReferedItems(j,k)},removeItem:function(j,k,l){d.removeItem(j,k,l);if(k){MFWA.PropertiesPane.clear();MFWA.TaskPane.clear();MFWA.Menu.UpdateMenuItemStates(null)}},loadChildren:function(j){d.loadChildren(j)},getListingMode:function(){return d.getDisplayMode()},setListingMode:function(j){d.setDisplayMode(j)},getViewSettingsID:function(){return d.getCurrentActiveViewID()},refreshListing:function(){d.refresh()},getCurrentColumns:function(){return d.getCurrentColumns()},addColumnToListing:function(j){d.addColumnToListing(j)},hideColumnFromListing:function(j){d.hideColumnFromListing(j)},getAppletInitialized:function(){if(f==null){return false}return f},setAppletInitialized:function(j){f=j},getSessionInfo:function(){return a},setSessionInfo:function(j){a=j}}});MFNamespace("MFWA.History",function(l){var e;var b;var c;var g=0;var h=[];var k=[];var j=false;var d=false;var i=[];var a=[];var f=function(){j=false;var n=h;h=[];for(var m in n){n[m].forward();k.push(n[m])}if(!j){while(i.length>g){i.pop()}i.push(k);k=[];g=i.length;c.val(g);b.submit()}};return{init:function(){g=0;b=$("#historyForm");c=$("#historyDepthInput");e=$("#historyIFrame");e.load(function(){var m=window.frames.historyIFrame.location.href;var p=/depth=(\d*)/.exec(m)[1]*1;d=true;while(g>p){g--;var o=i[g-1];for(var n in o){o[n].forward()}}while(g<p){g++;var o=i[g-1];for(var n in o){o[n].forward()}}d=false})},save:function(n,m){if(d){return}h.push({forward:n,reverse:m});if(!j){setTimeout(f,0);j=true}}}});MFNamespace("MFWA.Data.Ajax",function(self){var i18nMy=MFNamespace("MFWA.I18n.Alerts");var utils=MFNamespace("MFWA.Utils");var error=MFNamespace("MFWA.Dialogs.Error");var debug=MFNamespace("MFWA.Debug");var getQueue={};var sanitizeEmptyString=function(data,dataType){if(data===""){return"null"}else{return data}};var getErr=function(xhr){try{var errObject=eval(["(",")"].join(xhr.responseText));return errObject}catch(e){var text=xhr.responseText;var match=/<title>(.*?)<\/title>/.exec(text);var message;if(match){message=utils.format(i18nMy.UnknownErrorWithTitle,match[1]);match=/<body[^>]*>((\r|\n|.)*)<\/body>/.exec(text);var body=null;if(match){body=match[1]}error.show({message:message,rawstack:body})}else{message=i18nMy.UnknownError;error.show({message:message})}}return null};var createErrorHandler=function(status,errorCb){return function(xhr){if(!status||!status.cancel){var errObject=getErr(xhr);if(errObject===null){return}handleError(errObject,errorCb)}}};var handleError=function(errObject,errorCb){if((errObject.Status==403&&!errObject.IsLoggedToApplication)||(errObject.Exception&&errObject.Exception.InnerException&&errObject.Exception.InnerException.ErrorCode=="(0190)")){var viewInfo={ActiveView:"",IsSearch:false};MFWA.Data.Operations.saveActiveView(viewInfo);if(errObject.Status==403){window.location="login.aspx?timeout=true"}else{window.location="login.aspx"}}else{if(errorCb){errorCb(errObject)}else{MFWA.Dialogs.Alerts.ShowError(errObject)}}};var doMethod=function(url,method,data,callback,error){if(url.indexOf("?")!=-1){url+="&_method="+method.toUpperCase()}else{url+="?_method="+method.toUpperCase()}var status={cancel:false};jQuery.ajax({type:"POST",url:url,data:JSON.stringify(data,null,4),dataFilter:sanitizeEmptyString,success:function(data,text){if(!status.cancel&&callback){callback(data,text)}},error:createErrorHandler(status,error),dataType:"json"});return status};var get=function(url,success,error){var status={cancel:false};if(getQueue[url]){getQueue[url].push({success:success,status:status,error:error})}else{getQueue[url]=[{success:success,status:status,error:error}];jQuery.ajax({type:"GET",url:url,success:function(json){var t=new MFWA.Timer(function(value){debug.write("REST callbacks ("+url+"): "+value)});t.start();for(var i=0;i<getQueue[url].length;i++){var request=getQueue[url][i];if(!request.status.cancel&&request.success){request.success(json)}}getQueue[url]=null;t.report()},error:createErrorHandler(null,function(errObject){var invokeDefault=false;for(var i=0;i<getQueue[url].length;i++){var request=getQueue[url][i];if(!request.status.cancel){if(request.error){request.error(errObject)}else{invokeDefault=true}}}if(invokeDefault){MFWA.Dialogs.Alerts.ShowError(errObject)}getQueue[url]=null}),dataType:"json"})}return status};var put=function(url,data,callback,error){return doMethod(url,"PUT",data,callback,error)};var post=function(url,data,callback,error){return doMethod(url,"POST",data,callback,error)};var del=function(url,callback,error){return doMethod(url,"DELETE",null,callback,error)};return{get:get,put:put,post:post,del:del,createErrorHandler:createErrorHandler,handleError:handleError}});MFNamespace("MF.Cache",function(){return{GetViewObjects:function(a,b,c){MFWS.GetViewObjects(a,b,c)}}});MFNamespace("MFWA.Data.Cache",function(m){var k=MFNamespace("MFWA.Data.Ajax");var q=MFNamespace("MFWA.StringBuilder");var o=MFNamespace("MFWA.Debug");var s=MFNamespace("MFWA.Utils");var a=MFNamespace("MFWA.Enumerations");var b=k.get;var n=null;var i=null;var v=null;var e={};var u={};var f={};var r=null;var h=null;var t={};var g={};var c={};var d=[,];var j;var p;function l(y,C,B,z,x){var w="./REST/valuelists";if(y==true){w+="bypropdefid"}w+="/"+C+"/items.aspx";var A=new Array();if(z){if(z.text){A.push("filter="+z.text)}if(z.item&&z.item.values.length>0){A.push("filterItem="+z.item.type+":"+z.item.values.join(","))}}if(x){A.push("selected="+x)}if(A.length>0){w=w+"?"+A.join("&")}return b(w,B)}return{saveSearchState:function(){var w={SearchIn:$("#searchIn").val(),WithinFolder:$("#searchWithinThisFolder").attr("checked"),SearchObjectType:$("#searchObjectType").val(),LookWord:$('[name="searchTypeGroup"]:checked').val(),SearchWord:$("#searchString").val()};MFWA.Data.Operations.saveSearchState(w)},setForceUpdate:function(w){p=w},getForceUpdate:function(){return p},getClassesByGroup:function(w,x){w=w*1;if(!f[w]){return b("./REST/objects/"+w+"/classes.aspx?byGroup=true",function(y){f[w]=y;x(y)})}else{x(f[w])}},getClass:function(x,y,w){if(!t[x]){return b("./REST/structure/classes/"+x+".aspx",function(z){t[x]=z;y(z)},w)}else{y(t[x])}},getClassInfo:function(x,y){if(!t[x]||!g[x]||!c[x]||m.getForceUpdate()){return b("./REST/structure/classes/"+x+"/full.aspx",function(z){t[x]=z;g[x]=z.Templates;c[x]=z.AssociatedPropertyDefs;m.setForceUpdate(false);y(z)})}else{var w=t[x];w.Templates=g[x];w.AssociatedPropertyDefs=c[x];y(t[x])}},resolvePropertyDefs:function(B,C,x,D){var A={};var w=new Array();for(var z=0;z<B.length;z++){var y=B[z][C];if(n[y]){B[z][x]=n[y]}else{A[y]=B[z];w.push(y)}}if(w.length==0){D()}else{return b("./REST/structure/propertyDefs.aspx",function(F){for(var E=0;E<F.length;E++){var G=F[E];n[G.ID]=G;if(A[G.ID]){A[G.ID][x]=G}}D()})}},ensureObjectProperties:function(w,x){if(w.Properties){x(w)}else{return m.getProperties(w.ObjVer,function(y){x({ObjectVersion:w,Properties:y})})}},getLevelDefinition:function(w,x){return b("./REST/views/"+w+"/levelDefinition.aspx",function(y){x(y)})},getPropertyDefs:function(w){if(n){w(n)}else{return b("./REST/structure/propertyDefs.aspx",function(x){n=x;w(x)})}},hasValueListIcon:function(x,w,y){if(d[x,w]){y(d[x,w])}else{return b("./REST/objects/"+x+"/"+w+"/hasValueListIcon.aspx",function(z){d[x,w]=z;y(z)})}},getPropertyDefsByID:function(w){if(i){w(i)}else{m.getPropertyDefs(function(x){if(!i){i={};for(var y in x){i[x[y].ID]=x[y];e[x[y].ID]=x[y]}}w(i)})}},getPropertyDef:function(x,w){if(e[x]){w(e[x])}else{return b("./REST/structure/propertyDefs/"+x+".aspx",function(y){e[x]=y;w(y)})}},getValueList:function(w,x){if(u[w]){x(u[w])}else{return b("./REST/valueLists/"+w+".aspx",function(y){u[w]=y;x(y)})}},getObjectType:function(w,x){if(u[w]){x(u[w])}else{return b("./REST/objects/"+w+".aspx",function(y){u[w]=y;x(y)})}},getObjectsByType:function(w){if(v){w(v)}else{return b("./REST/objects.aspx",function(y){if(!v){v={};for(var x in y){v[y[x].ID]=y[x]}}w(v)})}},getValueListItems:function(y,z,x,w){return l(false,y,z,x,w)},getValueListItemsByPropDefID:function(w,z,y,x){return l(true,w,z,y,x)},getWorkflows:function(w){if(h){w(h)}else{return b("./REST/structure/workflows.aspx",function(x){h=x;w(x)})}},checkVaultAccess:function(z,B,y,A,w,C,x){return k.put("./REST/session/"+z+"/checkVaultAccess.aspx",{Username:B,Password:y,Domain:A,WindowsUser:w},C,x)},getWorkflowsForObject:function(w,x){return b("./REST/structure/workflows.aspx?object="+w.Type+","+w.ID+","+w.Version,x)},getSearchState:function(w){return b("./REST/views/searchstate.aspx",w)},getActiveView:function(w){return b("./REST/views/getactiveview.aspx",w)},getStatesForWorkflow:function(x,w,y){if(y){return b("./REST/structure/workflows/"+x+"/states/"+w+".aspx",y)}else{return b("./REST/structure/workflows/"+x+"/states.aspx",w)}},getNACLs:function(w){return b("./REST/structure/namedacls.aspx",w)},getObjectVersion:function(x,z,w,y){if(!w&&!y){y=z;w=x.Version;z=x.ID;x=x.Type}else{if(!y){y=w;w="latest"}}return b("./REST/objects/"+x+"/"+z+"/"+w+".aspx",y)},getObjectVersionOrHandleError:function(x,z,A){var y=x.Type;var B=x.ID;var w=x.Version;return b("./REST/objects/"+y+"/"+B+"/"+w+".aspx",z,A)},getProperties:function(y,A,w,z,x){if(!w&&!z&&!x){z=A;w=y.Version;A=y.ID;y=y.Type}else{if(!z&&!x){z=w;w="latest"}}return b("./REST/objects/"+y+"/"+A+"/"+w+"/properties.aspx",z,x)},getPropertiesForDisplay:function(x,z,w,y){if(!w&&!y){y=z;w=x.Version;z=x.ID;x=x.Type}else{if(!y){y=w;w="latest"}}return b("./REST/objects/"+x+"/"+z+"/"+w+"/displayproperties.aspx",y)},getPropertiesOfMultipleObjects:function(x,y){if(x&&x.length>0){return k.post("./REST/objects/getpropsofmultipleobjects.aspx",x,y)}else{var w=[];y(w)}},getVersionComments:function(x,z,w,y){if(!w&&!y){y=z;w=x.Version;z=x.ID;x=x.Type}else{if(!y){y=w;w="latest"}}return b("./REST/objects/"+x+"/"+z+"/"+w+"/comments.aspx",y)},getRelationship:function(x,z,w,y){return b("./REST/objects/"+x+"/"+z+"/"+w+"/relationshipsAsArray.aspx",y)},getRelationshipForPropertiespane:function(x,z,w,y){return b("./REST/objects/"+x+"/"+z+"/"+w+"/relationshipsForPropertiespane.aspx",y)},getNACL:function(x,z,w,y){return b("./REST/objects/"+x+"/"+z+"/"+w+"/nacl.aspx",y)},getWorkflowState:function(x,z,w,y){if(!w&&!y){y=z;w=x.Version;z=x.ID;x=x.Type}else{if(!y){y=w;w="latest"}}return b("./REST/objects/"+x+"/"+z+"/"+w+"/workflowstate.aspx",y)},getViewContents:function(x,y){var w=s.getSearchResultLimit();return b("./REST/views"+x+"/folders.aspx?limit="+w,y)},getGotoItems:function(w,x){if(w){return b("./REST/views/"+w+"/taskpanegotoitems.aspx",x)}else{return b("./REST/views/taskpanegotoitems.aspx",x)}},checkViewExistence:function(w,y,x){return b("./REST/views/"+w+"/"+y+"/CheckViewExistence.aspx",x)},getConfigurations:function(x,y,w){j=b("./REST/structure/"+x+"/getconfigurations.aspx",y,w);return j},performSearch:function(x,C,D){var z={SearchIn:$("#searchIn").val(),WithinFolder:$("#searchWithinThisFolder").attr("checked"),SearchObjectType:$("#searchObjectType").val(),LookWord:$('[name="searchTypeGroup"]:checked').val(),SearchWord:$("#searchString").val()};MFWA.Data.Operations.saveSearchState(z);var P=MFNamespace("MFWA.Data.Cache");P.getActiveView(function(S){var R={ActiveView:S.ActiveView,IsSearch:true};MFWA.Data.Operations.saveActiveView(R)});var N={SearchInMetadata:"qm",SearchInFileContents:"qf",SearchInBoth:"qb"};var G={AnyWord:"n",Boolean:"b",AllWords:"a"};var F={isNot:"!=",isNotEmpty:"!=",">":">>=",greaterThan:">>=",isAfter:">>=","<":"<<=",lessThan:"<<=",isBefore:"<<=",greaterOrEqualThan:">=",">=":">=",lessOrEqualThan:"<=","<=":"<=",contains:"*=",startsWith:"^=",is:"=",isEmpty:"=",today:"=",withinTheLastWeek:"=",withinTheLastMonth:"=",withinTheLastYear:"="};var E=new q.StringBuilder();for(var L=0;L<x.array.length;L++){var y=x.array[L];if(y.SearchString!=""&&($.inArray("*",y.SearchString)==-1||(L+1)==x.array.length)){E.append("&").append(L).append("_");E.append(N[y.SearchIn]);if(y.SearchType){E.append(G[y.SearchType])}else{E.append(G.AllWords)}E.append("=");var Q=s.encodeURIPart(y.SearchString);E.append(Q)}if(y.SearchObjectType!="All"){E.append("&").append(L).append("_o=");E.append(y.SearchObjectType);if(y.SearchObjectType==a.MFBuiltInObjectType.Document&&D){E.append("&").append(L).append("_o=");E.append(a.MFBuiltInObjectType.DocumentCollection)}}var J=y.PropertyCriteria;for(var K=0;K<J.length;K++){var w=J[K];var A=new q.StringBuilder();if(w.Property!="empty"){var B=w.Property.substring(0,2);var I=w.Property.substring(3);if(B=="VL"){A.append("vl").append(I)}else{if(B=="PV"){if(w.DataType){A.append("p").append(w.DataType).append(I)}else{A.append("p").append(I)}}else{continue}}if(w.DataFunction){A.append("f").append(w.DataFunction)}A.append(F[w.Condition]);var O=s.encodeURIPart(w.TypedValue);A.append(O)}A=A.toString();if(A!=""){E.append("&").append(String(L)).append(String(K)).append("_").append(A)}}}E=E.toString();if(E.length>0){E=E.substring(1)}var H="";if(x.path){H=x.path}else{H="/_tempsearch"}if(E.length>0){E="&"+E}var M=s.getSearchResultLimit();return b("./REST/views"+H+"/search.aspx?limit="+M+E,C,D)},getUserID:function(w){if(r){w(r)}else{return b("./REST/session/userid.aspx",function(x){r=x;w(x)})}},getVaultsList:function(w){return b("./REST/session/vaults.aspx",function(x){r=x;w(x)})},getOnlineVaultsList:function(w){return b("./REST/session/onlinevaults.aspx",function(x){r=x;w(x)})},canCompleteAssignment:function(y,w,x){return b("./REST/objects/"+y+"/"+w+"/canCompleteAssignment.aspx",x)},getComputerName:function(w){return b("./REST/session/computername.aspx",w)},getMobileSiteUsage:function(w){return b("./REST/session/canusemobilesite.aspx",w)},canForceUndoCheckout:function(w){return b("./REST/session/canforceundocheckout.aspx",w)},getCurrentTimestamp:function(w){return b("./REST/structure/currenttimestamp.aspx",w)},getVaultGUID:function(w){return b("./REST/session/vaultguid.aspx",w)},getSitePath:function(w){return b("./REST/session/sitepath.aspx",w)},isLoggedInToVault:function(w,x){return b("./REST/session/"+w+"/vault.aspx",x)},isLoggedInToApplication:function(w){return b("./REST/session/application.aspx",w)},getCheckedoutCount:function(w){return b("./REST/objects/getCheckedoutCount.aspx",w)},getVaultInfo:function(w){return b("./REST/views/baseroot.aspx",w)},Commands:{logout:function(w){return b("./REST/session.aspx?_method=DELETE",w)}}}});MFNamespace("MFWA.Data.Operations",function(a){var f=MFNamespace("MFWA.Data.Ajax");var e=MFNamespace("MFWA.MFWA");var g=MFNamespace("MFWA.Dialogs.Alerts");var d=f.get;var c=function(){return function(h){if(h.Status==403){window.location="login.aspx"}else{g.ShowError(h)}}};var b=function(){return function(h){e.setSessionInfo(h)}};return{logout:function(j){var i={SearchIn:$("#searchIn").val(),SearchObjectType:$("#searchObjectType").val(),LookWord:$('[name="searchTypeGroup"]:checked').val(),SearchWord:"",WithinFolder:"False"};MFWA.Data.Operations.saveSearchState(i);var h={ActiveView:"",IsSearch:false};MFWA.Data.Operations.saveActiveView(h);return f.del("./REST/session.aspx",j)},loginUser:function(n,k,l,j,h,m,i){return f.put("./REST/session.aspx",{Username:n,Password:k,Domain:l,WindowsUser:j},m,i)},loginVault:function(i,j,h){return f.put("./REST/session/vault.aspx",i,j,h)},putTimezoneOffset:function(h){return f.put("./REST/session/timezoneoffset.aspx",h)},putMobileSiteUsage:function(h){return f.put("./REST/session/setusemobilesite.aspx",h)},putLocale:function(h){return f.put("./REST/session/locale.aspx",h)},updateSessionInfo:function(){return d("./REST/session/sessioninfo.aspx",b(),c())},addEmptyFile:function(k,h,l,j){var i=h.title+"."+h.extension;return f.put("./REST/objects/"+k.Type+"/"+k.ID+"/"+k.Version+"/addemptyfile.aspx",i,l,j)},commitUpload:function(h,j,k,i){return f.put("./REST/files/"+h.uploadID+"/"+j.ID+"/"+j.Version+"/"+h.size+"/commit.aspx",null,k,i)},changePassword:function(i,k,l,j){var h={NewPassword:k,OldPassword:i};return f.put("./REST/session/password.aspx",h,l,j)},getObjectHistory:function(i,j,h){return d("./REST/objects/"+i.Type+"/"+i.ID+"/history.aspx",j,h)},getCollectionMembers:function(i,j,h){return d("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/collectionmembers.aspx",j,h)},getRelationships:function(i,j,h){return d("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/relationships.aspx",j,h)},getSubobjects:function(i,j,h){return d("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/subobjects.aspx",j,h)},getSingleobject:function(i,j,h){return d("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/singleObject.aspx",j,h)},getMFDContents:function(j,i,h){return d("./REST/objects/"+j.objVer.Type+"/"+j.objVer.ID+"/"+j.objVer.Version+"/mfdcontents.aspx?parentView="+j.parentViewSettingsID,i,h)},setProperties:function(i,j,k,h){if(i.ObjVer){i=i.ObjVer}return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/properties.aspx",j,k,h)},setWorkflowState:function(i,j,k,h){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/setworkflowstate.aspx",j,k,h)},setNACL:function(i,j,k,l,h){if(j==true){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/true/nacl.aspx",k,l,h)}else{return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/false/nacl.aspx",k,l,h)}},setSingleFileObject:function(j,i,k,h){if(i==true){return d("./REST/objects/"+j.Type+"/"+j.ID+"/"+j.Version+"/setsinglefile.aspx",k,h)}else{return d("./REST/objects/"+j.Type+"/"+j.ID+"/"+j.Version+"/setmultifile.aspx",k,h)}},markComplete:function(i,j,h){return d("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/markcomplete.aspx",j,h)},AddToFavorites:function(i,j,h){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/addtofavorites.aspx",false,j,h)},RemoveFromFavorites:function(i,j,h){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/removefromfavorites.aspx",false,j,h)},renameObject:function(j,h,k,i){return f.put("./REST/objects/"+j.Type+"/"+j.ID+"/"+j.Version+"/rename.aspx",h,k,i)},renameFile:function(j,k,h,l,i){return f.put("./REST/objects/"+j.Type+"/"+j.ID+"/"+j.Version+"/files/"+k.ID+"/"+k.Version+"/rename.aspx",h,l,i)},createObject:function(l,k,n,h){if(typeof l=="number"){l={objType:l}}var j={checkIn:l.checkIn};var m="";for(var i in j){if(m.length==0){m="?"}else{m+="&"}m+=i+"="+j[i]}return f.post("./REST/objects/"+l.objType+".aspx"+m,k,n,h)},deleteObject:function(i,j,h){return f.del("./REST/objects/"+i.Type+"/"+i.ID+".aspx",j,h)},deleteFile:function(i,j,k,h){return f.del("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/files/"+j.ID+"/"+j.Version+".aspx",k,h)},checkOut:function(i,j,h){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/checkedout.aspx",true,j,h)},checkIn:function(i,j,h){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/checkedout.aspx",false,j,h)},notifyObjectAccess:function(i,j,h){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/notifyObjectAccess.aspx",false,j,h)},undoCheckout:function(i,j,h){return f.del("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/checkedout.aspx",j,h)},forceUndoCheckout:function(i,j,h){return d("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/forceundocheckout.aspx",j,h)},addValueListItem:function(j,i,k,h){if(typeof i=="string"){i={Name:i}}return f.post("./REST/valuelists/"+j+"/items.aspx",i,k,h)},setVersionComment:function(j,h,k,i){return f.put("./REST/objects/"+j.Type+"/"+j.ID+"/"+j.Version+"/addcomment.aspx",h,k,i)},setColumnInfos:function(j,i,k,h){return f.put("./REST/viewsettings/"+j+"/columns.aspx",i,k,h)},saveSearchState:function(h){return f.put("./REST/views/savesearchstate.aspx",h)},saveActiveView:function(h){return f.put("./REST/views/saveactiveview.aspx",h)},setViewMode:function(h,i){return f.put("./REST/viewsettings/"+h+"/viewmode.aspx",i)},setGroupInfo:function(i,h){return f.put("./REST/viewsettings/"+i+"/groupinfo.aspx",h)},setConfigurations:function(j,h,k,l,i){return f.put("./REST/structure/"+j+"/"+h+"/setconfigurations.aspx",k,l,i)}}});MFNamespace("MFWA.Data.GlobalObjects",function(b){var g=MFNamespace("MFWA.Data.Cache");var f={};var e={};var a=function(){g.getObjectsByType(function(h){f=h})};var c=function(){g.getVaultInfo(function(h){e=h})};var d=function(){a();c()};return{collect:d,getObjectByTypes:function(){return f},getVaultInfo:function(){return e}}});MFNamespace("MFWA.Handlers.PropertyHandlers",function(l){var r=MFNamespace("MFWA.Data.Cache");var o=MFNamespace("MFWA.Data.Operations");var n=MFNamespace("MFWA.Dialogs.DocumentCard");var h=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var m=MFNamespace("MFWA.Dialogs.Alerts");var e=MFNamespace("MFWA.MFWA");var q=MFNamespace("MFWA.Utils");var d=MFNamespace("MFWA.Dialogs.PermissionChangesPrompt");var f=MFNamespace("MFWA.Model");var c=MFNamespace("MFWA.Enumerations");var g=MFNamespace("MFWA.Validator");var j=function(t,z){var v={};for(var s in t){var y=t[s];v[y.PropertyDef]=y}for(var s in z.AssociatedPropertyDefs){var w=z.AssociatedPropertyDefs[s];if(w.PropertyDef!=0&&w.PropertyDef!=1108&&w.PropertyDef!=1106){var x=v[37];if(x&&x.TypedValue&&x.TypedValue.Value){continue}}if(!w.Required){continue}if(!h.shownInProperties(w.PropertyDef)||!h.usedInCreation(w.PropertyDef)){continue}if(!v[w.PropertyDef]){continue}if(v[w.PropertyDef].IsAutomatic){continue}var u=v[w.PropertyDef].TypedValue;if(!q.typedValueExists(u)){return w}}return null};var a=function(w){for(var v in w.Properties){if(w.Properties[v].PropertyDef==c.MFBuiltInPropertyDef.AssignedTo){for(var u in w.Properties){if(w.Properties[u].PropertyDef==c.MFBuiltInPropertyDef.CompletedBy){var y=w.Properties[v].TypedValue.Lookups;var x=w.Properties[u].TypedValue.Lookups;if(y&&x){for(var t=0;t<y.length;t++){for(var s=0;s<x.length;s++){if(y[t]&&x[s]){if(y[t].Item==x[s].Item){y.splice(t,1);t--}}}}}}}}}};var p=function(t,s,u){if(u&&t.VisibleAfterOperation){u(t)}else{if(u){u(null)}}s.close()};var k=function(w,x,s,u,t,v){if(t){if(w.ThisVersionLatestToThisUser){o.setProperties(w,u.Properties,function(y){o.setNACL(y.ObjectVersion.ObjVer,v,u.AccessControlList,function(z){p(z,s,x)})})}else{o.setNACL(w.ObjVer,v,u.AccessControlList,function(y){p(y,s,x)})}}else{o.setProperties(w,u.Properties,function(y){o.setNACL(y.ObjectVersion.ObjVer,false,u.AccessControlList,function(z){p(z,s,x)})})}};var b=function(t,u){var s="";r.getNACL(t.ObjVer.Type,t.ObjVer.ID,t.ObjVer.Version,function(v){s=v});return function(v){var w=v.window;var y=v.result;y.propertiesByID=[];for(var x in y.Properties){y.Properties[x]={PropertyDef:y.Properties[x].PropertyDef,TypedValue:y.Properties[x].TypedValue};y.propertiesByID[y.Properties[x].PropertyDef]=y.Properties[x]}if(t.ObjVer.Type==c.MFBuiltInObjectType.Assignment){a(y)}if(!f.view.get().objectHistory||(t.ThisVersionLatestToThisUser&&s.ID==y.AccessControlList.ID)){k(t,u,w,y,false,false)}else{d.prompt(function(z){if(!z){return true}else{var A=(z=="allversions")?true:false;k(t,u,w,y,true,A);return true}})}return false}};var i=function(t){for(var s in t){var u=t[s];if(u.TypedValue&&u.TypedValue.DisplayValue&&u.TypedValue.DisplayValue.length>0){switch(u.TypedValue.DataType){case c.MFDataType.Floating:if(!g.isSignedRealNumber(u.TypedValue.DisplayValue)){return t[s]}break;case c.MFDataType.Integer:if(!g.isSignedNumber(u.TypedValue.DisplayValue)){return t[s]}break;break}}}return null};return{removeAssignedTo:a,validateProperties:i,getMissingProperty:j,editObject:function(s,t){r.getObjectType(s.ObjVer.Type,function(u){n.ShowEditObjectWindow({objectVersion:s,objType:u},b(s,t))})}}});MFNamespace("MFWA.Notifications",function(c){var g=$('<div class="notification-title" style="position:relative;">').css({"font-weight":"bold","margin-bottom":10});var e=$('<div class="notification-content" style="position:relative;">');var b=$('<div class="notification ui-state-highlight">').css({position:"absolute",right:20,bottom:20,background:"white","z-index":99999,padding:10}).hide().append(g,e);var a=[];var f=false;var d=function(){if(a.length==0){return}g.empty();e.empty();var h=a[0];g.append(h.title);e.append(h.content);b.fadeIn("slow",function(){setTimeout(function(){b.fadeOut("slow",function(){a.pop();d()})},5000)})};return{queue:function(i,h){if(!f){$("body").append(b);f=true}a.push({title:i,content:h});if(a.length==1){d()}}}});MFNamespace("MFWA.Dialogs.DocumentCard.Filters",function(){var a=MFNamespace("MFWA.Enumerations");return{includedFromTemplate:function(b){if((b!=0&&b!=22&&b!=26&&b!=a.MFBuiltInPropertyDef.Workflow&&b!=39&&b!=37&&b!=a.MFBuiltInPropertyDef.CreatedBy&&b!=a.MFBuiltInPropertyDef.LastModified&&b!=a.MFBuiltInPropertyDef.LastModifiedBy&&b!=a.MFBuiltInPropertyDef.Created)){return false}return true},requiredPropertyForHiddenOrDeletedClass:function(b){if(b==0||b==20||b==21||b==23||b==25){return true}return false},shownInProperties:function(b){if(b<1000&&b>21&&b!=23&&b!=25&&b!=26&&b!=29&&b!=34&&b!=33&&b!=87&&b!=86&&b!=36&&b!=37&&(b<41||b>47)){return false}return true},isAdditionalProperty:function(b){if(b<1000&&b!=34&&b!=86&&b!=36&&b!=37){return false}return true},isReadOnlyProperty:function(b){if(b==20||b==21||b==23||b==25){return true}return false},usedInCreation:function(b){if(b==0||b==100||b==20||b==21||b==22||b==33||b==34||b==36||b==37||b==87||b==41||b==42||b==43||b==44||b==45||b==46||b==47||b==75||b==77||b==78||b>=1000){return true}return false},showInPropertiesPane:function(b){if(b>999||b==26||b==34||b==35||b==37||b==41||b==42||b==44||b==87||b==86||b==45||b==46||b==47){return true}else{return false}},visibleView:function(b){if(b==a.MFBuiltInView.ByID||b==a.MFBuiltInView.BuiltIn){return false}return true}}});MFNamespace("MFWA.Dialogs.Templates",function(){var a=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.I18n");var d=MFNamespace("MFWA.I18n.DocumentCard");var b=MFNamespace("MFWA.I18n.Upload");var c=MFNamespace("MFWA.Configurations");return{createDocumentCard:function(){var T=$('<div id="doccard" class="documentcard"/>');var s=$('<div class="doccard_top" />');var o=a.unique("doccard");var p=$('<label for="'+o+'">'+d.Class+"</label>");var O=$('<select id="'+o+'" class="doccard_class" />');s.append($('<div class="doccard_class" />').append($('<div class="label_group">').append(p)).append($('<div class="wrap" />').append(O)));var B=a.unique("doccard");var W=a.unique("doccard");var H=a.unique("doccard");var L=$('<input type="checkbox" id="'+W+'" name="'+B+'" value="template" />');var I=$('<label for="'+W+'">'+d.UseTemplate+"</label>");var Q=$('<input type="radio" id="'+H+'" name="'+B+'" value="template" />');var g=$('<label for="'+H+'">'+d.UseTemplate+"</label>");var i=$('<select class="doccard_template" />');L.click(function(){if(L.is(":checked")){i.attr("disabled",false)}else{i.attr("disabled",true)}});var D=$('<div class="label_group" id="template_radio_label">').append(Q).append(g);var r=$('<div class="label_group" id="template_checkbox_label">').append(L).append(I);var F=$('<div class="doccard_template" />').append(D).append(r).append($('<div class="wrap">').append(i));s.append(F);var C=a.unique("doccard");var R=$('<input type="radio" id="'+C+'" name="'+B+'" value="mfd" />');var h=$('<label for="'+C+'">'+d.CreateEmptyMFD+"</label>");var G=$('<div class="doccard_emptyMFD">').append($('<div class="label_group">').append(R).append(h));s.append(G);var P=a.unique("doccard");var t=$('<input type="radio" id="'+P+'" name="'+B+'" value="sfd" />');var y=$('<label for="'+P+'">'+d.CreateEmptySFD+"</label>");$([]).add(Q).add(t).add(R).click(function(){i.attr("disabled",this!==Q[0])});var k=$('<div class="doccard_emptySFD">').append($('<div class="label_group">').append(t).append(y));s.append(k);var q=$('<div class="doccard_properties_label">'+d.Properties+"</div>");var u=$('<table class="doccard_middle" style="table-layout:fixed;" />');var M=$('<div class="doccard_middle" />').append(u);var j=$('<div class="doccard_bottom">');var x=$('<button class="doccard_relationships">'+d.Relationships+"</button>");var S=$('<button class="doccard_moreProperties">'+d.MoreProperties+"</button>");j.append($('<div class="doccard_buttons" />').append(x).append(S));var f=$("<label>"+d.Permissions+"</label>");var l=$('<select class="doccard_permissions" />');var E=$('<div class="doccard_permissions" />').append($('<div class="label_group">').append(f)).append($('<div class="wrap" />').append(l));j.append(E);var X=$("<label>"+d.Workflow+"</label>");var w=$('<select class="doccard_wf" />');var z=$('<div class="doccard_wf" />').append($('<div class="label_group">').append(X)).append($('<div class="wrap" />').append(w));j.append(z);var V=a.unique("doccard");var A=$('<input type="checkbox" checked="true" id="'+V+'">');var U=$('<label for="'+V+'">'+d.OpenForEditing+"</label>");var v=$('<div class="left" />').append(A).append(U);var m=a.unique("doccard");var N=$('<input type="checkbox" id="'+m+'">');var n=$('<label for="'+m+'">'+d.CheckInImmediately+"</label>");N.click(function(){if(A.is(":checked")&&N.is(":checked")){A.attr("checked",false)}});A.click(function(){if(A.is(":checked")&&N.is(":checked")){N.attr("checked",false)}});var K=$('<div class="right" />').append(N).append(n);var J=$('<div class="doccard_checkboxes">').append(v).append(K);j.append(J);T.append(s,q,M,j);return{documentcard:T,top:s,middle:M,bottom:j,middleContent:u,classSelect:O,templateSelect:i,radioGroupName:B,templateRadio:Q,templateCheck:L,templateRadioLabelGroup:D,templateCheckLabelGroup:r,sfdRadio:t,mfdRadio:R,relationships:x,moreProperties:S,checkInCheck:N,openCheck:A,permissions:l,workflow:w,groups:{template:F,sfd:k,mfd:G,relationships:x,permissions:E,workflow:z,open:v,checkIn:K,checkboxes:J}}},createMorePropertiesWindow:function(){var j=a.unique("doccard");var f=$('<select size="9" id="'+j+'" class="more_properties" />');var h=$("<button>"+e.Add+"</button>");var g=$("<button>"+e.Close+"</button>");f.dblclick(function(){if(f.find("option:selected").length){h.click()}});var i=$('<div class="more_properties"/>');i.append(f,g,h);return{window:i,list:f,add:h,close:g}},createReportsWindow:function(){var f=$('<div class="documentcard"/>');var g=$("<div>"+e.Alerts.DotNetRequiredForReporting+"</div>").css({"margin-bottom":"20px","margin-top":"10px","font-weight":"bold",display:"none"});f.append(g);return{window:f,dotNetWarning:g,jqReports:f}},createUploadDialog:function(){var g=$("<div>"+b.Help+"</div>");var i=$('<iframe frameBorder="0" Scrolling="no" src="UploadFrame.aspx">').css({width:"100%",height:60});var f=$('<ul style="height:150px;overflow:auto;"/>');var h=$('<div class="upload"/>').append(g,i,f);return{dialog:h,upload:i,fileList:f}},createUploadFileItem:function(j,f){var l=$("<div>");var i=j.title;if(j.extension&&j.extension!=""){i+="."+j.extension}var h=i+" ("+a.formatSize(j.size)+")";l.append(h);var g=$("<button>"+b.Remove+"</button>");var k=$("<li>").append(l,g);g.click(function(){k.remove();if(f){f()}});return k},createCommentsDialog:function(){var h=$('<div class="commentsDialog"/>');var i=$('<div id="commentArea"/>');var k=$('<div class="commentHeader"/>');var f=$("<textarea/>");i.append(k);i.append(f);h.append(i);var g=$('<div id="commentHistoryArea"/>');var j=$('<div id="commentHistory"/>');g.append('<div class="commentHeader">'+e.CommentsDialog.CommentHistory+"</div>");g.append(j);h.append(g);return{commentsDialog:h,newComment:f,newCommentArea:i,newCommentHeader:k,commentHistory:j,commentHistoryArea:g}},createChangePasswordDialog:function(){var f=$('<div class="changePassword"/>');var g=$('<input type="password" class="passwordField">');f.append($('<div class="changePasswordText">'+e.ChangePasswordDialog.OldPassword+"</div>"));f.append(g);var h=$('<input type="password" class="passwordField">');f.append($('<div class="changePasswordText">'+e.ChangePasswordDialog.NewPassword+"</div>"));f.append(h);var i=$('<input type="password" class="passwordField">');f.append($('<div class="changePasswordText">'+e.ChangePasswordDialog.NewPassword2+"</div>"));f.append(i);return{changePasswordDialog:f,oldPassword:g,newPassword:h,newPassword2:i}},createWorkflowDialog:function(){var j=$('<div class="workflowDialog"/>');var g=$('<div id="workflowArea"/>');var i=$('<div class="workflowHeader"/>');var o=$('<select id="workflow" onChange="MFNamespace(\'MFWA.Dialogs.Workflow\').updateStates();" />');g.append(i);g.append(o);var l=$('<div id="stateArea"/>');var k=$('<div class="workflowHeader"/>');var h=$('<select id="state"/>');l.append(k);l.append(h);var n=$('<div id="commentArea"/>');var f=$('<div class="workflowHeader"/>');var m=$('<textarea id="comment"/>');n.append(f);n.append(m);j.append(g);j.append(l);j.append(n);return{workflowDialog:j,workflowHeader:i,workflow:o,stateHeader:k,state:h,commentHeader:f,comment:m}},createErrorDialog:function(){var n=$('<div class="errorDialog"/>');var k=$('<div class="errorContextArea"/>');var h=$('<div class="shortErrorArea"/>');var m=$('<div class="openLongErrorArea">'+e.ErrorDialog.DetailsButton+"</div>");var f=$('<div class="longErrorDescription">'+e.ErrorDialog.DetailsText+"</div>");var j=$('<div class="longErrorArea"/>');var i=$('<div class="copyToClipboardContainer"></div>');var l=$("<button>"+e.ErrorDialog.CopyToClipboard+"</button>");var g=$('<div style="height:40px;"/>');n.append(k);n.append(h);n.append(m);if((window.clipboardData&&window.clipboardData.setData)||(MFWA.MFWA.getAppletInitialized())){n.append(i.append(l))}n.append(f);n.append(j);n.append(g);m.click(function(){f.toggle();j.toggle();i.toggle()});l.click(function(){if(window.clipboardData&&window.clipboardData.setData){var o=j.html();o=a.replaceAll(o,"<div>","");o=a.replaceAll(o,"</div>","");o=a.replaceAll(o,"<DIV>","");o=a.replaceAll(o,"</DIV>","");window.clipboardData.setData("text",o)}else{if(MFWA.MFWA.getAppletInitialized()){var o=j.html();o=a.replaceAll(o,"<div>","");o=a.replaceAll(o,"</div>","");o=a.replaceAll(o,"<DIV>","");o=a.replaceAll(o,"</DIV>","");MFWA.Java.setTextInClipboard(o,function(){},function(){})}}});return{errorDialog:n,errorContextArea:k,shortErrorArea:h,openLongErrorArea:m,longErrorArea:j,longErrorDescription:f,emptyArea:g}}}});MFNamespace("MFWA.Dialogs.Alerts",function(c){var a=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.I18n.Alerts");var b=MFNamespace("MFWA.Data.Cache");var d=MFNamespace("MFWA.Dialogs.Error");var f=MFNamespace("MFWA.Enumerations");return{RequiredPropertyMissing:function(g){b.getPropertyDef(g,function(h){c.ShowError(a.format(e.RequiredPropertyMissing,a.escape(h.Name)))})},TypeMismatchWarning:function(h,g){b.getPropertyDef(h,function(j){var i="";switch(g){case f.MFDataType.Floating:i=e.TypeMismatchFloat;break;case f.MFDataType.Integer:i=e.TypeMismatchNumber;break;case f.MFDataType.MultiLineText:case f.MFDataType.Text:i=e.ScriptEntryNotAllowed;break}c.ShowError(a.format(i,a.escape(j.Name)))})},PropertyValueNotFound:function(h,g){c.ShowError({Message:a.format(e.PropertyValueNotFound,a.escape(h)),Stack:g})},SelectOwnerPropertyFirst:function(g){b.getPropertyDef(g,function(h){c.ShowError(a.format(e.OwnerPropertyNotSelected,a.escape(h.Name)))})},CantAddNewValue:function(){c.ShowError(e.CantAddNewValue)},CantAddNewValueNotAllowed:function(){c.ShowError(e.CantAddNewValueNotAllowed)},CantAddNewValueAccessDenied:function(){c.ShowError(e.CantAddNewValueAccessDenied)},ShowError:function(g){if(typeof g=="string"){g={message:g}}else{g={stack:g.Stack,message:g.Message}}d.show(g)},ShowNotification:function(i,j,g,h){d.show({message:i,isNotification:true},j,g,h)}}});MFNamespace("MFWA.Dialogs.Error",function(){var i=MFNamespace("MFWA.I18n");var c=MFNamespace("MFWA.Window");var e=MFNamespace("MFWA.Pooling");var f=MFNamespace("MFWA.Dialogs.Templates");var g=MFNamespace("MFWA.Utils");var h=MFNamespace("MFWA.Icons");function d(l){var m=l.substr(l.length-5,l.length-2);var k=parseInt(m);if(isFinite(k)==true){var j=l.substr(0,k);var n=l.substring(k,l.length-6);return{message:j,stack:n}}else{return{message:l,stack:null}}}function b(){return e.get("ErrorDialog",function(){var k=f.createErrorDialog();var j={jq:k,jqNode:k.errorDialog,resize:function(){},initialize:function(q){q=$.extend({},a,q);q.title=i.Prompt.Title+" "+i.WebAccessVersion;var l=q.context;if(l){k.errorContextArea.append(l)}var m=q.message;if(m){k.shortErrorArea.append(m)}if(q.stack||q.rawstack){var p=(q.stack||q.rawstack);p=p.replace(/\r/g,"");var o=p.split("\n");for(var n in o){if(o[n]!=""){if(q.stack){k.longErrorArea.append("<div>"+g.escape(o[n])+"\r\n</div>")}else{k.longErrorArea.append("<div>"+o[n]+"\r\n</div>")}}}}else{k.openLongErrorArea.remove();k.longErrorArea.remove();k.longErrorDescription.remove();k.emptyArea.remove()}return q}};return j})}var a={title:i.ErrorDialog.Title,context:"",stack:"",icon:null};return{show:function(j,m,s,p){var l=b();var j=l.initialize(j);var n=(j.stack||j.rawstack);var o="";var k;if(p){k=p}else{k=550}var t=false;var q=["center","center"];var r="error";if(n){o=h.Dialog.Warning;q=["center",100]}else{if(j.isNotification){o=h.Dialog.Information;r="notification"}else{o=h.Dialog.Warning;r="warning"}}return c.show(j.title,l,{width:k,nowidth:t,noheight:true,position:q,type:r,image:o,resizable:false,ok:function(u){if($("#okButtonPressed").length>0){$("#okButtonPressed").val("false")}if(m){return m(u)}else{return true}},beforeClose:s,buttons:{ok:true,cancel:false}})},extractMessages:d}});MFNamespace("MFWA.Window",function(){var j=MFNamespace("MFWA.I18n");var h=MFNamespace("MFWA.Utils");var a=MFNamespace("MFWA.Debug.Assert");var d={minwidth:200,minheight:150,maxwidth:null,maxheight:null,width:null,height:null,noheight:false,nowidth:false,resizable:false,ok:null,cancel:null,beforeClose:null,noJqPages:false,buttons:{ok:true,cancel:true},position:"center",gradient:false};var c=0;var i=null;var f=new Array();var g={};var e=function(k){return function(){var l=$(this);var m;if(k){m=k()}l.blur();return m}};var b=function(){if(f.length>0){return f.pop()}else{var o=new Array();var n=false;var u=$('<div class="window" title="No title"></div>');var s=$('<div class="window_buttons" />');var k=$('<button class="window_ok" >'+j.OK+"</button>");var p=$('<button class="window_cancel">'+j.Cancel+"</button>");s.append(k,p);var l=$('<div class="window_pages"></div>');u.append(l,s);u.hide();var t=function(w){for(var v=0;v<o.length;v++){o[v].resize({width:w.width-25,height:w.height-50})}};var r={};var q={id:h.unique("window"),noJqPages:false,show:function(z,x,y){o.push(x);y=$.extend({},d,y);u.dialog("option","minWidth",y.minwidth);u.dialog("option","minHeight",y.minheight);u.dialog("option","maxHeight",y.maxheight);u.dialog("option","maxWidth",y.maxwidth);var v=y.height||y.minheight||150;var w=y.width||y.minwidth||200;if(y.noheight==false){u.dialog("option","height",v);u.height(v-50)}else{u.dialog("option","height","auto")}if(u.dialog("option","resizable")!=y.resizable){u.dialog("option","resizable",y.resizable)}r={ok:y.ok,cancel:y.cancel,beforeClose:y.beforeClose,cancelCleanup:y.cancelCleanup};if(y.buttons){k.toggle(!!y.buttons.ok);p.toggle(!!y.buttons.cancel)}if(y.gradient){u.dialog("option","dialogClass","dialog-gradient")}else{u.dialog("option","dialogClass","")}t({width:w,height:v});u.dialog("option","title",z);l.empty();if(y.image){l.append("<img src='"+y.image+"' style='float:left;'/>");if(y.type&&y.type=="warning"){u.css({"min-height":"80px","max-width":"600px"});x.jq.errorDialog.css("float","left");x.jq.shortErrorArea.css({width:y.width-90,"padding-bottom":"30px"})}else{if(y.type&&y.width&&y.type=="error"){x.jq.shortErrorArea.css({width:y.width-90})}}}l.append(x.jqNode);if(y.nowidth==false){u.dialog("option","width",w);u.width(w-30)}else{u.dialog("option","width","auto")}u.dialog("option","position",y.position);u.dialog("open");n=true;c+=1;if(i){i(c)}},close:function(){if(!n&&!this.noJqPages){return}n=false;o=new Array();u.dialog("close");if(!this.noJqPages){l.empty()}},cancelButtonPressed:false,preventDoubleSubmit:false};u.dialog({modal:true,closeOnEscape:true,bgiframe:false,open:function(v,w){if($("#okButtonPressed").length>0){$("#okButtonPressed").val("false")}},resize:function(v,w){t(w.size)},resizeStop:function(v,w){u.dialog("option","width",w.size.width);u.dialog("option","height",w.size.height);u.width(w.size.width-30);u.height(w.size.height-50);t(w.size)},beforeclose:function(v,w){if($("#okButtonPressed").length>0&&$("#okButtonPressed").val()=="true"){return true}else{if(q.beforeClose){return q.beforeClose()}}},close:function(){c-=1;if(i){i(c)}f.push(q);if($("#okButtonPressed").length==0||$("#okButtonPressed").val()!="true"){if(r.cancelCleanup){var v=m(q);r.cancelCleanup(v)}}}});var m=function(v){return{close:function(){if(v){v.close()}},invalidate:function(){v=null},id:v.id}};q.ok=function(){if(q.preventDoubleSubmit==true){return}if($("#okButtonPressed").length==0){$("#listing").append("<input type='hidden' id='okButtonPressed'></input>")}$("#okButtonPressed").val("true");setTimeout(function(){q.preventDoubleSubmit=false},1000);if(!r.ok){q.close()}var v=m(q);if(r.ok(v)!==false){v.invalidate();q.close()}};q.beforeClose=function(){if(r.beforeClose){return r.beforeClose()}};q.cancel=function(){if(q.cancelButtonPressed==true){return}q.cancelButtonPressed=true;setTimeout(function(){q.cancelButtonPressed=false},500);if(!r.cancel){q.close()}var v=m(q);if(r.cancel(v)!==false){v.invalidate();q.close()}};k.click(e(q.ok));p.click(e(q.cancel));g[q.id]=q;return q}};return{init:function(k){i=k},show:function(n,l,m){var k=b();k.show(n,l,m);return k},close:function(k){g[k].close()},windowShown:function(){c+=1;if(i){i(c)}},windowHidden:function(){c-=1;if(c<0){a.fail("Negative amount of windows open.")}if(i){i(c)}}}});MFNamespace("MFWA.Dialogs.Prompt",function(h){var e=MFNamespace("MFWA.Pooling");var i=MFNamespace("MFWA.I18n");var c=MFNamespace("MFWA.Window");var g=MFNamespace("MFWA.Utils");var d=MFNamespace("MFWA.Dialog.Alerts");var f=MFNamespace("MFWA.Configurations");var b=function(o){var p="empty";var j=null;var m=$('<div class="prompt"><div class="title"></div><input type="text" class="prompt"><a class="clipBoard" href="#">'+i.ErrorDialog.CopyToClipboard+'</a><div class="buttons"><button class="cancel">'+i.Cancel+'</button><button class="ok">'+i.OK+"</button></div></div>");var s=m.children("div.title");var t=m.children("input.prompt");var n=m.find("a");var r=m.find("button.ok");var u=m.find("button.cancel");var l={window:m,title:s,input:t,ok:r,cancel:u,copyToClipboardLink:n};l.window.dialog({bgiframe:false,modal:true,closeOnEscape:true,resizable:false});var v=null;var k=function(){if(v!=null&&p(v,q)===false){v=null;return false}if(!v&&j){j()}c.windowHidden();v=null;o.dispose();return true};l.window.bind("dialogbeforeclose",k);l.cancel.click(function(){v=null;if(j){j()}l.window.dialog("close")});l.ok.click(function(){v=l.input.val();if(v.length==0){MFWA.Dialogs.Alerts.ShowNotification(i.Alerts.CannotBeEmpty)}l.window.dialog("close")});var q={jq:l,show:function(x,w){p=x;j=w;v=null;l.window.dialog("open");c.windowShown()},close:function(w){v=null;if(w){w()}l.window.dialog("close")},initialize:function(w){l.window.dialog("option","title",w.title);l.title.html(w.message);l.ok.toggle(w.ok);l.cancel.toggle(w.cancel);l.input.val(w.value);l.input.attr("title",w.value);l.input.select();l.input.focus();if(w.showCopyToClipboard&&((window.clipboardData&&window.clipboardData.setData)||(MFWA.MFWA.getAppletInitialized()))){l.copyToClipboardLink.click(function(){if(window.clipboardData&&window.clipboardData.setData){window.clipboardData.setData("text",w.value);l.input.select()}else{if(MFWA.MFWA.getAppletInitialized()){MFWA.Java.setTextInClipboard(w.value,function(){l.input.select()},function(){})}}})}else{l.copyToClipboardLink.remove()}}};return q};var a={title:i.Prompt.Title,message:i.Prompt.Message,ok:true,cancel:true,value:""};return{prompt:function(m,n,j){var k=e.get("Prompt",b);if(typeof m=="string"){var l=m;m=a;m.message=l}else{m=$.extend({},a,m)}k.initialize(m);k.show(n,j)}}});MFNamespace("MFWA.Dialogs.CheckOutPrompt",function(c){var d=MFNamespace("MFWA.Pooling");var f=MFNamespace("MFWA.I18n");var a=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.Window");var b=function(o){var l="empty";var j=$('<div class="promptWindow"><div class="promptText namePrompt"></div><table class="buttons"><tr><td><button class="checkout">'+f.CheckOutPrompt.CheckOutButton+'</button></td><td><button class="readonly">'+f.CheckOutPrompt.ReadOnlyButton+'</button></td><td><button class="cancel">'+f.Cancel+"</button></td></tr></table></div>");var k=j.find("button.checkout");var m=j.find("button.readonly");var n=j.find("button.cancel");var i={window:j,checkout:k,readonly:m,cancel:n};var g="M-Files";i.window.dialog({bgiframe:false,modal:true,title:g,resizable:false,width:420});var p=null;var h=function(){if(!l(p)){p=null;return false}e.windowHidden();p=null;o.dispose();return true};i.window.bind("dialogbeforeclose",h);i.cancel.click(function(){i.window.dialog("close")});i.readonly.click(function(){p="readonly";i.window.dialog("close")});i.checkout.click(function(){p="checkout";i.window.dialog("close")});return{jq:i,show:function(q){l=q;p=null;i.window.dialog("open");e.windowShown()},initialize:function(q){if(q.ThisVersionLatestToThisUser==false){k.hide();m.html(f.OK);var r=q.Title;if(q.SingleFile&&q.Files[0].Extension){r+="."+q.Files[0].Extension}j.find("div.namePrompt").html(a.format(f.CheckOutPrompt.OlderVersionPromptText,a.escape(r)).replace(/\n\n/g," "))}else{k.show();m.html(f.CheckOutPrompt.ReadOnlyButton);j.find("div.namePrompt").html(a.format(f.CheckOutPrompt.PromptText,a.escape(q.Title)).replace(/\n\n/g," "))}}}};return{prompt:function(h,i){var g=d.get("CheckOutPrompt",b);g.initialize(h);g.show(i)}}});MFNamespace("MFWA.Dialogs.DiscardChangesPrompt",function(c){var d=MFNamespace("MFWA.Pooling");var g=MFNamespace("MFWA.I18n");var a=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.Window");var f=MFNamespace("MFWA.StringBuilder");var b=function(k){var o="empty";var j=$('<div class="promptWindow"><div class="promptText namePrompt"></div><table class="buttons"><td><button class="discardchanges">'+g.DiscardChangesPrompt.DiscardChangesButton+'</button></td><td><button class="continueediting">'+g.DiscardChangesPrompt.ContinueEditingButton+"</button></td></tr></table></div>");j.attr("isDiscardChange","true");var i=j.find("button.discardchanges");var m=j.find("button.continueediting");var n={window:j,discardchanges:i,continueediting:m};n.window.dialog({bgiframe:false,modal:true,title:g.DiscardChangesPrompt.Title,resizable:false,width:330});var h=null;var l=function(){if(!o(h)){h=null;return false}e.windowHidden();h=null;k.dispose();return true};n.window.bind("dialogbeforeclose",l);n.continueediting.click(function(){h="continueediting";n.window.dialog("close")});n.discardchanges.click(function(){h="discardchanges";n.window.dialog("close")});return{jq:n,show:function(p){o=p;h=null;n.window.dialog("open");e.windowShown()},initialize:function(q){var p=new f.StringBuilder(g.DiscardChangesPrompt.PromptText.length);p.append(g.DiscardChangesPrompt.PromptText);p.append("<br><br>");p.append(g.DiscardChangesPrompt.ConfirmationText);p.append("<br><br>");j.find("div.namePrompt").html(a.format(p.toString(),a.escape(q)).replace(/\n\n/g," "))}}};return{prompt:function(j,i){var h=d.get("DiscardChangesPrompt",b);h.initialize(j);h.show(i)}}});MFNamespace("MFWA.Dialogs.PermissionChangesPrompt",function(c){var d=MFNamespace("MFWA.Pooling");var f=MFNamespace("MFWA.I18n");var a=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.Window");var b=function(n){var k="empty";var j=$('<div class="promptWindow"><div class="promptText namePrompt"></div><table class="buttons"><tr><td><button class="allversions">'+f.PermissionChangesPrompt.AllVersionsButton+'</button></td><td><button class="currentversion">'+f.PermissionChangesPrompt.CurrentVersionButton+'</button></td><td><button class="cancel">'+f.Cancel+"</button></td></tr></table></div>");var l=j.find("button.allversions");var p=j.find("button.currentversion");var m=j.find("button.cancel");var i={window:j,allversions:l,currentversion:p,cancel:m};var g="M-Files";i.window.dialog({bgiframe:false,modal:true,title:g,resizable:false,width:420});var o=null;var h=function(){if(!k(o)){o=null;return false}e.windowHidden();o=null;n.dispose();return true};i.window.bind("dialogbeforeclose",h);i.cancel.click(function(){i.window.dialog("close")});i.allversions.click(function(){o="allversions";i.window.dialog("close")});i.currentversion.click(function(){o="currentversion";i.window.dialog("close")});return{jq:i,show:function(q){k=q;o=null;i.window.dialog("open");e.windowShown()},initialize:function(){j.find("div.namePrompt").html(a.escape(f.PermissionChangesPrompt.PromptText).replace(/\n\n/g," "))}}};return{prompt:function(h){var g=d.get("PermissionChangesPrompt",b);g.initialize();g.show(h)}}});MFNamespace("MFWA.Dialogs.LogoutPrompt",function(i){var f=MFNamespace("MFWA.Pooling");var j=MFNamespace("MFWA.I18n");var g=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.Window");var a=MFNamespace("MFWA.Data.Cache");var h=MFNamespace("MFWA.Icons");var c=MFNamespace("MFWA.Data.GlobalObjects");var b=false;var d=function(u){var n=c.getVaultInfo().Name;var q="empty";var p=$('<div class="promptWindow"><table class="buttons"><tr><td><img src="'+h.Dialog.Information+'" style="float:left;"></td><td><div class="promptText namePrompt"></div></td></table><table class="buttons"><tr><td><button class="ok">'+j.OK+'</button></td><td><button class="cancel">'+j.Cancel+"</button></td>"+(b?('<td><button class="show">'+j.Settings.Show+"</button></td>"):"")+"</tr></table></div>");var r=p.find("button.ok");var t=p.find("button.cancel");var s=p.find("button.show");var o=p.find("button.promptText");var m={window:p,ok:r,cancel:t,show:s,promptText:o};var k=j.LogoutPrompt.DialogTitle+' "'+n+' "';m.window.dialog({bgiframe:false,modal:true,title:k,resizable:false,width:b?420:280});var v=null;var l=function(){if(!q(v)){v=null;return false}e.windowHidden();v=null;u.dispose();return true};m.window.bind("dialogbeforeclose",l);m.show.click(function(){v="show";m.window.dialog("close")});m.ok.click(function(){v="ok";m.window.dialog("close")});m.cancel.click(function(){m.window.dialog("close")});return{jq:m,show:function(w){q=w;v=null;m.window.dialog("open");e.windowShown()},initialize:function(y){var w=y.toString();var x;if(y==1){x=j.LogoutPrompt.Msg_Singular_ObjCheckedOut}else{x=g.format(j.LogoutPrompt.Msg_Plural_ObjsCheckedOut,g.escape(w))}p.find("div.namePrompt").html(g.escape(x).replace(/\n\n/g," "))}}};return{prompt:function(k,l){a.getGotoItems(null,function(m){b=false;for(var o in m){var p=m[o];if(p.TargetPath=="/V5"){b=true;break}}var n=f.get("LogoutPrompt",d);n.initialize(k);n.show(l)})}}});MFNamespace("MFWA.Dialogs.Confirm",function(a){var c=MFNamespace("MFWA.Pooling");var e=MFNamespace("MFWA.I18n");var d=MFNamespace("MFWA.Window");var f=function(j){var k="empty";var i=$('<div class="Confirm"><div class="message"></div><div class="buttons"><button class="ok">'+e.Yes+'</button><button class="cancel">'+e.No+"</button></div></div>");var l=i.find("button.ok");var m=i.find("button.cancel");var n=i.children("div.message");var h={window:i,message:n,ok:l,cancel:m};h.window.dialog({modal:true,closeOnEscape:true,width:350,resizable:false,bgiframe:false});var o=null;var g=function(){if(k(o)===false){o=null;return false}d.windowHidden();o=null;j.dispose();return true};h.window.bind("dialogbeforeclose",g);h.cancel.click(function(){o=false;h.window.dialog("close")});h.ok.click(function(){o=true;h.window.dialog("close")});return{jq:h,show:function(p){k=p;o=null;h.window.dialog("open");d.windowShown()},initialize:function(p){h.window.dialog("option","title",p.title);h.message.html(p.message);h.ok.toggle(p.ok);h.cancel.toggle(p.cancel)}}};var b={ok:true,cancel:true};return{prompt:function(h,i){var g=c.get("Confirm",f);h=$.extend({},b,h);g.initialize(h);g.show(i)}}});MFNamespace("MFWA.Dialogs.DocumentCard",function(I){var g=MFNamespace("MFWA.Utils"),B=MFNamespace("MFWA.Debug.Assert"),L=MFNamespace("MFWA.Nulls"),s=MFNamespace("MFWA.Debug"),C=MFNamespace("MFWA.Dialog.Alerts"),d=MFNamespace("MFWA.Model"),M=MFNamespace("MFWA.I18n"),x=MFNamespace("MFWA.I18n.DocumentCard"),J=MFNamespace("MFWA.Data.Cache"),F=MFNamespace("MFWA.Pooling"),f=MFNamespace("MFWA.Enumerations"),u=MFNamespace("MFWA.Window"),c=MFNamespace("MFWA.Dialogs.Templates"),h=MFNamespace("MFWA.Dialogs.DocumentCard.MoreProperties"),p=MFNamespace("MFWA.Dialogs.DocumentCard.Filters"),k=MFNamespace("MFWA.Dialogs.DiscardChangesPrompt"),K=MFNamespace("MFWA.Icons"),a=MFNamespace("MFWA.Handlers"),o=MFNamespace("MFWA.Configurations"),A=MFNamespace("MFWA.Data.GlobalObjects");viewItem=MFNamespace("MFWA.ViewItem");var H=null;var w=null;var r=false;var v=null;var E=null;var z=false;var l=null;var n=function(){return F.get("DocumentCard",function(){J.getUserID(function(al){v=al.Value;J.getValueListItems(f.MFBuiltInValueList.Users,function(am){for(var an=0;an<am.length;++an){if(al.Value==am[an].ID){E=am[an].Name;break}}})});r=false;w=null;H=null;l=A.getObjectByTypes();var ag,ak=c.createDocumentCard(),af,ah,N=0,W=0;var ai=function(an,ao,al){B.doesNotHaveValue(ag.propertiesByID,an.PropertyDef,"The property already exists in the datamodel.");var am=I.PropertyDef.create(an,ao);return aa(am,al)};var aa=function(am,al){B.doesNotHaveValue(ag.propertiesByID,am.PropertyID,"The property already exists in the datamodel.");ag.properties.push(am);ag.propertiesByID[am.PropertyID]=am;if(!al){aj(am)}return am};var aj=function(al){B.hasValue(ag.propertiesByID,al.PropertyID,"The property does not exist in the datamodel.");if(al.jq){if(I.Filters.isReadOnlyProperty(al.PropertyID)){ak.middleContent.append(al.jq);if(!af){af=al.jq}}else{if(af){af.before(al.jq)}else{ak.middleContent.append(al.jq)}}}};var X=function(an,al){if(typeof(an)=="object"){for(var am=0;am<ag.properties.length;am++){if(ag.properties[am]==an){an=am}}}if(typeof(an)=="number"){var ao=ag.properties[an];if(ao.boundProperty){ao.boundProperty.Observers[ao.PropertyID]=null}ag.properties.splice(an,1);ag.propertiesByID[ao.PropertyID]=null;if(ao.jq){ao.jq.remove()}return ao}else{return null}};var Z=function(al){S(ag.objectClassID,null,false,true,al)};var Q=function(al,am){if(!am){return}if(am.Deleted||am.Hidden){return}J.getObjectType(al.PropertyDef.ValueList,function(an){if(an.RealObjectType){J.getProperties(al.PropertyDef.ValueList,am.Item,"latest",function(ao){J.getPropertyDefsByID(function(aq){B.exists(al.control);var av={};var at={};for(var aw=0;aw<ao.length;aw++){var ap=ao[aw];av[ap.PropertyDef]=ap;var ar=ag.propertiesByID[ap.PropertyDef];if(ap.TypedValue&&ap.TypedValue.HasValue){if(!at[aq[ap.PropertyDef].ValueList]){at[aq[ap.PropertyDef].ValueList]=[]}at[aq[ap.PropertyDef].ValueList].push(ap)}if(!ar||!ar.control){continue}if(I.Filters.isReadOnlyProperty(ar.PropertyID)){continue}if(ar.PropertyDef.DataType!=f.MFDataType.Lookup&&ar.PropertyDef.DataType!=f.MFDataType.MultiSelectLookup){continue}if(al.boundProperty&&al.boundProperty==ar){continue}var au=ar.control.get();if(au!=null){continue}if(profiling||confirm(g.format(x.AutoFillConfirm,am.DisplayValue,ar.PropertyDef.Name,ap.TypedValue.DisplayValue))){ar.control.set(ap.TypedValue,ap.ValueSource)}}if(al.boundProperty){var ax=function(ay){J.getValueList(al.boundProperty.PropertyDef.ValueList,function(aB){var az=ay.control.get();if(az.Lookup||az.Lookups){return}var aA;if(aB.HasOwner&&aB.Owner==al.boundProperty.PropertyDef.ValueList){aA=av[aB.OwnerPropertyDef];if(aA){ay.control.set(aA.TypedValue,al.control.getSource())}}else{if(at[aB.ID]&&at[aB.ID].length==1){aA=at[aB.ID][0].TypedValue;var aC;if(aA.DataType==f.MFDataType.MultiSelectLookup){aC=aA.Lookups[0]}else{aC=aA.Lookup}aA={DisplayValue:aC.DisplayValue,DataType:ay.PropertyDef.DataType};if(aA.DataType==f.MFDataType.MultiSelectLookup){aA.Lookups=[aC]}else{aA.Lookup=aC}ay.control.set(aA,al.control.getSource())}}})}(al.boundProperty)}})},function(ao){MFWA.Dialogs.Alerts.PropertyValueNotFound(am.DisplayValue,ao.Stack)})}else{if(!an.HasOwner){return}J.getValueListItems(al.PropertyDef.ValueList,function(ao){for(var ap=0;ap<ao.length;++ap){if(ao[ap].ID==am.Item){J.getValueListItems(al.boundProperty.PropertyDef.ValueList,function(ar){for(var au=0;au<ar.length;++au){if(ar[au].ID==ao[ap].OwnerID){var av=null;var at=null;var aq=null;if(al.boundProperty.PropertyDef.DataType==f.MFDataType.MultiSelectLookup){aq=f.MFDataType.MultiSelectLookup;at=[{Item:ar[au].ID,DisplayValue:ar[au].Name,Version:-1,Deleted:false,Hidden:false}]}else{aq=f.MFDataType.Lookup;av={Item:ar[au].ID,DisplayValue:ar[au].Name,Version:-1,Deleted:false,Hidden:false}}al.boundProperty.control.set({DataType:aq,DisplayValue:ar[au].Name,Lookup:av,Lookups:at},al.control.getSource());break}}});break}}})}})};var ab=function(al){ag.properties=[];ag.propertiesByID={};af=null;if(!al){ak.middleContent.empty()}};var U=function(al){J.getPropertyDefsByID(function(am){for(var an in ag.properties){var ao=ag.properties[an];ao.PropertyDef=am[ao.PropertyID]}al()})};var Y=function(aB,az,aE,ap){var aO=ag.properties;var ar=[];var ao=[];if(ag.options.objType.External){if(z){for(var aL=0;aL<ag.options.objType.ReadOnlyPropertiesDuringUpdate.length;aL++){ao[ag.options.objType.ReadOnlyPropertiesDuringUpdate[aL]]=true}}else{for(var aL=0;aL<ag.options.objType.ReadOnlyPropertiesDuringInsert.length;aL++){ao[ag.options.objType.ReadOnlyPropertiesDuringInsert[aL]]=true}}}for(var aL=0;aL<aO.length;aL++){aO[aL].Observers={};aO[aL].boundProperty=null}if(ap){var aI;for(var aL=0;aL<ap.length;aL++){aI=ap[aL];aC=false;for(var aJ=0;aJ<aO.length;aJ++){if(aI.PropertyID==aO[aJ].PropertyID){aC=true;break}}if(aC){X(aO[aJ])}}}for(var aL=0;aL<aO.length;aL++){var aI=aO[aL];var ax=aI.PropertyDef;if(!aI.jq){continue}if(!ax){continue}var aM=aI.jq.children("td.property_name");var aP=aI.PropertyDef.Name+":";var an=aI.jq.children("td.property_control");var aq=false;if(!aI.control||aI.control.type!=ax.DataType){aq=true;an.empty();var aw=ao[ax.ID];var ay=function(aS){var aR=l[ax.ValueList];var aQ=(ag.options.objType.ID==15&&aR&&aR.RealObjectType);aS.control=I.Controls.getControl(aQ,ax,aw,{change:function(aV,aU){for(var aT in aS.Observers){aS.Observers[aT](aS,aV,aU)}if(aS.PropertyDef.OwnerPropertyDef&&aS.PropertyDef.OwnerPropertyDef.ID>0){var aW=ag.propertiesByID[aS.PropertyDef.OwnerPropertyDef.ID];if(aW){aW.control.filteredChanged(aS.PropertyDef,aV)}}},select:function(aV,aU,aT){if(aU&&aU.Lookups&&aU.Lookups.length>1){return}if(!!aT){P(aT,aV.DisplayValue)}if(aS.PropertyDef.DataType==f.MFDataType.Lookup||aS.PropertyDef.DataType==f.MFDataType.MultiSelectLookup){Q(aS,aV)}},getBoundPropertyValue:function(){var aT=aS.boundProperty;if(!aT){return null}return{ID:aT.PropertyID,ValueList:aT.PropertyDef.ValueList,Value:aT.control.get()}}})}(aI);if(aw){aI.control.enabled(false)}an.append(aI.control.jq);if(aI.Required){aI.control.jq.append($('<div class="required">*</div>'))}var aG=false;if(ag.objectClass.AssociatedPropertyDefs){for(var aD=0;aD<ag.objectClass.AssociatedPropertyDefs.length;aD++){if(aI.PropertyID==ag.objectClass.AssociatedPropertyDefs[aD].PropertyDef){aG=true;break}}}var au=false;if(aE){var aC=false;for(var aK=0;aK<aE.length;aK++){if(aE[aK].PropertyID==aI.PropertyID){aC=true;break}}if(aC){au=true}else{au=false}}if(z||az||au){if(!aG&&!aI.Required){var ay=function(aQ){aQ.control.jq.append($('<div class="remove" style="background-image: url(\''+K.Commands.RemoveProperty+"');\"></div>").click(function(){X(aQ);Y()}))}(aI)}}else{if(!aG){X(aI);Y()}}ar.push(aI)}if(!aq&&aB){ar.push(aI)}if(!z&&ax.IsOwnerPropertyDef){var al=-1;var av="";var aF=-1;var at=-1;if(ag.ownerInfo&&ag.ownerInfo.Type==ax.ValueList){al=parseInt(ag.ownerInfo.Id);av=ag.ownerInfo.Value;aF=ag.ownerInfo.Type}else{var aA=d.selectedItem.get();if(aA&&aA.objectVersion){al=parseInt(aA.objectVersion.DisplayID);av=aA.objectVersion.Title;aF=aA.objectVersion.ObjVer.Type;at=aA.objectVersion.ObjVer.Version}}if(al>0){if(ax.ValueList==aF){aI.TypedValue={DisplayValue:av,HasValue:true,SerializedValue:al,DataType:f.MFDataType.Lookup,Lookup:{Deleted:false,DisplayValue:av,Hidden:false,Item:al,Version:at}};aI.control.set(aI.TypedValue,aI.ValueSource);aI.control.enabled(false);aI.control.hideControls(true)}}}if(ax.OwnerPropertyDef){var aN=function(aT,aQ){var aR=ag.propertiesByID[aQ.ID];var aS=function(aW,aV,aU){aT.control.filter(aW,aV,aU)};aR.Observers[aT.PropertyID]=aS};var am=ax.OwnerPropertyDef;if(am.ID>0){var aH=ag.propertiesByID[am.ID];if(aH){B.exists(aH.PropertyDef);aI.boundProperty=aH;aN(aI,aI.PropertyDef.OwnerPropertyDef)}}else{if(am.ID==-106){var ay=function(aQ){J.getValueList(ax.ValueList,function(aR){if(!aR.HasOwner){return}var aU=false;var aT=null;for(var aS=0;aS<aO.length;aS++){if((aO[aS].PropertyDef.DataType==f.MFDataType.Lookup||aO[aS].PropertyDef.DataType==f.MFDataType.MultiSelectLookup)&&(aO[aS].PropertyDef.ValueList==aR.Owner)){aT=aO[aS]}if(aO[aS].ID==aQ.propertyID){aU=true}if(aT&&aU){break}}if(aT){B.exists(aT.PropertyDef);aQ.boundProperty=aT;aN(aQ,aT.PropertyDef)}})}(aI)}}}aM.text(aP);aM.limitCharWidth({width:aM.width(),set_title:aP})}for(var aL in ar){if((!ar[aL].ValueSource)&&(ar[aL].PropertyID==f.MFBuiltInPropertyDef.MonitoredBy)){ar[aL].TypedValue={DisplayValue:E,HasValue:true,SerializedValue:v,DataType:10,Lookups:[{Deleted:false,DisplayValue:E,Hidden:false,Item:v,Version:-1}]}}ar[aL].control.set(ar[aL].TypedValue,ar[aL].ValueSource)}};var O=function(am){ab(false);var al};var T=function(an){var ao=[];for(var am=0;am<ag.properties.length;am++){if(I.Filters.isReadOnlyProperty(ag.properties[am].PropertyID)){ao.push(ag.properties[am])}}ag.properties=[];ag.propertiesByID={};af=null;ak.middleContent.empty();var al;for(var am=0;am<an.AssociatedPropertyDefs.length;am++){var ap=an.AssociatedPropertyDefs[am];if(I.Filters.isReadOnlyProperty(ap.PropertyDef)){continue}ai(ap,{propertySource:"user",oldProperty:al},false)}for(am=0;am<ao.length;am++){var aq=ao[am];ai({PropertyDef:aq.PropertyID,Required:aq.Required},{PropertyDef:aq.PropertyDef,oldProperty:{TypedValue:aq.TypedValue,ValueSource:"user"},propertySource:"user"},false)}};var ad=function(am,al){$.getJSON("./REST/objects/"+am+"/"+al+"/latest/full.aspx",function(az){var av=ag.propertiesByID;var ap={};var au=[];for(var aq=0;aq<az.Properties.length;aq++){var aw=az.Properties[aq];ap[aw.PropertyDef]=aw;if(I.Filters.includedFromTemplate(aw.PropertyDef)){continue}var at=true;if(aw.PropertyDef==33&&!aw.TypedValue.Value){at=false}if(!av[aw.PropertyDef]&&at){var ay=ai(aw,{valueSource:"template",propertySource:"template"});au.push(ay)}else{if(at){var an=av[aw.PropertyDef];if(!!an.control&&!!an.control.isAutomaticProperty){continue}if(g.typedValueExists(aw.TypedValue)&&an.ValueSource!="user"){if(an.control){an.control.set(aw.TypedValue,"template")}an.TypedValue=aw.TypedValue;an.ValueSource="template"}else{if(!g.typedValueExists(aw.TypedValue)){var ax;an.TypedValue=ax;an.ValueSource="template";av[aw.PropertyDef]=an}}}}}var ar=[];for(var ao=0;ao<ag.properties.length;ao++){if(!ap[ag.properties[ao].PropertyID]){ar.push(ag.properties[ao])}}ag.template={objectAndProperties:az,propertiesByID:ap};U(function(){Y(true,false,au,null)});if(ar.length>0){U(function(){Y(true,false,null,ar)})}})};var P=function(ap,am){if(!ap){return}if(ap.HasAutomaticComponent){ak.permissions.attr("disabled","disabled");ak.permissions.empty();ak.permissions.append($('<option value="'+ap.ID+'" selected="true">'+x.AutomaticPermissionsFromObjectProperties+"</option>"));return}if(ap.IsNamedACL){var ao=ak.permissions.find('option[value="'+ap.ID+'"]');if(ao.length>0){ao.attr("selected","true")}}else{var al=M.Custom;if(!!am&&am.length>0){var an="("+am+")";al+=an}var ao=ak.permissions.find('option[value="'+al+'"]');if(ao.length==0){ak.permissions.append($('<option value="'+al+'" selected="true">'+al+"</option>"));ag.nacls.push(ap);ag.naclsByID[al]=ap}else{ao.attr("selected","true")}}ak.permissions.css("width","100%")};var R=function(am,al,at){ak.moreProperties.attr("disabled",false);if(am==L.Class){try{ak.classSelect.find("option[value="+ag.objectClassID+"]").attr("selected",true)}catch(au){}return}var ap=null;try{ap=ak.classSelect.find("option[value="+am+"]");ap.attr("selected",true)}catch(au){}var aq=ap.data("item");if(aq){if(!z){P(aq.DefaultNamedACLForObject,aq.Name)}if(aq.Hidden===true||aq.Deleted===true){ag.objectClassID=am;ag.objectClass=aq;ak.middleContent.empty();af=null;if(al==false){for(var ar=0;ar<ag.properties.length;ar++){if(p.requiredPropertyForHiddenOrDeletedClass(ag.properties[ar].PropertyID)){ag.properties[ar].Required=true}aj(ag.properties[ar])}}else{var ao=ag.properties;ag.properties=[];ag.propertiesByID={};for(var ar=0;ar<ao.length;ar++){var an=ao[ar];if(p.requiredPropertyForHiddenOrDeletedClass(an.PropertyID)){an.Required=true}if(an.Required||g.typedValueExists(an.TypedValue)){ai({PropertyDef:an.PropertyID,Required:an.Required},{PropertyDef:an.PropertyDef,oldProperty:{TypedValue:an.TypedValue,ValueSource:"user"},propertySource:"user"},false)}}}U(function(){Y(true)});if(at){at()}return}}S(am,at,al,false,true)};var S=function(ao,al,an,ap,am){J.getClassInfo(ao,function(aG){aG=g.copy(aG);if(ag.options.objType.ID==f.MFBuiltInObjectType.DocumentCollection){aG.AssociatedPropertyDefs.push({PropertyDef:f.MFBuiltInPropertyDef.CollectionMemberDocuments,Required:false});aG.AssociatedPropertyDefs.push({PropertyDef:f.MFBuiltInPropertyDef.CollectionMemberCollections,Required:false})}ag.objectClassID=ao;ag.objectClass=aG;var au=ag.properties;var av=ag.propertiesByID;var at;ab(true);for(var ax=0;ax<au.length;ax++){var aC=au[ax];if((ap||z)&&aC&&aC.PropertyDef&&aC.PropertyDef.IsOwnerPropertyDef){at=aC}if(aC.control){aC.TypedValue=aC.control.get();s.write(aC.PropertyID);if(g.typedValueExists(aC.TypedValue)||!an){aC.ValueSource=aC.control.getSource()}else{aC.ValueSource=null}}}for(var ax=0;ax<aG.AssociatedPropertyDefs.length;ax++){var aB=aG.AssociatedPropertyDefs[ax];var aF=ai(aB,{propertySource:"class",oldProperty:av[aB.PropertyDef]},true)}var aE;if(ap&&at){ai({PropertyDef:at.PropertyDef.ID,Required:at.Required},{propertySource:"class",oldProperty:at},true)}for(var ax in au){var ar=au[ax];if(!(ag.objectClass.NamePropertyDef!=f.MFBuiltInPropertyDef.NameOrTitle&&ar.PropertyID==f.MFBuiltInPropertyDef.NameOrTitle)){var aH=ar.PropertyDef;if(aH.IsOwnerPropertyDef&&ag.objectClass.AssociatedPropertyDefs){ag.objectClass.AssociatedPropertyDefs.push({PropertyDef:aH.ID,Required:true})}if(g.typedValueExists(ar.TypedValue)||!an||aH.IsOwnerPropertyDef){if(ag.propertiesByID[ar.PropertyID]&&(!ap||I.Filters.isReadOnlyProperty(ar.PropertyID))){var aq=ag.propertiesByID[ar.PropertyID];aq.TypedValue=ar.TypedValue;aq.ValueSource=ar.ValueSource}else{if(!ag.propertiesByID[ar.PropertyID]&&!ap){var aA="user";var az=ar.Required;if(aH.IsOwnerPropertyDef&&ar.ValueSource){aA=ar.ValueSource}if(z){aA="user"}if(aH.IsOwnerPropertyDef){az=true}ai({PropertyDef:ar.PropertyID,Required:az},{PropertyDef:ar.PropertyDef,oldProperty:{TypedValue:ar.TypedValue,ValueSource:aA},propertySource:aA},true)}}}}}ak.middleContent.empty();for(var ax=0;ax<ag.properties.length;ax++){aj(ag.properties[ax])}if(am){var aw=null;if(ak.groups.template.css("display")!="none"){ak.templateSelect.empty();if(aG.Templates&&aG.Templates.length>0){ak.templateSelect.append($('<option value="empty" selected="selected"></option>'))}for(var ax=0;ax<aG.Templates.length;ax++){var aD=aG.Templates[ax];if(ag.options.objType.ID===aD.ObjVer.Type){var ay;if(ax==0&&!ap){ay=$('<option value="'+aD.ObjVer.Type+","+aD.ObjVer.ID+'" selected="selected" />')}else{ay=$('<option value="'+aD.ObjVer.Type+","+aD.ObjVer.ID+'" />')}ay.text(aD.Title);ak.templateSelect.append(ay);ak.templateSelect.css("width","100%");if(!aw){aw={type:aD.ObjVer.Type,id:aD.ObjVer.ID}}}}if($.browser.msie){ak.templateSelect.hide();ak.templateSelect.show()}if(!aw){T(aG);ak.templateSelect.attr("disabled",true);ak.templateRadio.attr("disabled",true);ak.templateCheck.attr("checked",false);ak.templateCheck.attr("disabled",true);if(ak.groups.sfd.css("display")!="none"){if(ak.templateRadio.is(":checked")||!(ak.mfdRadio.is(":checked")||ak.sfdRadio.is(":checked"))){ak.sfdRadio.click()}}}}}U(function(){Y(true);if(aw&&!ap){ad(aw.type,aw.id);ak.templateRadio.attr("disabled",false);ak.templateRadio.click();ak.templateSelect.attr("disabled",false);ak.templateCheck.attr("disabled",false);ak.templateCheck.attr("checked",true)}});V();if(al){al()}H=documentCard.getWindowResults();if((H!=null)&&(w==null)){w=H.Class.ID}ac()})};var V=function(){if(ag.workflows){ak.workflow.empty();var an=$('<option value="'+L.Workflow+'">'+M.Empty+"</option>");ak.workflow.append(an);var am=L.WorkflowObjectClass;var ap=null;if(ag.objectClass){am=ag.objectClass.ID;ap=ag.objectClass.Workflow}for(var al=0;al<ag.workflows.length;al++){var aq=ag.workflows[al];if(aq.item.ObjectClass==L.WorkflowObjectClass||aq.item.ObjectClass==am){ak.workflow.append(aq.node);if(aq.item.ID==ap){an=aq.node}}}ak.workflow.css("width","100%");if(an){try{an.attr("selected",true)}catch(ao){}}}};var ae=function(an,am,ao,al){J.getPropertyDefsByID(function(av){ab();ag.immutableProperties=[];if(al){ag.ownerInfo=al}var ar=null;for(var aq in an){var at=an[aq];var au=av[at.PropertyDef];var ap=true;if(au.ID==f.MFBuiltInPropertyDef.VersionComment&&z){ap=false}if(I.Filters.shownInProperties(au.ID)&&ap){ai(at,{PropertyDef:au,Value:at.TypedValue,valueSource:"old"},true)}else{ag.immutableProperties.push(at)}if(au.ID==f.MFBuiltInPropertyDef.SingleFileObject){if(at.TypedValue.Value){ak.sfdRadio.click()}else{ak.mfdRadio.click()}}if(au.ID==f.MFBuiltInPropertyDef.Class){ar=at}}if(ar!==null){ag.objectClassID=ar.TypedValue.Lookup.Item*1;ag.objectClass={ID:ar.TypedValue.Lookup.Item*1,Name:ar.TypedValue.Lookup.DisplayValue,Hidden:ar.TypedValue.Lookup.Hidden,Deleted:ar.TypedValue.Lookup.Deleted}}if(ao){ao()}})};var ac=function(){var al=d.selectedItem.get();if((!z)||(!al)||(!al.objectVersion)){return}var am=al.objectVersion;if(!am.ThisVersionLatestToThisUser||(am.ObjectCheckedOut&&!am.ObjectCheckedOutToThisUser)){ak.top.find("*").attr("disabled",true);ak.moreProperties.attr("disabled",true);ak.middleContent.find("*").attr("disabled",true);ak.middleContent.find("*").unbind("click");ak.middleContent.find("*").unbind("dblclick");ak.middleContent.find("*").unbind("keydown");ak.middleContent.find("*").unbind("keypress");ak.middleContent.find("*").unbind("keyup");ak.middleContent.find("*").unbind("mousedown");ak.middleContent.find("*").unbind("mouseup")}};ak.classSelect.change(function(al){R(ak.classSelect.val(),true)});ak.templateSelect.change(function(am){var al=ak.templateSelect.val().split(",");if(al[0]=="empty"){Z(true)}else{Z(false);ad(al[0],al[1])}});ak.moreProperties.click(function(){h.getNewProperty(ag.objectClass.ObjType,ag.propertiesByID,function(al){if(al){if(al.OwnerPropertyDef!=null&&al.OwnerPropertyDef.ID>0){var am=ag.propertiesByID[al.OwnerPropertyDef.ID];if(am==null){J.getPropertyDef(al.OwnerPropertyDef.ID,function(an){ai({PropertyDef:an.ID,Required:false},{PropertyDef:an});Y(false,[an.ID])})}}ai({PropertyDef:al.ID,Required:false},{PropertyDef:al});Y(false,[al.ID])}return true})});documentCard={jq:ak,jqNode:ak.documentcard,setProperties:ae,setPermissions:P,resize:function(al){ak.middle.width(al.width-23);ak.middle.height(al.height-(N+W));ak.middle.children("table").width(al.width-23-20)},initialize:function(al,an,am,ao){B.hasValue(al,"objType","The object type has not been set");ak.moreProperties.attr("disabled",true);g_PendingLookupRequestCounter=0;ag={objectClass:null,objectClassID:null,properties:[],immutableProperties:[],propertiesByID:{},options:al,workflows:null,nacls:null};ab();ah=false;if(al.checkIn===true){ak.checkInCheck.attr("checked",true)}else{ak.checkInCheck.attr("checked",false)}J.getWorkflows(function(ar){ag.workflows=[];ag.workflowsByID={};for(var aq=0;aq<ar.length;aq++){var at=ar[aq];var ap={item:at,node:$('<option value="'+at.ID+'">'+g.escape(at.Name)+"</option>")};ag.workflows.push(ap);ag.workflowsByID[at.ID]=ap}V();J.getNACLs(function(av){ag.nacls=av;ag.naclsByID=[];if(ao==true){ak.permissions.append($('<option value="empty" selected="selected"></option>'))}for(var au=0;au<av.length;au++){ak.permissions.append($('<option value="'+av[au].ID+'">'+g.escape(av[au].Name)+"</option>"));ag.naclsByID[av[au].ID+""]=av[au]}ak.permissions.css("width","100%");if(al.objType.HasOwner&&an){J.getObjectType(al.objType.Owner,function(aw){J.getPropertyDef(aw.OwnerPropertyDef,function(ax){an({DataType:ax.DataType,PropertyDef:ax.ID,Required:true,TypedValue:{DataType:ax.DataType,HasValue:false}},function(){documentCard.loadClasses(al.objType.ID,am)})})})}else{if(an){an(null,function(){documentCard.loadClasses(al.objType.ID,am)})}else{this.loadClasses(al.objType.ID,am)}}})})},preload:function(an,al,am){if(!an.Properties){J.getProperties(an.ObjVer,function(ao){ae(ao,al,am)})}else{ae(an.Properties,al,am)}J.getNACL(an.ObjVer.Type,an.ObjVer.ID,an.ObjVer.Version,function(ao){P(ao,"");if(H){H.AccessControlList=ao}})},loadClasses:function(am,al){if(am==f.MFBuiltInObjectType.DocumentCollection){am=f.MFBuiltInObjectType.Document}J.getClassesByGroup(am,function(ap){ak.classSelect.empty();var ar=null;var at=null;var au=0;ak.classSelect.append($('<option value="'+L.Class+'">'+x.ChooseClass+"</option>"));for(var ao=0;ao<ap.length;ao++){if(ap[ao].Name==""){at=ap[ao].Classes;continue}var av=$('<optgroup label="'+ap[ao].Name+'" />');ak.classSelect.append(av);for(var an=0;an<ap[ao].Classes.length;an++){if(!ar){ar=ap[ao].Classes[an].ID}var aq=$('<option value="'+ap[ao].Classes[an].ID+'">'+g.escape(ap[ao].Classes[an].Name)+"</option>");aq.data("item",ap[ao].Classes[an]);av.append(aq);au++}}if(at){for(var an=0;an<at.length;an++){if(!ar){ar=at[an].ID}var aq=$('<option value="'+at[an].ID+'">'+g.escape(at[an].Name)+"</option>");aq.data("item",at[an]);ak.classSelect.append(aq);au++}}ak.classSelect.css("width","100%");ah=true;if(ag.objectClass&&(ag.objectClass.Hidden===true||ag.objectClass.Deleted===true)){var aq=$('<option value="'+ag.objectClass.ID+'">'+g.escape(ag.objectClass.Name)+"</option>");aq.data("item",ag.objectClass);ak.classSelect.append(aq)}if(au==1&&!ag.objectClass){ag.objectClassID=ar}if(typeof(ag.objectClassID)=="number"){R(ag.objectClassID,false,al)}else{w=-999;H=documentCard.getWindowResults();if(al){al()}}})},loadClass:R,getWindowResults:function(){if(!(ag.properties&&ag.workflows)){return null}var ay={};if(ag.objectClass!=null){for(var aq in ag.immutableProperties){var aw=ag.immutableProperties[aq];ay[aw.PropertyDef]=aw}for(var aq in ag.properties){var aw=ag.properties[aq];if(!aw.jq){continue}if(ag.options.filter&&!ag.options.filter(aw.PropertyID)){continue}var av=aw.control.get();var ar=false;if(aw.control.isAutomaticProperty){ar=aw.control.isAutomaticProperty()}var an=aw.PropertyID;ay[aw.PropertyID]={PropertyDef:an,IsAutomatic:ar,TypedValue:av,isOwnerProperty:aw.PropertyDef.IsOwnerPropertyDef}}ay[f.MFBuiltInPropertyDef.Class]={PropertyDef:f.MFBuiltInPropertyDef.Class,TypedValue:{DisplayValue:ag.objectClass.Name,Lookup:{Item:ag.objectClass.ID,DisplayValue:ag.objectClass.Name,Hidden:false,Version:-1,Deleted:false},DataType:f.MFDataType.Lookup}}}var am=ak.top.find("input[@name='"+ak.radioGroupName+"']:checked:visible").val();var ap=null;var au=null;switch(am){case"template":if(ag.template){au=ag.template.objectAndProperties;ap=ag.template.propertiesByID[f.MFBuiltInPropertyDef.SingleFileObject].TypedValue.Value}break;case"sfd":ap=true;break;case"mfd":ap=false;break;default:ap=null;break}s.write("SFD: "+ap);if(ap!==null){ay[f.MFBuiltInPropertyDef.SingleFileObject]={PropertyDef:f.MFBuiltInPropertyDef.SingleFileObject,TypedValue:{DisplayValue:ap?M.Yes:M.No,Value:ap,DataType:f.MFDataType.Boolean}}}var ax=ag.naclsByID[ak.permissions.val()];if(ax){ax.HasAutomaticComponent=ak.permissions.attr("disabled")}var at=null;if(ak.workflow.is(":visible")){at=ag.workflowsByID[ak.workflow.val()*1]}if(at){at=at.item;ay[f.MFBuiltInPropertyDef.Workflow]={PropertyDef:f.MFBuiltInPropertyDef.Workflow,Value:at.ID}}var ao=[];for(var al in ay){ao.push(ay[al])}return{Properties:ao,AccessControlList:ax,Workflow:at,Class:ag.objectClass,Template:au,CheckIn:ak.checkInCheck.is(":checked"),Open:(ak.openCheck.is(":visible")&&ak.openCheck.is(":checked")),SelectedFileMode:am}},hasMetaCardChanged:function(az){var aC=false;var aB=documentCard.getWindowResults();if((az)&&((H!=null)&&(H.SelectedFileMode))){return true}if(aB==null){return false}if(ag.objectClassID!=null){var am=(H==null||H.AccessControlList==null)?-1:H.AccessControlList.ID;var au=(aB==null||aB.AccessControlList==null)?-1:aB.AccessControlList.ID;var aq=(H==null||H.Workflow==null)?-1:H.Workflow.item;var aA=(aB==null||aB.Workflow==null)?-1:aB.Workflow.item;if(H==null&&aB==null){aC=false}else{if(H==null&&aB!=null){aC=true}else{if(aB.Class!=null&&w!=aB.Class.ID){aC=true}else{if(am!=au){aC=true}else{if(aq!=aA){aC=true}else{if(H.Properties.length!=aB.Properties.length){aC=true}else{if(H.CheckIn!=aB.CheckIn){aC=true}else{if(H.Open!=aB.Open){aC=true}else{if(H.SelectedFileMode!=aB.SelectedFileMode){aC=true}else{if((!H.SelectedFileMode)&&(H.Template!=aB.Template)){aC=true}else{if(H.Properties.length==aB.Properties.length){for(var ay in H.Properties){if(H.Properties[ay].TypedValue==null&&aB.Properties[ay].TypedValue==null){continue}else{if(H.Properties[ay].TypedValue==null&&aB.Properties[ay].TypedValue!=null){aC=true;break}else{if(H.Properties[ay].TypedValue!=null&&aB.Properties[ay].TypedValue==null){aC=true;break}else{if(H.Properties[ay].TypedValue.DisplayValue!=aB.Properties[ay].TypedValue.DisplayValue){aC=true;break}}}}}}}}}}}}}}}}}else{var am=(H==null||H.AccessControlList==null)?-1:H.AccessControlList.ID;var au=(aB==null||aB.AccessControlList==null)?-1:aB.AccessControlList.ID;var aq=(H==null||H.Workflow==null)?-1:H.Workflow.item;var aA=(aB==null||aB.Workflow==null)?-1:aB.Workflow.item;var al=(H==null)?-1:H.Open;var aD=(aB==null)?-1:aB.Open;var aw=(aB==null)?-1:aB.CheckIn;var an=(H==null)?-1:H.CheckIn;var ap=(H==null)?-1:H.SelectedFileMode;var ax=(aB==null)?-1:aB.SelectedFileMode;var at=(H==null)?-1:H.Template;var ao=(aB==null)?-1:aB.Template;var av=(H==null||H.Properties==null)?-1:H.Properties;var ar=(aB==null||aB.Properties==null)?-1:aB.Properties;if(am!=au){aC=true}else{if(aq!=aA){aC=true}else{if(an!=aw){aC=true}else{if(al!=aD){aC=true}else{if(ap!=ax){aC=true}else{if(at!=ao){aC=true}else{if(av.length==ar.length){for(var ay in av){if(av[ay].TypedValue.DisplayValue!=ar[ay].TypedValue.DisplayValue){aC=true;break}}}}}}}}}}return aC},setVisibleItems:function(al){N=30;W=85;ak.groups.template.toggle(!!al.template);if(al.template){N+=25}if(al.template&&!al.singleFile){ak.templateCheckLabelGroup.show();ak.templateRadioLabelGroup.hide()}else{ak.templateCheckLabelGroup.hide();ak.templateRadioLabelGroup.show()}ak.groups.sfd.toggle(!!al.singleFile);ak.groups.mfd.toggle(!!al.singleFile);if(al.singleFile){N+=50}ak.groups.relationships.toggle(!!al.relationships);ak.groups.permissions.toggle(!!al.permissions);if(al.permissions){W+=25}ak.groups.workflow.toggle(!!al.workflow);if(al.workflow){W+=25}ak.groups.open.toggle(!!al.open);ak.groups.checkIn.toggle(!!al.checkIn);ak.groups.checkboxes.toggle(!!al.open||!!al.checkIn);if(al.open||al.checkIn){W+=25}}};return documentCard})};var t=function(N){return'<img style="vertical-align:middle;margin-right:5px" src="REST/objects/'+N+'/icon.ashx?size=16">'};var q=function(N){return'<img style="vertical-align:middle;margin-right:5px" src="'+viewItem.getObjectIcon(N)+'">'};var G=function(P,U,T,R,O){var N=function(){var V=T.hasMetaCardChanged(false);if(V){Q.noJqPages=true;k.prompt(U,function(W){if(W=="discardchanges"){w=null;H=null;r=true;Q.close(Q.id);return true}else{return true}})}else{w=null;H=null}return !V};var S=false;var Q=u.show(U,T,{minwidth:475,minheight:500,resizable:true,gradient:true,ok:function(V){if(R){var aa=T.getWindowResults();if((T.jq.templateCheck.is(":enabled")&&T.jq.templateCheck.is(":visible")&&T.jq.templateCheck.is(":checked"))||(T.jq.templateRadio.is(":enabled")&&T.jq.templateRadio.is(":visible")&&T.jq.templateRadio.is(":checked"))){var X=T.jq.templateSelect.val().split(",");if(X[0]=="empty"){MFWA.Dialogs.Alerts.ShowError(M.ErrorDialog.ValueCantEmpty);return false}}if(!aa.Class){MFWA.Dialogs.Alerts.ShowError(M.DocumentCard.ClassSelectMessage);return false}var Z=a.PropertyHandlers.getMissingProperty(aa.Properties,aa.Class);if(Z){MFWA.Dialogs.Alerts.RequiredPropertyMissing(Z.PropertyDef);return false}var W=a.PropertyHandlers.validateProperties(aa.Properties);if(W){MFWA.Dialogs.Alerts.TypeMismatchWarning(W.PropertyDef,W.TypedValue.DataType);return false}var Y=false;if(z){Y=T.hasMetaCardChanged(true)}else{Y=true}if(Y||P){return R({window:V,result:aa,Copy:P})}else{return true}}else{return true}},beforeClose:function(){setTimeout("obj.removeClass('ChangeCursor');  $('#panel').css('cursor', 'default'); obj.addClass('ActualColor'); $('#taskpane #taskpaneContent .taskpaneItemText').css('cursor', 'default');  $('#taskpane #taskpaneContent').css('cursor', 'default'); $('#tree').css('cursor','default'); $('#listing').css('cursor','default'); $('#taskpane').css('cursor', 'default');  $('#searchBasic').css('cursor', 'default'); $('#tree a').css('cursor', 'default');  $('.listing-column').css('cursor', 'default'); $('#propertiesPane').css('cursor', 'default'); $('.nameText').css('cursor', 'default');$('#propertiesPaneProperties').css('cursor', 'default'); $('.propertiesPaneColumn').css('cursor', 'default'); ",200);if(r){r=false;return true}var V=$("div .promptWindow[isDiscardChange='true']");if(V.is(":visible")){return false}return N()},cancel:function(V){return true},cancelCleanup:function(V){if(O){return O(V)}else{return true}}});return Q};var y=function(O,N){J.getUserID(function(P){J.getValueListItems(f.MFBuiltInValueList.Users,function(Q){J.getCurrentTimestamp(function(U){var R="";for(var S=0;S<Q.length;++S){if(P.Value==Q[S].ID){R=Q[S].Name;break}}var T=new Date();var V=[{PropertyDef:f.MFBuiltInPropertyDef.Created,TypedValue:U},{PropertyDef:f.MFBuiltInPropertyDef.CreatedBy,TypedValue:{DataType:f.MFDataType.Text,HasValue:true,DisplayValue:R,SerializedValue:"",Value:R}},{PropertyDef:f.MFBuiltInPropertyDef.LastModified,TypedValue:U},{PropertyDef:f.MFBuiltInPropertyDef.LastModifiedBy,TypedValue:{DataType:f.MFDataType.Text,HasValue:true,DisplayValue:R,SerializedValue:"",Value:R}}];if(O){V.push({PropertyDef:f.MFBuiltInPropertyDef.NameOrTitle,TypedValue:{DataType:f.MFDataType.Text,HasValue:true,DisplayValue:O,SerializedValue:"",Value:O}})}N(V)})})})};var e=function(S,O,X,ad){z=false;if(!O){O={}}var P=O.filename;var Y=O.properties;var ab=O.makingCopy;var Z=O.creatingFromFile;var ac=O.workflow;var R=O.NACL;if(typeof(S)=="number"){J.getObjectType(S,function(ae){return e(ae,O,X,ad)})}else{var U=n();if(O.filename){U.jq.openCheck.attr("checked",false)}var Q=false;var N=false;var aa=(S.ID==f.MFBuiltInObjectType.Document&&!O.ownerInfo);var T=false;if(!Z&&!ab){Q=true;N=(S.ID==f.MFBuiltInObjectType.Document)}U.setVisibleItems({template:Q,singleFile:N,permissions:true,workflow:o.TaskPane.ViewAndModifyOptions.Workflow,open:aa,checkIn:o.TaskPane.ViewAndModifyOptions.CheckIn});var V=o.TaskPane.ViewAndModifyOptions.CheckIn;if(V){if(S.ID==f.MFBuiltInObjectType.Document){V=false}else{if(ab){V=false}}}var W=null;if(ab){W=function(){if(ac){U.jq.workflow.find('option[value="'+ac+'"]').attr("selected","true")}if(R){U.setPermissions(R,"")}}}U.initialize({objType:S,checkIn:V},function(af,ae){y(P,function(am){var ai=false;if(Y){var ag={};for(var ah in am){var al=am[ah];ag[al.PropertyDef]=al}for(var ak in Y){var al=Y[ak];ag[al.PropertyDef]=al}am=[];for(var aj in ag){am.push(ag[aj]);if((af)&&(ag[aj].PropertyDef==af.PropertyDef)){ai=true}}}if(af&&ai==false){am.push(af)}U.setProperties(am,T,ae,O.ownerInfo)})},W,true);return G(ab,t(S.ID)+g.escape(S.Name),U,X,ad)}};var i=function(P,O,N){e(P,null,O,N)};var m=function(S,P,R,O,N){var Q={properties:P,ownerInfo:N};e(S,Q,R,O)};var b=function(S,O,P,R,N){var Q={filename:O,creatingFromFile:true,properties:P};e(S,Q,R,N)};var j=function(S,P,O,R,N){var Q={properties:P,NACL:O,makingCopy:true};J.getCurrentTimestamp(function(V){for(var U in P){if(P[U].PropertyDef==f.MFBuiltInPropertyDef.Workflow){var T=P[U];Q.workflow=P[U].TypedValue.Lookup.Item}else{if(P[U].PropertyDef==f.MFBuiltInPropertyDef.Created){P[U].TypedValue=V}else{if(P[U].PropertyDef==f.MFBuiltInPropertyDef.LastModified){P[U].TypedValue=V}}}}e(S,Q,R,N)})};var D=function(P,O,N){z=true;if(!P.objType){J.getObjectType(P.ObjVer.Type,function(Q){return D({objectVersion:P,objType:Q},O,N)})}else{J.getUserID(function(R){var Q=n();Q.setVisibleItems({permissions:true,singleFile:(P.objType.ID==f.MFBuiltInObjectType.Document)});Q.initialize({objType:P.objType},function(T,S){Q.preload(P.objectVersion,P.objectVersion.CheckedOutToUserID!=R.Value,S)});return G(false,q(P.objectVersion)+g.escape(P.objectVersion.Title),Q,O,N)})}};return{ShowNewObjectWindow:i,ShowNewObjectWindowWithProperties:m,ShowNewObjectWindowFromFile:b,ShowNewObjectWindowFromAnotherObject:j,ShowEditObjectWindow:D}});MFNamespace("MFWA.Dialogs.DocumentCard.PropertyDef",function(a){var b=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");return{create:function(f,d){if(!d){d={}}var c={PropertyID:f.PropertyDef,PropertyDef:d.PropertyDef,Required:f.Required,TypedValue:f.TypedValue,ValueSource:d.valueSource,PropertySource:d.propertySource,Observers:{},jq:null};if(d.oldProperty){if(d.oldProperty.TypedValue&&d.oldProperty.ValueSource=="user"){c.TypedValue=d.oldProperty.TypedValue;c.ValueSource=d.oldProperty.ValueSource}}if(b.shownInProperties(c.PropertyID)){var e=$('<tr class="property" />').append($('<td class="property_name" />').append("Property "+f.PropertyDef)).append($('<td class="property_control"><input type="readonly" readonly="true" /></td>'));c.jq=e}return c}}});MFNamespace("MFWA.Dialogs.DocumentCard.Controls",function(d){var c=MFNamespace("MFWA.Utils");var h=MFNamespace("MFWA.Enumerations");var f=MFNamespace("MFWA.I18n");var b=MFNamespace("MFWA.Debug.Assert");var e=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var a=function(i){return{DisplayValue:"",Value:null,DataType:i}};var g={};g[h.MFDataType.Date]=function(p,n){var q=false;var i=null;var j=null;var o=$('<div class="date" />');var m=$('<input type="checkbox" class="date_check" />');var k=$('<input type="readonly" class="date" readonly="true" />');o.append(m,k);k.datepicker({dateFormat:f.DateTime.ShortDateFormat,changeMonth:true,changeYear:true,duration:"fast",gotoCurrent:true,buttonImage:"res/calendar.png",buttonText:"Choose",buttonImageOnly:true,showOn:"both",beforeShow:function(){if(!m.is(":checked")){m.attr("checked",true);i="user";r()}}});var r=function(s){if(typeof(s)!="undefined"){m.each(function(){this.checked=s})}if(o.children("input:checked").length>0){k.removeAttr("disabled");q=true}else{k.attr("disabled",true);q=false}};m.click(function(){i="user",r()});var l={jq:o,get:function(){if(q){var s=k.datepicker("getDate");return{DisplayValue:k.val(),Value:c.dateToStr(c.copyLocalToUTCDate(s)),DataType:h.MFDataType.Date}}else{return a(h.MFDataType.Date)}},getSource:function(){return i},set:function(s,t){q=(s!=null&&s.Value!=null);if(q){b.equals(s.DataType,h.MFDataType.Date);var u=c.strToDate(s.Value,true);k.datepicker("setDate",u);k.val($.datepicker.formatDate(f.DateTime.ShortDateFormat,u));i=t;r(true)}else{k.val($.datepicker.formatDate(f.DateTime.ShortDateFormat,new Date()));k.datepicker("setDate",new Date());i=null;r(false)}},filter:function(t,s){},enabled:function(s){if(s){o.removeAttr("disabled")}else{o.attr("disabled","disabled")}}};k.datepicker("option","onSelect",function(){i="user";q=true;k.blur();var s=l.get();if(j!=s&&n.change){n.change(l,s)}j=s;r(true)});return l};g[h.MFDataType.Time]=function(p,n){var q=false;var i=null;var j=null;var o=$('<div class="time" />');var m=$('<input type="checkbox" class="time_check" />');var k=$('<input type="text" class="time" />');o.append(m,k);k.timeEntry({spinnerImage:"Images/spinnerUpDownMotive.png",spinnerIncDecOnly:true,spinnerSize:[15,16,0],show24Hours:f.DateTime.Is24HourClock,separator:f.DateTime.TimeSeparator,ampmNames:[f.DateTime.AMDesignator,f.DateTime.PMDesignator],showSeconds:true,spinnerRepeat:[300,150],beforeShow:function(){if(!m.is(":checked")){m.attr("checked",true);i="user";r()}}});var r=function(t){if(typeof(t)!="undefined"){m.each(function(){this.checked=t})}if(o.children("input:checked").length>0){k.removeAttr("disabled");q=true}else{k.attr("disabled",true);var s=k.val();k.val("");k.val(s);q=false}};m.click(function(){i="user",r()});var l={jq:o,get:function(){if(q){var s=k.timeEntry("getTime");return{DisplayValue:k.val(),Value:c.dateToStr(c.copyLocalToUTCDate(s)),DataType:h.MFDataType.Time}}else{return a(h.MFDataType.Time)}},getSource:function(){return i},set:function(s,t){q=(s!=null&&s.Value!=null);if(q){b.equals(s.DataType,h.MFDataType.Time);var u=c.strToDate(s.Value,true);k.timeEntry("setTime",u);i=t;r(true)}else{k.timeEntry("setTime",new Date());i=null;r(false)}},filter:function(t,s){},enabled:function(s){if(s){o.removeAttr("disabled")}else{o.attr("disabled",true)}}};return l};g[h.MFDataType.Boolean]=function(m,k){var l=null;var i=null;var j=$('<select class="check"><option value="null" selected="selected">'+f.Empty+'</option><option value="true">'+f.Yes+'</option><option value="false">'+f.No+"</option></select>");var n={jq:$('<div class="common_control" />').append(j),get:function(){if(j.val()=="null"){return a(h.MFDataType.Boolean)}if(j.val()=="true"){return{DisplayValue:f.Yes,Value:true,DataType:h.MFDataType.Boolean}}else{return{DisplayValue:f.No,Value:false,DataType:h.MFDataType.Boolean}}},getSource:function(){return l},set:function(o,p){if(!o){o={DisplayValue:"",Value:null,DataType:h.MFDataType.Boolean}}b.equals(o.DataType,h.MFDataType.Boolean);if(o.Value===true){j.val("true");l=p}else{if(o.Value===false){j.val("false");l=p}else{j.val("null");l=null}}j.find("option[value="+j.val()+"]").attr("selected",true)},filter:function(p,o){},enabled:function(o){if(o){j.removeAttr("disabled")}else{j.attr("disabled","disabled")}}};j.change(function(){l="user";var o=n.get();if(i!=o&&k.change){k.change(n,o)}i=o});return n};g[h.MFDataType.MultiSelectLookup]=function(i,k,j){return d.Lookups.msluConstructor(i,k,j)};g[h.MFDataType.Lookup]=function(i,k,j){return d.Lookups.ssluConstructor(i,k,j)};g[h.MFDataType.Timestamp]=function(n,k){var j=$('<input type="readonly" class="readonly" readonly="true">');var m=null;var l=null;var i=null;var o={jq:$('<div class="common_control" />').append(j),get:function(){if(j.val()!=""){return{DisplayValue:j.val(),Value:l,DataType:h.MFDataType.Timestamp}}else{return a(h.MFDataType.Timestamp)}},getSource:function(){return m},set:function(q,p){if(q&&q.Value){b.equals(q.DataType,h.MFDataType.Timestamp);l=q.Value;j.val($.datepicker.formatDate(f.DateTime.ShortDateTimeFormat,l));m=p}else{j.val("");m=null;l=null}},filter:function(q,p){},enabled:function(p){if(p){j.removeAttr("disabled")}else{j.attr("disabled","disabled")}}};j.change(function(){m="user";var p=o.get();if(i!=p&&k.change){k.change(o,p)}i=p});return o};g[h.MFDataType.Text]=function(m,k,o){var j=$('<input type="text" class="text" />');var l=null;var i=null;var n={jq:$('<div class="common_control" />').append(j),get:function(){if(j.val()!=""){var p=""+j.val();if(m.DataType==h.MFDataType.Floating){p=p.replace(f.DecimalPoint,".")}var q=m.DataType==h.MFDataType.Text?p:p*1;if(typeof q=="number"){if(m.DataType==h.MFDataType.Integer){p=$.trim(p);q=c.validateSignedNumberRange(p)}else{if(m.DataType==h.MFDataType.Floating){p=$.trim(p);q=c.roundToTwoDecimal(p)}}}return{DisplayValue:p,Value:q,DataType:m.DataType}}else{return a(m.DataType)}},getSource:function(){return l},set:function(q,r){if(q&&(q.Value||(q.Value!=null&&q.Value==0))){b.equals(q.DataType,m.DataType);l=r;var p=""+q.Value;if(m.DataType==h.MFDataType.Floating){p=q.DisplayValue.replace(".",f.DecimalPoint)}j.val(p)}else{l=null;j.val("")}},filter:function(q,p){},enabled:function(p){if(p){j.removeAttr("disabled")}else{j.attr("disabled","disabled")}}};j.change(function(){l="user";var p=n.get();if(i!=p&&k.change){k.change(n,j.val())}i=p});return n};g[h.MFDataType.Integer]=g[h.MFDataType.Text];g[h.MFDataType.Floating]=g[h.MFDataType.Text];g[h.MFDataType.MultiLineText]=function(m,k){var j=$('<textarea class="text" rows="5" cols="20"/>');var l=null;var i=null;var n={jq:$('<div class="common_control" />').append(j),get:function(){if(j.val()!=""){var o=j.val();return{DisplayValue:o,Value:o,DataType:h.MFDataType.MultiLineText}}else{return a(h.MFDataType.MultiLineText)}},getSource:function(){return l},set:function(o,p){if(o&&o.Value){b.equals(o.DataType,h.MFDataType.MultiLineText);j.val(o.Value);l=p}else{j.val("");l=null}},filter:function(p,o){},enabled:function(o){if(o){j.removeAttr("disabled")}else{j.attr("disabled","disabled")}}};j.change(function(){l="user";var o=n.get();if(i!=o&&k.change){k.change(n,j.val())}i=o});return n};g[h.MFDataType.ReadOnly]=function(m,j){var i=$('<input type="readonly" class="readonly" disabled="disabled">');var l=null;var k=null;var n={jq:$('<div class="common_control" />').append(i),get:function(){if(k==null){return a(m.DataType)}else{return k}},getSource:function(){return l},set:function(p,o){k=p;l=o;if(k){i.val(k.DisplayValue)}else{i.val("")}},filter:function(p,o){},enabled:function(o){if(o){i.removeAttr("disabled")}else{i.attr("disabled","disabled")}}};i.change(function(){l="user";var o=n.get();if(previousValue!=o&&j.change){j.change(n,o)}previousValue=o});return n};g[h.MFDataType.Automatic]=function(m,j){var i=$('<input type="readonly" class="readonly" disabled="disabled">');var l=null;var k=null;var n={jq:$('<div class="common_control" />').append(i),get:function(){if(k==null){return a(m.DataType)}else{return k}},getSource:function(){return l},set:function(p,o){k=p;l=o;if(k){i.val(k.DisplayValue)}else{i.val(f.DocumentCard.AutomaticValue)}},filter:function(p,o){},enabled:function(o){if(o){i.removeAttr("disabled")}else{i.attr("disabled","disabled")}},isAutomaticProperty:function(){return true}};i.change(function(){l="user";var o=n.get();if(previousValue!=o&&j.change){j.change(n,o)}previousValue=o});return n};return{getControl:function(k,n,j,l){var i=n.DataType;if(e.isReadOnlyProperty(n.ID)||j){i=h.MFDataType.ReadOnly}else{if(n.AutomaticValueType!=h.MFAutomaticValueType.None){i=h.MFDataType.Automatic}}if(g[i]){if(i==h.MFDataType.MultiSelectLookup||i==h.MFDataType.Lookup){var m=g[i](k,n,l)}else{var m=g[i](n,l)}}else{b.fail("Unknown data type: "+i)}m.type=i;return m}}});MFNamespace("MFWA.Dialogs.DocumentCard.Controls.Lookups",function(u){var l=MFNamespace("MFWA.Debug");var p=MFNamespace("MFWA.Utils");var a=MFNamespace("MFWA.Enumerations");var h=MFNamespace("MFWA.I18n");var q=MFNamespace("MFWA.I18n.DocumentCard");var t=MFNamespace("MFWA.Data.Cache");var f=MFNamespace("MFWA.Nulls");var b=MFNamespace("MFWA.Debug.Assert");var i=MFNamespace("MFWA.Dialogs.Prompt");var o=MFNamespace("MFWA.Data.Operations");var r=MFNamespace("MFWA.Icons");var m=MFNamespace("MFWA.Dialogs.Alerts");var n=MFNamespace("MFWA.StringBuilder");var l=MFNamespace("MFWA.Debug");var c=MFNamespace("MFWA.Model");var k=MFNamespace("MFWA.Dialogs.Confirm");var g=MFNamespace("MFWA.Configurations");var e=function(v){return function(x,w){if(v.change){v.change(x,w)}}};var s=function(v){return function(y,x,w){if(v.select){if(!x){if(y){x={DisplayValue:y.DisplayValue,Lookup:y,DataType:a.MFDataType.Lookup}}else{x={DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}}v.select(y,x,w)}}};var d=function(v){return function(w){if(v.remove){v.remove(w)}}};var j=function(D,y,N,B){if(!N){N={}}var H=null;var G=null;var z=null;var A={};var I=e(N);var L=s(N);var x=d(N);var O=N;var K={id:p.unique("mslu")};K.canAddAnyItem=D;K.isTraditionalFolder=(y.ValueList==a.MFBuiltInValueList.TraditionalFolders);var v=function(P){if(!P){return null}if(P.Lookup){P=P.Lookup}if(P.Item){P=P.Item}if(typeof(P)=="number"){return P}else{return null}};K.jq=$('<div class="lookup" />');K.select=$('<select class="lookup" />').change(function(){H="user";var Q=K.value;K.value=K.get();var P=v(K.value);if(P<0){return}if(v(Q)!=P){if(P==f.ClearFilter){K.filterText("");K.set(Q);return}I(K.value,H);if(K.value.Lookup){L(K.value.Lookup,null,K.valuesByID[P].defaultACL)}}});K.jq.append(K.select);var M=$('<div class="filter" style="background-image: url(\''+r.Commands.SetFilter+"');\"></div>");K.filterItem=M;if(g.TaskPane.ShowNew){var J=$('<div class="addItem" style="background-image: url(\''+r.Commands.AddValue+"');\"></div>");K.addItem=J;K.jq.append(J,M)}else{K.jq.append(M)}if(N.remove){K.minusMark=$('<div class="mslu_minus" style="background-image: url(\''+r.Commands.AddRemove+"');\"></div>").click(function(){x(K)});K.jq.append(K.minusMark)}var C=function(){i.prompt(q.SetFilter,function(P){if(P){K.filterText(P)}return true})};M.click(C);var w=function(S,R,P,Q){o.addValueListItem(S.ValueList,{Name:R,OwnerID:P.Value,HasOwner:!!P.Value},function(T){K.set({DataType:a.MFDataType.Lookup,DisplayValue:R,Lookup:{Item:T.ID,DisplayValue:R,Version:-1,Deleted:false,Hidden:false}},"user");K.refresh();Q.close()})};if(J){J.click(function(){if(K.isTraditionalFolder){m.ShowNotification(h.Alerts.TraditionalFolderAlert);return}t.getObjectType(y.ValueList,function(S){var T={};if(S.RealObjectType){T.NotAllowed=h.Alerts.CantAddNewObjectNotAllowed;T.AccessDenied=h.Alerts.CantAddNewObjectAccessDenied;T.Alert=h.Alerts.CantAddNewObject;T.MultipleOwnerExistsAlert=h.Alerts.MultipleOwnerExists}else{T.NotAllowed=h.Alerts.CantAddNewValueNotAllowed;T.AccessDenied=h.Alerts.CantAddNewValueAccessDenied;T.Alert=h.Alerts.CantAddNewValue}if(S.Name==""){m.ShowError(T.AccessDenied);return}if(S.AllowAdding==false){m.ShowError(p.format(T.NotAllowed,p.escape(S.Name)));return}var P={Value:null};var R={Id:-1,Value:""};if(S.HasOwner){if(!O.getBoundPropertyValue){m.ShowError("Internal error: lookup callbacks not set!");return}var Q=c.selectedItem.get();if((!Q||!Q.objectVersion)||(Q&&Q.objectVersion&&S.Owner!=Q.objectVersion.ObjVer.Type)){P=O.getBoundPropertyValue();if((!P)||(!P.Value.Lookups&&!P.Value.Lookup)||(P.Value.Lookups!=null&&P.Value.Lookups[0].Hidden)||(P.Value.Lookup!=null&&P.Value.Lookup.Hidden)){m.ShowError(T.Alert);return}if(P.Value.Lookups&&P.Value.Lookups.length>1){m.ShowError(T.MultipleOwnerExistsAlert);return}if(P.Value.Lookups){R.Value=P.Value.Lookups[0].DisplayValue;R.Type=P.ValueList;P.Value=v(P.Value.Lookups[0]);R.Id=P.Value}else{if(P.Value.Lookup){R.Value=P.Value.Lookup.DisplayValue;R.Type=P.ValueList;P.Value=v(P.Value.Lookup);R.Id=P.Value}}if(P.ValueList!=S.Owner){if(!S.RealObjectType){m.ShowError(T.Alert);return}else{P.Value=null}}if(!P.Value&&!S.RealObjectType){m.SelectOwnerPropertyFirst(P.ID);return}}}if(!S.RealObjectType){i.prompt(q.AddNewValueToList,function(X,U){if(X){var Y=false;for(var V in K.values){if(K.values[V].value.DisplayValue.toLowerCase()==X.toLowerCase()){Y=true;break}}if(Y==true){var W=new Object();W.message=p.format(h.NewItemDialog.PromptMessage,p.escape(X));W.title=h.NewItemDialog.Title;k.prompt(W,function(Z){if(Z==true){w(y,X,P,U)}else{U.close()}})}else{w(y,X,P,U)}}return false})}else{MFWA.Actions.newObject(y.ValueList,{ownerInfo:R,callback:function(U){if(U){K.set({DataType:a.MFDataType.Lookup,DisplayValue:U.Title,Lookup:{Item:U.ObjVer.ID,DisplayValue:U.Title,Version:U.ObjVer.Version,Deleted:false,Hidden:false}},"user");K.refresh()}}})}})})}K.get=function(){var Q=K.select.val();if(Q!=f.Lookup&&K.valuesByID){var R=K.select.val()*1;var P=K.valuesByID[R];return{DisplayValue:P.value.DisplayValue,Lookup:P.value,DataType:a.MFDataType.Lookup}}else{return{DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}};K.getSource=function(){return H};K.set=function(R,T){if(!R){R={DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}b.equals(R.DataType,a.MFDataType.Lookup);H=T;var P=null;if(R&&R.Lookup){if(K.values&&K.valuesByID[R.Lookup.Item]){try{$("#"+K.valuesByID[R.Lookup.Item].option).attr("selected",true)}catch(S){}P=K.valuesByID[R.Lookup.Item].defaultACL}else{var Q=$('<option value="'+R.Lookup.Item+'" selected>'+p.escape(R.Lookup.DisplayValue)+"</option>");K.select.append(Q);K.valuesByID={};K.valuesByID[R.Lookup.Item]={value:R.Lookup};try{Q[0].attr("selected",true)}catch(S){}}}else{if(K.values){try{K.select.children()[0].attr("selected",true)}catch(S){}}else{K.select.empty()}}if(v(K.value)!=v(R)){K.value=R;I(R,H);if(R.Lookup){L(R.Lookup,null,P)}}};var F=function(am,P){z=null;var X=K.select.outerWidth();var af=false;K.values=new Array();K.valuesByID={};var R=new n.StringBuilder(3+am.length*8);R.append('<option value="').append(f.Lookup).append('"></option>');if(K.canAddAnyItem){var aq={Item:-1000,DisplayValue:q.LookupItemAny,Hidden:false,Version:-1,Deleted:false};R.append('<option value="').append(-1000).append('">').append(q.LookupItemAny).append("</option>");var T={value:aq,option:p.unique("optionAny"),defaultACL:null};K.values.push(T);K.valuesByID[aq.Item]=T}var ad=new Array();for(var ah=0;ah<am.length;ah++){var Z=am[ah];if(Z.HasParent==false){ad.push(Z)}else{var aa=ad.length;var ap=0;var ak=false;for(var Y=0;Y<aa;Y++){if(Z.ParentID==ad[Y].ID){ak=true;continue}else{if((ak==true)&&(ad[Y].ParentID!=Z.ParentID)){ap=Y;break}}}if(ap==0){ad.push(Z)}else{ad.splice(ap,0,Z)}}}am=ad;var ae=false;var U=false;for(var ah=0;ah<am.length;ah++){var Z=am[ah];if(Z.ID<0&&!Z.IsClearItem){continue}var ao={Item:Z.ID,DisplayValue:Z.Name,Hidden:false,Version:-1,Deleted:false};var aj=p.escape(ao.DisplayValue);if(Z.IsClearItem){aj=Z.Name}var ag=function(ar,au){if(am[au].HasParent==true){ar="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ar;U=true;for(var at=au;at>=0;at--){if(am[au].ParentID==am[at].ID){ar=ag(ar,at);break}}}return ar};var Q=ag("",ah);var S=Q.length/6;var V=aj;var an=p.unique("option");var ai="";if(!($.browser.msie&&$.browser.version=="7.0")&&Z.Icon){ai='" indentation="'+Q+'" title="'+p.currentUrl+"REST/objects/"+Z.ValueListID+"/"+Z.ID+'/valueListIcon.aspx" style="';ae=true}else{if(K.isTraditionalFolder){ai='" indentation="'+Q+'" title="'+r.Listing.TraditionalFolder+'" style="';ae=true}else{ai='" style = "';V=Q+V}}R.append('<option id="').append(an).append('" value="').append(ao.Item);if(v(K.value)==ao.Item){af=true;R.append(ai).append('" selected >')}else{if(Z.IsClearItem){R.append(ai).append('font-weight:bold;">')}else{R.append(ai).append('">')}}R.append(V).append("</option>");var T={value:ao,option:an,defaultACL:Z.DefaultNamedACLForObject};K.values.push(T);K.valuesByID[ao.Item]=T}K.select.html(R.toString());K.select.css("cursor","wait");K.select.css("width","100%");var ac=K.value;if(!af){if(P||!(K.value&&K.value.Lookup)){ac={DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}else{ac=K.value;var W=ac.Lookup.DisplayValue;var ab=$('<option value="'+ac.Lookup.Item+'" selected>'+p.escape(W)+"</option>");var T={value:ac.Lookup,option:ab};K.values.push(T);K.valuesByID[ac.Lookup.Item]=T;K.select.append(ab)}}if(!($.browser.msie&&$.browser.version=="7.0")&&(ae||U)){K.select.attr("id",K.id);var al="";if(K.value&&K.value.Lookup){al=K.value.Lookup.DisplayValue}K.select.msDropDown({replaceDropDown:true,showIcon:false,currentItem:al,isHierarchy:U});ae=false;U=false}if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}if(g_PendingLookupRequestCounter==0){$("#doccard").css("cursor","default");$("#doccard").find("*").css("cursor","default")}};var E=function(Q){if(A.text){var P={ID:f.ClearFilter,Name:q.ClearFilter+"'"+A.text+"'",IsClearItem:true};Q.splice(0,0,P)}F(Q)};K.filterText=function(P){A.text=P;if(z){z.cancel=true;if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}}++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard").css("cursor","wait");$("#doccard").find("*").css("cursor","wait")}z=t.getValueListItemsByPropDefID(y.ID,E,{item:A.item,text:A.text})};K.filter=function(U,R,Q){var T=Array();if(R.DataType==a.MFDataType.MultiSelectLookup){for(var P in R.Lookups){if(R.Lookups[P]!=null&&R.Lookups[P].Item!=f.Lookup){T.push(R.Lookups[P].Item)}}}else{if(R.Lookup&&R.Lookup.Item!=f.Lookup){T.push(R.Lookup.Item)}}if(z){z.cancel=true;if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}}A.item={type:U.PropertyDef.ValueList,values:T};++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){var S=$("#doccard");S.css("cursor","wait");S.find("*").css("cursor","wait")}z=t.getValueListItemsByPropDefID(y.ID,function(V){F(V,Q=="user")},{item:A.item,text:A.text})};K.refresh=function(){if(z){z.cancel=true;if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}}++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard").css("cursor","wait");$("#doccard").find("*").css("cursor","wait")}z=t.getValueListItemsByPropDefID(y.ID,F,{item:A.item,text:A.text})};K.filteredChanged=function(Q,P){};K.canRemove=function(P){if(P){K.minusMark.show()}else{K.minusMark.hide()}};K.enabled=function(P){if(P){K.select.removeAttr("disabled")}else{K.select.attr("disabled","disabled")}};K.hideControls=function(P){if(P){if(K.minusMark){K.minusMark.hide()}K.addItem.hide();K.filterItem.hide()}else{if(K.minusMark){K.minusMark.show()}K.addItem.show();K.filterItem.show()}};if(B){K.filter(B.property,B.value,B.source)}else{++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard").css("cursor","wait");$("#doccard").find("*").css("cursor","wait")}z=t.getValueListItemsByPropDefID(y.ID,F)}return K};return{ssluConstructor:function(v,x,w){var y=j(v,x,w);return{jq:y.jq,get:function(){return y.get()},getSource:function(){return y.getSource()},set:function(A,z){y.set(A,z)},filter:function(B,A,z){y.filter(B,A,z)},filteredChanged:function(A,z){y.filteredChanged(A,z)},enabled:function(z){y.enabled(z)},hideControls:function(z){y.hideControls(z)}}},msluConstructor:function(E,I,C){var G=new Array();var w=null;var x=null;var D=e(C);var F=s(C);var v=C;var J=function(N){var M=false;for(var L=0;L<G.length;L++){if(G[L]==N){var O=G[L].get();if(O!=null&&O!=f.Lookup){M=true}G.splice(L,1);L--}}if(G.length==1){G[0].canRemove(false)}N.jq.remove();if(M){D(A.get(),A.getSource())}};var z=false;var K={remove:J,change:function(){w="user";if(!z){D(A.get(),A.getSource())}},select:function(N,M,L){if(!z){F(N,A.get(),L)}},getBoundPropertyValue:function(){if(v.getBoundPropertyValue){return v.getBoundPropertyValue()}return null}};var B=function(){var L=j(E,I,K,x);G.push(L);H.append(L.jq);G[0].canRemove(true)};var H=$('<div class="mslu" />');var y=$('<div class="mslu_plus" style="background-image: url(\''+r.Commands.AddRemove+"');\"></div>").click(function(){B()});H.append(y);B();G[0].canRemove(false);var A={jq:H,get:function(){var O={};for(var M=0;M<G.length;M++){var P=G[M].get();if(P.Lookup){O[P.Lookup.Item]=P}}var L={DisplayValue:new Array(),Lookups:new Array(),DataType:a.MFDataType.MultiSelectLookup};for(var N in O){L.DisplayValue.push(O[N].DisplayValue);L.Lookups.push(O[N].Lookup)}L.DisplayValue=L.DisplayValue.join("; ");if(L.Lookups.length==0){L.Lookups=null}return L},getSource:function(){return w},set:function(O,R){if(!O||!O.Lookups){O={DisplayValue:"",Lookups:new Array(),DataType:a.MFDataType.MultiSelectLookup}}b.equals(O.DataType,a.MFDataType.MultiSelectLookup);var L=A.get();while(O.Lookups.length>G.length){B()}while(O.Lookups.length<G.length&&G.length>1){J(G.pop())}z=true;if(O.Lookups.length==0){G[0].set({DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup})}else{for(var N=0;N<O.Lookups.length;N++){G[N].set({DisplayValue:O.Lookups[N].DisplayValue,Lookup:O.Lookups[N],DataType:a.MFDataType.Lookup},R)}}z=false;w=R;var Q=A.get();var M=false;if(!L||!L.Lookups){L=new Array()}else{L=L.Lookups}if(!Q||!Q.Lookups){Q=new Array()}else{Q=Q.Lookups}if(Q.length!=L.length){M=true}else{var P={};for(var N in Q){P[Q[N].Item]=true}var S={};for(var N in L){S[L[N].Item]=true}for(var N in S){if(!P[N]){M=true}}}if(M){D(O,w);if(O.Lookups&&O.Lookups.length==1){F(O.Lookups[0],null,G[0].valuesByID[O.Lookups[0].Item].defaultACL)}}},filter:function(O,N,M){x={property:O,value:N,source:M};for(var L=0;L<G.length;L++){G[L].filter(O,N,M)}},filteredChanged:function(M,L){},enabled:function(M){for(var L in G){G[L].enabled(M)}}};return A}}});MFNamespace("MFWA.Dialogs.DocumentCard.MoreProperties",function(f){var e=MFNamespace("MFWA.Pooling");var d=MFNamespace("MFWA.Dialogs.Templates");var h=MFNamespace("MFWA.Data.Cache");var g=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var a=MFNamespace("MFWA.I18n.DocumentCard");var b=MFNamespace("MFWA.Utils");var c=function(){var n=d.createMorePropertiesWindow();var j;n.window.dialog({bgiframe:false,modal:true,resizable:false,width:450,noheight:true,position:["center","center"],title:a.MorePropertiesDialogTitle});var m={};var i=null;var l=function(){if(!j(i)){i=null;return false}i=null;k.dispose();return true};n.window.bind("dialogbeforeclose",l);n.close.click(function(){i=null;n.window.dialog("close")});n.add.click(function(){i=m[n.list.val()*1];n.window.dialog("close")});n.list.click(function(){if(n.list.find("option:selected").length){n.add.attr("disabled","")}});n.list.change(function(){n.list.click()});if($.browser.msie){n.list.keyup(function(o){if((o.keyCode==38)||(o.keyCode==40)||(o.keyCode>=48&&o.keyCode<=57)||(o.keyCode>=65&&o.keyCode<=90)||(o.keyCode>=96&&o.keyCode<=105)){n.list.change()}})}var k={jq:n,show:function(){i=null;n.window.dialog("open");n.add.attr("disabled","disabled");n.list.css("width","100%")},init:function(p,o,q){j=q;m={};h.getPropertyDefs(function(r){n.list.empty();for(var s in r){var u=r[s];if(o[u.ID]){continue}if(!g.isAdditionalProperty(u.ID)){continue}if(u.IsOwnerPropertyDef){continue}if(u.AllObjectTypes==false&&p!=u.ObjectType){continue}var t=$('<option value="'+u.ID+'">'+b.escape(u.Name)+"</option>");m[u.ID]=u;n.list.append(t)}})}};return k};return{getNewProperty:function(k,j,l){var i=e.get("MorePropertiesWindow",c);i.init(k,j,l);i.show()}}});MFNamespace("MFWA.Dialogs.DocumentCard.Report",function(g){var f=MFNamespace("MFWA.Pooling");var h=MFNamespace("MFWA.Dialogs.Templates");var b=MFNamespace("MFWA.Data.Cache");var a=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var j=MFNamespace("MFWA.I18n");var i=MFNamespace("MFWA.Utils");var c=MFNamespace("MFWA.Model");var d=MFNamespace("MFWA.Layout");var e=function(){var o=h.createReportsWindow();var m=c.selectedItem.get();var n=i.escape(m.objectVersion.Title);var m=c.selectedItem.get();var k;o.window.dialog({width:900,height:600,resizable:true,modal:true,closeOnEscape:false,bgiframe:false,position:["center","center"],title:n,open:function(){d.enableApplet(false)},close:function(){d.enableApplet(true)}});var l={jq:o};return l};return{showReport:function(l){if(!l){MFWA.Dialogs.Alerts.ShowError(j.ReportError.NoURL);return}else{var m=l.split("?");var o=m[0];var n=m[1];if(!o){o=""}if(!n){n=""}if(!$.inArray("Http://",n)&&!$.inArray("?",n)){}var k=f.get("ReportWindow",e);k.jq.dotNetWarning.toggle(!g_reportingLoaded);if(o.length==0||n.length==0){return}if(g_reportingLoaded){l="Report.aspx?server="+o+"&path="+n}$.ajax({url:l,type:"GET",dataType:"html",async:false,success:function(q){$("#contentRpt").remove();var p=$('<div id="contentRpt"> </div>').css({width:"100%",height:"100%"});p.html(q);k.jq.jqReports.append(p)},error:function(s,p,q){var r=$('<div id="ErrorMsg"> </div>').css({width:"100%",height:"100%"});r.html(q);k.jq.jqReports.append(r)}})}}}});MFNamespace("MFWA.Dialogs.Upload",function(m){var e=MFNamespace("MFWA.Utils"),b=MFNamespace("MFWA.Debug.Assert"),j=MFNamespace("MFWA.Nulls"),n=MFNamespace("MFWA.I18n"),l=MFNamespace("MFWA.I18n.Upload"),c=MFNamespace("MFWA.Data.Cache"),g=MFNamespace("MFWA.Pooling"),i=MFNamespace("MFWA.Utils"),a=MFNamespace("MFWA.Enumerations"),d=MFNamespace("MFWA.Window"),h=MFNamespace("MFWA.Dialogs.Templates"),k=MFNamespace("MFWA.Dialogs.DocumentCard.MoreProperties");var f=function(){var o,p=h.createUploadDialog();p.upload.load(function(){b.exists(this.contentWindow);var q=this.contentWindow.fileData;var r=this.contentWindow.objectVersion;if(q){o.files[q.uploadID]=q}if(r){o.objectVersion=r}if(q||r){if(o.singleFile){o.ok()}else{if(q){jqFile=h.createUploadFileItem(this.contentWindow.fileData,function(){o.files[q.uploadID]=null});p.fileList.append(jqFile)}}}});return{jq:p,jqNode:p.dialog,initialize:function(t){var q=t.singleFile;var s="";if(t.objVer!==undefined){var r=t.objVer;s=["&objectType=",r.Type,"&objectID=",r.ID,"&objectVersion=",r.Version].join("")}var u="";if(t.fileID!==undefined){u="&fileID="+t.fileID}p.upload.attr("src","UploadFrame.aspx?type="+t.type+s+u);o={type:t.type,files:{},objectVersion:null,singleFile:q,ok:t.ok};p.fileList.empty();p.fileList.toggle(!q)},resize:function(q){p.dialog.width(q.width);p.dialog.height(q.height)},getUploadResults:function(){if(o.type=="store"){var q=[];for(fId in o.files){if(!o.files[fId]){continue}q.push(o.files[fId])}return q}else{return o.objectVersion}},getDuplicate:function(t){var r,q,s;s=t.length;for(r=0;r<s;r++){for(q=r+1;q<s;q++){if((t[r].title==t[q].title)&&(t[r].extension==t[q].extension)&&(t[r].size==t[q].size)){return t[r]}}}return null}}};return{addFile:function(q,s,p){var r=g.get("upload",f);var o;r.initialize({type:"add",singleFile:true,ok:function(){o.ok()},objVer:q});o=d.show(l.Title,r,{width:400,height:150,ok:function(u){o.noJqPages=true;if(s){var t=r.getUploadResults();return s(u,t)}},cancel:function(t){if(p){return p(t)}},buttons:{cancel:true}})},replaceFile:function(r,o,t,q){var s=g.get("upload",f);var p;s.initialize({type:"replace",singleFile:true,ok:function(){p.ok()},objVer:r,fileID:o});p=d.show(l.Title,s,{width:400,height:150,ok:function(v){p.noJqPages=true;if(t){var u=s.getUploadResults();return t(v,u)}},cancel:function(u){if(q){return q(u)}},buttons:{cancel:true}})},singleFile:function(r,p){var q=g.get("upload",f);var o;q.initialize({type:"store",singleFile:true,ok:function(){o.ok()}});o=d.show(l.Title,q,{width:400,height:150,ok:function(t){if(r){o.noJqPages=true;var s=q.getUploadResults();return r(t,s)}},cancel:function(s){if($("#okButtonPressed").length>0){$("#okButtonPressed").val("false")}if(p){return p(s)}},buttons:{cancel:true}})},multipleFiles:function(q,o){var p=g.get("upload",f);p.initialize({type:"store"});ulWindow=d.show(l.Title,p,{width:400,height:300,ok:function(s){if(q){ulWindow.noJqPages=true;var r=p.getUploadResults();var t=p.getDuplicate(r);if(!t){return q(s,r)}else{var u=i.format(n.DocumentCard.FileExists,i.escape(t.title)+"."+i.escape(t.extension));MFWA.Dialogs.Alerts.ShowError(u);return false}}else{ulWindow.noJqPages=true;return true}},cancel:function(r){if($("#okButtonPressed").length>0){$("#okButtonPressed").val("false")}if(o){return o(r)}else{return true}}});return ulWindow}}});MFNamespace("MFWA.Dialogs.Comments",function(){var i=MFNamespace("MFWA.I18n");var b=MFNamespace("MFWA.Data.Cache");var d=MFNamespace("MFWA.Window");var f=MFNamespace("MFWA.Pooling");var g=MFNamespace("MFWA.Dialogs.Templates");var a=MFNamespace("MFWA.Enumerations");var h=MFNamespace("MFWA.Utils");var c=MFNamespace("MFWA.Dialogs.Alerts");function e(){return f.get("CommentsDialog",function(){var k=g.createCommentsDialog();var j={jq:k,jqNode:k.commentsDialog,resize:function(l){k.commentHistory.height(l.height-220)},initialize:function(l,m){b.getPropertyDef(a.MFBuiltInPropertyDef.VersionComment,function(p){k.newCommentHeader.append(h.escape(p.Name)+":");var q="";for(var o=0;o<l.length;o++){if(m.ObjectCheckedOutToThisUser==true&&l[o].ObjVer.Version==m.ObjVer.Version){var n=h.escape(l[o].Comment.TypedValue.DisplayValue);if(n){k.newComment.append(n)}continue}q+='<div class="commentRow">';q+='<div class="commentTimestamp">'+h.escape(l[o].StatusChanged.TypedValue.DisplayValue)+i.Comma+h.escape(l[o].LastModifiedBy.TypedValue.DisplayValue)+"</div>";q+='<div class="commentText">'+h.escape(l[o].Comment.TypedValue.DisplayValue)+"</div>";q+="</div>"}k.commentHistory.append(q)})},getWindowResults:function(){return k.newComment.val()}};return j})}return{show:function(l,k,j){b.getVersionComments(l.ObjVer,function(n){var m=e();m.initialize(n,l);return d.show(i.CommentsDialog.Title+" - "+h.escape(l.Title),m,{minwidth:450,minheight:500,ok:function(o){if(k){var p=m.getWindowResults();return k(o,p)}else{return true}},cancel:function(o){if(j){return j(o)}else{return true}}})})}}});MFNamespace("MFWA.Dialogs.Workflow",function(){var k=MFNamespace("MFWA.I18n");var c=MFNamespace("MFWA.Data.Cache");var f=MFNamespace("MFWA.Window");var g=MFNamespace("MFWA.Pooling");var i=MFNamespace("MFWA.Dialogs.Templates");var a=MFNamespace("MFWA.Enumerations");var h=MFNamespace("MFWA.Nulls");var j=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.Dialogs.Alerts");var b=function(n,o){var l=$(".workflowDialog #workflow").val();var m=$(".workflowDialog select#state");m.empty();m.append('<option value="-1"></option>');if(o){$(".workflowDialog #workflow").attr("disabled","disabled");m.attr("disabled","disabled")}if(n){c.getStatesForWorkflow(l,n,function(p){for(var q=0;q<p.length;q++){if(p[q].ID==n){m.append('<option value="'+p[q].ID+'" selected>'+j.escape(p[q].Name)+"</option>")}else{if(p[q].Selectable==true){m.append('<option value="'+p[q].ID+'">'+j.escape(p[q].Name)+"</option>")}else{if($.browser.msie&&$.browser.version=="7.0"){m.append('<optgroup value="'+p[q].ID+'" class="disableOption" label="'+j.escape(p[q].Name)+'"></option>')}else{m.append('<option value="'+p[q].ID+'" disabled class="disableOption">'+j.escape(p[q].Name)+"</option>")}}}}if($.browser.msie){if(o){m.attr("disabled","")}m.hide();m.show();if(o){m.attr("disabled","disabled")}}})}else{c.getStatesForWorkflow(l,function(p){for(var q=0;q<p.length;q++){if(p[q].Selectable==true){m.append('<option value="'+p[q].ID+'">'+j.escape(p[q].Name)+"</option>")}else{if($.browser.msie&&$.browser.version=="7.0"){m.append('<optgroup value="'+p[q].ID+'" class="disableOption" label="'+j.escape(p[q].Name)+'"></option>')}else{m.append('<option value="'+p[q].ID+'" disabled class="disableOption">'+j.escape(p[q].Name)+"</option>")}}}if($.browser.msie){if(o){m.attr("disabled","")}m.hide();m.show();if(o){m.attr("disabled","disabled")}}})}m.val(n)};function d(l){return g.get("WorkflowDialog",function(){var n=i.createWorkflowDialog();var m={jq:n,jqNode:n.workflowDialog,resize:function(o){n.comment.height(o.height-180)},initialize:function(q,p){var s="";var o="";var r="";c.getPropertyDefsByID(function(t){s=j.escape(t[a.MFBuiltInPropertyDef.Workflow].Name);o=j.escape(t[a.MFBuiltInPropertyDef.State].Name);r=j.escape(t[a.MFBuiltInPropertyDef.VersionComment].Name);n.workflowHeader.append(s+k.Colon);n.stateHeader.append(o+k.Colon);n.commentHeader.append(r+k.Colon);c.getWorkflowsForObject(p,function(v){n.workflow.empty();n.workflow.append('<option value="-1"></option>');var w=null;if(q.Workflow.TypedValue.Lookup){w=q.Workflow.TypedValue.Lookup.Item}for(var u=0;u<v.length;u++){if(w==v[u].ID){n.workflow.append('<option value="'+v[u].ID+'" selected>'+j.escape(v[u].Name)+"</option>")}else{n.workflow.append('<option value="'+v[u].ID+'">'+j.escape(v[u].Name)+"</option>")}}var x=null;if(typeof(l)=="number"){x=l;b(x,true)}else{if(q.State.TypedValue.Lookup){x=q.State.TypedValue.Lookup.Item;b(x,false)}else{b(-1)}}})});return s},getWindowResults:function(){var o=$(".workflowDialog #workflow").val();var p=$(".workflowDialog #state").val();var q=$(".workflowDialog #comment").val();return{workflow:o,state:p,comment:q}}};return m})}return{show:function(o,m,l,n){c.getWorkflowState(o.ObjVer,function(p){var r=d(n);var q=r.initialize(p,o.ObjVer);return f.show(q+" - "+j.escape(o.Title),r,{minwidth:400,minheight:350,ok:function(s){if(m){var t=r.getWindowResults();var u=t.comment;return m(s,t)}else{return true}},cancel:function(s){if(l){return l(s)}else{return true}}})})},updateStates:function(l){b(l,false)}}});MFNamespace("MFWA.Dialogs.ChangePassword",function(){var g=MFNamespace("MFWA.I18n");var f=MFNamespace("MFWA.Data.Cache");var b=MFNamespace("MFWA.Window");var e=MFNamespace("MFWA.Pooling");var d=MFNamespace("MFWA.Dialogs.Templates");var c=MFNamespace("MFWA.Data.Operations");var h=MFNamespace("MFWA.Dialogs.Alerts");function a(){return e.get("ChangePassword",function(){var j=d.createChangePasswordDialog();var i={jq:j,jqNode:j.changePasswordDialog,resize:function(k){},getOld:function(){return j.oldPassword.val()},getNew1:function(){return j.newPassword.val()},getNew2:function(){return j.newPassword2.val()}};return i})}return{show:function(j){var i=a();return b.show(g.ChangePasswordDialog.Title,i,{width:300,height:180,ok:function(l){var k=i.getOld();var n=i.getNew1();var m=i.getNew2();if(k==""||n==""||m==""){h.ShowError(g.ChangePasswordDialog.EmptyPasswordError);return false}else{if(n!=m){h.ShowError(g.ChangePasswordDialog.NewPasswordsNotEqualError);return false}else{c.changePassword(k,n,function(){h.ShowNotification(g.ChangePasswordDialog.PasswordChanged,function(){c.logout(function(o){if(o.Value==true){window.location="login.aspx?logout=true"}})},function(){},690);if(j){return j(l)}else{return true}},function(o){h.ShowError(o.Message)})}}},cancel:function(k){return true}})}}});MFNamespace("MFWA.Dialogs.UndoCheckout",function(a){var c=MFNamespace("MFWA.Pooling");var e=MFNamespace("MFWA.I18n");var d=MFNamespace("MFWA.Window");var f=function(j){var k="empty";var i=$('<div class="UndoCheckout"><div class="message"></div><div class="buttons"><button class="ok">'+e.Yes+'</button><button class="cancel">'+e.No+"</button></div></div>");var l=i.find("button.ok");var m=i.find("button.cancel");var n=i.children("div.message");var h={window:i,message:n,ok:l,cancel:m};h.window.dialog({modal:true,closeOnEscape:true,width:350,height:150,resizable:false,bgiframe:false});var o=null;var g=function(){if(k(o)===false){o=null;return false}d.windowHidden();o=null;j.dispose();return true};h.window.bind("dialogbeforeclose",g);h.cancel.click(function(){o=false;h.window.dialog("close")});h.ok.click(function(){o=true;h.window.dialog("close")});return{jq:h,show:function(p){k=p;o=null;h.window.dialog("open");d.windowShown()},initialize:function(p){h.window.dialog("option","title",e.UndoCheckoutDialog.Title);h.message.html(p.message);h.ok.toggle(p.ok);h.cancel.toggle(p.cancel)}}};var b={ok:true,cancel:true};return{prompt:function(h,i){var g=c.get("UndoCheckout",f);h=$.extend({},b,h);g.initialize(h);g.show(i)}}});MFNamespace("MFWA.Dialogs.ForceUndoCheckout",function(a){var c=MFNamespace("MFWA.Pooling");var e=MFNamespace("MFWA.I18n");var d=MFNamespace("MFWA.Window");var f=function(j){var k="empty";var i=$('<div class="ForceUndoCheckout"><div class="message"></div><div class="question">'+e.ForceUndoCheckoutDialog.ProceedQuestion+'</div><div class="buttons"><button class="ok">'+e.Yes+'</button><button class="cancel">'+e.No+"</button></div></div>");var l=i.find("button.ok");var m=i.find("button.cancel");var n=i.children("div.message");var h={window:i,message:n,ok:l,cancel:m};h.window.dialog({bgiframe:false,modal:true,closeOnEscape:true,width:400,resizable:false});var o=null;var g=function(){if(k(o)===false){o=null;return false}d.windowHidden();o=null;j.dispose();return true};h.window.bind("dialogbeforeclose",g);h.cancel.click(function(){o=false;h.window.dialog("close")});h.ok.click(function(){o=true;h.window.dialog("close")});return{jq:h,show:function(p){k=p;o=null;h.window.dialog("open");d.windowShown()},initialize:function(p){h.window.dialog("option","title",e.ForceUndoCheckoutDialog.Title);h.message.html(p.message);h.ok.toggle(p.ok);h.cancel.toggle(p.cancel)}}};var b={ok:true,cancel:true};return{prompt:function(h,i){var g=c.get("ForceUndoCheckout",f);h=$.extend({},b,h);g.initialize(h);g.show(i)}}});MFNamespace("MFWA.Menu",function(){var a=MFNamespace("MFWA.Filters");var g=MFNamespace("MFWA.MFWA");var d=MFNamespace("MFWA.Icons");var e=MFNamespace("MFWA.Enumerations");var c=MFNamespace("MFWA.Configurations");var b=new Array("menu_ViewList","menu_ViewThumbnails");clearViewModeMenuItemIcons=function(){for(var h in b){$("#"+b[h]+" .menuItemIcon").css("background-image","")}};var f=new Array("menu_Group_GroupObjectsByObjectType","menu_Group_GroupViewsAndFolders");clearGroupInfoMenuItemIcons=function(){for(var h in f){$("#"+f[h]+" .menuItemIcon").css("background-image","")}};return{UpdateMenuItemStates:function(k){for(var m in a){if(m=="_namespace"){continue}var j=a[m];var i=$("#menu_"+m+" > div.menuItemText");var h=$("#contextmenu_"+m+" > div.menuItemText");var l=j(k);if(l&&(c.ViewAndModifyOptions)&&(c.ViewAndModifyOptions[m]==false)){l=false}if(l&&m=="Properties"&&(c.Controls&&!c.Controls.ShowDocumentCard)){l=false}if(l&&m=="CheckInWithComments"&&(c.ViewAndModifyOptions)&&(c.ViewAndModifyOptions.CheckIn==false)){l=false}if(l){i.removeClass("dimmed");h.removeClass("dimmed")}else{i.addClass("dimmed");h.addClass("dimmed")}}},RefreshGroupInfoMenuItems:function(){clearGroupInfoMenuItemIcons();var h=g.getListingMode();if(h.GroupByObjects.selected){$("#menu_Group_GroupObjectsByObjectType .menuItemIcon").css("background-image","url('"+d.Commands.Checked+"')")}if(h.GroupByViews.selected){$("#menu_Group_GroupViewsAndFolders .menuItemIcon").css("background-image","url('"+d.Commands.Checked+"')")}},RefreshViewModeMenuItems:function(i){var h=g.getListingMode();var j;if(h.List.selected){j="ViewList"}else{j="ViewThumbnails"}clearViewModeMenuItemIcons();$("#menu_"+j+" .menuItemIcon").css("background-image","url('"+d.Commands.Checked+"')")},RefreshColumnSettingMenuItems:function(h){$(".menuColumnInfoEnabler").css("background-image","");var h=g.getCurrentColumns();for(var j=0;j<h.length;j++){$("#menu_columnvisibility_"+h[j].PropertyID+" .menuItemIcon").css("background-image","url('"+d.Commands.Checked+"')")}},setMenuForItems:function(l){if(c.Controls&&!c.Controls.ShowContextMenu){return}var h;for(var k in l){var j=l[k];$("#"+j.row).contextMenu({menu:"menuSubOperations"},function(o){var p=$().listing.getListingItem(o);var q=p[0],m=p[1];var i=q.data("listing").opts;var n=q.listing("getSelected");if(n&&n.row==m.row){if(i.onrename){if(h){clearTimeout(h)}h=setTimeout(function(){h=null;i.onrename(m)},1000)}}else{if(h){clearTimeout(h)}i.onclick&&i.onclick(m)}});if(j.children&&j.children.length>0){this.setMenuForItems(j.children)}}}}});MFNamespace("MFWA.ViewItem",function(q){var B=MFNamespace("MFWA.Icons");var e=MFNamespace("MFWA.Debug.Assert");var d=MFNamespace("MFWA.Enumerations");var z=MFNamespace("MFWA.Utils");var s=MFNamespace("MFWA.Consts.ViewItem");var r=MFNamespace("MFWA.Debug");var D=MFNamespace("MFWA.Data.Cache");var x=MFNamespace("MFWA.StringBuilder");var t;var a;var w;var k;var i=[];var c=function(){D.getObjectsByType(function(F){k=F});D.getPropertyDefsByID(function(F){w=F})};var l=function(F){if(!t){t={};t.T=d.MFDataType.Text;t.B=d.MFDataType.Boolean;t.M=d.MFDataType.MultiLineText;t.L=d.MFDataType.Lookup;t.S=d.MFDataType.MultiSelectLookup;t.D=d.MFDataType.Date;t.C=d.MFDataType.Time;t.I=d.MFDataType.Integer;t.O=d.MFDataType.Integer64;t.R=d.MFDataType.Floating;t.E=d.MFDataType.FILETIME;t.P=d.MFDataType.Timestamp;a={};for(var G in t){a[t[G]]=G}}return a[F]};var o={};o[false]="User";o[true]="Common";var g={};g[false]="";g[true]="Overlapping";var E=function(F){return{itemType:s.ItemType.ObjectVersion,objectType:F.ObjVer.Type,id:F.ObjVer.ID,version:F.ObjVer.Version,file:0}};var n=function(G){if(G.ObjVer.Type==d.MFBuiltInObjectType.Assignment){if(G.ObjectVersionFlags&d.MFObjectVersionFlag.Completed){var F=B.Listing.IconDoneAssignment;return F}else{var F=B.Listing.IconUndoneAssignment;return F}}else{if(G.SingleFile){extension=G.Files[0].Extension.toLowerCase();var F=B.Extensions[extension];if(!F||F===""){F=B.Listing.Default}return F}else{return z.currentUrl+"REST/objects/"+G.ObjVer.Type+"/classes/"+G.Class+"/icon.aspx"}}};var f=function(G,F){if(!G){return}if(G.ObjectVersion){if(!F&&G.ObjectVersion.HasRelatedObjects){if(!G.ObjectVersion.SingleFile&&G.ObjectVersion.Files&&G.ObjectVersion.Files.length>0){return B.Expand_Collapse.FilesandRelatedObjectsCollapsed}else{return B.Expand_Collapse.RelatedObjectsCollapsed}}else{if(G.ObjectVersion.Files&&G.ObjectVersion.Files.length>0){return B.Expand_Collapse.FilesOnlyCollapsed}else{return B.Common.ImageSpacer}}}else{if(G.emptyRow){return B.Expand_Collapse.RelatedObjectsCollapsed}}};var u=function(G,F){if(!G){return}if(G.ObjectVersion){if(!F&&G.ObjectVersion.HasRelatedObjects){if(!G.ObjectVersion.SingleFile&&G.ObjectVersion.Files&&G.ObjectVersion.Files.length>0){return B.Expand_Collapse.FilesandRelatedObjectsExpanded}else{return B.Expand_Collapse.RelatedObjectsExpanded}}else{if(G.ObjectVersion.Files&&G.ObjectVersion.Files.length>0){return B.Expand_Collapse.FilesOnlyExpanded}else{return B.Common.ImageSpacer}}}else{if(G.emptyRow){return B.Expand_Collapse.RelatedObjectsExpanded}}};var b=function(H,I){var F=false;var G=H.parent;if(G&&G.emptyRow){G=G.parent}if(G&&G.objectVersion&&I.ObjVer.ID==G.objectVersion.ObjVer.ID){F=true}if(!F){if((H.parent)&&(!H.objectVersion.SingleFile&&H.objectVersion.Files.length>0)){F=true}}return F};var C=function(H,F){var G=null;G=q.ViewItem({emptyRow:true,itemType:F.ObjectType,objectType:F.ObjectType,sortingKey:F.sortingKey,name:"grouping"},H.path,H);G.childrenVisible=false;if(H.objectVersion.ObjVer.Type==d.MFBuiltInObjectType.Assignment&&F.ObjectType==d.MFBuiltInObjectType.Assignment){G.icon=n(H.objectVersion)}else{G.icon=z.currentUrl+"REST/objects/"+F.ObjectType+"/icon.aspx"}G.expandableRow=true;G.name=F.Name;if(G.name.length==0){G.name=MFWA.I18n.DocumentCard.PropertyValueHidden;if(F.ObjectType==d.MFBuiltInObjectType.Document){G.icon=B.Commands.MakeCopy}}return G};var m=function(O,G,K){var H=null;var N=[];N.children=[];for(var J in G){var M=G[J];if(!M||!M.GroupType){continue}N=C(O,M.GroupType);N.children=[];for(var F in M){if(F=="GroupType"){continue}var I=M[F];var L=q.ViewItem({FolderContentItemType:d.MFFolderContentItemType.ObjectVersion,ObjectVersion:I},O.path,O);L.rootItem=O;L.isRelatedObject=true;L.expandableRow=b(L,I);if(K){L.parent=N;N.children.push(L)}else{L.parent=O;O.children.push(L)}}if(K&&N.name){O.children.push(N)}}};var v=function(K,G,F){for(var I in F){var J=F[I];for(var H in J){var M=J[H];var L=k[M.ObjVer.Type];if(!G[M.ObjVer.Type]){G[M.ObjVer.Type]=[]}G[M.ObjVer.Type].GroupType={Name:L.NamePlural,ID:M.ObjVer.ID,ObjectType:M.ObjVer.Type,sortingKey:M.ObjVer.Type};if(!G[M.ObjVer.Type][M.ObjVer.ID]){G[M.ObjVer.Type][M.ObjVer.ID]=[]}G[M.ObjVer.Type][M.ObjVer.ID]=M}}};var j=function(J,F){if(!J.objectVersion){return}J.children=[];J.rootItem=J;var G=false;if(!J.objectVersion.SingleFile&&J.objectVersion.Files.length>0){G=true;for(var I in J.objectVersion.Files){var H=q.ViewItem({FolderContentItemType:d.MFFolderContentItemType.ObjectFile,ObjectFile:J.objectVersion.Files[I]},J.path,J);H.rootItem=J;J.children.push(H)}}else{if(J.objectVersion.ObjVer.Type!=d.MFBuiltInObjectType.Assignment){G=true}}if(!J.parent&&J.objectVersion.HasRelatedObjects){m(J,F,G)}};var A=function(Q,H,L,O,J,I){if(L[O.ValueList]){var P=L[O.ValueList][J.Item];if(!P&&i[O.ValueList]){P=i[O.ValueList][J.Item]}if(P){var K;var N;var G;var M;if(O.ID==d.MFBuiltInPropertyDef.CollectionMemberDocuments||O.ID==d.MFBuiltInPropertyDef.CollectionMemberCollections){K=-2}else{K=P.ObjVer.Type}if(I.DefaultPropertyDef==O.ID){N=P.ObjVer.Type;G=P.ObjVer.ID;M={Name:I.NamePlural,ID:P.ObjVer.ID,ObjectType:P.ObjVer.Type,sortingKey:K}}else{var F;if(K==-2){N=d.MFBuiltInPropertyDef.CollectionMemberDocuments;name=MFNamespace("MFWA.I18n").Properties.CollectionMember;F=d.MFBuiltInObjectType.DocumentCollection}else{N=O.ID;name=O.Name;F=P.ObjVer.Type}G=P.ObjVer.ID;M={Name:name,ID:P.ObjVer.ID,ObjectType:F,sortingKey:K}}if(!H[N]){H[N]=[]}H[N].GroupType=M;if(!H[N][G]){H[N][G]=[]}H[N][G]=P;if(!i[O.ValueList]){i[O.ValueList]=[]}if(!i[O.ValueList][J.Item]){i[O.ValueList][J.Item]=[]}i[O.ValueList][J.Item]=L[O.ValueList][J.Item];delete L[O.ValueList][J.Item]}}};var p=function(N,F,J,M,L,G){if(M.TypedValue.Lookup&&M.TypedValue.Lookup.Deleted==false){A(N,F,J,L,M.TypedValue.Lookup,G)}if(M.TypedValue.Lookups){var K=M.TypedValue.Lookups;for(var I in K){var H=K[I];if(H.Deleted){continue}A(N,F,J,L,H,G)}}};var h=function(F){if(!F.objectVersion){return}D.getRelationshipForPropertiespane(F.objectVersion.ObjVer.Type,F.objectVersion.ObjVer.ID,F.objectVersion.ObjVer.Version,function(G){D.getProperties(F.objectVersion.ObjVer,function(M){if(G.length>0){var L=[];for(var K in G){var H=G[K];if(!L[H.ObjVer.Type]){L[H.ObjVer.Type]=[]}if(!L[H.ObjVer.Type][H.ObjVer.ID]){L[H.ObjVer.Type][H.ObjVer.ID]=[]}L[H.ObjVer.Type][H.ObjVer.ID]=H}var I=[];for(var O in M){var P=M[O];var N=w[P.PropertyDef];if(N.BasedOnValueList){var J=k[N.ValueList];if(J&&J.RealObjectType){p(F,I,L,P,N,J)}}}v(F,I,L)}i=[];j(F,I);MFWA.MFWA.loadChildren(F);F.expandIcon=u({ObjectVersion:F.objectVersion},F.parent);F.collapseIcon=f({ObjectVersion:F.objectVersion},F.parent);if(F.children.length>0){F.toggleChildren()}else{F.showToggleIcon(false)}F.loadingChildren=false})})};var y=function(H){var G=$().listing.getListingItem(H)[1];if(!G||G.loadingChildren){return}G.childrenVisible=!G.childrenVisible;if(!G.childrenVisible||G.emptyRow||(G.children&&G.children.length>0)){G.toggleChildren()}else{G.loadingChildren=true;var F=$("#"+H+"_plus");F.attr("src",B.Expand_Collapse.Throbber);h(G)}};return{getObjectsAndProperties:c,getObjectIcon:n,expandChildren:y,ViewItem:function(T,L,R){var V=L;if(!V){V=""}if((V.length>1)&&(V[V.length-1]!="/")){V+="/"}var G;var O;var F;var P;var U=null;var S;var N=0;if(T.View){var J=false;G=T.View.Name;itemType=s.ItemType.View;if(T.View.ViewLocation&&T.View.ViewLocation.Overlapping){J=true;itemType=s.ItemType.PropertyFolder;if(T.View.Name==""){G=T.View.ViewLocation.OverlappedFolder.DisplayValue}}V+="V"+T.View.ID;F={itemType:itemType,objectType:0,id:T.View.ID,version:0,file:0};if(T.View.ID==15){O=B.Listing.IconFavoritesView}else{var Q=o[T.View.Common]+g[J]+"ViewFolder";O=B.Listing[Q]}}else{if(T.PropertyFolder){G=T.PropertyFolder.DisplayValue;V+=l(T.PropertyFolder.DataType);if(T.PropertyFolder.SerializedValue){V+=T.PropertyFolder.SerializedValue}O=B.Listing.PropertyFolder;F={itemType:s.ItemType.PropertyFolder,objectType:0,id:V,version:0,file:0}}else{if(T.ObjectVersion){G=T.ObjectVersion.Title;V+="O"+T.ObjectVersion.ObjVer.Type+"-"+T.ObjectVersion.ObjVer.ID+"-"+T.ObjectVersion.ObjVer.Version;if(T.ObjectVersion.SingleFile){var I=T.ObjectVersion.Files[0].Extension;if(I&&I!=""){G+="."+I}}F=E(T.ObjectVersion);N=parseInt(z.unique(""));O=n(T.ObjectVersion);var H=false;if(T.ObjectVersion.ObjectVersionFlags&d.MFObjectVersionFlag.HasRelatedObjects){H=true}T.ObjectVersion.HasRelatedObjects=H;var K=(!T.ObjectVersion.SingleFile&&T.ObjectVersion.Files.length>0);U=(H||K)}else{if(T.ObjectFile){G=T.ObjectFile.Name;var I=T.ObjectFile.Extension;if(I){G+="."+I}O=B.Extensions[I.toLowerCase()];if(!O||O===""){O=B.Listing.Default}V+="F"+T.ObjectFile.ID;F={itemType:s.ItemType.ObjectVersion,objectType:R.objectVersion.ObjVer.Type,id:R.objectVersion.ObjVer.ID,version:R.objectVersion.ObjVer.Version,file:T.ObjectFile.ID};N=parseInt(z.unique(""));if(!O){O=B.Extensions.defaultExtension}}else{if(T.TraditionalFolder){G=T.TraditionalFolder.DisplayValue;V+="Y"+T.TraditionalFolder.Item;O=B.Listing.TraditionalFolder;F={itemType:s.ItemType.TraditionalFolder,objectType:0,id:T.TraditionalFolder.Item,version:0,file:0}}else{if(T.emptyRow){O:T.icon;P=T.emptyRow;F={id:-1,itemType:T.itemType,objectType:T.objectType,sortingKey:T.sortingKey}}else{e.fail("Unknown view type")}}}}}}var M={type:T.FolderContentItemType,view:T.View,propertyFolder:T.PropertyFolder,objectVersion:T.ObjectVersion,objectFile:T.ObjectFile,traditionalFolder:T.TraditionalFolder,name:G,icon:O,path:V,children:[],ids:F,parent:R,pending:false,emptyRow:P,expandableRow:U,loadingChildren:false,rootItem:S,itemId:N,expandIcon:u(T,R),collapseIcon:f(T,R),isRelatedObject:false,updateObject:function(Y){this.name=Y.Title;if(Y.SingleFile&&Y.Files[0].Extension){this.name+="."+Y.Files[0].Extension}this.objectVersion=Y;this.icon=n(Y);this.ids=E(Y);this.pending=false;var X=false;if(this.objectVersion.ObjectVersionFlags&d.MFObjectVersionFlag.HasRelatedObjects){X=true}this.objectVersion.HasRelatedObjects=X;var W=(!this.objectVersion.SingleFile&&this.objectVersion.Files.length>0);this.expandableRow=(X||W)},updatePending:function(W){this.pending=W},showToggleIcon:function(W){if(W){$("#"+this.row+"_plus").show()}else{$("#"+this.row+"_plus").hide()}},toggleChildren:function(){var W=$("#"+this.row+"_plus");if(this.childrenVisible){W.attr("src",this.expandIcon)}else{W.attr("src",this.collapseIcon)}for(var Y in this.children){var X=this.children[Y];$("#"+X.row).toggle(this.childrenVisible);if(!this.childrenVisible){X.childrenVisible=false}X.toggleChildren()}},showChildren:function(Y){for(var X in this.children){var W=this.children[X];if(this.childrenVisible&&Y){$("#"+W.row).show()}else{$("#"+W.row).hide()}W.showChildren(Y)}},getColumnString:function(Z){var ac=new Array(Z.length);var ae=0;for(var ab in Z){var ad=new x.StringBuilder(12);var Y=Z[ab];var af=Y.func(this,Y);var W=null;if(af&&af.constructor==Date){af=$.datepicker.formatDate(i18n.DateTime.ShortDateTimeFormat,af)}if($("#hdnAddColumn").val()=="true"){ad.append(Y.realColumnNumber)}else{ad.append(ab)}ad.append('">');var X=Y.currentWidth;if(!af){ad.append('<div class="list_holder" style="width:'+X+'px;">')}else{if(Y.id==-1){ad.append('<div class="list_holder name_column" style="text-indent:21px;width:'+(X-af.indent)+"px;left:"+af.indent+"px;background-image: url("+af.objectIcon+');">');if(af.rowId){ad.append('<img class="arrow_icon" id="'+af.rowId+'_plus" onclick="MFWA.ViewItem.expandChildren(\''+af.rowId+'\')" src="'+af.expandIcon+'"/>')}if(af.overlayIcon){ad.append('<span class="list_content cellData" style="background: url('+af.overlayIcon+') no-repeat;">'+af.cellContent+"</span>")}else{ad.append('<span class="list_content cellData">'+af.cellContent+"</span>")}}else{if(af.id){if(af.isSize){ad.append('<div class="list_holder cellData _filesize" style="width:'+X+'px;" id="'+af.id+'">')}else{ad.append('<div class="list_holder cellData" style="width:'+X+'px;" id="'+af.id+'">')}ad.append(af.cellContent)}else{if(af.image){ad.append("<img src="+af.image+">")}else{ad.append('<div class="list_holder cellData" style="width:'+X+'px;">');if(af.cellContent){ad.append(af.cellContent)}else{ad.append(af)}}}}}ad.append("</div>");ac[ae]=ad.toString();ae++}var ag=["<",' onselectstart="return false" onmousedown="return false" class="listing-column column-'].join("td");var aa=["</",">"].join("td");return[ag,ac.join(aa+ag),aa].join("")},getRowString:function(Y,X){if(!this.row){var ac=z.unique("listing");var aa=[Y.id,ac].join("_row_");this.row=aa}var Z=Y.getContentFunc(this);if(Z.length==0){return}var ab=new x.StringBuilder(12);ab.append("<").append(Y.rowtag);if(Y.listingMode.Thumbnails.selected){if(Z.title){ab.append('  title="'+Z.title+'"')}ab.append(' class="list_thumnail_content" id="').append(this.row).append('"')}else{ab.append(' class="listing-item" id="').append(this.row).append('"')}if(!X&&this.parent){X=this.parent.groupHeaderId}if(X){ab.append(' GroupHeaderId="'+X+'"');this.groupHeaderId=X}if(this.parent&&!this.parent.childrenVisible){ab.append(' style="display:none;"')}addClickHandlers(ab,this.row);ab.append(">");if(Y.listingMode.Thumbnails.selected){ab.append(Z.content)}else{ab.append(Z)}ab.append("</").append(Y.rowtag).append(">");Y.items.push(this);Y.itemsByID[this.row]=this;var W=M.objectVersion;if(W){if(!Y.itemsByObjectVersionId[W.ObjVer.Type]){Y.itemsByObjectVersionId[W.ObjVer.Type]={}}if(!Y.itemsByObjectVersionId[W.ObjVer.Type][W.ObjVer.ID]){Y.itemsByObjectVersionId[W.ObjVer.Type][W.ObjVer.ID]=[]}Y.itemsByObjectVersionId[W.ObjVer.Type][W.ObjVer.ID].push(this)}return ab.toString()}};return M}}});MFNamespace("MFWA.SearchRefinement",function(o){var x=MFNamespace("MFWA.Data.Cache");var w=MFNamespace("MFWA.Utils");var c=MFNamespace("MFWA.Enumerations");var i=MFNamespace("MFWA.I18n");var t=MFNamespace("MFWA.StringBuilder");var q=[c.MFBuiltInPropertyDef.SingleFileObject,c.MFBuiltInPropertyDef.ClassGroups,c.MFBuiltInPropertyDef.CreatedBy,c.MFBuiltInPropertyDef.LastModifiedBy,c.MFBuiltInPropertyDef.DeletedBy,c.MFBuiltInPropertyDef.MarkedForArchiving,c.MFBuiltInPropertyDef.MonitoredBy,c.MFBuiltInPropertyDef.WorkflowAssignment];var g=function(y){if(y){if($.inArray(y,q)>-1){return false}else{return true}}else{return true}};var v=function(C,F,E,D){var A=false;if(!C.searchCriteria){return false}for(var z=0;z<C.searchCriteria.array.length;z++){if(F){if(C.searchCriteria.array[z].SearchObjectType===E){A=true;break}}else{for(var B=0;B<C.searchCriteria.array[z].PropertyCriteria.length;B++){var y=C.searchCriteria.array[z].PropertyCriteria[B];if(y.Property===D){A=true;break}}}}return A};var l=function(B,E,D,A,F,z,y){var C=new t.StringBuilder();C.append('<li propValue="'+D+'" class="noChild ');if(F){C.append('dimmed"')}else{if(z){C.append('accessedRefinement" ');C.append("onclick=\"$().listing.refinementHandlers.OnClick('accessedRefinement',")}else{C.append('commonRefinement" ');C.append("onclick=\"$().listing.refinementHandlers.OnClick('commonRefinement',")}C.append("'");C.append(B);C.append("','");C.append(D);C.append("','");C.append(E);C.append("','");C.append(w.escape(A));C.append("','");C.append(y);C.append("')\" ");C.append('propertyId="');C.append(E);C.append('" groupId="');C.append(B);C.append('"')}C.append(">");C.append(w.escape(A));C.append("</li>");return $(C.toString())};var d=function(){var y=$("<ul class='contextMenu' id='"+w.unique("refinmentMain_")+"' style='display: none;'></ul>");return y};var p=function(z,C){var B=w.unique("");var A=$("<li class='menuMain'></li>");var y=$("<span id='refinementHeader_"+B+"' style='float:left;'></span>");if(z.length>30){y.attr("title",z);z=z.substring(0,30)+"..."}y.append(z);y.append("<a class='ui-icon ui-icon-carat-1-s'></a>");A.append(y);A.contextMenu({activateLeft:true,menu:C});return A};var f=function(z,y){var A=p(z,y.attr("id"));if(!$("#searchRefinementItems").length){$("body").append("<div id='searchRefinementItems' class='searchRefinement'></div>")}$("#searchRefinementItems").append(y);y.find(".refinementImage").click(function(D){var C=$(this);var B=$(this).parent().find("ul");if(B.is(":visible")){B.css("display","none");C.css("background-position","0px 0px")}else{B.css("display","");C.css("background-position","0px -11px")}});return A};var k=function(B,E,C){var z;var D=B.refinementItem.Properties[E.ID];if(!D){D={id:-1,name:E.Name};B.refinementItem.Properties[E.ID]=D}if(D.id===-1){z=f(E.Name,C)}else{z=f(D.name,C);var A=l(B.Id,E.ID,-1,i.SearchRefinement.AnyString,false,(E.ID==-9999),B.Type);C.prepend(A);if(E.ID!=-9999){var y=l(B.Id,E.ID,E.ID,E.Name,true,false,B.Type);C.prepend(y)}}return z};var u=function(z,y,A){x.getPropertyDef(y.PropertyDef,function(E){if((E.DataType==c.MFDataType.Lookup)||(E.DataType==c.MFDataType.MultiSelectLookup)){var D=d();var B=k(z,E,D);var C=A.children().length;if(C<=2){if(C<2){A.prepend(B)}else{if(z.refinementItem.Class.Selected==null||z.refinementItem.Class.Selected>0){$(A.children()[0]).after(B)}else{z.refinementItem.Properties[E.ID]=null}}x.getValueListItemsByPropDefID(E.ID,function(I){if(!y.Required){var H=l(z.Id,E.ID,i.Empty,i.SearchRefinement.EmptyString,false,false,z.Type);D.append(H)}for(var F=0;F<I.length;F++){var G=I[F];var H=l(z.Id,E.ID,G.ID,G.Name,false,false,z.Type);D.append(H)}})}}})};var j=function(z,y,A){x.getClassInfo(y,function(D){for(var C=0;C<D.AssociatedPropertyDefs.length;C++){var E=D.AssociatedPropertyDefs[C];var B=g(E.PropertyDef);if(B){u(z,E,A)}}})};var s=function(z,B){var A=z.Type;var y=A;if(A==c.MFBuiltInObjectType.DocumentCollection){A=c.MFBuiltInObjectType.Document}x.getClassesByGroup(A,function(N){var G=null;var H=null;var J=0;var K;var C=d();for(var F=0;F<N.length;F++){if(N[F].Name==""){H=N[F].Classes;continue}var M=$('<ul id="'+w.unique(N[F].Name)+'"></ul>');for(var E=0;E<N[F].Classes.length;E++){if(!G){G=N[F].Classes[E].ID}var L=l(z.Id,c.MFBuiltInPropertyDef.Class,N[F].Classes[E].ID,N[F].Classes[E].Name,false,false,y);M.append(L);J++}var D=$('<li><div class="refinementImage ui-icon" style="background-position:0px -11px;background-image:url('+MFWA.Icons.Expand_Collapse.IconRefinementExpandCollapse+');"></div><span class="context_menu_head">'+N[F].Name+"</span></li>");D.append(M);C.append(D)}if(H){for(var E=0;E<H.length;E++){if(!G){G=H[E].ID}var L=l(z.Id,c.MFBuiltInPropertyDef.Class,H[E].ID,H[E].Name,false,false,y);C.append(L);J++}}if(J>1){var I=k(z,{ID:c.MFBuiltInPropertyDef.Class,Name:i.DocumentCard.Class.substring(0,i.DocumentCard.Class.length-1)},C);B.prepend(I)}else{if(G){j(z,G,B)}}})};var n=function(H,B,E){var C=(B.refinementItem.AccessedButton==-1);var y=[c.MFBuiltInPropertyDef.LastModified,c.MFBuiltInPropertyDef.LastModified,c.MFBuiltInPropertyDef.LastModified,c.MFBuiltInPropertyDef.AccessedByMe,c.MFBuiltInPropertyDef.AccessedByMe,c.MFBuiltInPropertyDef.AccessedByMe];var A=[i.SearchRefinement.ModifiedWithinLastWeek,i.SearchRefinement.ModifiedWithinLastMonth,i.SearchRefinement.ModifiedWithinLastYear,i.SearchRefinement.AccessedByMeWithinLastWeek,i.SearchRefinement.AccessedByMeWithinLastMonth,i.SearchRefinement.AccessedByMeWithinLastYear];var z=d();for(var D=0;D<A.length;D++){var I=v(H,false,0,"PV_"+y[D]);if(!I||!C){var G=l(B.Id,y[D],"mf"+y[D],A[D],false,true,B.Type);z.append(G)}}var I=v(H,false,0,"PV_"+c.MFBuiltInPropertyDef.CreatedBy);if(!I||!C){var G=l(B.Id,c.MFBuiltInPropertyDef.CreatedBy,-100,i.SearchRefinement.CreatedByMe,false,true,B.Type);z.append(G)}var F=k(B,{ID:-9999,Name:i.SearchRefinement.Accessed},z);E.prepend(F);B.refinementItem.AccessedButton=-9999};var e=function(H,A,F,y,J,C){var z=H.searchCriteria.array[0].PropertyCriteria;for(var B=0;B<z.length;B++){var D=z[B];if(D.Property=="PV_"+A){z.splice(B,1);B--}else{if((D.Property.IsAccessed)||(D.Property=="PV_"+c.MFBuiltInPropertyDef.CreatedBy)){z.splice(B,1);B--}}}if(F!="-1"){if(J&&y!=i.SearchRefinement.CreatedByMe){var G=new Date();switch(y){case i.SearchRefinement.AccessedByMeWithinLastWeek:case i.SearchRefinement.ModifiedWithinLastWeek:G=7;break;case i.SearchRefinement.AccessedByMeWithinLastMonth:case i.SearchRefinement.ModifiedWithinLastMonth:G=30;break;case i.SearchRefinement.AccessedByMeWithinLastYear:case i.SearchRefinement.ModifiedWithinLastYear:G=365;break}var I={Property:"PV_"+A,Condition:"lessOrEqualThan",TypedValue:w.getUTCTime(new Date()).getTime(),DataFunction:"d",DataType:"d",IsAccessed:true};z.push(I);var E={Property:"PV_"+A,Condition:"lessOrEqualThan",TypedValue:G,DataFunction:"m",DataType:"i",IsAccessed:true};z.push(E);if(w.isNumber(C)){H.searchCriteria.array[0].SearchObjectType=C}}else{if(w.isNumber(C)){H.searchCriteria.array[0].SearchObjectType=C}var E={Property:"PV_"+A,Condition:"is",TypedValue:F,DataFunction:null,DataType:null}}if(E){z.push(E)}}};var h=function(C,E,F,D,A,B,z){var y=(A=="accessedRefinement");e(C,F,D,B,y,z);if(y){F=-9999}if(D!="-1"){E.refinementItem.Properties[F].name=B;E.refinementItem.Properties[F].id=F;if(!y&&E.refinementItem.Class.Id==-1){if(F==100){E.refinementItem.Class.Id=D}}}else{E.refinementItem.Properties[F]=null}MFWA.Listing.ResetListingContainer();MFWA.Model.view.set({searchRefinementCriteria:C.searchCriteria})};var a=function(y,z){y.items=[];y.itemsByID={};y.itemsByObjectVersionId={};y.groupItemsById={};y.groupItemsByType={};y.groupItems=[];z.children=[];z.childrenVisible=false;z.loadingChildren=false;y.groupItems.push(z);y.groupItemsByType[z.Type]=z;y.groupItemsById[z.Id]=z};var r=function(A,z,D){if(!D){D=$("#menu_"+z)}if(A.listingMode.List.selected){var y=$("#listing").width();var C=$("#name_"+z).find(".thumb_group_head").width();var B=C-y+40;D.parent().css("right",B+"px");if(B>$("#header_"+z).width()){D.parent().css("right","0px")}}};var b=function(z,A){var y=$("#menu_"+A.Id);r(z,A.Id,y);if(A.refinementItem.AccessedButton){}else{A.refinementItem={AccessedButton:-1,Class:{Id:-1,Selected:null},Properties:[]}}n(z,A,y);s(A,y);if(A.refinementItem.Class.Id!=-1){j(A,A.refinementItem.Class.Id,y)}y.parent().toggle(A.childrenVisible)};var m=function(z,B,E,D,C,A,y){a(B,E);if(D==100){E.refinementItem.Class.Selected=C}h(B,E,D,C,z,A,y)};return{addRefinementItem:b,adjustAlignment:r,refinementItemClick:m}});MFNamespace("MFWA.GroupItem",function(m){var q=MFNamespace("MFWA.Utils");var o=MFNamespace("MFWA.StringBuilder");var r=MFNamespace("MFWA.Icons");var t=MFNamespace("MFWA.Data.Cache");var s=MFNamespace("MFWA.I18n.Grouping");var d=MFNamespace("MFWA.Enumerations");var c=MFNamespace("MFWA.Menu");var f=MFNamespace("MFWA.SearchRefinement");var j;var g=function(){t.getObjectsByType(function(v){j=v})};var p={View:"View",CommonView:"CommonView",PrivateView:"PrivateView",BuiltInView:"BuiltInView",PropertyFolder:"PropertyFolder",TraditionalFolder:"TraditionalFolder",Object:"Object"};var a=function(v){var w=new o.StringBuilder();if(v.listingMode.List.selected){w.append("<tr id='");w.append(this.Id);w.append("' style='height:45px;' GroupType='");w.append(this.Id);w.append("'><td class='table_group_header_cell' colspan='");w.append(v.options.columns.length);w.append("' id='name_");w.append(this.Id);w.append("' onmousedown='return false' onselectstart='return false'><div class='content_group'><div class='thumb_group_head'");w.append("><div class='group_header' style='background-image: url("+r.Expand_Collapse.IconGroupsExpanded+")'");w.append(" id='header_");w.append(this.Id);w.append("' onClick = '$().listing.groupingHandlers.OnClick(\"");w.append(this.Id);w.append("\")'></div><div class='header_line'></div></div>");w.append("<div class='searchRefinement'><ul class='menu' id='menu_");w.append(this.Id);w.append("' GroupType='");w.append(this.Id);w.append("'></ul></div></div></td></tr>")}else{if(v.listingMode.Thumbnails.selected){w.append("<div id='");w.append(this.Id);w.append("' GroupType='");w.append(this.Id);w.append("' class='thumbnail_group_container'><div class='content_group'><div class='thumb_group_head'><div class='group_header' style='background-image: url("+r.Expand_Collapse.IconGroupsExpanded+")'");w.append(" id='header_");w.append(this.Id);w.append("' onClick = '$().listing.groupingHandlers.OnClick(\"");w.append(this.Id);w.append("\")'></div><div class='header_line' id='header_line_");w.append(this.Id);w.append("'></div></div><div class='searchRefinement'><ul class='menu' id='menu_");w.append(this.Id);w.append("' GroupType='");w.append(this.Id);w.append("'></ul></div></div><div class='thumb_group_content' id='");w.append(this.Id);w.append("'></div>")}}return w.toString()};var h=function(v){v.content.find(v.rowtag+"[groupheaderid='"+this.Id+"']").remove()};var e=function(y){if(y.listingMode.List.selected){var w=$("#header_"+this.Id).width()+15;var x;if($("#mainTable").height()<=$(".listing-container").height()){if($("#mainTable").width()<=$(".listing-container").width()){x=$(".listing-container").width()-w-2}else{x=$("#mainTable").width()-w-2}}else{if($("#mainTable").width()<=$(".listing-container").width()){x=$(".listing-container").width()-w-22}else{x=$("#mainTable").width()-w-22}}$("#header_"+this.Id).next().css("left",w);$("#header_"+this.Id).next().css("width",x);f.adjustAlignment(y,this.Id)}else{var v=$(".listing-container").width()-$("#header_"+this.Id).width()-45;$("#header_line_"+this.Id).css("left",$("#header_"+this.Id).width()+20);$("#header_line_"+this.Id).width(v)}};var b=function(A,B,z){if(this.Type!=p.View&&this.Type!=p.CommonView&&this.Type!=p.PrivateView&&this.Type!=p.BuiltInView&&this.Type!=p.PropertyFolder&&this.Type!=p.TraditionalFolder){var v="";var y=this.Type;var C="moreResults_"+this.Id;if(this.children.length==50){v=" <a id='top_"+C+"' >"+s.ShowMoreResults+"</a>";$("#top_"+C).live("click",function(){var D={SearchIn:"SearchInBoth",SearchString:"",SearchWithinThisFolder:false,CurrentFolder:null,SearchType:null,SearchObjectType:y,PropertyCriteria:new Array()};var E={path:"",array:[]};E.array.push(D);MFWA.Listing.ResetListingContainer();$("body").append("<input type='hidden' id='showMoreHidden'/>");MFWA.Model.view.set({searchCriteria:E})});var w=this.Name+" ("+this.children.length+"+)"+v;$("#header_"+this.Id).html(w);$("#top_"+C).addClass("group_link");if(B){var x=new o.StringBuilder();if(A.listingMode.List.selected){x.append("<tr id='");x.append(C);x.append("' groupheaderid='");x.append(this.Id);if(!this.childrenVisible){x.append("' style='display:none;'><td colspan='")}else{x.append("'><td colspan='")}x.append(A.options.columns.length);x.append("' style='width:");x.append(q.getTextWidth(this.Name));x.append("px;'>");x.append("<a id='bottom_"+C+"' >"+s.ShowMoreResults+"</a>");x.append("</td></tr>")}else{x.append("<div id='");x.append(C);x.append("' groupheaderid='");x.append(this.Id);if(!this.childrenVisible){x.append("' style='display:none;clear:both;width:")}else{x.append("' style='clear:both;width:")}x.append(q.getTextWidth(this.Name));x.append("px;'>");x.append("<a id='bottom_"+C+"' >"+s.ShowMoreResults+"</a>");x.append("</div>")}if(z){$("#"+A.groupItems[1].Id).before(x.toString())}else{$("#"+this.children[49].row).after(x.toString())}$("#bottom_"+C).addClass("group_link_bottom");$("#bottom_"+C).click(function(){$("#top_"+C).click()})}}else{var w;if(this.children.length>0){w=this.Name+" ("+this.children.length+")"}else{w=this.Name}$("#header_"+this.Id).text(w)}}else{$("#header_"+this.Id).text(this.Name)}this.reAlignLines(A)};var k=function(y,B,A){if(this.autoExpand||B){this.clearChildren(y);if(this.children.length>0){var w=new o.StringBuilder();for(var v in this.children){var x=this.children[v];var z=x.getRowString(y,this.Id);w.append(z)}if(y.listingMode.List.selected){y.content.find(y.rowtag+"[grouptype='"+this.Id+"']").after(w.toString())}else{y.content.find(y.rowtag+"[grouptype='"+this.Id+"']").append(w.toString())}c.setMenuForItems(this.children)}else{y.createNoResultMessage(true)}this.loadingChildren=true;this.childrenVisible=true;$("#header_"+this.Id).css("background-image","url('"+r.Expand_Collapse.IconGroupsExpanded+"')")}else{$("#header_"+this.Id).css("background-image","url('"+r.Expand_Collapse.IconGroupsCollapsed+"')")}};var l=function(){for(var w in this.children){var v=this.children[w];v.showChildren(this.childrenVisible)}};var n=function(w,v){if(w.loadingChildren){w.childrenVisible=!w.childrenVisible;v.content.find(v.rowtag+"[groupheaderid='"+w.Id+"']").toggle(w.childrenVisible);w.toggleChildren()}else{w.fetchChildren(v,true)}if(w.childrenVisible){$("#header_"+w.Id).css("background-image","url('"+r.Expand_Collapse.IconGroupsExpanded+"')")}else{$("#header_"+w.Id).css("background-image","url('"+r.Expand_Collapse.IconGroupsCollapsed+"')")}$("#menu_"+w.Id).parent().toggle(w.childrenVisible);w.reAlignLines(v)};var u=function(v){for(var w in v.groupItemsByType){var x=v.groupItemsByType[w];f.addRefinementItem(v,x)}};var i=function(G,H,x){var B;var E;var y;var D=false;var w=H.objectVersion;if(!w&&H.parent){w=H.parent.objectVersion}if(w){if(G.listingMode.GroupByObjects.selected){var v=j[H.ids.objectType];if(v.NamePlural&&v.NamePlural.length>0){E=v.NamePlural}else{E=s.UnknownObject}B=v.ID;if(v.ID==d.MFBuiltInObjectType.Document){y="#";D=true}else{if(v.ID==d.MFBuiltInObjectType.DocumentCollection){y="$";D=true}else{y=E}}}else{E=s.Objects;B=p.Object;y=E}}else{if(G.listingMode.GroupByViews.selected){D=true;if(H.view){if(H.view.ID<100){E=s.BuiltInView;B=p.BuiltInView;y="2"}else{if(H.view.Common){E=s.CommonView;y="1";B=p.CommonView}else{E=s.PrivateView;y="0";B=p.PrivateView}}}else{if(H.propertyFolder){E=s.PropertyFolder;B=p.PropertyFolder;y="0"}else{if(H.traditionalFolder){E=s.TraditionalFolder;B=p.TraditionalFolder;y="3"}}}}else{E=s.Views;B=p.View;y=E}}var A=q.replaceAll(E," ","_");A=q.unique("groupHeader_");if(G.groupItemsByType[B]){var z=G.groupItemsByType[B];z.Name=E;if(x&&G.listingMode.GroupByObjects.selected){if(z.children.length<50){z.children.push(H)}}else{z.children.push(H)}return z}else{G.groupItemsByType[B]={};var C=[];C.push(H);var F={Id:A,Name:E,childrenVisible:false,Type:B,children:C,loadingChildren:false,sortKey:y,refinementItem:[],autoExpand:D,fetchChildren:k,updateHeaderName:b,getHtmlString:a,toggleChildren:l,clearChildren:h,reAlignLines:e};G.groupItems.push(F);G.groupItemsByType[B]=F;G.groupItemsById[A]=F;return F}};return{addGroupItem:i,toggleGroup:n,setSearchRefinementButtons:u,getObjects:g}});(function(j){var v=MFNamespace("MFWA.StringBuilder");var s=MFNamespace("MFWA.Debug");var e=MFNamespace("MFWA.Debug.Assert");var B=MFNamespace("MFWA.Utils");var q=MFNamespace("MFWA.I18n");var E=MFNamespace("MFWA.Icons");var c=MFNamespace("MFWA.Enumerations");var b=MFNamespace("MFWA.Menu");var l=MFNamespace("MFWA.GroupItem");var f=MFNamespace("MFWA.Model");var C=MFNamespace("MFWA.Layout");var n=MFNamespace("MFWA.Configurations");var t={};var r;var w;var D=function(H){var G;var F;if(H.ondblclick&&H.onclick){addClickHandlers=function(J,I){J.append(" ondblclick=\"$().listing.handlers.OnDblClick('");J.append(I);J.append("')\" onclick=\"$().listing.handlers.OnClick('");J.append(I);J.append("')\"")};F=5}else{if(H.ondblclick){addClickHandlers=function(J,I){J.append(" ondblclick=\"$().listing.handlers.OnDblClick('");J.append(I);J.append("')\"")};F=3}else{if(H.onclick){addClickHandlers=function(J,I){J.append(" onclick=\"$().listing.handlers.OnClick('");J.append(I);J.append("')\"")};F=3}else{addClickHandlers=function(){}}}}return{handler:G,elements:F}};var g=function(U){var O=j("#searchString");var V=false;var N=false;var M=j("<div class='EmptyMsg' id='dvemptyMsg' oncontextmenu='return false;' onmousedown='return false;' onselectstart='return false;'><img class='information' src='Images/Icons/information.png'/><div id='noResultsText' class='content noresults'>"+q.Search.NoResult.Message_NoResultstoDisplay+"</div><div id='newSearchText' class='propertiesPaneButton content'>"+q.Search.NoResult.Message_TryNewSearch+"</div><div id='widenSearchText' class='propertiesPaneButton content'>"+q.Search.NoResult.Message_WidenYourSearch+B.escape(O.val())+"* </div><div id='turnOffSearchwithInFolder' class='propertiesPaneButton content'>"+q.Search.NoResult.Message_TurnOffSearchWithinFolder+"</div><div id='showAllResults' class='propertiesPaneButton content'>"+q.Search.NoResult.Message_ShowAllResults+"</div><div id='advancedSearch' class='propertiesPaneButton content'>"+q.Search.NoResult.Message_SearchWithoutAdvanced+"</div><div id='valutSearch' class='propertiesPaneButton content'>"+q.Search.NoResult.Message_SearchEntrieVault+"</div></div>");j("#listingTable").append(M);if(j.browser.msie&&j.browser.version=="9.0"){j("#listingTable").find(".EmptyMsg").addClass("corner_ie9")}var R=j("#newSearchText");var P=j("#widenSearchText");var I=j("#valutSearch");var R=j("#newSearchText");var L=j("#advancedSearch");var T=j("#searchWithinThisFolder");var J=j("#widenSearchDone");var G=j("#searchWithinFolderDone");var H=j("#turnOffSearchwithInFolder");var F=j("#showAllResults");if(U){M.css("top","40px");F.click(function(){MFWA.Search.PerformSearch()})}else{F.remove()}if(j("#searchAdvanced").is(":visible")){V=true}if(V){for(var K=1;K<=2;K++){var Q=j("#searchPropertyCriterion"+K+" .searchExpression option:selected").text();if(Q&&Q.length>0){N=true;break}}}var S=O.val();if(S.length==0){R.hide()}if(J.val()=="true"||S.length==0||(S.substring(S.length-1)=="*")){P.hide()}else{P.click(function(){P.hide();J.val(true);O.val(O.val()+"*");MFWA.Search.PerformSearch()})}if(j("#searchObjectType").val()==-1){I.hide()}else{I.click(function(){I.hide();j("#searchObjectType").val(-1);if(T.is(":checked")){T.click()}MFWA.Search.PerformSearch()})}if(!N){L.hide()}else{L.click(function(){L.hide();MFWA.Search.OpenSearch();MFWA.Search.PerformSearch()})}if(!T.is(":checked")||G.val()=="true"){H.hide()}else{H.click(function(){H.hide();G==true;T.click();MFWA.Search.PerformSearch()})}R.click(function(){var X=j("#bubbleTooltip");if(!X.length){var ab=q.Search.NoResult.ToolTip_TypeNewSearch;var Z=B.getTextWidth(ab)+6;var W=j("#searchBasic");O.select();X=j('<div id="bubbleTooltip" class="cornerPanel_container" style="#width:'+Z+'px"><div class="cornerPanel_top"><div></div></div><div class="cornerPanel_mid1"><div class="cornerPanel_mid2"><div class="cornerPanel_mid3" oncontextmenu="return false;" onmousedown="return false;" onselectstart="return false;">'+ab+'</div></div></div><div class="cornerPanel_btm"><div></div></div></div>');W.append(X);var aa=B.getTextWidth(O.val());var Y=W.position().left+aa;X.css("left",Y+"px");if(j.browser.msie&&j.browser.version=="9.0"){X.addClass("corner_ie9")}setTimeout(function(){X.remove()},10000);O.blur(function(){X.remove()});O.keydown(function(){X.remove()})}})};var u=function(J){if(!J.listingMode.Thumbnails.selected){for(var I in J.options.columns){var H=J.options.columns[I];if(H.id==J.options.sortedColumn.id){var G=parseInt(I)+1;var L=J.dummyHeader.find("th");L.css("background","");L.find("div").removeClass("emptyDiv");var K=J.dummyHeader.find("> :nth-child("+G+")");var F=K.find("div");F.addClass("emptyDiv");F.height(j("#mainTable").find("tbody").height());break}}}};var z=function(F,H){for(var G=0;G<F.length;G++){if(F[G].row==H.row){F.splice(G,1);break}}};var y=function(F){if(this.options.columns.length==0){return""}return F.getColumnString(this.options.columns)};var k=function(G){if(G.parent||(G.parent&&!G.parent.childrenVisible)){return""}var J=new v.StringBuilder();var I;var H=G.name;if(H.length>23){H=H.substr(0,20);H+="...";I=G.name}J.append('<span class="list_thumbItem" style="background:url(');if(G.objectVersion){if(G.objectVersion.ObjVer.Type==c.MFBuiltInObjectType.Document){if(G.objectVersion.SingleFile&&G.objectVersion.Files.length==1){J.append(B.currentUrl);J.append("REST/objects/");J.append(G.objectVersion.ObjVer.Type);J.append("/");J.append(G.objectVersion.ObjVer.ID);J.append("/");J.append(G.objectVersion.ObjVer.Version);J.append("/files/");J.append(G.objectVersion.Files[0].ID);J.append("/");J.append(G.objectVersion.Files[0].Version);J.append("/");J.append("thumbnail.aspx")}else{J.append(E.Listing.MultiFileDocument48)}}else{if(G.objectVersion.ObjVer.Type==c.MFBuiltInObjectType.Assignment){if(G.objectVersion.ObjectVersionFlags&c.MFObjectVersionFlag.Completed){J.append(E.Listing.IconDoneAssignment48)}else{J.append(E.Listing.IconUndoneAssignment48)}}else{if(G.objectVersion.ObjVer.Type==c.MFBuiltInObjectType.DocumentCollection){J.append(E.Listing.DocumentCollection48)}else{J.append(B.currentUrl);J.append("REST/objects/");J.append(G.objectVersion.ObjVer.Type);J.append("/icon.aspx?size=48")}}}}if(G.objectFile){if(G.parent&&G.parent.objectVersion){J.append(B.currentUrl);J.append("REST/objects/");J.append(G.parent.objectVersion.ObjVer.Type);J.append("/");J.append(G.parent.objectVersion.ObjVer.ID);J.append("/");J.append(G.parent.objectVersion.ObjVer.Version);J.append("/files/");J.append(G.objectFile.ID);J.append("/");J.append(G.objectFile.Version);J.append("/");J.append("thumbnail.aspx")}}else{if(G.view){if(G.view.Common){if(G.view.ID==15){J.append(E.Listing.IconFavoritesView48)}else{if(G.view.ViewLocation&&G.view.ViewLocation.Overlapping){J.append(E.Listing.CommonOverlappingViewFolder48)}else{J.append(E.Listing.CommonViewFolder48)}}}else{if(G.view.ViewLocation&&G.view.ViewLocation.Overlapping){J.append(E.Listing.UserOverlappingViewFolder48)}else{J.append(E.Listing.UserViewFolder48)}}}else{if(G.propertyFolder){J.append(E.Listing.PropertyFolder48)}else{if(G.traditionalFolder){J.append(E.Listing.TraditionalFolder48)}}}}J.append(') no-repeat center center;">');if(G.pending){J.append('<img src="');J.append(E.Overlays.Pending48c32);J.append('">')}else{if(G.objectVersion||(G.parent&&G.parent.objectVersion)){var F=G.objectVersion||G.parent.objectVersion;if(!F.ThisVersionLatestToThisUser){J.append('<img src="');J.append(E.Overlays.PreviousVersion48c32);J.append('">')}else{if(F.ObjectCheckedOutToThisUser){J.append('<img src="');J.append(E.Overlays.CheckedOutCurrent48c32);J.append('">')}else{if(F.ObjectCheckedOut){J.append('<img src="');J.append(E.Overlays.CheckedOutOther48c32);J.append('">')}}}}}J.append("</span>");J.append(B.escape(H));return{title:I,content:J.toString()}};var m=function(G){var F=j('<div id="refreshListing" style="background-image: url(\''+E.Commands.Refresh+"')\"></div>");j("#listing").prepend(F);if(G.onrefresh){F.click(G.onrefresh)}F.wrap('<div class="refreshIcon"></div>')};var i=function(K,F){var L=j(K);var M={jq:null,value:null};L.empty();L.addClass("listing");var N=j('<tr class="header" style="height:0px;"></tr>');var I=j('<table id="headerTable" class="listing-headers" cellspacing="0" cellpadding="0"></table>');var O=j("<tr></tr>");var G=j('<div class="listing-container"></div>');var P=j('<tr class="emptyRow1"></tr>');L.before(I.append(j("<thead></thead>").append(O).append(P)));L.before('<div id="dummyHeader"></div>');L.before(G);G.append(L);m(F);var J=L.attr("id");if(!J||J==""){J=B.unique("listing");L.attr("id",J)}G.parent().bind("resize",function(){var T=j(this);G.width(T.width());var R=T.outerHeight(true)-20;var V=MFWA.Model.view.get();var S=j("#viewCaption");if(S.length&&S.html().length>0){var U=j("#viewCaption").outerHeight(true)+2;if(U){R-=U}}else{R-=2}G.height(R);j().listing.adjustGroupingWidth()});G.parent().trigger("resize");G.parent().css("overflow","hidden");G.bind("scroll",function(){I.css("left",-G.scrollLeft())});var H={Thumbnails:{selected:false}};var Q={node:L,opts:F,path:null,content:{},header:N,fixedHeader:O,dummyHeader:P,selected:null,items:[],itemsByID:{},itemsByObjectVersionId:{},groupItems:[],groupItemsById:{},groupItemsByType:{},id:J,getContentFunc:y,createNoResultMessage:g,rowtag:"",listingMode:H,container:j("#listing").find(" .listing-container"),options:{data:null,columns:[],sortedColumn:{id:[],isAscending:false},columnchangedcb:function(){}}};t[J]=L;L.data("listing",Q);L.listing("setListingMode",H)};var a=function(H,G,F){H.sort(function(K,I){var J=G.comparer(K,I,G,F);if(F){return J}else{return -J}})};var p=function(K,G,F,L,J){for(var I in G){var H=G[I];L.append(j("#"+H.row));F.push(H);if(H.childrenVisible){H.childrenVisible=false}if(H.children&&H.children.length>0){a(H.children,J,K.options.sortedColumn.isAscending);p(K,H.children,F,L,J)}}return{listItems:L,listValues:F}};var o=function(N,O){var I=N.items.length;var F=N.content.find("tr");var J;for(var H in N.options.columns){var K=N.options.columns[H];if(K.id==N.options.sortedColumn.id){var L=parseInt(H)+1;J=F.find("> :nth-child("+L+")").find(".cellData");O=K;break}}if(I==J.length){var G="";var M=0;J.each(function(P){if(P>0&&G!=j(this).text()){return false}else{G=j(this).text()}M=M+1});if(M==I){return false}}else{if(J.length==0){return false}}return true};var h=function(M,J,N){var H=J;var F=[];for(var G in H){if(!H[G].parent){F.push(H[G])}}if(F.length>0){var K;if(N){K=N}else{for(var I in M.options.columns){if(M.options.sortedColumn.id==M.options.columns[I].id){K=M.options.columns[I];break}}}if(K){a(F,K,M.options.sortedColumn.isAscending)}}var L=[];var O=j("<tbody></tbody>");return p(M,F,L,O,K)};var d=function(F){if(F.listingMode.GroupByViews.selected||F.listingMode.GroupByObjects.selected){F.content.find("tr[grouptype]:first-child").each(function(G){var H=j(this);H.attr("colspan",F.options.columns.length)})}};var A={setColumns:function(I,N){var G=j(this);var O=G.data("listing");var M=[];if(j("#hdnAddColumn").val()!="true"){O.fixedHeader.empty();O.dummyHeader.empty();O.header.empty()}else{M=O.options.columns}var F=0;for(var J in I){var H=I[J];if(typeof(H)=="string"){H={path:H}}if(typeof H.title=="undefined"){H.title=H.path}var K=parseInt(B.unique(""));if(j("#hdnAddColumn").val()=="true"){F=H.realColumnNumber;H.realColumnNumber=K}else{F=J;H.realColumnNumber=J}H=j.extend({},j.fn.listing.column_defaults,H);var L=function(T,R){var Y,X,W;T.headerHTMLId="column_header_"+T.realColumnNumber;var Z=T.title.length>0?T.title:"&nbsp";var P=j("<span id='"+T.headerHTMLId+"'>"+Z+"</span>");T.textWidth=B.getTextWidth(Z)+13;if(T.sorting){if(T.sorting==1){P.addClass("column-header-sortimage-up")}else{if(T.sorting==2){P.addClass("column-header-sortimage-down")}}P.css({backgroundPosition:+T.textWidth+"px center",width:T.currentWidth})}else{P.width(T.currentWidth)}var V=j("<img class='sorting_tempImage'>");if(T.sorting){O.options.sortedColumn.id=T.id;if(T.sorting==1){V.attr("src",E.Listing.ArrowUp);O.options.sortedColumn.isAscending=true}else{if(T.sorting==2){V.attr("src",E.Listing.ArrowDown);O.options.sortedColumn.isAscending=false}}if(T.currentWidth-13<T.textWidth){P.append(V)}}X=j('<th class="table_header header ui-state-default" style="border-top: none;"></th>').append(P).bind("onselectstart",function(){return false}).hover(function(){X.addClass("ui-state-hover")},function(){X.removeClass("ui-state-hover")}).width(T.currentWidth+1).click(function(){if(O.suppressSort||O.suppressDrag){return}if(O.options.sortedColumn.id==T.id){O.options.sortedColumn.isAscending=!O.options.sortedColumn.isAscending}else{O.options.sortedColumn.id=T.id;O.options.sortedColumn.isAscending=true}G.listing("sort");u(O)});Y=X.clone();Y.addClass("spacer");Y.span=Y.find("span");Y.span.find("img").remove();O.fixedHeader.append(X);O.header.append(Y);W=j("<th></th>");var S=j("<div></div>");S.width(T.currentWidth);S.height(j("#listing").find(".listing-container").height());if(T.sorting){S.addClass("emptyDiv")}W.append(S);W.width(T.currentWidth+1);O.dummyHeader.append(W);Y.data("listing",T);P.resizable({handles:"e",minWidth:12,maxWidth:T.maxWidth,start:function(){O.suppressSort=true},resize:function(){var ac=P.width();X.width(ac);X.css("position","");P.css("left","0px");var af=O.content.find(".column-"+T.realColumnNumber);af.find(".list_holder").width(ac);Y.width(ac);Y.span.width(ac);var ab=ac-13;W.width(ac);W.find("div").width(ac);var ad=P.find("img");if(ab<T.textWidth){if(ad.length==0){var ae=true;if(P.hasClass("column-header-sortimage-up")){V.attr("src",E.Listing.ArrowUp)}else{if(P.hasClass("column-header-sortimage-down")){V.attr("src",E.Listing.ArrowDown)}else{ae=false}}if(ae){P.append(V)}}else{if(P.hasClass("column-header-sortimage-up")){ad.attr("src",E.Listing.ArrowUp)}else{if(P.hasClass("column-header-sortimage-down")){ad.attr("src",E.Listing.ArrowDown)}else{ad.remove()}}}}else{ad.remove()}},stop:function(){setTimeout(function(){O.suppressSort=false},0);T.currentWidth=X.width();T.onColumnResize();for(var ac=0;ac<O.groupItems.length;ac++){var ab=O.groupItems[ac];ab.reAlignLines(O)}O.container.trigger("scroll")}});var aa=function(ab,ac){O.suppressDrag=true;X.css({background:"url(images/ui-bg_flat_100_aaaab8_40x100.png) repeat-x scroll 50% 50% #F8ECE0"})};var Q=function(ac,ak){var ae=ak.position.left;var ag=M[R];if(j(this).position().left>ae){var ab=X.position().left;for(var aj=R-1;aj>=0;aj--){var ad=M[aj].currentWidth;ab-=ad;var ah=j("#column_header_"+M[aj].realColumnNumber).parent();if((ab+(ad/2))>(ae)){var al=j("#column_header_"+M[aj+1].realColumnNumber).parent();ah.css("border-left-color","black");al.css("border-left-color","#D3D3D3")}else{ah.css("border-left-color","#D3D3D3")}}}else{var af=(X.position().left+M[R].currentWidth);var aj=R;for(aj=parseInt(aj)+1;aj<M.length;aj++){af+=(M[aj].currentWidth);var ah=j("#column_header_"+M[aj].realColumnNumber).parent();if((af-(M[aj].currentWidth/2))<(ae+M[R].currentWidth)){var ai=j("#column_header_"+M[aj-1].realColumnNumber).parent();ah.css("border-right-color","black");ai.css("border-right-color","#D3D3D3")}else{ah.css("border-right-color","#D3D3D3")}}}};var U=function(ac,ak){var ag=[];for(var ae=0;ae<M.length;ae++){ag.push((ae+1)*2)}var af=ak.position.left;var ai=M[R];if(j(this).position().left>af){var ab=X.position().left;for(var aj=R-1;aj>=0;aj--){var ad=M[aj].currentWidth;ab-=ad;if((ab+(ad/2))>(af)){ag[R]=ag[aj]-1}}}else{var ah=(X.position().left+M[R].currentWidth);var aj=R;for(aj=parseInt(aj)+1;aj<M.length;aj++){var ad=M[aj].currentWidth;ah+=ad;if((ah-(ad/2))<(af+M[R].currentWidth)){ag[R]=ag[aj]+1}}}N(ag);setTimeout(function(){O.suppressDrag=false},0)};X.draggable({axis:"x",containment:"window",opacity:0.5,zIndex:2000,helper:"clone",start:aa,drag:Q,stop:U});O.header.height(0);O.header.parent().height(0);M.push(T)}(H,F)}O.options.columns=M;O.options.columnchangedcb=N},setData:function(Z,U){var N=new MFWA.Timer(function(aa){s.write("SetData preparations @ jquery.listing: "+aa)});var R=new MFWA.Timer(function(aa){s.write("SetData string building @ jquery.listing: "+aa)});var K=new MFWA.Timer(function(aa){s.write("SetData finalizing @ jquery.listing: "+aa)});N.start();var P=j(this);var V=P.data("listing");if(!V.fromSearchRefinement){V.items=[];V.itemsByID={};V.itemsByObjectVersionId={};V.groupItemsById={};V.groupItemsByType={};V.groupItems=[]}var G=V.content;G.empty();V.options.data=Z;V.selected=null;if(!Z){return}else{if(!U){if(V.path==2){if(Z.length==0){g();P.listing("updatePending",false);return}else{j("#widenSearchDone").val(false);j("#searchWithinFolderDone").val(false)}}}}var M=h(V,Z);var W=M.listValues;var O=7;var L=D(V.opts);O+=L.elements;L=L.handler;var H=new v.StringBuilder(W.length*O);N.report();R.start();R.report();K.start();if(V.listingMode.GroupByViews.selected||V.listingMode.GroupByObjects.selected){var Q=false;Q=(parseInt(j("#searchObjectType").val())!==-1)&&(isNaN(j("#searchObjectType").val())===false);if(j("#showMoreHidden").length){Q=false;j("#showMoreHidden").remove()}for(var T in W){var X=W[T];X.children=[];if(!X.parent){l.addGroupItem(V,X,Q)}}V.groupItems.sort(function(ac,ab){var aa=(""+ac.sortKey.toLowerCase()),ad=(""+ab.sortKey.toLowerCase());if(aa>ad){return 1}if(aa<ad){return -1}return 0});var I=V.groupItems.length;for(var Y=0;Y<I;Y++){var F=V.groupItems[Y];G.append(F.getHtmlString(V));if(I==1){F.fetchChildren(V,true)}else{F.fetchChildren(V,false)}F.updateHeaderName(V,true)}if(I==1&&V.path==2&&Q){var S=j("#header_"+V.groupItems[0].Id);S.css("background","none");S.removeAttr("onclick")}}else{for(var T in W){var X=W[T];var J=X.getRowString(V);H.append(J)}G.html(H.toString());b.setMenuForItems(W)}P.listing("updatePending",false);K.report();if(V.listingMode.Thumbnails.selected){V.dummyHeader.hide()}else{V.dummyHeader.show()}d(V)},setDataForNewColumn:function(){var I=j(this);var M=I.data("listing");if(!M.listingMode.Thumbnails.selected){var G=[];var H=M.options.columns.length-1;G.push(M.options.columns[H]);for(var J in M.items){var N=M.items[J];var F=N.getColumnString(G);j("#"+N.row).append(F)}d(M)}for(var K=0;K<M.groupItems.length;K++){var L=M.groupItems[K];L.reAlignLines(M)}},removeColumnFromListing:function(L){var K=j(this);var M=K.data("listing");for(var J in M.options.columns){var I=M.options.columns[J];if(I.id==L.PropertyID){var H=parseInt(J)+1;M.fixedHeader.find("> :nth-child("+H+")").remove();M.dummyHeader.find("> :nth-child("+H+")").remove();M.header.find("> :nth-child("+H+")").remove();M.options.columns.splice(parseInt(J),1);if(!M.listingMode.Thumbnails.selected){M.content.find("tr.listing-item > :nth-child("+H+")").remove();M.container.trigger("scroll");d(M)}break}}for(var G=0;G<M.groupItems.length;G++){var F=M.groupItems[G];F.reAlignLines(M)}},repositionColumns:function(K){var J=K.header;if(J.length>0){var F=J.find("th");for(var I=0;I<F.length;I++){var G=F[I];j(G).width(K.options.columns[I].currentWidth);var H=j(G).find("span");j(H).width(K.options.columns[I].currentWidth)}}},setSortingIcon:function(J){for(var G in J.options.columns){var I=J.options.columns[G];var L=j("#"+I.headerHTMLId);if(I.sorting){if(I.sorting==1){L.removeClass("column-header-sortimage-down");L.addClass("column-header-sortimage-up")}else{if(I.sorting==2){L.removeClass("column-header-sortimage-up");L.addClass("column-header-sortimage-down")}}L.css({backgroundPosition:+I.textWidth+"px center",width:I.currentWidth});var F=I.currentWidth-13;if(F<I.textWidth){var H=L.find("img");if(H.length){if(I.sorting==1){H.attr("src",E.Listing.ArrowUp)}else{if(I.sorting==2){H.attr("src",E.Listing.ArrowDown)}}}else{var K=j("<img class='sorting_tempImage'>");if(I.sorting==1){K.attr("src",E.Listing.ArrowUp)}else{if(I.sorting==2){K.attr("src",E.Listing.ArrowDown)}}L.append(K)}}}else{L.removeClass("column-header-sortimage-up column-header-sortimage-down");L.find("img").remove()}}},sort:function(F,G){var H=j(this);var O=H.data("listing");if(typeof F!="undefined"){O.options.sortedColumn.id=F}if(typeof G!="undefined"){O.options.sortedColumn.isAscending=G}var N=false;var P;if((O)&&(O.items.length)){if(O.listingMode.Thumbnails.selected){N=true}else{N=o(O,P)}}if(N){if(!O.listingMode.GroupByViews.selected&&!O.listingMode.GroupByObjects.selected){var R=h(O,O.options.data,P);var Q=R.listItems;O.content.html(Q.children())}else{var L;for(var I in O.options.columns){if(O.options.sortedColumn.id==O.options.columns[I].id){L=O.options.columns[I];break}}var M=[];var Q=j("<tbody></tbody>");for(var K=0;K<O.groupItems.length;K++){var J=O.groupItems[K];var R=h(O,J.children,P);var Q=R.listItems;J.clearChildren(O);if(O.listingMode.List.selected){O.content.find(O.rowtag+"[grouptype='"+J.Id+"']").after(Q.children())}else{O.content.find(O.rowtag+"[grouptype='"+J.Id+"']").append(Q.children())}J.updateHeaderName(O,true,true)}}}for(var I in O.options.columns){if((O.options.columns[I].sorting)!==0&&(O.options.sortedColumn.id!==O.options.columns[I].id)){O.options.columns[I].sorting=0;O.options.columns[I].onColumnSort()}else{if(O.options.sortedColumn.id==O.options.columns[I].id){if(O.options.sortedColumn.isAscending){O.options.columns[I].sorting=1}else{O.options.columns[I].sorting=2}O.options.columns[I].onColumnSort()}}}H.listing("setSortingIcon",O)},select:function(J){var F=j(this);var I=F.data("listing");if(I.selected){I.selected.jq.removeClass("row_highlight")}var H=j("#"+J);var G=F.listing("getItemByID",J);if(j.browser.msie){j("html").focus()}else{j("#taskpane").append("<input type='text' id='tempText' style='width:0px;height:0px;'></input>");j("#tempText").focus();j("#tempText").remove()}H.addClass("row_highlight");I.selected={jq:H,item:G}},unselect:function(){var F=j(this);var G=F.data("listing");if(G.selected){G.selected.jq.removeClass("row_highlight")}G.selected=null},updatePending:function(H){var F=j(this);var G=F.data("listing");if(H){C.enableApplet(false);j.blockUI({message:'<img src="images/load.gif" /> ',overlayCSS:{backgroundColor:"#D3D3D3"},css:{width:"0%",height:"0%",top:"47%",left:"50%",border:"0px solid #aaa"}})}else{j.unblockUI({onUnblock:function(){C.enableApplet(true)}})}},getSelected:function(){var F=j(this);var G=F.data("listing");if(G.selected){return G.selected.item}else{return null}},setItem:function(I,H){var F=j(this);var G=F.data("listing");var K=j("#"+I);K.empty();var J=G.getContentFunc(H);if(G.listingMode.Thumbnails.selected){K.append(J.content)}else{K.append(J)}},addItemsAfter:function(K,F){var H=j(this);var J=H.data("listing");if(F.constructor!==Array){F=[];for(var G=1;G<arguments.length;G++){F.push(arguments[G])}}var I;for(var G in J.options.columns){if(J.options.columns[G].id==J.options.sortedColumn.id){I=J.options.columns[G];break}}H.listing("_addItems",{items:F,afterItem:K,currentSortedColumn:I})},addItem:function(G){var F=j(this);F.listing("_addItems",{items:[G]})},_addItems:function(S){var J=j(this);var R=J.data("listing");var M=S.items;if(M.length>1){a(M,S.currentSortedColumn,R.options.sortedColumn.isAscending)}var P=D(R.opts);var O=new v.StringBuilder(M.length*(7+P.elements));P=P.handler;if(R.listingMode.GroupByViews.selected||R.listingMode.GroupByObjects.selected){var F=[];for(var K=0;K<M.length;K++){var Q=M[K];R.options.data.push(Q);if(Q.parent){var N=Q.getRowString(R);if(S.afterItem){j("#"+S.afterItem.row).after(N)}else{if(S.beforeItem){j("#"+S.beforeItem.row).before(N)}else{R.content.append(N)}}}else{if(!R.groupItemsByType[Q.ids.objectType]){var L=l.addGroupItem(R,Q);F.push(L);var N=Q.getRowString(R,L.Id);O.append(N)}else{var L=R.groupItemsByType[Q.ids.objectType];var N=Q.getRowString(R,L.Id);if(L.childrenVisible&&L.children.length>0){j("#"+L.children[L.children.length-1].row).after(N)}L.children.push(Q);L.updateHeaderName(R)}}}var H=F.length;var G;if(H>0){for(var I=0;I<H;I++){var L=F[I];L.childrenVisible=true;if(j("#"+L.Id).length){j("#"+L.children[L.children.length-1].row).after(O.toString())}else{R.content.append(L.getHtmlString(R));j("#"+L.Id).after(O.toString())}L.updateHeaderName(R);G=L}}if(R.listingMode.GroupByObjects.selected&&(R.path==2||R.path==9)){if(G&&G.Id){l.setSearchRefinementButtons(R)}}}else{for(var K=0;K<M.length;K++){var Q=M[K];R.options.data.push(Q);var N=Q.getRowString(R);O.append(N)}if(S.afterItem){j("#"+S.afterItem.row).after(O.toString())}else{if(S.beforeItem){j("#"+S.beforeItem.row).before(O.toString())}else{R.content.append(O.toString())}}}b.setMenuForItems(M)},removeItem:function(L,K){var I=j(this);var J=I.data("listing");j("#"+L.row).remove();J.itemsByID[L.row]=null;z(J.items,L);if(f.view.get().objectHistory){K=true}if(K){for(var H=0;H<J.groupItems.length;H++){var F=J.groupItems[H];z(F.children,L);z(J.groupItemsByType[F.Type].children,L);z(J.groupItemsById[F.Id].children,L);if(F.children.length>0){F.updateHeaderName(J)}else{j("#"+F.Id).remove();J.groupItemsByType[F.Type]=null;J.groupItemsById[F.Id]=null;J.groupItems.splice(H,1)}}}if(!J.options||!J.options.data){return}for(var G=0;G<J.options.data.length;G++){if(J.options.data[G].row==L.row){J.options.data.splice(G,1);return}}},selectNext:function(){var H=j(this);var I=H.data("listing");var G=I.selected;if(G){var F=G.jq.next();while(F.length==1&&F.css("display")=="none"&&F.attr("grouptype")!==""){F=F.next()}if(F.length==1){j().listing.handlers.OnClick(F.attr("id"))}}else{if(I.options.data.length>0){j().listing.handlers.OnClick(I.options.data[0].row)}}},selectPrev:function(){var G=j(this);var I=G.data("listing");var F=I.selected;if(F){var H=F.jq.prev();while(H.length==1&&H.css("display")=="none"&&H.attr("grouptype")!==""){H=H.prev()}if(H.length==1){j().listing.handlers.OnClick(H.attr("id"))}}else{if(I.options.data.length>0){j().listing.handlers.OnClick(I.options.data[0].row)}}},setListingMode:function(M){var I=j(this);var K=I.data("listing");K.listingMode=M;I.empty();var L;var H;var G;if(M.Thumbnails.selected){for(var F in K.options.data){var J=K.options.data[F];if(J.childrenVisible){J.childrenVisible=false}}G=j("<div></div>");K.rowtag="div";K.getContentFunc=k;I.append(G)}else{L=j("<table id='mainTable' class='listing-headers' style='border-spacing:0;' cellspacing=0 cellpadding=0></table>");H=j('<thead style="height:0px;overflow:hidden;"></thead>');H.append(K.header);G=j("<tbody></tbody>");K.rowtag="tr";K.getContentFunc=y;L.append(H);L.append(G);I.append(L)}K.content=G},getItemByID:function(F){return j(this).data("listing").itemsByID[F]},getGroupItemByID:function(F){return j(this).data("listing").groupItemsById[F]}};j.fn.listing=function(H){var F=[];for(var G=1;G<arguments.length;G++){F.push(arguments[G])}var I;this.each(function(){if(I!==undefined){return}if(typeof H=="string"){var J=H;I=A[J].apply(this,F)}else{e.exists(H,"columns");H=j.extend({},j.fn.listing.defaults,H);e.exists(H,"columns");i(this,H)}});return I};j.fn.listing.defaults={data:[],ondblclick:null,onclick:null,sortColumn:0,sortAscending:true};j.fn.listing.column_defaults={currentWidth:100,path:"",func:function(G,F){return B.extractPath(F.path,G)},comparer:function(G,F,H){var J=this.func(G,H);var I=this.func(F,H);if(J==I){return 0}if(J<I){return -1}else{return 1}}};j.fn.listing.getListing=function(F){return t[F]};j.fn.listing.getListingItem=function(H){var G=H.lastIndexOf("_");var F=H.substr(0,G-4);var I=j().listing.getListing(F);return[I,I.listing("getItemByID",H)]};j.fn.listing.getGroupItem=function(G){var H=j().listing.getListing("listingTable");var F=H.data("listing");return F.groupItemsById[G]};j.fn.listing.adjustGroupingWidth=function(){var M=j().listing.getListing("listingTable");if(M){var K=M.data("listing");if(K.listingMode.Thumbnails.selected){var J=K.groupItems.length;for(var H=0;H<J;H++){var L=K.groupItems[H];var F=j(".listing-container").width()-j("#header_"+L.Id).width()-45;j("#header_line_"+L.Id).css("left",j("#header_"+L.Id).width()+20);j("#header_line_"+L.Id).width(F)}}else{for(var I=0;I<K.groupItems.length;I++){var G=K.groupItems[I];G.reAlignLines(K)}}}};var x;j.fn.listing.handlers={OnClick:function(I){var J=j().listing.getListingItem(I);var K=J[0],G=J[1];var F=K.data("listing").opts;var H=K.listing("getSelected");if(H&&H.row==G.row){if(F.onrename){if(x){clearTimeout(x)}x=setTimeout(function(){x=null;F.onrename(G)},1000)}}else{if(x){clearTimeout(x)}}F.onclick&&F.onclick(G)},OnDblClick:function(G){if(x){clearTimeout(x);x=null}var H=j().listing.getListingItem(G);var I=H[0],F=H[1];I.data("listing").opts.ondblclick(F)}};j.fn.listing.refinementHandlers={OnClick:function(N,H,G,I,F,K){var L=j().listing.getGroupItem(H);var J=j().listing.getListing("listingTable");var M=J.data("listing");MFWA.SearchRefinement.refinementItemClick(N,M,L,I,G,F,K)}};j.fn.listing.groupingHandlers={OnClick:function(F){var H=j().listing.getGroupItem(F);var I=j().listing.getListing("listingTable");var G=I.data("listing");l.toggleGroup(H,G)}};j.fn.disableDragAndDrop=function(){var F=function(G){G.stopPropagation();G.preventDefault()};return this.each(function(){obj=j(this);obj.bind("dragenter",function(G){obj.addClass("ActualColor");j("#searchBasic").css("cursor","default");j("#tree").css("cursor","default");j("#propertiesPane").css("cursor","default");j(".propertiesPaneColumn").css("cursor","default");j("#tree a").css("cursor","default");j("#listing").css("cursor","default");j(".listing-column").css("cursor","default");j(".nameText").css("cursor","default");j("#panel").css("cursor","default");j("#taskpane #taskpaneContent .taskpaneItemText").css("cursor","default");j("#taskpane").css("cursor","default");j("#taskpane #taskpaneContent").css("cursor","default");j("#propertiesPaneProperties").css("cursor","default");F(G)},false);obj.bind("dragover",function(G){F(G)},false);obj.bind("dragleave",function(G){j("#tree").css("cursor","no-drop");j("#propertiesPane").css("cursor","no-drop");j("#listing").css("cursor","no-drop");j("#tree a").css("cursor","no-drop");j("#taskpane #taskpaneContent .taskpaneItemText").css("cursor","no-drop");j("#taskpane").css("cursor","no-drop");j("#taskpane #taskpaneContent").css("cursor","no-drop");j(".listing-column").css("cursor","no-drop");j("#searchBasic").css("cursor","no-drop");j(".nameText").css("cursor","no-drop");j("#panel").css("cursor","no-drop");j("#propertiesPaneProperties").css("cursor","no-drop");j(".propertiesPaneColumn").css("cursor","no-drop");F(G)},false);obj.bind("drop",function(G){setTimeout("obj.removeClass('ChangeCursor');  $('#panel').css('cursor', 'default'); obj.addClass('ActualColor'); $('#taskpane #taskpaneContent .taskpaneItemText').css('cursor', 'default');  $('#taskpane #taskpaneContent').css('cursor', 'default'); $('#tree').css('cursor','default'); $('#listing').css('cursor','default'); $('#taskpane').css('cursor', 'default');  $('#searchBasic').css('cursor', 'default'); $('#tree a').css('cursor', 'default');  $('.listing-column').css('cursor', 'default'); $('#propertiesPane').css('cursor', 'default'); $('.nameText').css('cursor', 'default');$('#propertiesPaneProperties').css('cursor', 'default'); $('.propertiesPaneColumn').css('cursor', 'default'); ",200);F(G)},false)})}})(jQuery);MFNamespace("MFWA.Listing",function(n){var o=MFNamespace("MFWA.Debug");var s=MFNamespace("MFWA.Utils");var x=MFNamespace("MFWA.Data.Cache");var r=MFNamespace("MFWA.Data.Operations");var m=MFNamespace("MFWA.Handlers.PropertyHandlers");var k=MFNamespace("MFWA.Java");var j=MFNamespace("MFWA.ViewItem");var e=MFNamespace("MFWA.Model");var b=MFNamespace("MFWA.Enumerations");var u=MFNamespace("MFWA.I18n.Listing");var v=MFNamespace("MFWA.Icons");var p=MFNamespace("MFWA.Status");var h=MFNamespace("MFWA.Notifications");var a=MFNamespace("MFWA.Menu");var g=MFNamespace("MFWA.Configurations");var t=MFNamespace("MFWA.Data.GlobalObjects");var f=-9999;var c;var i={View:1,Search:2,History:3,CollectionMembers:4,Relationships:5,Subobjects:6,MFDContents:7,SingleObject:8,SearchFromSearchRefinemnt:9};var l={viewPath:i.View,searchCriteria:i.Search,objectHistory:i.History,collectionMembers:i.CollectionMembers,relationships:i.Relationships,subobjects:i.Subobjects,mfdcontents:i.MFDContents,singleObject:i.SingleObject,searchRefinementCriteria:i.SearchFromSearchRefinemnt};var q={List:{selected:false},Thumbnails:{selected:false},GroupByObjects:{selected:false},GroupByViews:{selected:false}};var d=q;var w=b.GroupingInfo.None;return{makeListing:function(N,H){var ab;var aA={};var aG=null;var aq=[];var C=[];var aa=[];var aw=[];var ak=[];var S=true;var Q="";var ai={};var z=null;var aI=false;var aO=[];var ax=[];j.getObjectsAndProperties();MFWA.GroupItem.getObjects();t.collect();var aj=[];x.getPropertyDefsByID(function(aP){aj=aP});x.getObjectsByType(function(aP){aO=aP});var aM=function(aR){if(!aR){aR=e.view.get()}var aQ=null;for(var aS in aR){if(aQ!==null){assert.fail("There are two active views.")}aQ=aS}if(aQ===null){return}if(z){clearTimeout(z);z=null}var aP=l[aQ];T[aP](aR[aQ])};e.view.observe(n,aM);var T={};T[i.View]=function(aP){if(typeof aP=="undefined"){assert.fail("Refreshing view with no path");return}if(ab){ab.cancel=true}ab=x.getViewContents(aP,D)};T[i.Search]=function(aP){x.performSearch(aP,function(aQ){y({json:aQ,view:i.Search,criteria:aP})},function(aR){MFWA.Dialogs.Alerts.ShowError(aR);$("#searchString").val("");$("#listingTable").listing("updatePending",false);var aQ={ActiveView:"",IsSearch:false};MFWA.Data.Operations.saveActiveView(aQ);var aS={SearchIn:$("#searchIn").val(),WithinFolder:$("#searchWithinThisFolder").attr("checked"),SearchObjectType:$("#searchObjectType").val(),LookWord:$('[name="searchTypeGroup"]:checked').val(),SearchWord:""};MFWA.Data.Operations.saveSearchState(aS)})};T[i.SearchFromSearchRefinemnt]=function(aP){x.performSearch(aP,function(aQ){y({json:aQ,view:i.SearchFromSearchRefinemnt,criteria:aP})})};T[i.History]=function(aP){r.getObjectHistory(aP,function(aQ){y({json:aQ,view:i.History})})};T[i.CollectionMembers]=function(aP){r.getCollectionMembers(aP,function(aQ){y({json:aQ,view:i.CollectionMembers})})};T[i.Relationships]=function(aP){r.getRelationships(aP,function(aQ){y({json:aQ,view:i.Relationships})})};T[i.Subobjects]=function(aP){r.getSubobjects(aP,function(aQ){y({json:aQ,view:i.Subobjects})})};T[i.MFDContents]=function(aP){r.getMFDContents(aP,function(aQ){y({json:aQ,view:i.MFDContents})})};T[i.SingleObject]=function(aP){r.getSingleobject(aP,function(aQ){y({json:aQ,view:i.SingleObject})})};var E=function(aP){aA[aP.itemId]=aP};var ad=function(aR){if(aR.objectVersion){E(aR)}for(var aQ in aR.children){var aP=aR.children[aQ];ad(aP)}};var B=function(aU){var aV=e.view.get();var aQ="";if(aV&&aV.viewPath){aQ=aV.viewPath}var aS=[];aS.ObjectVersion=aU;var aT=j.ViewItem(aS,aQ);var aR=N.data("listing");for(var aP=0;aP<aR.items.length;aP++){if(aR.items[aP]&&aR.items[aP].objectVersion&&aR.items[aP].itemId==aU.itemId&&aR.items[aP].objectVersion.ObjVer.Version==aU.ObjVer.Version){aT=aR.items[aP];break}}e.selectedItem.set(aT);return aT};var aH=function(aU){var aV=e.view.get();var aQ="";if(aV&&aV.viewPath){aQ=aV.viewPath}var aR=[];aR.ObjectVersion=aU;var aT=j.ViewItem(aR,aQ);E(aT);N.listing("addItem",aT);for(var aP in aT.children){var aS=aT.children[aP];N.listing("addItem",aS)}return aT};var av=function(aP){N.listing("setItem",aP.row,aP)};var K=function(aR){aR.emptyRow=false;if(aR.objectVersion){aR.objectVersion.ThisVersionLatestToThisUser=false}N.listing("setItem",aR.row,aR);for(var aQ in aR.children){var aP=aR.children[aQ];if(!aP.emptyRow){if(aP.objectVersion){aP.objectVersion.ThisVersionLatestToThisUser=false}K(aP)}}};var I=function(aX,aV,aP){if(aV){N.listing("removeItem",aX,aP)}for(var aS in aX.children){var aU=aX.children[aS];I(aU,true,false)}if(aP){var aQ=aX.objectVersion;if(!aQ){aQ=aX.ObjectVersion}if(aQ){var aY=N.data("listing");for(var aT=0;aT<aY.itemsByObjectVersionId[aQ.ObjVer.Type][aQ.ObjVer.ID].length;aT++){var aW=aY.itemsByObjectVersionId[aQ.ObjVer.Type][aQ.ObjVer.ID][aT];if(aW.parent&&aW.parent.children&&aW.parent.children.length>0){for(var aR=0;aR<aW.parent.children.length;aR++){if(aX.ids.id==aW.parent.children[aR].ids.id){aW.parent.children.splice(aR,1);if(aW.parent.children.length==0){if(aW.parent.emptyRow){I(aW.parent,true,false);aR--}else{aW.parent.showToggleIcon(false)}}}}}I(aW,true,false);aY.itemsByObjectVersionId[aQ.ObjVer.Type][aQ.ObjVer.ID].splice(aT,1);aT--}}}};var F=function(aR){N.listing("addItemsAfter",aR,aR.children);if(aR.objectVersion){ad(aR)}for(var aQ in aR.children){var aP=aR.children[aQ];if(aP.children&&aP.children.length>0){F(aP)}}};var an=function(aR,aS){aR.updatePending(aS);N.listing("setItem",aR.row,aR);for(var aQ in aR.children){var aP=aR.children[aQ];if(!aP.emptyRow&&aP.isRelatedObject==false){an(aP,aS)}}};var Z=function(aS,aT){var aV=e.view.get();if(aV&&aV.objectHistory&&(!aS.parent)){return}if(!aS.objectVersion){return}var aU=aS.objectVersion;var aR=N.data("listing");if(!aR.itemsByObjectVersionId||!aR.itemsByObjectVersionId[aU.ObjVer.Type]||!aR.itemsByObjectVersionId[aU.ObjVer.Type][aU.ObjVer.ID]){return}for(var aP=0;aP<aR.itemsByObjectVersionId[aU.ObjVer.Type][aU.ObjVer.ID].length;aP++){var aQ=aR.itemsByObjectVersionId[aU.ObjVer.Type][aU.ObjVer.ID][aP];an(aQ,aT)}};var M=function(aP){I(aP);av(aP);F(aP)};var ap=function(aT,aW,aP,aX){var aY;if(aX.objectFile){aY=aA[aX.parent.itemId]}else{aY=aA[aX.itemId]}if(!aY){return}var aV;if(aY.objectVersion){aV=aY.objectVersion}else{aV=aY.ObjectVersion}var aU=aV.ObjVer;if((aU.ID!=aT.ID)||(aU.Type!=aT.Type)||(aU.Version!=aT.Version)){return}var aS=false;var aR=e.selectedItem.get();if(aR.objectVersion){var aQ=aR.objectVersion;if(aU.Type==aQ.ObjVer.Type&&aU.ID==aQ.ObjVer.ID&&aU.Version==aQ.ObjVer.Version){aS=true}}A(aW,aY);if(aS){e.selectedItem.set(aY)}else{e.selectedItem.set(null)}if(aP){MFWA.Listing.RefreshChildren(aY,aP)}ay(true)};var ao=function(aV,aU,aQ){if(aU.objectFile){return}var aT=N.data("listing");if(!aT.itemsByObjectVersionId||!aT.itemsByObjectVersionId[aV.ObjVer.Type]||!aT.itemsByObjectVersionId[aV.ObjVer.Type][aV.ObjVer.ID]){return}var aS=aT.itemsByObjectVersionId[aV.ObjVer.Type][aV.ObjVer.ID];if(aS.length==1){return}for(var aP=0;aP<aS.length;aP++){var aR=aS[aP];if(aR.row==aU.row){continue}A(aV,aR);if(aV.HasRelatedObjects){MFWA.Listing.RefreshChildren(aR,aQ)}}};var R=function(aR,aT,aQ,aW){var aS=false;var aU=false;if(aR.objectVersion.ObjVer.Version<aT.ObjVer.Version){aW=aH(aT);an(aR,false);K(aR);N.listing("sort");aU=true}else{if(aR.objectVersion.ObjVer.Version>aT.ObjVer.Version){I(aR,true,false);var aV=N.data("listing");for(var aP=0;aP<aV.items.length;aP++){if(aV.items[aP]&&aV.items[aP].objectVersion&&aV.items[aP].objectVersion.ObjVer.Version==aT.ObjVer.Version){aW=aV.items[aP];break}}}}if(!aU){A(aT,aW)}if(aS){e.selectedItem.set(aW)}else{e.selectedItem.set(null)}if(aQ){MFWA.Listing.RefreshChildren(aW,aQ)}ay(true)};var A=function(aQ,aP){if(aP.children&&aP.children.length>0){I(aP,false,false)}aP.updateObject(aQ);an(aP,false);av(aP);if(aP.children&&aP.children.length>0){F(aP)}};var y=function(aP){if(ab){ab.cancel=true}D(aP)};var V=function(aR,aQ,aP){if(aR){q={List:{selected:false},Thumbnails:{selected:false},GroupByObjects:{selected:false},GroupByViews:{selected:false}};if(aR.ViewMode==2){q.List.selected=false;q.Thumbnails.selected=true}else{q.List.selected=true;q.Thumbnails.selected=false}w=aR.DisplayMode;if(w!=b.GroupingInfo.None){if((w&b.GroupingInfo.GroupObjectsByObjectType)&&(w&b.GroupingInfo.GroupViewsAndFolders)){q.GroupByObjects.selected=true;q.GroupByViews.selected=true}else{if(w&b.GroupingInfo.GroupObjectsByObjectType){q.GroupByObjects.selected=true}else{if(w&b.GroupingInfo.GroupViewsAndFolders){q.GroupByViews.selected=true}}}}}else{q={List:{selected:true},Thumbnails:{selected:false},GroupByObjects:{selected:false},GroupByViews:{selected:false}};if(aP==i.Search){q.GroupByObjects.selected=true;q.GroupByViews.selected=true}else{if(aQ=="/"){q.List.selected=true;q.GroupByViews.selected=true}}var aS=MFWA.MFWA.getViewSettingsID();if(q.GroupByViews.selected&&q.GroupByObjects.selected){r.setGroupInfo(aS,(b.GroupingInfo.GroupObjectsByObjectType+b.GroupingInfo.GroupViewsAndFolders))}else{if(!q.GroupByViews.selected&&!q.GroupByObjects.selected){r.setGroupInfo(aS,b.GroupingInfo.None)}else{if(q.GroupByViews.selected){r.setGroupInfo(aS,b.GroupingInfo.GroupViewsAndFolders)}else{if(q.GroupByObjects.selected){r.setGroupInfo(aS,b.GroupingInfo.GroupObjectsByObjectType)}}}}r.setViewMode(aS,1)}return q};var at=function(aP){var aQ=$("#viewCaption");aQ.addClass("Caption");aQ.html("");aQ.show();var aR=$("#captionText").val();if(aP==i.History){aR=MFWA.I18n.Commands.History;aQ.html(aR)}else{if(aP==i.Relationships){aR=MFWA.I18n.Commands.Relationships+" - "+aR;aR=s.escape(aR);aQ.html(aR)}else{if(aP==i.CollectionMembers){aR=u.CollectionMemberCaption+" - "+aR;aR=s.escape(aR);aQ.html(aR)}else{if(aP==i.Subobjects){aR=u.SubObjectsCaption+" - "+aR;aR=s.escape(aR);aQ.html(aR)}else{aQ.removeClass("Caption");aQ.html("");aQ.hide()}}}}if(aQ.is(":visible")){aQ.append("<div id='backButton' class='viewBackButton'></div>");$("#backButton").click(function(){history.back()})}};var D=function(aT){var a3=aT;var a4=N.data("listing");a4.path=aT.view;a4.fromSearchRefinement=(aT.view==i.SearchFromSearchRefinemnt);if(!a4.fromSearchRefinement&&aT.criteria){a4.searchCriteria=aT.criteria}N.listing("setData",null);e.selectedItem.set(null);if(aT.json){a3=aT.json}var aP=a3.Path;var aX=a3.ViewSettingsID;var a2=[];var a0=null;c=a3.Path;aA={};aq=[];C=[];aa=[];aw=[];ak=[];var aV=new MFWA.Timer(function(a7){o.write("ParseViewContentsListing @ Listing, without setData: "+a7)});aV.start();if(a3.IsMFDContents){if(a3.Items.length>0){var aR=a3.Items[0];var a5=j.ViewItem(aR,aP);if(aR.ObjectVersion){a0=aR.ObjectVersion.ObjVer}}}else{for(var a1 in a3.Items){var aR=a3.Items[a1];var a5=j.ViewItem(aR,aP);if(a5.view&&!MFWA.Dialogs.DocumentCard.Filters.visibleView(a5.view.ID)){continue}a2.push(a5);if(aR.ObjectVersion){E(a5)}}}aV.report();if(!a3.ColumnInfos){a3.ColumnInfos=new Array()}if(a3.ColumnInfos.length==0){a3.ColumnInfos=ae(a3,aT.view,aP,aX);if(aP!="/"&&a3.IsGroupingEnabled==true){x.getLevelDefinition(aP,function(a7){if(a7.Value&&a7.Value.length>0){a3.ColumnInfos[1].LevelDefinition=a7.Value;var a8=$("#column_header_1");var a9=s.getTextWidth(a7.Value)+13;a8.text(a7.Value);a8.css("backgroundPosition",a9+"px center");r.setColumnInfos(aX,a3.ColumnInfos)}})}}else{var aU=null;for(var a5=0;a5<a3.ColumnInfos.length;a5++){var aS=a3.ColumnInfos[a5].PropertyID;if(aS>0&&!aj[aS]){a3.ColumnInfos.splice(a5,1);a5--;aU=true}}if(aU){r.setColumnInfos(aX,a3.ColumnInfos)}}if(aT.view==i.Search){var aZ=false;for(var a1=0;a1<a3.ColumnInfos.length;a1++){var aQ=a3.ColumnInfos[a1];if(aQ.PropertyID==f){aQ.Sorting=2;aZ=true}else{aQ.Sorting=0}}if(!aZ){a3.ColumnInfos.push({PropertyID:f,MinColumnWidth:1,CurrentColumnWidth:80,MaxColumnWidth:1000,Sorting:2})}}al(a3.ColumnInfos,aX);Q=aX;ai=a3.ColumnInfos;d=V(a3.ViewModeInfo,aP,aT.view);N.listing("setListingMode",d);a.RefreshViewModeMenuItems();a.RefreshGroupInfoMenuItems();e.selectedItem.set(null);if(a0){MFWA.PropertiesPane.setProperties(a0)}if(a2){N.listing("setData",a2)}p.setStatus(a3.Items.length+" objects");if(a3.MoreResults){var aY=a3.Items.length;var aW=s.format(u.MoreResultsText,aY);h.queue(u.MoreResultsTitle,aW)}if(!$("#viewCaption").length){$("#listing").prepend('<div id="viewCaption"></div>')}var a6=e.view.get();at(a4.path);MFWA.Layout.resizePanels();if(ax.length>0&&MFWA.MFWA.getAppletInitialized()){MFWA.Java.getLocalFileSize(ax,function(a8){for(var a7 in a8){$("#"+a7).text(s.formatSize(a8[a7]))}ax=[]},function(a7){ax=[]})}ay(true)};var ae=function(aT,aS,aV,aU){var aQ=[];aQ.push({PropertyID:-1,MinColumnWidth:1,CurrentColumnWidth:250,MaxColumnWidth:1000,Sorting:((aV!="_history"&&aS!=i.Search)?1:0)});if(aV=="_history"){aQ.push({PropertyID:-8,MinColumnWidth:1,CurrentColumnWidth:70,MaxColumnWidth:1000,Sorting:2});aQ.push({PropertyID:24,MinColumnWidth:1,CurrentColumnWidth:130,MaxColumnWidth:1000,Sorting:0});aQ.push({PropertyID:23,MinColumnWidth:1,CurrentColumnWidth:55,MaxColumnWidth:1000,Sorting:0});aQ.push({PropertyID:39,MinColumnWidth:1,CurrentColumnWidth:100,MaxColumnWidth:1000,Sorting:0});aQ.push({PropertyID:29,MinColumnWidth:1,CurrentColumnWidth:100,MaxColumnWidth:1000,Sorting:0});r.setColumnInfos(aU,aQ)}else{var aP=false;for(var aR=0;aR<aT.Items.length;aR++){if((aT.Items[aR].FolderContentItemType!=1)&&(aT.Items[aR].FolderContentItemType!=2)&&(aT.Items[aR].FolderContentItemType!=3)){aP=true;break}}if(aP){aQ.push({PropertyID:-3,MinColumnWidth:1,CurrentColumnWidth:80,MaxColumnWidth:1000,Sorting:0});aQ.push({PropertyID:-14,MinColumnWidth:1,CurrentColumnWidth:150,MaxColumnWidth:1000,Sorting:0})}else{aQ.push({PropertyID:-2,MinColumnWidth:1,CurrentColumnWidth:150,MaxColumnWidth:1000,Sorting:0})}}return aQ};var al=function(aP,aT){var aR=[];for(var aS in aP){if(($("#hdnAddColumn").val()=="true")&&(aS<aP.length-1)){continue}var aQ=aP[aS].PropertyID;var aU=function(aV){aR.push({title:ar(aP[aS]),id:aQ,minWidth:aV.MinColumnWidth,currentWidth:aV.CurrentColumnWidth,maxWidth:aV.MaxColumnWidth,func:Y(aQ),headerHTMLId:"",textWidth:0,sorting:aV.Sorting,comparer:L(aQ),realColumnNumber:aS,onColumnResize:function(){aV.CurrentColumnWidth=this.currentWidth;r.setColumnInfos(aT,aP)},onColumnSort:function(){aV.Sorting=this.sorting;r.setColumnInfos(aT,aP)}})}(aP[aS])}N.listing("setColumns",aR,function(aV){for(var aW=0;aW<ai.length;aW++){ai[aW].tempPos=aV[aW]}ai.sort(function(aY,aX){return aY.tempPos-aX.tempPos});for(var aW=0;aW<ai.length;aW++){delete ai[aW].tempPos}r.setColumnInfos(aT,ai);al(ai,aT);N.listing("setData",N.data("listing").options.data,true)})};var ar=function af(aP){propertyId=aP.PropertyID;switch(propertyId){case -1:if(aP.LevelDefinition&&aP.LevelDefinition.length>0){return aP.LevelDefinition}else{return u.Columns.Name}case -2:return u.Columns.Type;case -3:return u.Columns.Size;case -4:return u.Columns.Status;case -5:return u.Columns.CheckedOutTo;case -6:return u.Columns.CheckoutTime;case -7:return u.Columns.ID;case -8:return u.Columns.Version;case -9:return"Date-Time";case 23:return u.Columns.User;case 24:return u.Columns.StatusTime;case -11:return"Location";case -12:return"Relative Location";case -13:return u.Columns.DateCreated;case -14:return u.Columns.DateModified;case -15:return"Score";case -16:return"Description";case -17:return"";case -18:return"Target Version";case -19:return u.Columns.ObjectType;case -20:u.Columns.Permissions;case -21:return u.Columns.Type;case f:return u.Columns.Score;default:if(propertyId>=0){var aR=s.unique("headercell");var aQ=null;x.getPropertyDefsByID(function(aS){var aT=" ";if(aS[propertyId]){aT=aS[propertyId].Name}if(!aT){aT=""}if(aQ===null){aQ=s.escape(aT)}else{$("#"+aR).text(aT)}});if(aQ===null){aQ={id:aR}}return aQ}else{return""}}};var Y=function az(aV){switch(aV){case -1:return function aW(a8){var a3=0;if(a8.parent){if(a8.parent.parent){if(a8.parent.parent.parent){a3=60}else{a3=40}}else{a3=20}}var a5;var a9;if(a8.expandableRow){a9=a8.row;if(a8.childrenVisible){a5=a8.expandIcon}else{a5=a8.collapseIcon}}var a4=a8.icon;var a7;if(!a8.emptyRow){if(a8.pending){a7=v.Overlays.Pending}else{if(a8.objectVersion||(a8.parent&&a8.parent.objectVersion)){var a6=a8.objectVersion||a8.parent.objectVersion;if(!a6.ThisVersionLatestToThisUser){a7=v.Overlays.PreviousVersion}else{if(a6.ObjectCheckedOutToThisUser){a7=v.Overlays.CheckedOutCurrent}else{if(a6.ObjectCheckedOut){a7=v.Overlays.CheckedOutOther}}}}}}return{expandIcon:a5,indent:a3,objectIcon:a4,cellContent:s.escape(a8.name),overlayIcon:a7,rowId:a9}};case -17:return function a1(a4){if(a4.objectVersion){var a6=a4.objectVersion.HasRelationshipsFrom;var a5=a4.objectVersion.HasRelationshipsTo;var a3;if(a6&&a5){a3=v.Listing.RelationshipsFromAndTo}else{if(a6){a3=v.Listing.RelationshipsFrom}else{if(a5){a3=v.Listing.RelationshipsTo}else{return""}}}return{image:a3}}else{return""}};case -8:return function aZ(a3){if(a3.objectVersion){return{cellContent:a3.objectVersion.ObjVer.Version}}else{return""}};case -2:case -21:return function aQ(a4){var a3=null;if(a4.objectVersion){var a5=s.unique("listingcell");x.getObjectType(a4.objectVersion.ObjVer.Type,function(a6){var a7=a6.Name;if(!a7){a7=""}if(a3===null){a3=s.escape(a7)}else{$("#"+a5).text(a7)}});if(a3===null){a3={id:a5}}return a3}else{if(a4.objectFile){a3={cellContent:u.ListingItemTypes.File}}else{if(a4.propertyFolder){return{cellContent:u.ListingItemTypes.PropertyFolder}}else{if(a4.view){return{cellContent:u.ListingItemTypes.View}}else{if(a4.traditionalFolder){return{cellContent:u.ListingItemTypes.TraditionalFolder}}else{return""}}}}}};case -3:return function aU(a4){if(a4.objectVersion){if(a4.objectVersion.SingleFile){var a3=a4.objectVersion.Files[0].Size;if(a3>0){return{cellContent:s.formatSize(a3)}}else{var a6=s.unique("file_");var a5={Name:a4.objectVersion.EscapedTitleWithID,PathInIDView:a4.objectVersion.PathInIDView,ItemId:a6};ax.push(a5);return{id:a6,isSize:true}}}else{return""}}else{if(a4.objectFile){var a3=a4.objectFile.Size;if(a3>0){return{cellContent:s.formatSize(a3)}}else{var a6=s.unique("file_");var a5={Name:a4.objectFile.EscapedName,PathInIDView:a4.parent.objectVersion.PathInIDView,ItemId:a6};ax.push(a5);return{id:a6,isSize:true}}}else{return""}}};case -5:return function a2(a3){if(a3.objectVersion&&a3.objectVersion.ObjectCheckedOut){return{cellContent:a3.objectVersion.CheckedOutTo}}else{return""}};case -14:return function aT(a3){if(a3.objectVersion){return{cellContent:a3.objectVersion.LastModifiedDisplayValue}}else{if(a3.objectFile){return{cellContent:a3.objectFile.LastModifiedDisplayValue}}else{return""}}};case -6:return function a0(a3){if(a3.objectVersion&&a3.objectVersion.ObjectCheckedOut){return{cellContent:a3.objectVersion.CheckedOutAtDisplayValue}}else{return""}};case -13:return function aY(a3){if(a3.objectVersion){return{cellContent:a3.objectVersion.CreatedDisplayValue}}else{return""}};case -7:return function aR(a3){if(a3.objectVersion){return{cellContent:a3.objectVersion.DisplayID}}else{return""}};case f:return function aS(a3){if(a3.objectVersion){return a3.objectVersion.Score}else{return""}};case -19:return function aX(a4){if(a4.objectVersion){var a5=s.unique("listingcell");var a3=null;x.getObjectType(a4.objectVersion.ObjVer.Type,function(a6){var a7=a6.Name;if(!a7){a7=""}if(a3===null){a3=s.escape(a7)}else{$("#"+a5).text(a7)}});if(a3===null){a3={id:a5}}return a3}else{return""}};case -9:case -10:case -11:case -4:case -12:case -15:case -16:case -18:case -20:default:if(aV>=0){return function aP(a7){if(a7.objectVersion){var a4=a7.objectVersion.ObjVer;if(!aq[a4.Type]){aq[a4.Type]=[]}if(!aq[a4.Type][a4.ID]){aq[a4.Type][a4.ID]=[]}if(!aq[a4.Type][a4.ID][a4.Version]){C.push(a4)}else{if(!ak[a4.Type]){ak[a4.Type]=[]}if(!ak[a4.Type][a4.ID]){ak[a4.Type][a4.ID]=[]}var a6=ak[a4.Type][a4.ID][a4.Version];if(a6){for(var a5=0;a5<a6.length;a5++){if(a6[a5].PropertyDef==aV){var a9=s.unique("listingcell");var a8=null;if(a6[a5].TypedValue.Lookups&&a6[a5].TypedValue.DataType==MFWA.Enumerations.MFDataType.MultiSelectLookup){a8=a6[a5].TypedValue.Lookups[0]}else{if(a6[a5].TypedValue.DataType==MFWA.Enumerations.MFDataType.Lookup){a8=a6[a5].TypedValue.Lookup}}if(a8&&a8.Hidden==false){var a3=a6[a5].PropertyDef;x.getPropertyDef(a3,function(ba){x.hasValueListIcon(ba.ValueList,a8.Item,function(bb){var bd=$("#"+a9);if(bb.Value==true){var bc=s.currentUrl+"REST/objects/"+ba.ValueList+"/"+a8.Item+"/valueListIcon.aspx";bd.text(a6[a5].TypedValue.DisplayValue);bd.css({background:"url('"+bc+"') no-repeat","text-indent":"21px"})}else{bd.text(a6[a5].TypedValue.DisplayValue)}})})}return{id:a9,cellContent:a6[a5].TypedValue.DisplayValue}}}return""}}var a9=s.unique("listingcell");aa.push({objver:a4,propertyID:aV,htmlID:a9});ay(true);return{id:a9,cellContent:"..."}}return""}}else{return function(a3){return""}}}};var L=function L(aP){switch(aP){case -1:return aJ(function(aQ){if(aQ.propertyFolder){if(aQ.propertyFolder.IsNumberSorting){return parseInt(aQ.propertyFolder.SortingKey)}else{return aQ.propertyFolder.SortingKey}}return""},function(aQ){return aQ.name});case -17:return aJ(function(aR){if(!aR.objectVersion){return 0}var aQ=aR.objectVersion;if(aQ.HasRelationshipsTo&&aQ.HasRelationshipsFrom){return 3}if(aQ.HasRelationshipsFrom){return 2}if(aQ.HasRelationshipsTo){return 1}return 0});case -8:return aJ(function(aQ){if(aQ.objectVersion){return aQ.objectVersion.ObjVer.Version}return 0});case -3:return aJ(function(aQ){if(aQ.objectVersion){if(aQ.objectVersion.SingleFile){return aQ.objectVersion.Files[0].Size}else{return 0}}else{if(aQ.objectFile){return aQ.objectFile.Size}else{return 0}}});case f:return aJ(function(aQ){if(aQ.objectVersion){return aQ.objectVersion.Score}else{return 0}});case -7:return aJ(function(aR){if(aR.objectVersion){var aQ=parseInt(aR.objectVersion.DisplayID);if(aQ!=NaN){return aQ}else{return aR.objectVersion.DisplayID}}else{return 0}});case -13:return aJ(function(aQ){if(aQ.objectVersion){return aQ.objectVersion.CreatedUtc}else{return""}});case -14:return aJ(function(aQ){if(aQ.objectVersion){return aQ.objectVersion.LastModifiedUtc}else{if(aQ.objectFile){return aQ.objectFile.LastModified}else{return""}}});case -6:case -5:case -10:return aJ(function(aQ){return Y(aP)(aQ)});case -19:case -2:case -21:return aJ(function(aQ){return Y(aP)(aQ)});case -4:case -9:case -11:case -12:case -15:case -16:case -18:case -20:return aJ(function(aQ){return 0});default:return aJ(function(aU){if(aP>=0){if(aU.objectVersion){var aQ=aU.objectVersion.ObjVer;if(ak[aQ.Type]&&ak[aQ.Type][aQ.ID]){var aT=ak[aQ.Type][aQ.ID][aQ.Version];if(aT){for(var aS=0;aS<aT.length;aS++){var aR=aT[aS];if(aR.PropertyDef==aP){var aV=aR.TypedValue;if(aV.SortingKey){return aV.SortingKey}return aV.DisplayValue}}}}}}return""})}};var ay=function ay(aR){if((aR&&(C.length>0||aa.length>0))||C.length>100){var aQ=C;C=[];var aP=aa;aa=[];x.getPropertiesOfMultipleObjects(aQ,function(aZ){if(aQ.length!=aZ.length){assert.fail("Inconsistent number of properties.")}for(var aU in aQ){var aY=aQ[aU];if(!ak[aY.Type]){ak[aY.Type]=[]}if(!ak[aY.Type][aY.ID]){ak[aY.Type][aY.ID]=[]}ak[aY.Type][aY.ID][aY.Version]=aZ[aU]}for(var aU in aw){aP.push(aw[aU])}aw=[];for(var aU in aP){var aV=aP[aU].objver;var aW=ak[aV.Type][aV.ID][aV.Version];if(aW){var a0=false;for(var aS=0;aS<aW.length;aS++){if(aW[aS].PropertyDef==aP[aU].propertyID){$("#"+aP[aU].htmlID).text(aW[aS].TypedValue.DisplayValue);var aT=null;if(aW[aS].TypedValue.Lookups&&aW[aS].TypedValue.DataType==MFWA.Enumerations.MFDataType.MultiSelectLookup){aT=aW[aS].TypedValue.Lookups[0]}else{if(aW[aS].TypedValue.DataType==MFWA.Enumerations.MFDataType.Lookup){aT=aW[aS].TypedValue.Lookup}}if(aT&&aT.Hidden==false){var aX=aW[aS].PropertyDef;x.getPropertyDef(aX,function(a1){x.hasValueListIcon(a1.ValueList,aT.Item,function(a2){if(a2.Value==true){var a4=s.currentUrl+"REST/objects/"+a1.ValueList+"/"+aT.Item+"/valueListIcon.aspx";var a3=$("#"+aP[aU].htmlID);a3.css({background:"url('"+a4+"') no-repeat","text-indent":"21px"})}})})}a0=true;break}}if(a0==false){$("#"+aP[aU].htmlID).text("")}}else{aw.push(aP[aU])}}})}};var am=function(aR){if(aR.objectVersion){var aQ=false;x.getProperties(aR.objectVersion.ObjVer,function(aU){var aS=null;var aV=false;for(var aT=0;aT<aU.length;aT++){if((aU[aT].PropertyDef==37)&&(aU[aT].TypedValue.SerializedValue)){aQ=true}else{if(aR.objectVersion.ObjVer.Type==15&&aU[aT].PropertyDef==87){aS=aU[aT].TypedValue.DisplayValue;aV=true}}}if(aV){MFWA.Actions.showReport(aS)}else{if(aQ&&g.TaskPane&&g.TaskPane.ShowNew&&g.Controls&&g.Controls.ShowDocumentCard){MFWA.Actions.objectOperations("MakeFileFromTemplate",aR)}else{if(aR.objectVersion.SingleFile){if(g.TaskPane&&g.TaskPane.ViewAndModifyOptions&&g.TaskPane.ViewAndModifyOptions.OpenFile){MFWA.Actions.objectOperations("OpenFile",aR)}}else{if(g.Controls&&g.Controls.ShowDocumentCard&&g.TaskPane&&g.TaskPane.ViewAndModifyOptions&&g.TaskPane.ViewAndModifyOptions.Properties){MFWA.Actions.objectOperations("Properties",aR)}}}}})}else{if(aR.objectFile){if(g.TaskPane&&g.TaskPane.ViewAndModifyOptions&&g.TaskPane.ViewAndModifyOptions.OpenFile){MFWA.Actions.objectOperations("OpenFile",aR)}}else{if(aR.emptyRow){MFWA.ViewItem.expandChildren(aR.row)}else{if(aR.path!=""){var aP={ActiveView:aR.path,IsSearch:false};MFWA.Data.Operations.saveActiveView(aP)}MFWA.Listing.ResetListingContainer();e.view.set({viewPath:aR.path})}}}};e.selectedItem.observe(n,function(aP){if(aP){N.listing("select",aP.row)}else{N.listing("unselect")}});var aL=40;var aF=38;var aE=37;var aD=39;var aN=13;$(document).keydown(function(aR){if(!S||$.Menu.isActive()){return}if(aR.target.tagName=="SELECT"||aR.target.tagName=="INPUT"){return}var aQ=null;if(aR.which==aL){aQ=function(){N.listing("selectNext")}}else{if(aR.which==aF){aQ=function(){N.listing("selectPrev")}}else{if(aR.which==aN){var aP=N.listing("getSelected");if(aP){aQ=function(){am(aP)}}}else{return true}}}if(aQ){if(z){clearTimeout(z)}z=setTimeout(aQ,25)}return true});var U=function(){return Q};var au=function(aQ){d=aQ;var aP=N.data("listing");N.listing("setListingMode",d);N.listing("setData",aP.options.data);if(aQ.Thumbnails.selected){r.setViewMode(Q,2)}else{r.setViewMode(Q,1)}if(aQ.List.selected){N.listing("repositionColumns",aP)}J();ay(true)};var aK=function(){return d};var X=function(){return ai};var W=function(aP){$("#hdnAddColumn").val("true");ai.push({MinColumnWidth:1,CurrentColumnWidth:150,MaxColumnWidth:1000,Sorting:0,PropertyID:aP});r.setColumnInfos(Q,ai);al(ai,Q);N.listing("setDataForNewColumn");J();ay(true);$("#hdnAddColumn").val("")};var ac=function(aS){if(aS!=-1){var aQ=[];var aP;var aT=false;for(var aR=0;aR<ai.length;aR++){if(ai[aR].PropertyID!=aS){aQ.push(ai[aR])}else{aP=ai[aR]}}ai=aQ;r.setColumnInfos(Q,ai);N.listing("removeColumnFromListing",aP);J()}};function J(){var aP=e.selectedItem.get();if(aP!=null){N.listing("select",aP.row)}}var aB=function(aQ,aP,aT,aS,aR){if((aQ.parent&&aP.parent&&aQ.parent!=aP.parent)||(!aQ.emptyRow&&aP.emptyRow||aQ.emptyRow&&!aP.emptyRow)){return 0}return aR(aQ,aP,aT)};var aJ=function(){var aP=[];for(var aQ=0;aQ<arguments.length;aQ++){aP.push(arguments[aQ])}if(aP.length==0){aP=[function(aS,aR){return aR.func(aS,aR)}]}aP.unshift(ah);if(c!="/"){aP.push(G);aP.push(P);aP.push(O);aP.push(aC)}return function(aS,aR,aU,aT){return aB(aS,aR,aU,aT,function(aZ,aX,a0){for(var aW=0;aW<aP.length;aW++){keyFunction=aP[aW];var aY=keyFunction(aZ,a0);var aV=keyFunction(aX,a0);if(typeof aY=="string"){aY=aY.toLowerCase()}if(typeof aV=="string"){aV=aV.toLowerCase()}if(aY<aV){return -1}if(aY>aV){return 1}}return 0})}};var ah=function(aP){if(aP.emptyRow){return(aP.parent.ids.objectType==b.MFBuiltInObjectType.DocumentCollection)?aP.ids.sortingKey:aP.name}else{return aP.ids.itemType}};var G=function(aP){return aP.ids.objectType};var P=function(aP){return aP.ids.id};var O=function(aP){return aP.ids.version};var aC=function(aP){return aP.ids.file};var ag=[];ag.push({title:"",minWidth:50,currentWidth:100,maxWidth:200,sorting:0,func:function(aP){return""},comparer:aJ(function(aP){return 0}),onColumnResize:function(){},onColumnSort:function(){}});N.listing({columns:ag,ondblclick:am,onclick:function(aP){e.selectedItem.set(aP)},onrefresh:function(){N.listing("updatePending",true);aM()}});return{setDisplayMode:au,getDisplayMode:aK,getCurrentActiveViewID:U,getCurrentColumns:X,addColumnToListing:W,hideColumnFromListing:ac,setFolderListing:y,refresh:aM,addItem:aH,getItemFromObjectVersion:B,updateItem:av,removeItem:I,updateObject:ap,updateReferedObject:ao,updateHistoryObject:R,loadChildren:M,updatePending:an,updatePendingToReferedItems:Z,enableKeys:function(aP){S=aP}}},SetActiveView:function(y){x.getActiveView(function(A){if(A.ActiveView==""||A.ActiveView=="/"){MFWA.Listing.ResetListingContainer();y=(y=="")?"/":y;if(y!="/"){x.checkViewExistence("current",y.replace("/V",""),function(C){if(C.Value==false){y="/"}e.view.set({viewPath:y})})}else{e.view.set({viewPath:y})}}else{if(A.IsSearch=="True"){var B=MFNamespace("MFWA.Search");if(A.ActiveView==""){B.ActiveView.ViewPath="/"}else{B.ActiveView.ViewPath=A.ActiveView}B.PerformSearch()}else{var z=A.ActiveView;MFWA.Listing.ResetListingContainer();e.view.set({viewPath:z})}}})},RefreshChildren:function(A,z){var y=A.rootItem;if(A.parent&&A.parent.emptyRow&&A.parent.children&&A.parent.children.length==0){y=A.parent.rootItem}if(!y){y=A}if(z&&y){MFWA.MFWA.removeItem(y,false,false);y.children=[];if(y.childrenVisible){y.childrenVisible=false;MFWA.ViewItem.expandChildren(y.row)}}},ResetListingContainer:function(){$("#listingTable").listing("updatePending",true);$("#headerTable").css("left","0px");$("#listing .listing-container").scrollLeft(0)}}});MFNamespace("MFWA.Tree",function(c){var b=MFNamespace("MFWA.Utils");var g=MFNamespace("MFWA.Enumerations");var a=MFNamespace("MFWA.ViewItem");var d=MFNamespace("MFWA.Model");var h=MFNamespace("MFWA.Debug.Assert");var e=MFNamespace("MFWA.Icons");var f=MFNamespace("MFWA.Data.Ajax");return{makeTree:function(l,m){var j={};var k=null;var o=false;var i=null;var n=l.attr("id");if(!n){n=b.unique("tree");l.attr("id",n)}l.bind("select_node.jstree",function(u,s){var t=s.rslt.obj.attr("viewPath");MFWA.BreadCrumb.makeBreadCrumb(t);if(!o){var q={ActiveView:t,IsSearch:false};MFWA.Data.Operations.saveActiveView(q);var r={SearchIn:$("#searchIn").val(),WithinFolder:$("#searchWithinThisFolder").attr("checked"),SearchObjectType:$("#searchObjectType").val(),LookWord:$('[name="searchTypeGroup"]:checked').val(),SearchWord:""};MFWA.Data.Operations.saveSearchState(r);var p=d.view.get();if(p&&p.viewPath==t){var v=MFNamespace("MFWA.MFWA");v.refreshListing();return}MFWA.Listing.ResetListingContainer();d.view.set({viewPath:t})}}).jstree({json_data:{ajax:{url:"MFWS.ashx",data:function(p){var q=$(p).attr("viewPath");if(typeof q=="undefined"){return{restPath:"views/baseroot.aspx"}}else{return{restPath:"views"+q+"/folders.aspx"}}},success:function(t){if(t.Status>=400){t.handleError(t);return}var A=[];if(typeof t.Name!="undefined"){i=b.unique("tree");A.push({attr:{id:i,viewPath:"",itemType:g.MFFolderContentItemType.ViewFolder},state:"closed",data:{title:t.Name,icon:e.Listing.VaultMounting}});j["/"]=i;setTimeout(function(){$.jstree._reference(n).open_node($("#"+i))},0)}else{for(var u in t.Items){var r=t.Items[u];var z=a.ViewItem(r,t.Path);if(!z||z.type==g.MFFolderContentItemType.ObjectVersion){continue}if(z.type==g.MFFolderContentItemType.ViewFolder&&!MFWA.Dialogs.DocumentCard.Filters.visibleView(z.ids.id)){continue}var q=b.unique("tree");j[z.path]=q;A.push({attr:{id:q,viewPath:z.path,itemType:z.type,SortingKey:(z.propertyFolder&&z.propertyFolder.SortingKey!="")?z.propertyFolder.SortingKey:z.name,IsNumberSorting:z.propertyFolder?z.propertyFolder.IsNumberSorting:false},state:"closed",data:{title:z.name,icon:z.icon}});if(k){if(k==z.path){var x=function(B){setTimeout(function(){o=true;$.jstree._reference(n).select_node($("#"+B));o=false},0)}(q);k=""}else{var y=k.split("/");var s=z.path.split("/");var w="";for(var p=1;p<s.length;p++){w+="/"+y[p]}if(w==z.path){var x=function(B){setTimeout(function(){$.jstree._reference(n).open_node($("#"+B))},0)}(q)}}}}var v=function(B){if(B==g.MFFolderContentItemType.ViewFolder||B==g.MFFolderContentItemType.PropertyFolder){return 1}if(B==g.MFFolderContentItemType.TraditionalFolder){return 2}if(B==g.MFFolderContentItemType.ObjectVersion){return 3}h.fail("Unknown folder content item type");return 10};A.sort(function(E,D){var C=v(E.attr.itemType);var B=v(D.attr.itemType);if(C!=B){return C-B}if(E.attr.IsNumberSorting){if(parseInt(E.attr.SortingKey)<parseInt(D.attr.SortingKey)){return -1}else{if(parseInt(E.attr.SortingKey)>parseInt(D.attr.SortingKey)){return 1}else{return 0}}}else{if(E.attr.SortingKey<D.attr.SortingKey){return -1}else{if(E.attr.SortingKey>D.attr.SortingKey){return 1}else{return 0}}}})}if(A.length){return A}else{return null}},error:function(s,q,r){var p=f.createErrorHandler();p(s)}}},themes:{theme:"default",dots:false,icons:true,url:"css/themes/default/style.css"},core:{animation:0},plugins:["themes","json_data","ui"]});d.view.observe(c,function(p){if(typeof p.viewPath!="undefined"){var s=p.viewPath;if(s===""){s="/"}o=true;var t=j[s];jQuery.each($.jstree._reference(n).get_selected(),function(u,v){$.jstree._reference(n).deselect_node(v)});if(typeof t!="undefined"){var r=$("#"+t);$.jstree._reference(n).select_node(r)}else{var q=s;while(typeof t=="undefined"&&q.length>0){q=q.substr(0,q.lastIndexOf("/"));t=j[q]}if(typeof t=="undefined"){t=i}var r=$("#"+t);$.jstree._reference(n).open_node(r);k=s}o=false}})}}});MFNamespace("MFWA.Actions",function(m){var f=MFNamespace("MFWA.MFWA");var n=MFNamespace("MFWA.Data.Cache");var w=MFNamespace("MFWA.Data.Operations");var c=MFNamespace("MFWA.Model");var l=MFNamespace("MFWA.Enumerations");var B=MFNamespace("MFWA.Debug");var V=MFNamespace("MFWA.I18n");var U=MFNamespace("MFWA.Utils");var L=MFNamespace("MFWA.Dialogs.Alerts");var s=MFNamespace("MFWA.Dialogs.CheckOutPrompt");var C=MFNamespace("MFWA.Dialogs.Upload");var D=MFNamespace("MFWA.Dialogs.DocumentCard");var R=MFNamespace("MFWA.Dialogs.Comments");var q=MFNamespace("MFWA.Dialogs.Workflow");var a=MFNamespace("MFWA.Dialogs.ChangePassword");var I=MFNamespace("MFWA.Dialogs.UndoCheckout");var H=MFNamespace("MFWA.Dialogs.ForceUndoCheckout");var K=MFNamespace("MFWA.Dialogs.Confirm");var P=MFNamespace("MFWA.Dialogs.Upload");var J=MFNamespace("MFWA.Dialogs.Error");var M=MFNamespace("MFWA.Dialogs.Prompt");var y=MFNamespace("MFWA.Structs");var b=MFNamespace("MFWA.Handlers");var v=MFNamespace("MFWA.Filters");var A=MFNamespace("MFWA.Listing");var T=MFNamespace("MFWA.Menu");var u=MFNamespace("MFWA.Configurations");var O=MFNamespace("MFWA.Dialogs.LogoutPrompt");var Q=MFNamespace("MFWA.Dialogs.DocumentCard.Report");var p={CheckOut:true,CheckIn:true,UndoCheckout:true,Rename:true,Delete:true,MarkComplete:true,ConvertToSFD:true,ConvertToMFD:true,AddFile:true,OpenFile:true};var o=false;var e;var r;var S=true;var F=false;var t=function(W){return function(X){if(X.Status==403){window.location="login.aspx"}else{L.ShowError(X)}if(W){f.updatePending(W,false)}}};var N=function(W){var X=W.Title;if(W.SingleFile&&W.Files[0].Extension){X+="."+W.Files[0].Extension}$("body").append("<input id='captionText' type='hidden'></input>");$("#captionText").val(X)};var z=function(){var W=f.getSessionInfo();if(!W.LicenseAllowsModifications){L.ShowError(V.ErrorDialog.OperationAccessDenied);return false}return true};var g=function(W){return function(Y){if(Y){var X=W;if(W.objectFile){X=W.parent}if(Y.ObjectVersion){Y=Y.ObjectVersion}if((F)||(X.objectVersion.SingleFile!=Y.SingleFile)||(X.objectVersion.Files.length>0)||(Y.Files.length>0)||(X.objectVersion.HasRelatedObjects)||(Y.HasRelatedObjects)){o=true}else{o=false}if(c.view.get().objectHistory){if((!W.parent)||(W.rootItem.itemId===W.parent.itemId)){if(W.objectVersion){f.updateHistoryObject(X,Y,o,W)}else{f.updateHistoryObject(X,Y,o,W.parent)}}}if(!c.view.get().objectHistory){f.updateObject(X.objectVersion.ObjVer,Y,o,W)}}else{f.removeItem(W,true,true)}n.setForceUpdate(true)}};var k=function(W){return function(){if(S){setTimeout("obj.removeClass('ChangeCursor');  $('#panel').css('cursor', 'default'); obj.addClass('ActualColor'); $('#taskpane #taskpaneContent .taskpaneItemText').css('cursor', 'default');  $('#taskpane #taskpaneContent').css('cursor', 'default'); $('#tree').css('cursor','default'); $('#listing').css('cursor','default'); $('#taskpane').css('cursor', 'default');  $('#searchBasic').css('cursor', 'default'); $('#tree a').css('cursor', 'default');  $('.listing-column').css('cursor', 'default'); $('#propertiesPane').css('cursor', 'default'); $('.nameText').css('cursor', 'default');$('#propertiesPaneProperties').css('cursor', 'default'); $('.propertiesPaneColumn').css('cursor', 'default'); ",200);L.ShowNotification(V.FavoriteDialog.ObjectAffectedMessage)}}};var i=function(W){return function(){if(S){setTimeout("obj.removeClass('ChangeCursor');  $('#panel').css('cursor', 'default'); obj.addClass('ActualColor'); $('#taskpane #taskpaneContent .taskpaneItemText').css('cursor', 'default');  $('#taskpane #taskpaneContent').css('cursor', 'default'); $('#tree').css('cursor','default'); $('#listing').css('cursor','default'); $('#taskpane').css('cursor', 'default');  $('#searchBasic').css('cursor', 'default'); $('#tree a').css('cursor', 'default');  $('.listing-column').css('cursor', 'default'); $('#propertiesPane').css('cursor', 'default'); $('.nameText').css('cursor', 'default');$('#propertiesPaneProperties').css('cursor', 'default'); $('.propertiesPaneColumn').css('cursor', 'default'); ",200);L.ShowNotification(V.FavoriteDialog.ObjectNotAffectedMessage)}}};var h=function(X,W,Y){return function(Z){if(Z==true){W.RemoveFromFavorites(X.ObjVer,function(){Y.refreshListing();L.ShowNotification(V.FavoriteDialog.ObjectAffectedMessage)})}}};var E=function(X){clearGroupInfoMenuItemIcons();var W=f.getViewSettingsID();if(X.GroupByViews.selected&&X.GroupByObjects.selected){w.setGroupInfo(W,(l.GroupingInfo.GroupObjectsByObjectType+l.GroupingInfo.GroupViewsAndFolders))}else{if(!X.GroupByViews.selected&&!X.GroupByObjects.selected){w.setGroupInfo(W,l.GroupingInfo.None)}else{if(X.GroupByViews.selected){w.setGroupInfo(W,l.GroupingInfo.GroupViewsAndFolders)}else{if(X.GroupByObjects.selected){w.setGroupInfo(W,l.GroupingInfo.GroupObjectsByObjectType)}}}}};var d=function(Z,X,Y,aa,W){return function(ab){if(ab==true){if(X){if(aa.getAppletInitialized()){MFWA.Java.deleteFile(Y,X,g(Z),t(Z))}else{W.deleteFile(Y.ObjVer,X,g(Z),t(Z))}}else{n.getObjectType(Y.ObjVer.Type,function(ac){n.getObjectsByType(function(ag){var af=false;for(var ad in ag){if(ag[ad].HasOwner&&ag[ad].Owner==ac.ID){af=true;break}}if(af==true){var ae=new Object();ae.message=V.DeleteDialog.MessageSubObjects;ae.title=V.DeleteDialog.Title;K.prompt(ae,function(ah){if(ah==true){if(aa.getAppletInitialized()){MFWA.Java.deleteObject(Y,g(Z),t(Z))}else{W.deleteObject(Y.ObjVer,g(Z),t(Z))}}else{aa.updatePending(Z,false)}})}else{if(aa.getAppletInitialized()){MFWA.Java.deleteObject(Y,g(Z),t(Z))}else{W.deleteObject(Y.ObjVer,g(Z),t(Z))}}})})}}else{aa.updatePending(Z,false)}}};var G=function(W,Y,X){return function(ae){var ab=W.ObjVer;var ad=y.createNewLookup(W.Title,ab.ID,-1);var Z=y.createNewTypedValue(10,W.Title,ad);var ac=ae.DefaultPropertyDef;var aa=y.createNewPropertyValue(ac,Z);if(X.properties==null){X.properties=new Array()}X.properties.push(aa);n.getObjectType(Y,j(X))}};var j=function(W){return function(X){D.ShowNewObjectWindowWithProperties(X,W.properties,x(W,X),W.cancelCallback,W.ownerInfo)}};var x=function(X,Y){var W=new Array();return function(ah){setTimeout("obj.removeClass('ChangeCursor');  $('#panel').css('cursor', 'default'); obj.addClass('ActualColor'); $('#taskpane #taskpaneContent .taskpaneItemText').css('cursor', 'default');  $('#taskpane #taskpaneContent').css('cursor', 'default'); $('#tree').css('cursor','default'); $('#listing').css('cursor','default'); $('#taskpane').css('cursor', 'default');  $('#searchBasic').css('cursor', 'default'); $('#tree a').css('cursor', 'default');  $('.listing-column').css('cursor', 'default'); $('#propertiesPane').css('cursor', 'default'); $('.nameText').css('cursor', 'default');$('#propertiesPaneProperties').css('cursor', 'default'); $('.propertiesPaneColumn').css('cursor', 'default'); ",200);if(X.validate){X.validate(ah)}var ae=ah.window;var af=ah.result;var aa=ah.Copy;var ab=b.PropertyHandlers.getMissingProperty(af.Properties,af.Class);if(ab){L.RequiredPropertyMissing(ab.PropertyDef);return false}var ak={};var ac=[];if(Y.ID==l.MFBuiltInObjectType.Assignment){MFWA.Handlers.PropertyHandlers.removeAssignedTo(af)}for(var ag in af.Properties){var Z=af.Properties[ag];Z={PropertyDef:Z.PropertyDef,TypedValue:Z.TypedValue};if(Z.PropertyDef==37&&Z.TypedValue){n.setForceUpdate(true)}ak[Z.PropertyDef]=Z;if(D.Filters.usedInCreation(Z.PropertyDef)){ac.push(Z)}}var ad=function(al,am,ao,aq){var au;if(al.addToList!==false){if(aq.VisibleAfterOperation){au=f.addItem(aq);if(aa){var an=$("#"+au.row).find("._filesize").attr("id");var ar=[];if(aq.SingleFile){var av=aq.Files[0].Size;if(av==0){ar.push({Name:aq.EscapedTitleWithID,PathInIDView:aq.PathInIDView,ItemId:an})}}MFWA.Java.getLocalFileSize(ar,function(ax){for(var aw in ax){$("#"+aw).text(U.formatSize(ax[aw]))}ar=[]},function(aw){ar=[]})}}}setTimeout("obj.removeClass('ChangeCursor');  $('#panel').css('cursor', 'default'); obj.addClass('ActualColor'); $('#taskpane #taskpaneContent .taskpaneItemText').css('cursor', 'default');  $('#taskpane #taskpaneContent').css('cursor', 'default'); $('#tree').css('cursor','default'); $('#listing').css('cursor','default'); $('#taskpane').css('cursor', 'default');  $('#searchBasic').css('cursor', 'default'); $('#tree a').css('cursor', 'default');  $('.listing-column').css('cursor', 'default'); $('#propertiesPane').css('cursor', 'default'); $('.nameText').css('cursor', 'default');$('#propertiesPaneProperties').css('cursor', 'default'); $('.propertiesPaneColumn').css('cursor', 'default'); ",200);if(am){am.close()}var ap=c.view.get();if(ap.viewPath=="/V15"){var at=f.getItemFromObjectVersion(aq);S=false;m.objectOperations("AddToFavorites",at)}else{S=true}if(al.closeDocumentCard!==false){ao.close()}if(al.allowOpenFile!==false&&aq.SingleFile&&!af.CheckIn&&af.Open){MFWA.Java.openFile(aq,aq.Files[0])}if(al.callback){al.callback(aq)}};var ai=function(at,aq){var al=[];if(X.objectFiles){al=X.objectFiles}for(var ao in aq){al.push({Title:aq[ao].title,Extension:aq[ao].extension,UploadID:aq[ao].uploadID,Size:aq[ao].size})}W=new Array();for(var ao in al){W.push({title:al[ao].Title,extension:al[ao].Extension,uploadID:al[ao].UploadID,size:al[ao].Size})}var ap=null;if(af.Template&&af.Template.ObjectVersion){ap=af.Template.ObjectVersion.ObjVer}else{if(X.templateForFiles){ap=X.templateForFiles}}var an=null;if(af.AccessControlList&&af.AccessControlList.AccessControlList){an=af.AccessControlList.AccessControlList}var ar=null;if(af.AccessControlList&&af.AccessControlList.IsNamedACL){ar=af.AccessControlList.ID}var am=null;if(typeof Y=="number"){am=Y}else{am=Y.ID}w.createObject({objType:am,checkIn:af.CheckIn},{PropertyValues:ac,Workflow:af.Workflow,TemplateForFiles:ap,Files:al,NamedACL:ar,ACL:an},function(au){if((aa)&&(e.ObjectCheckedOutToThisUser)&&(e.Files.length>0)){MFWA.Java.makeCopy(e,r,au,function(){n.getObjectVersion(au.ObjVer.Type,au.ObjVer.ID,au.ObjVer.Version,function(aw){ad(X,at,ae,aw)});f.getItemFromObjectVersion(au)},t())}else{if(aa){n.getObjectVersion(au.ObjVer.Type,au.ObjVer.ID,au.ObjVer.Version,function(aw){ad(X,at,ae,aw)})}else{var av=c.view.get();if(!av.objectHistory){ad(X,at,ae,au)}else{S=true;if(X.closeDocumentCard!==false){ae.close()}if(X.callback){X.callback(au)}}}}},t())};if(af.Template||X.files===false){ai(null,[])}else{var aj=ak[l.MFBuiltInPropertyDef.SingleFileObject];if(aj){aj=aj.TypedValue.Value}if(aj){if(W.length==1){ai(null,W)}else{C.singleFile(ai)}}else{if(Y.ID==l.MFBuiltInObjectType.Document){if(W.length>0){ai(null,W)}else{C.multipleFiles(ai)}}else{ai(null,[])}}}return false}};return{newObject:function(aa,X){if(!z()){return}if(!X){X={}}var Z=c.selectedItem.get();if(aa==l.MFBuiltInObjectType.Assignment&&Z&&Z.objectVersion){var Y=Z.objectVersion.ObjVer;if(Y.Type!=l.MFBuiltInObjectType.Assignment){var W=Y.Type;n.getObjectType(W,G(Z.objectVersion,aa,X))}else{n.getObjectType(aa,j(X))}}else{n.getObjectType(aa,j(X))}n.getObjectType(aa,function(){})},newDragDocument:function(aa,Y,X,Z,W){if(u.Controls.ShowDocumentCard){n.getObjectType(0,function(ac){var ab;D.ShowNewObjectWindowFromFile(0,aa,X,x({validate:function(ad){ab=U.copy(ad);ad.result.CheckIn=false},callback:function(ad){Z({args:ab,objectVersion:ad})},files:false,addToList:false,closeDocumentCard:false,objectFiles:Y,allowOpenFile:false},ac),W)})}},uploadDocument:function(W){n.getObjectType(W);C.show(function(X,Y){var Z=n.getObjectType(W);D.showNewObjectWindow(Z,function(aa,ab){L.ShowNotification("Creating object with "+Y.length+" files and "+ab.length+" properties!")})})},goTo:function(X){if(X!=""){var W={ActiveView:X,IsSearch:false};MFWA.Data.Operations.saveActiveView(W);var Y={SearchIn:$("#searchIn").val(),WithinFolder:$("#searchWithinThisFolder").attr("checked"),SearchObjectType:$("#searchObjectType").val(),LookWord:$('[name="searchTypeGroup"]:checked').val(),SearchWord:""};MFWA.Data.Operations.saveSearchState(Y)}$("#searchString").val("");MFWA.Listing.ResetListingContainer();c.view.set({viewPath:X})},changeState:function(Y){var X=c.selectedItem.get();var W=X.objectVersion;w.notifyObjectAccess(W.ObjVer);q.show(W,function(Z,aa){w.setWorkflowState(W.ObjVer,aa,function(ab){Z.close();g(X)(ab)},t(X));return false},null,Y)},showReport:function(W){Q.showReport(W)},objectOperations:function(Y,ah){if(!ah){ah=c.selectedItem.get()}if(ah){var X=ah;var ad=X.objectVersion;var ac=X.objectFile;if(!ad&&X.objectFile&&X.parent&&X.parent.objectVersion){ad=X.parent.objectVersion}if(!ad){return}if(p[Y]){if(X.pending){B.write("Canceling '"+Y+"' because of a pending update.");return}if(v[Y]&&!v[Y](X)){B.write("Canceling '"+Y+"' because the command is not valid in the item's current state.");return}f.updatePending(X,true)}switch(Y){case"Show":n.getProperties(X.objectVersion.ObjVer,function(ak){var ai=null;for(var aj=0;aj<ak.length;aj++){if(ah.objectVersion.ObjVer.Type==15&&ak[aj].PropertyDef==87){ai=ak[aj].TypedValue.DisplayValue;break}}if(ai){MFWA.Actions.showReport(ai)}});break;case"CheckOut":if(!z()){f.updatePending(X,false);return}n.getUserID(function(ai){var aj=ai.Value;n.getNACL(ad.ObjVer.Type,ad.ObjVer.ID,ad.ObjVer.Version,function(am){var ak;for(var al=0;al<am.AccessControlList.length;al++){if(aj==am.AccessControlList[al].UserOrGroupID){ak=am.AccessControlList[al]}}if(!ak){ak=am.AccessControlList[0]}if(am&&ak&&ak.EditPermission!=l.MFPermission.Allow){L.ShowError(V.ErrorDialog.OperationAccessDeniedRights);f.updatePending(X,false)}else{o=true;if(f.getAppletInitialized()){MFWA.Java.checkOut(ad,g(X),t(X))}else{w.checkOut(ad.ObjVer,g(X),t(X))}}})});break;case"CheckIn":if(!z()){f.updatePending(X,false);return}o=true;if(f.getAppletInitialized()){MFWA.Java.checkIn(ad,g(X),t(X))}else{w.checkIn(ad.ObjVer,g(X),t(X))}break;case"UndoCheckout":if(!z()){f.updatePending(X,false);return}o=true;var W={message:U.format(V.UndoCheckoutDialog.Message,ad.Title,ad.CheckedOutTo,ad.CheckedOutFrom)};I.prompt(W,function(ai){if(ai==true){n.getObjectVersion(ad.ObjVer.Type,ad.ObjVer.ID,"latest",function(aj){n.canForceUndoCheckout(function(ak){n.getUserID(function(al){if(aj.ObjectCheckedOutToThisUser==true){if(f.getAppletInitialized()){MFWA.Java.undoCheckout(ad,g(X),t(X))}else{w.undoCheckout(ad.ObjVer,g(X),t(X))}}else{if(ak.Value==true||aj.CheckedOutToUserID==al.Value){var am={message:U.format(V.ForceUndoCheckoutDialog.Message,U.escape(ad.Title),U.escape(ad.CheckedOutTo),U.escape(ad.CheckedOutFrom))};H.prompt(am,function(an){if(an==true){if(f.getAppletInitialized()){MFWA.Java.forceUndoCheckout(ad,g(X),t(X))}else{w.forceUndoCheckout(ad.ObjVer,g(X),t(X))}}else{f.updatePending(X,false)}})}else{L.ShowError(V.Alerts.CannotUndoCheckout);f.updatePending(X,false)}}})})})}else{f.updatePending(X,false)}});break;case"Comments":w.notifyObjectAccess(ad.ObjVer);R.show(ad,function(ai,aj){if(aj==""&&ad.ObjectCheckedOut==false){ai.close()}else{w.setVersionComment(ad.ObjVer,aj,function(ak){ai.close();g(X)(ak.ObjectVersion)},t(X))}return false});break;case"CheckInWithComments":if(!ad||ad.ObjectCheckedOutToThisUser==false||ad.ThisVersionLatestToThisUser==false){return false}R.show(ad,function(ai,aj){if(aj!=""){w.setVersionComment(ad.ObjVer,aj,function(){ai.close();if(f.getAppletInitialized()){MFWA.Java.checkIn(ad,g(X),t(X))}else{w.checkIn(ad.ObjVer,g(X),t(X))}},t(X))}else{ai.close();if(f.getAppletInitialized()){MFWA.Java.checkIn(ad,g(X),t(X))}else{w.checkIn(ad.ObjVer,g(X),t(X))}}return false});break;case"Workflow":case"ChangeState":m.changeState(null);break;case"Properties":w.notifyObjectAccess(ad.ObjVer);X.childrenVisible=true;F=true;b.PropertyHandlers.editObject(ad,g(X),t(X));break;case"AddToFavorites":w.AddToFavorites(ad.ObjVer,k(ad),i(ad));break;case"RemoveFromFavorites":var W=new Object();W.message=V.FavoriteDialog.RemoveFromFavoriteMessage;W.title=V.FavoriteDialog.Title;K.prompt(W,h(ad,w,f));break;case"Delete":if(!z()){f.updatePending(X,false);return}n.getUserID(function(ai){var aj=ai.Value;n.getNACL(ad.ObjVer.Type,ad.ObjVer.ID,ad.ObjVer.Version,function(an){var ak;for(var al=0;al<an.AccessControlList.length;al++){if(aj==an.AccessControlList[al].UserOrGroupID){ak=an.AccessControlList[al]}}if(!ak){ak=an.AccessControlList[0]}if(an&&ak&&ak.DeletePermission!=l.MFPermission.Allow){L.ShowError(V.ErrorDialog.OperationAccessDeniedRights);f.updatePending(X,false)}else{o=true;var am=new Object();if(ac){am.message=V.DeleteDialog.MessageItem}else{am.message=V.DeleteDialog.MessageObject}am.title=V.DeleteDialog.Title;K.prompt(am,d(X,ac,ad,f,w))}})});break;case"MarkComplete":o=true;w.markComplete(ad.ObjVer,g(X),t(X));break;case"ConvertToSFD":o=true;if(f.getAppletInitialized()){MFWA.Java.setSingleFileObject(ad,true,g(X),t(X))}else{w.setSingleFileObject(ad.ObjVer,true,g(X),t(X))}break;case"ConvertToMFD":o=true;if(f.getAppletInitialized()){MFWA.Java.setSingleFileObject(ad,false,g(X),t(X))}else{w.setSingleFileObject(ad.ObjVer,false,g(X),t(X))}break;case"History":w.notifyObjectAccess(ad.ObjVer);MFWA.Listing.ResetListingContainer();c.view.set({objectHistory:ad.ObjVer});N(ad);break;case"Rename":if(!z()){f.updatePending(X,false);return}n.getUserID(function(ai){var aj=ai.Value;n.getNACL(ad.ObjVer.Type,ad.ObjVer.ID,ad.ObjVer.Version,function(an){var ak;for(var al=0;al<an.AccessControlList.length;al++){if(aj==an.AccessControlList[al].UserOrGroupID){ak=an.AccessControlList[al]}}if(!ak){ak=an.AccessControlList[0]}if(an&&ak&&ak.EditPermission!=l.MFPermission.Allow){L.ShowError(V.ErrorDialog.OperationAccessDeniedRights);f.updatePending(X,false)}else{o=true;var am={title:V.Commands.Rename,value:""};if(ac||ad.SingleFile==true){if(ad.SingleFile==true){ac=ad.Files[0]}am.value=ac.Name;if(ac.Extension!=""){am.value+="."+ac.Extension}}else{am.value=ad.Title}M.prompt(am,function(ap,ao){if(ap!==null&&ap!==undefined&&ap!==""){F=true;if(ac){if(f.getAppletInitialized()){MFWA.Java.renameFile(ad,ac,ap,g(X),t(X))}else{w.renameFile(ad.ObjVer,ac,ap,g(X),t(X))}}else{if(f.getAppletInitialized()){MFWA.Java.renameObject(ad,ap,g(X),t(X))}else{w.renameObject(ad.ObjVer,ap,g(X),t(X))}}return true}return false},function(){f.updatePending(X,false)})}})});break;case"OpenFile":w.notifyObjectAccess(ad.ObjVer);var ag=ac;if(ad.SingleFile==true){ag=ad.Files[0]}if(!f.getAppletInitialized()){var ab=ad.ObjVer;f.updatePending(X,false);window.location="REST/objects/"+ab.Type+"/"+ab.ID+"/"+ab.Version+"/files/"+ag.ID+"/download.aspx"}else{n.getUserID(function(ai){var aj=ai.Value;n.getNACL(ad.ObjVer.Type,ad.ObjVer.ID,ad.ObjVer.Version,function(ao){var am;for(var an=0;an<ao.AccessControlList.length;an++){if(aj==ao.AccessControlList[an].UserOrGroupID){am=ao.AccessControlList[an]}}if(!am){am=ao.AccessControlList[0]}var ak=false;if(ad.ObjectCheckedOut==true&&ad.ThisVersionLatestToThisUser==true){ak=true}var al=f.getSessionInfo();if(!al.LicenseAllowsModifications){ak=true}else{if(ao&&am&&am.EditPermission!=l.MFPermission.Allow){ak=true}}if(ak||(!u.Controls.ShowCheckoutDialog)||(!u.TaskPane.ViewAndModifyOptions.CheckOut)){f.updatePending(X,false);if(ad.SingleFile==true){MFWA.Java.openFile(ad,ad.Files[0])}else{if(ac){MFWA.Java.openFile(ad,ac)}}}else{s.prompt(ad,function(ap){if(ap==null){f.updatePending(X,false);return true}if(ap=="checkout"){w.checkOut(ad.ObjVer,function(aw){var ay=c.view.get();var at=X;if(!X.parent){at=X}else{if(X.objectFile){at=X.parent}}if(!at.parent&&ay&&ay.objectHistory){f.updateHistoryObject(at,aw,false,at)}else{f.updateObject(at.objectVersion.ObjVer,aw,false,at)}var aq=aw.Files;var av;var ax;var ar=0;for(ar=0;ar<aq.length;ar++){ax=aq[ar];if(ax.ID===ag.ID){av=ax;break}}if(av){MFWA.Java.openFile(aw,av)}else{var au={context:V.CheckOutPrompt.NotFoundErrroMessage};J.show(au)}},t(X))}else{f.updatePending(X,false);MFWA.Java.openFile(ad,ag)}return true})}})})}break;case"DownloadFile":var ag=ac;if(ad.SingleFile==true){ag=ad.Files[0]}var ab=ad.ObjVer;window.location="REST/objects/"+ab.Type+"/"+ab.ID+"/"+ab.Version+"/files/"+ag.ID+"/download.aspx";break;case"AddFile":o=true;P.addFile(ad.ObjVer,function(ai,aj){X.childrenVisible=true;g(X)(aj);return true},function(ai){f.updatePending(X,false);return true});break;case"ReplaceFile":var aa={};if(X.objectFile){aa.ID=ac.ID;aa.Version=ac.Version}else{aa.ID=X.objectVersion.Files[0].ID;aa.Version=X.objectVersion.Files[0].Version}P.replaceFile(ad.ObjVer,aa.ID,function(ai,aj){MFWA.Java.removeTemporaryFile(aj,function(){},t(X));return true},function(ai){f.updatePending(X,false);return true});break;case"GetAssignmentsForObject":var af={SearchIn:"SearchInMetadata",SearchString:"",SearchWithinThisFolder:false,CurrentFolder:null,SearchType:null,SearchObjectType:"10",PropertyCriteria:new Array()};var ae={Property:"VL_"+ad.ObjVer.Type,Condition:"is",TypedValue:ad.ObjVer.ID+"",DataFunction:null,DataType:null};af.PropertyCriteria.push(ae);var Z={path:"",array:[]};Z.array.push(af);MFWA.Listing.ResetListingContainer();c.view.set({searchCriteria:Z});break;case"CollectionMembers":if(ad.ObjVer.Type==9){MFWA.Listing.ResetListingContainer();N(ad);c.view.set({collectionMembers:ad.ObjVer})}break;case"Relationships":MFWA.Listing.ResetListingContainer();N(ad);c.view.set({relationships:ad.ObjVer});break;case"Subobjects":w.notifyObjectAccess(ad.ObjVer);MFWA.Listing.ResetListingContainer();N(ad);c.view.set({subobjects:ad.ObjVer});break;case"MakeFileFromTemplate":n.getProperties(ad.ObjVer.Type,ad.ObjVer.ID,ad.ObjVer.Version,function(aj){aj[0].TypedValue.DisplayValue="";aj[0].TypedValue.SerializedValue="";aj[0].TypedValue.Value="";for(var ai=0;ai<aj.length;ai++){if(aj[ai].PropertyDef==l.MFBuiltInPropertyDef.IsTemplate){aj.splice(ai,1);ai--}else{if(aj[ai].PropertyDef==l.MFBuiltInPropertyDef.Created){aj.splice(ai,1);ai--}else{if(aj[ai].PropertyDef==l.MFBuiltInPropertyDef.CreatedBy){aj.splice(ai,1);ai--}else{if(aj[ai].PropertyDef==l.MFBuiltInPropertyDef.LastModified){aj.splice(ai,1);ai--}else{if(aj[ai].PropertyDef==l.MFBuiltInPropertyDef.LastModifiedBy){aj.splice(ai,1);ai--}}}}}}var ak={templateForFiles:ad.ObjVer,files:false};D.ShowNewObjectWindowWithProperties(ad.ObjVer.Type,aj,x(ak,ad.ObjVer.Type),null)});break;case"MakeCopy":if(!z()){f.updatePending(X,false);return}r=ac;e=ad;n.getProperties(ad.ObjVer.Type,ad.ObjVer.ID,ad.ObjVer.Version,function(ai){n.getNACL(ad.ObjVer.Type,ad.ObjVer.ID,ad.ObjVer.Version,function(aj){var ak={templateForFiles:ad.ObjVer,files:false};D.ShowNewObjectWindowFromAnotherObject(ad.ObjVer.Type,ai,aj,x(ak,ad.ObjVer.Type),null,t(X))})});break;case"GetHyperlink":n.getVaultGUID(function(ai){n.getSitePath(function(ak){var am=ai.Value.replace("{","").replace("}","");var al="";al=ak.Value+"openfile.aspx?vault="+am+"&objtype="+ad.ObjVer.Type+"&docid="+ad.ObjVer.ID;if(ac){al+="&fileid="+ac.ID}else{if(ad.SingleFile==true){al+="&fileid="+ad.Files[0].ID}}var aj={title:V.Prompt.Title,message:V.Prompt.GetHyperlink,ok:true,cancel:false,value:al,showCopyToClipboard:true};M.prompt(aj,function(an){return true})})});break;default:L.ShowError("Unknown command: "+Y);break}}},settings:function(Z){var Y="menu_"+Z;var W=f.getListingMode();switch(Z){case"ViewList":W.List.selected=true;W.Thumbnails.selected=false;f.setListingMode(W);T.RefreshViewModeMenuItems();break;case"ViewThumbnails":W.Thumbnails.selected=true;W.List.selected=false;f.setListingMode(W);T.RefreshViewModeMenuItems();break;case"LogOut":var X=false;MFWA.Data.Cache.isLoggedInToApplication(function(aa){if(aa.Value==true){var ab=n.getCheckedoutCount(function(ac){if(ac.Value>0){O.prompt(ac.Value,function(ad){if(!ad){return true}else{var ae=(ad=="show")?true:false;if(ae){MFWA.Listing.ResetListingContainer();c.view.set({viewPath:"/V5"});return true}else{w.logout(function(af){if(af.Value==true){window.location="login.aspx?logout=true"}})}}})}else{X=true}if(X){w.logout(function(ad){if(ad.Value==true){window.location="login.aspx?logout=true"}})}})}else{window.location="login.aspx?logout=true"}});break;case"Group_GroupObjectsByObjectType":W.GroupByObjects.selected=!W.GroupByObjects.selected;E(W);f.setListingMode(W);T.RefreshGroupInfoMenuItems();break;case"Group_GroupViewsAndFolders":W.GroupByViews.selected=!W.GroupByViews.selected;E(W);f.setListingMode(W);T.RefreshGroupInfoMenuItems();break;case"ChangePassword":a.show(function(aa){aa.close()});break;default:L.ShowError("Unknown command: "+Z);break}},columnsettings:function(Y){var W=f.getCurrentColumns();var Z=false;for(var X=0;X<W.length;X++){if(W[X].PropertyID==Y){Z=true;break}}if(Z){f.hideColumnFromListing(Y)}else{f.addColumnToListing(Y)}},updateColumnSettingsMenu:function(){T.RefreshColumnSettingMenuItems()},browseRelationships:function(X){var W=c.selectedItem.get().objectVersion;n.getObjectType(W.ObjVer.Type,function(Z){var Y=Z.objectTypeTargetsForBrowsing;var aa="/V13";var ac;for(var ab=0;ab<Y.length;ab++){if(Y[ab].TargetObjectType==X){ac=Y[ab].ViewCollection}}if(ac){aa+="/V"+ac;n.getViewContents(aa,function(ad){if(ad.Items.length>0){aa+="/V"+ad.Items[0].View.ID;n.getViewContents(aa,function(ae){if(ae.Items.length>0){var af=W.ObjVer.ID%1000;var ag=(W.ObjVer.ID-af)/1000;if(ae.Items[ag]){aa+="/I"+ag+"/L"+W.ObjVer.ID;MFWA.Listing.ResetListingContainer();c.view.set({viewPath:aa})}}})}})}})},showRelatedObject:function(W,X){MFWA.Listing.ResetListingContainer();c.view.set({singleObject:{ID:X,Type:W,Version:"latest"}})}}});MFNamespace("MFWA.Filters",function(c){var b=MFNamespace("MFWA.Data.Cache");var d=MFNamespace("MFWA.Model");var f=function(g){return function(h){if(!h||!h.objectVersion){return false}else{return g(h.objectVersion)}}};var a=function(g){return function(h){if(!h){return false}else{if(h.objectVersion){return g()}else{return false}}}};var e=function(g){return function(h){if(!h){return false}else{if(h.objectVersion){return g(h.objectVersion,false)}else{if(h.objectFile&&h.parent&&h.parent.objectVersion){return g(h.parent.objectVersion,true)}else{return false}}}}};return{Show:f(function(g){return(g.ObjVer.Type==15)}),CheckOut:f(function(g){if(!g||g.ObjectCheckedOut==true||g.ThisVersionLatestToThisUser==false||g.Deleted==true){return false}return true}),CheckIn:f(function(g){if(!g||g.ObjectCheckedOutToThisUser==false||g.ThisVersionLatestToThisUser==false){return false}return true}),CheckInWithComments:f(function(g){if(!g||g.ObjectCheckedOutToThisUser==false||g.ThisVersionLatestToThisUser==false){return false}return true}),UndoCheckout:f(function(g){if(!g||g.ObjectCheckedOut==false||g.ThisVersionLatestToThisUser==false){return false}return true}),Properties:f(function(g){return true}),History:f(function(g){var h=d.view.get();if(h&&h.objectHistory){return false}else{if(!g){return false}}return true}),Relationships:f(function(g){if(!g){return false}return true}),Comments:f(function(g){if(!g||g.ThisVersionLatestToThisUser==false){return false}return true}),Workflow:f(function(g){if(!g||g.ThisVersionLatestToThisUser==false){return false}return true}),Rename:e(function(h,g){if(!h||h.Deleted==true){return false}else{if(h.ThisVersionLatestToThisUser==false){return false}else{if(g){if(h.ObjectCheckedOutToThisUser==true){return true}else{return false}}else{if(h.ObjectCheckedOut==false||h.ObjectCheckedOutToThisUser==true){return true}else{return false}}}}}),Delete:e(function(h,g){var i=d.view.get();if(i&&i.viewPath=="/V15"){return false}else{if(i&&i.objectHistory){return false}else{if(!h||h.Deleted==true){return false}else{if(g){if(h.ObjectCheckedOutToThisUser==true){return true}else{return false}}else{if(h.ObjectCheckedOut==false||h.ObjectCheckedOutToThisUser==true){return true}else{return false}}}}}}),ConvertToSFD:f(function(g){if(!g||g.ObjVer.Type||g.SingleFile==true||g.ObjectCheckedOutToThisUser==false||g.Files.length!=1){return false}else{if(g.ThisVersionLatestToThisUser==false){return false}}return true}),ConvertToMFD:f(function(g){if(!g||g.SingleFile==false||g.ObjectCheckedOutToThisUser==false){return false}else{if(g.ThisVersionLatestToThisUser==false){return false}}return true}),ReplaceFile:e(function(h,g){if(!h||h.Deleted==true){return false}else{if(h.ThisVersionLatestToThisUser==false){return false}else{if(g){if(h.ObjectCheckedOutToThisUser==true){return true}else{return false}}else{if((h.SingleFile==true)&&(h.ObjectCheckedOutToThisUser==true)){return true}else{return false}}}}}),OpenFile:e(function(h,g){if(!h){return false}else{if(g){return true}else{if(h.SingleFile==true){return true}else{return false}}}}),RemoveFromFavorites:a(function(){var g=d.view.get();if(g&&g.viewPath=="/V15"&&!d.selectedItem.value.isRelatedObject){return true}else{return false}}),AddToFavorites:a(function(){var i=d.view.get();if(i&&i.viewPath!="/V15"){var g=MFWA.TaskPane.getCachedGoToItems();for(var h in g){if(g[h].TargetPath=="/V15"){return g[h].Visible}}}return false})}});MFNamespace("MFWA.TaskPane",function(t){var c=MFNamespace("MFWA.MFWA");var r=MFNamespace("MFWA.Data.Cache");var w=MFNamespace("MFWA.Data.Operations");var x=MFNamespace("MFWA.Dialogs.Upload");var p=MFNamespace("MFWA.Dialogs.DocumentCard");var u=MFNamespace("MFWA.Dialogs.Alerts");var k=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var q=MFNamespace("MFWA.Handlers.PropertyHandlers");var a=MFNamespace("MFWA.Enumerations");var l=MFNamespace("MFWA.Configurations");var h=MFNamespace("MFWA.Model");var f=MFNamespace("MFWA.StringBuilder");var m=MFNamespace("MFWA.Actions");var A=MFNamespace("MFWA.Icons");var y=MFNamespace("MFWA.Utils");var o=MFNamespace("MFWA.I18n");var z=null;var s=false;var j={};var v=function(D){var C=D.metadata();if(C.action){D.click(function(){if(s){return}var E=m[C.action];E.apply(m,C.params||[]);s=true;setTimeout(function(){s=false},50)})}};var e=function(C){C.find(".taskpaneButton").each(function(){v($(this))})};var d=function(C){return function(D){if(D.CanHaveFiles){if(C.objectVersion.SingleFile==true){$("#taskpaneAddFile").hide();$("#taskpaneOpenFile").show();$("#taskpaneDownloadFile").show();if(C.objectVersion.ThisVersionLatestToThisUser==true){$("#taskpaneGetHyperlink").show()}else{$("#taskpaneGetHyperlink").hide()}}else{if(C.objectVersion.SingleFile==false){$("#taskpaneDownloadFile").hide();$("#taskpaneGetHyperlink").hide();$("#taskpaneOpenFile").hide();if(C.objectVersion.ThisVersionLatestToThisUser==true&&C.objectVersion.ObjectCheckedOutToThisUser==true){$("#taskpaneAddFile").show()}else{$("#taskpaneAddFile").hide()}}}}else{$("#taskpaneAddFile").hide();$("#taskpaneDownloadFile").hide();$("#taskpaneGetHyperlink").hide();$("#taskpaneOpenFile").hide()}}};var g={taskpaneCheckOut:function(C){return C.ThisVersionLatestToThisUser&&!C.ObjectCheckedOut&&!C.Deleted},taskpaneCheckIn:function(C){return C.ThisVersionLatestToThisUser&&C.ObjectCheckedOutToThisUser},taskpaneUndoCheckout:function(C){return C.ThisVersionLatestToThisUser&&C.ObjectCheckedOut},taskpaneCollectionMembers:function(C){return C.ObjVer.Type==9},taskpaneReplaceFile:false,taskpaneProperties:true,taskpaneHistory:true,taskpaneRelationships:true,taskpaneSubobjects:false,taskpaneWorkflow:true,taskpaneStates:true,taskpaneMakeCopy:true,taskpaneGetHyperlink:false,taskpaneViewAndModify:true,taskpaneThumbnailArea:true};var B={taskpaneCheckOut:false,taskpaneCheckIn:false,taskpaneUndoCheckout:false,taskpaneMarkComplete:false,taskpaneCollectionMembers:false,taskpaneHistory:false,taskpaneRelationships:false,taskpaneCollectionMembers:false,taskpaneSubobjects:false,taskpaneWorkflow:false,taskpaneStates:false,taskpaneMakeCopy:false,taskpaneGetHyperlink:function(C){return C.ThisVersionLatestToThisUser},taskpaneBrowse:false,taskpaneProperties:function(C){return !C},taskpaneThumbnailArea:true};MFWA.Model.selectedItem.observe(this,function(C){if(C&&C.objectVersion){for(var F in g){var E=g[F];if(typeof E=="function"){E=E(C.objectVersion)}$("#"+F).toggle(E)}if((C.objectVersion.SingleFile)&&(C.objectVersion.ObjectCheckedOutToThisUser)&&(C.objectVersion.ThisVersionLatestToThisUser==true)){$("#taskpaneReplaceFile").show()}if(MFWA.Model.view.get().objectHistory){$("#taskpaneHistory").hide();if(C.objectVersion.ThisVersionLatestToThisUser==false){$("#taskpaneWorkflow").hide();$("#taskpaneMakeCopy").hide()}}if(C.objectVersion.ObjVer.Type==a.MFBuiltInObjectType.Assignment){r.canCompleteAssignment(C.objectVersion.ObjVer.ID,C.objectVersion.ObjVer.Version,function(G){if(G.Value==true&&C.objectVersion.ThisVersionLatestToThisUser==true&&C.objectVersion.Deleted==false){$("#taskpaneMarkComplete").show()}else{$("#taskpaneMarkComplete").hide()}})}else{$("#taskpaneMarkComplete").hide()}r.getObjectType(C.objectVersion.ObjVer.Type,d(C));r.getObjectType(C.objectVersion.ObjVer.Type,function(J){var G=J.objectTypeTargetsForBrowsing;if(G.length>0){$("#taskpaneBrowse .taskpaneButton").hide();for(var H=0;H<G.length;H++){var I="taskpaneBrowseObjectType_"+G[H].TargetObjectType;$("#"+I).show()}$("#taskpaneBrowse").show()}else{$("#taskpaneBrowse").hide()}});r.getObjectsByType(function(G){r.getObjectType(C.objectVersion.ObjVer.Type,function(H){var J=false;for(var I in G){if(G[I].HasOwner&&G[I].Owner==H.ID){J=true;break}}if(J==true){$("#taskpaneSubobjects").show()}else{$("#taskpaneSubobjects").hide()}})})}else{if(C&&C.objectFile){for(var F in B){var E=B[F];if(typeof E=="function"){E=E(C.objectFile)}$("#"+F).toggle(E)}if(C.parent&&C.parent.objectVersion){var D=C.parent.objectVersion;if(D.ObjectCheckedOutToThisUser==true&&D.ThisVersionLatestToThisUser==true){$("#taskpaneAddFile").show();$("#taskpaneDownloadFile").show();$("#taskpaneOpenFile").show();$("#taskpaneGetHyperlink").show();$("#taskpaneReplaceFile").show()}else{if(D.ThisVersionLatestToThisUser==true){$("#taskpaneAddFile").hide();$("#taskpaneDownloadFile").show();$("#taskpaneOpenFile").show();$("#taskpaneGetHyperlink").show();$("#taskpaneReplaceFile").hide()}else{$("#taskpaneAddFile").hide();$("#taskpaneDownloadFile").show();$("#taskpaneOpenFile").show();$("#taskpaneGetHyperlink").hide();$("#taskpaneReplaceFile").hide()}}$("#taskpaneViewAndModify").show()}else{$("#taskpaneViewAndModify").hide();$("#taskpaneStates").hide()}}else{$("#taskpaneViewAndModify").hide();$("#taskpaneBrowse").hide();$("#taskpaneStates").hide()}}n(C);b(C)});var b=function(G){var F=$("#taskpaneThumbnail");if(!G){F.hide();return}var C=null;if(G.objectFile&&G.parent&&G.parent.objectVersion){var E=G.parent.objectVersion.ObjVer;var D=G.objectFile;C=y.currentUrl+"REST/objects/"+E.Type+"/"+E.ID+"/"+E.Version+"/files/"+D.ID+"/"+D.Version+"/preview.aspx?size=150&force=true"}else{if(G.objectVersion){var E=G.objectVersion.ObjVer;C=y.currentUrl+"REST/objects/"+E.Type+"/"+E.ID+"/"+E.Version+"/preview.aspx?size=150&force=true"}}if(C){F.attr("src",C);F.show()}else{F.hide()}};function i(C){r.hasValueListIcon(a.MFBuiltInValueList.States,C,function(D){if(D.Value==true){$("#states_"+C).show()}else{$("#states_"+C).css("background-image","url('"+A.Listing.WorkflowStates+"')");$("#states_"+C).show()}})}var n=function(C){$("#taskpaneStates .taskpaneButton").remove();$("#taskpaneStates").hide();if(!l.TaskPane.ShowWorkFlow||!C||!C.objectVersion||!C.objectVersion.ThisVersionLatestToThisUser){return}r.getWorkflowState(C.objectVersion.ObjVer,function(E){var D=(E.Workflow.TypedValue.Lookup!=null)?E.Workflow.TypedValue.Lookup.Item:0;if(D>0){var F=(E.State.TypedValue.Lookup!=null)?E.State.TypedValue.Lookup.Item:0;r.getStatesForWorkflow(D,F,function(G){if(G&&G.length>0){var I=new f.StringBuilder("");var K=false;$("#taskpaneStates .taskpaneButton").remove();$("#taskpaneStates").hide();for(var H in G){if((!G[H])||(G[H].ID==F)||(!G[H].Selectable)){continue}var J="{action:'changeState',params:["+G[H].ID+"]}";I.append('<div class="taskpaneButton hidden '+J+' ">');I.append('<div id="states_'+G[H].ID+'" class="taskpaneItemIcon 8bit" style="display:none;background-image: url('+y.currentUrl+"REST/objects/"+a.MFBuiltInValueList.States+"/"+G[H].ID+'/valueListIcon.aspx)"></div>');I.append('<div class="taskpaneItemText">');I.append(y.escape(G[H].Name));I.append("</div></div>");if(!K){K=true}}if(K){$("#taskpaneStates").append(I.toString());$("#taskpaneStates").show();e($("#taskpaneStates"));for(var H in G){i(G[H].ID)}}}})}})};return{create:function(C){C.find(".taskpaneArea").each(function(){e($(this))})},clear:function(){$("#taskpaneViewAndModify").hide();$("#taskpaneStates").hide();$("#taskpaneBrowse").hide();$("#taskpaneThumbnailArea").hide()},createGoToItems:function(C){r.getGotoItems(null,function(I){z=I;if(C.length){var G=new f.StringBuilder("");G.append('<div id="taskpaneGoTo" class="taskpaneArea">');G.append('<div class="taskpaneHeader">');G.append(o.TaskPane.GoTo);G.append("</div>");G.append("");var K;var J;var D=0;for(var F in I){var L=I[F];if((l.TaskPane.GotoOptions)&&(!l.TaskPane.GotoOptions[L.TargetPath])){continue}D++;if(L.TargetPath=="/"){K=o.TaskPane.Root;J=A.Listing.VaultMounting}else{K=L.Title;if(L.TargetPath=="/V15"){J=A.Listing.IconFavoritesView}else{J=A.Listing.CommonViewFolder}}G.append('<div id="taskpaneGoTo_'+F);G.append('" class="taskpaneButton" onclick="MFWA.Actions.goTo(\''+L.TargetPath+"');\">");var E="url('"+J+"')";G.append('<div class="taskpaneItemIcon" style="background-image:'+E+'">');G.append('</div><div class="taskpaneItemText">');G.append(K);G.append("</div></div>")}G.append(t.createLogout());G.append("</div>");var H=$(G.toString());C.append(H);if(D==0){$("#taskpaneGoTo .taskpaneHeader").hide()}}})},createLogout:function(){var C=new f.StringBuilder("");C.append('<div id="taskpaneLogOut" class="taskpaneButton" style="margin-top:20px;" onclick="MFWA.Actions.settings(\'LogOut\');">');C.append('<div class="taskpaneItemIcon" style="background-image: url(\''+A.Commands.LogOut+"')\"></div>");C.append('<div class="taskpaneItemText">');C.append(o.Commands.LogOut);C.append("</div></div>");return C.toString()},getCachedGoToItems:function(){return z}}});MFNamespace("MFWA.Search",function(){var d=MFNamespace("MFWA.Debug.Assert");var e=MFNamespace("MFWA.Model");var u=MFNamespace("MFWA.Utils");var y=MFNamespace("MFWA.Data.Cache");var k=MFNamespace("MFWA.Enumerations.MFDataType");var j=MFNamespace("MFWA.I18n");var a=MFNamespace("MFWA.I18n.Search");var w=MFNamespace("MFWA.Listing");var c=MFNamespace("MFWA.MFWA");var m=MFNamespace("MFWA.Dialogs.Alerts");var i=MFNamespace("MFWA.Configurations");var n=MFNamespace("MFWA.StringBuilder");function b(B,Q,J){var I=new Array();var z=new n.StringBuilder(3+Q.length*8);for(var L=0;L<Q.length;L++){var G=Q[L];if(G.HasParent==false){I.push(G)}else{var H=I.length;var T=0;var P=false;for(var F=0;F<H;F++){if(G.ParentID==I[F].ID){P=true;continue}else{if((P==true)&&(I[F].ParentID!=G.ParentID)){T=F;break}}}if(T==0){I.push(G)}else{I.splice(T,0,G)}}}Q=I;var K=false;var D=false;for(var L=0;L<Q.length;L++){var G=Q[L];if(G.ID<0&&!G.IsClearItem){continue}var S={Item:G.ID,DisplayValue:G.Name,Hidden:false,Version:-1,Deleted:false};var O=u.escape(S.DisplayValue);if(G.IsClearItem){O=G.Name}var M=function(U,W){if(Q[W].HasParent==true){U="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+U;D=true;for(var V=W;V>=0;V--){if(Q[W].ParentID==Q[V].ID){U=M(U,V);break}}}return U};var A=M("",L);var C=A.length/6;var E=O;var R=u.unique("option");var N="";N='" style = "';E=A+E;z.append('<option id="').append(R).append('" value="').append(S.Item);if(G.IsClearItem){z.append(N).append('font-weight:bold;">')}else{z.append(N).append('">')}z.append(E).append("</option>")}J.html(z.toString());if(!($.browser.msie&&$.browser.version=="7.0")&&(K||D)){J.attr("id",u.unique("hierarchy"));J.msDropDown({replaceDropDown:true,showIcon:false,currentItem:"",isHierarchy:D,isAdvSearch:true});K=false;D=false;$(B).find(".dd").wrap("<div class='mainSearch_Dropdown'>")}}function q(z){$(z+" .searchConditionType").empty()}function s(z){q(z);var A='<option value="is">'+a.Conditions.same+"</option>";A+='<option value="isNot">'+a.Conditions.notSame+"</option>";A+='<option value="isEmpty">'+a.Conditions.isEmpty+"</option>";A+='<option value="isNotEmpty">'+a.Conditions.isNotEmpty+"</option>";$(z+" .searchConditionType").append(A)}function r(z){q(z);var A='<option value="is">'+a.Conditions.same+"</option>";A+='<option value="contains">'+a.Conditions.contains+"</option>";A+='<option value="startsWith">'+a.Conditions.startsWith+"</option>";A+='<option value="isEmpty">'+a.Conditions.isEmpty+"</option>";A+='<option value="isNotEmpty">'+a.Conditions.isNotEmpty+"</option>";$(z+" .searchConditionType").append(A)}function f(z){q(z);var A='<option value="is">'+a.Conditions.same+"</option>";A+='<option value="isNot">'+a.Conditions.notSame+"</option>";A+='<option value="greaterThan">'+a.Conditions.greaterThan+"</option>";A+='<option value="greaterOrEqualThan">'+a.Conditions.greaterOrEqualThan+"</option>";A+='<option value="lessThan">'+a.Conditions.lessThan+"</option>";A+='<option value="lessOrEqualThan">'+a.Conditions.lessOrEqualThan+"</option>";A+='<option value="isEmpty">'+a.Conditions.isEmpty+"</option>";A+='<option value="isNotEmpty">'+a.Conditions.isNotEmpty+"</option>";$(z+" .searchConditionType").append(A)}function l(z){q(z);var A='<option value="is">'+a.Conditions.same+"</option>";A+='<option value="isAfter">'+a.Conditions.isAfter+"</option>";A+='<option value="isBefore">'+a.Conditions.isBefore+"</option>";A+='<option value="today">'+a.Conditions.today+"</option>";A+='<option value="withinTheLastWeek">'+a.Conditions.withinTheLastWeek+"</option>";A+='<option value="withinTheLastMonth">'+a.Conditions.withinTheLastMonth+"</option>";A+='<option value="withinTheLastYear">'+a.Conditions.withinTheLastYear+"</option>";A+='<option value="isEmpty">'+a.Conditions.isEmpty+"</option>";A+='<option value="isNotEmpty">'+a.Conditions.isNotEmpty+"</option>";$(z+" .searchConditionType").append(A)}function x(z){$(z+" .searchTypedValue").remove();$(z+" .ui-datepicker-trigger").remove();$(z+" div").remove();$(z).css("padding-top","")}function p(A){var z='<select class="searchTypedValue"></select>';$(A).append(z)}function g(A){var z='<input class="searchTypedValue"></select>';$(A).append(z)}function o(A){var z='<input class="searchTypedValue" readonly="readonly"></select>';$(A).append(z);$(A+" .searchTypedValue").datepicker({dateFormat:j.DateTime.ShortDateFormat,changeMonth:true,changeYear:true,duration:"fast",gotoCurrent:true,buttonImage:"res/calendar.png",buttonText:"Choose",buttonImageOnly:true,showOn:"both"}).datepicker("setDate","+0");if($(A).find("img").length){$(A).css("padding-top","3px")}}function h(A,z){y.getValueListItems(z,function(D){var B="";for(var C=0;C<D.length;C++){B+='<option value="'+D[C].ID+'">'+u.escape(D[C].Name)+"</option>"}$(A+" .searchTypedValue").append(B);MFWA.Layout.setDropDownWidth()})}function v(B,F,A,E){if(A=="isEmpty"||A=="isNotEmpty"){var D={Property:E,Condition:A,TypedValue:"$0",DataFunction:null,DataType:null};F.PropertyCriteria.push(D)}else{if($("#searchPropertyCriterion"+B+" .hasDatepicker").length==1){var H=$("#searchPropertyCriterion"+B+" .hasDatepicker").datepicker("getDate");var z="d";var C="d";switch(A){case"today":H=new Date();break;case"withinTheLastWeek":case"withinTheLastMonth":case"withinTheLastYear":var G=365;if(A=="withinTheLastMonth"){G=30}else{if(A=="withinTheLastWeek"){G=7}}var I={Property:E,Condition:"lessOrEqualThan",TypedValue:u.getUTCTime(new Date()).getTime(),DataFunction:"d",DataType:"d"};F.PropertyCriteria.push(I);z="m";A="lessOrEqualThan";H=G;C="i";break;case"isAfter":case"isBefore":case"is":default:break}var D={Property:E,Condition:A,TypedValue:null,DataFunction:z,DataType:C};if(z=="m"){D.TypedValue=H}else{D.TypedValue=u.getUTCTime(H).getTime()}F.PropertyCriteria.push(D)}else{var D={Property:E,Condition:A,TypedValue:$("#searchPropertyCriterion"+B+" .searchTypedValue").val(),DataFunction:null,DataType:null};F.PropertyCriteria.push(D)}}return F}function t(A){var z='<option value="true">'+a.Conditions.booleanTrue+"</option>";z+='<option value="false">'+a.Conditions.booleanFalse+"</option>";$(A+" .searchTypedValue").append(z);MFWA.Layout.setDropDownWidth()}e.view.observe(this,function(z){if(z&&(z.viewPath||z.searchCriteria)){$("#searchWithinThisFolder").removeAttr("disabled")}else{$("#searchWithinThisFolder").attr("disabled",true);$("#searchWithinThisFolder").removeAttr("checked")}});return{ResetSearch:function(){var A=$("#searchIn").msDropDown().data("dd");A.set("selectedIndex",0);$(".ddChild").hide();$("#searchObjectType").val("-1");$('#searchIn option[value="SearchInBoth"]').attr("selected","selected");$("#searchWithinThisFolder").removeAttr("checked");$("#searchString").attr("value","");$("#searchAllWordsButton").click();$('#searchObjectType option[value="All"]').attr("selected","selected");for(var z=1;z<=2;z++){$("#searchPropertyCriterion"+z+" .searchExpression").val("empty");$("#searchPropertyCriterion"+z+" .searchConditionType").empty();x("#searchPropertyCriterion"+z)}},OpenSearch:function(){if($("#searchAdvanced").css("display")=="none"){if(i.LayOut==0||i.LayOut==1||i.LayOut==4){$("#browse").trigger("resize",[150])}$("#searchAdvanced").css("display","block");$("#taskpaneShadowBox").css("background-image","none");$("#searchBasic").css("background-image","none");$("#openSearchButton .searchIcon").css("background-image","url('Images/Icons/up_small.png')");if(i.LayOut==2||i.LayOut==3||i.LayOut==5){var z=$("#page").height()-$("#searchAdvanced").height();MFWA.Layout.setHeight(z)}}else{if(i.LayOut==0||i.LayOut==1||i.LayOut==4){$("#browse").trigger("resize",[68])}$("#searchAdvanced").css("display","none");$("#taskpaneShadowBox").css("background-image","url('Images/TaskPaneShadow.png')");$("#openSearchButton .searchIcon").css("background-image","url('Images/Icons/down_small.png')");if(i.LayOut==2||i.LayOut==3||i.LayOut==5){var z=$("#page").height()+$("#searchAdvanced").height();MFWA.Layout.setHeight(z)}}},ActiveView:{},PerformSearch:function(){var J={};var G=false;var C=$("#searchString").val();var A=$(".searchTypedValue");$("#searchIn option").each(function(){if($(this).text()==C){G=true}});if(C&&C!=""&&$("#searchIn")[0].length<=3){$("#searchIn").prepend("<option value='clearHistory' class=disableOption>"+a.Filters.ClearHistory+"</option>");$("#searchIn").prepend("<option disabled class=disableOption> -- </option>");$("#searchIn").prepend("<option>"+u.escape(C)+"</option>")}else{if(C&&C!=""&&(!G)){$("#searchIn").prepend("<option>"+u.escape(C)+"</option>")}}$("#searchIn").msDropDown();$(".ddChild").hide();$("#searchString").val(C);if($("#searchObjectType").val()=="-1"){J={SearchIn:$("#searchIn").val(),SearchString:C,SearchWithinThisFolder:$("#searchWithinThisFolder").attr("checked"),CurrentFolder:null,SearchType:null,SearchObjectType:"All",PropertyCriteria:new Array()}}else{J={SearchIn:$("#searchIn").val(),SearchString:C,SearchWithinThisFolder:$("#searchWithinThisFolder").attr("checked"),CurrentFolder:null,SearchType:null,SearchObjectType:$("#searchObjectType").val(),PropertyCriteria:new Array()}}var L=true;if($("#searchAdvanced").css("display")=="none"){L=false}var K=false;if(L){J.SearchType=$('[name="searchTypeGroup"]:checked').val();for(var E=1;E<=2;E++){var I=$("#searchPropertyCriterion"+E+" .searchExpression").val();var B=$("#searchPropertyCriterion"+E+" .searchConditionType").val();var z=false;if($("#searchPropertyCriterion"+E+" .searchTypedValue").is(":visible")){z=true}var F=I.replace(/[^0-9]/g,"");if(!K&&F.length>0&&!K){y.getPropertyDef(F,function(M){if(z&&(M.DataType==k.Integer||M.DataType==k.Floating)){var N=$("#searchPropertyCriterion"+E+" .searchTypedValue").val();var O=j.Search.Filters.CannotEmpty;if(!N||(!!N&&N.length==0)){m.ShowNotification(O);K=true}O=j.Search.Filters.NumbersOnly;if(isNaN(N)||($.inArray(".",N)!=-1)){m.ShowNotification(O);K=true}else{if(N.length>0){N=u.validateSignedNumberRange(N);$("#searchPropertyCriterion"+E+" .searchTypedValue").val(N)}}}J=v(E,J,B,I)})}}}if(K){return false}var D;if(J.SearchWithinThisFolder==false||!e.view.get()||!e.view.get().searchCriteria){D={path:"",array:[]}}else{D=e.view.get().searchCriteria}if(J.SearchWithinThisFolder){var H=e.view.get();if(typeof H!="undefined"){if(typeof H.viewPath!="undefined"){D.path=H.viewPath}else{if(H.searchCriteria){D.path=H.searchCriteria.path}}}else{if(this.ActiveView.ViewPath){D.path=this.ActiveView.ViewPath}else{d.fail("Cannot search within this view")}}}D.array.push(J);MFWA.Listing.ResetListingContainer();e.view.set({searchCriteria:D})},UpdateConditionField:function(D){var C="#searchPropertyCriterion"+D;var B=$(C+" .searchExpression").val();x(C);if(B=="empty"){q(C)}else{if(B.substring(0,2)=="VL"){var A=B.substring(3);s(C);p(C);h(C,A)}else{if(B.substring(0,2)=="PV"){var z=B.substring(3);y.getPropertyDef(z,function(F){switch(F.DataType){case k.Lookup:case k.MultiSelectLookup:var E=F.ValueList;s(C);p(C);y.getValueList(F.ValueList,function(G){if(G.Hierarchial){y.getValueListItemsByPropDefID(F.ID,function(I){var H=$(C+" .searchTypedValue");b(C,I,H)})}else{h(C,E)}});break;case k.Text:r(C);g(C);break;case k.Integer:case k.Floating:f(C);g(C);break;case k.Date:case k.Timestamp:l(C);o(C);break;case k.Boolean:s(C);p(C);t(C);break;case k.Uninitialized:case k.Time:case k.Integer64:case k.FILETIME:case k.MultiLineText:case k.ACL:default:q(C)}})}}}},SetSearchControlsWithSavedSettings:function(){y.getSearchState(function(z){$("#searchIn").val(z.SearchIn);$("#searchIn").msDropDown();$(".ddChild").hide();$("#searchString").val(z.SearchWord);$("#searchObjectType").val(z.SearchObjectType);$("#search"+z.LookWord+"Button").attr("checked",true);if(z.WithinFolder=="True"){$("#searchWithinThisFolder").attr("checked",true)}else{$("#searchWithinThisFolder").attr("checked",false)}})},UpdateTypedValueField:function(A){var z="#searchPropertyCriterion"+A;var B=$(z+" .searchConditionType").val();switch(B){case"isEmpty":case"isNotEmpty":case"today":case"withinTheLastWeek":case"withinTheLastMonth":case"withinTheLastYear":$(z+" .searchTypedValue").css("display","none");$(z+" .ui-datepicker-trigger").css("display","none");break;default:$(z+" .searchTypedValue").css("display","inline");$(z+" .ui-datepicker-trigger").css("display","inline");break}}}});MFNamespace("MFWA.PropertiesPane.Row",function(){return{createRow:function(b,a){var c={};c.HTML=b;c.Height=a;return c}}});MFNamespace("MFWA.PropertiesPane.Column",function(){var a=MFNamespace("MFWA.PropertiesPane.Row");return{createColumn:function(d){var e={};e.Rows=new Array();e.Height=0;e.Left=null;e.Right=null;e.pushRight=function(g,i,h){if(this.Right&&this.Rows.length>1&&i>this.Right.Height&&i>=this.Right.Height+g&&this.Height>h){var f=this.Rows.length-1;this.Right.Rows.splice(0,0,this.Rows[f]);this.Right.Height+=g;this.Rows.splice(f,1);this.Height-=g;if(this.Right.Right){this.Right.pushRight(this.Right.Rows[this.Right.Rows.length-1].Height,this.Right.Height,h)}return true}return false};if(d){for(var c=0;c<d.length;c++){var b=d[c].outerHTML;if(typeof b=="undefined"){b="<tr>"+d[c].innerHTML+"</tr>"}e.Rows.push(a.createRow(b,d[c].offsetHeight));e.Height+=d[c].offsetHeight}}return e}}});MFWA.Model.selectedItem.observe(this,function(a){if(a&&a.objectVersion){MFWA.PropertiesPane.setProperties(a.objectVersion.ObjVer)}else{if(a&&a.objectFile&&a.parent&&a.parent.objectVersion){MFWA.PropertiesPane.setProperties(a.parent.objectVersion.ObjVer)}else{MFWA.PropertiesPane.clear()}}});MFNamespace("MFWA.PropertiesPane",function(r){var x=MFNamespace("MFWA.Data.Cache");var v=MFNamespace("MFWA.Utils");var o=MFNamespace("MFWA.I18n");var w=MFNamespace("MFWA.Enumerations.MFBuiltInPropertyDef");var b=MFNamespace("MFWA.Enumerations");var d=MFNamespace("MFWA.PropertiesPane.Column");var u=MFNamespace("MFWA.StringBuilder");var q=MFNamespace("MFWA.ViewItem");var n=MFNamespace("MFWA.Configurations");var a=new Array();var f='<div class="propertiesPaneColumn"><table></table></div>';var c=[];var k;function l(z,A){for(var y=0;y<z.length;y++){if(z[y].PropertyDef==A){return z[y]}}return null}function p(A,y){for(var z=0;z<A.length;z++){if(A[z].ID==y){return A[z]}}return null}function t(z){if(z[0].Rows.length>0){var A=$("#propertiesPaneMargin").height()+10;var y=z[0].Rows[z[0].Rows.length-1].Height;while(z[0].pushRight(y,z[0].Height,A)!=false){y=z[0].Rows[z[0].Rows.length-1].Height}}}function m(){for(var y in c){$("#"+c[y]).show()}}function s(A){a=new Array();var y=$("#propertiesPaneProperties").width();var C=$("#propertiesPaneTitle").outerWidth(true);var B=Math.floor(y/C);a.push(d.createColumn(A));for(var z=1;z<B;z++){a.push(d.createColumn());a[z-1].Right=a[z];a[z].Left=a[z-1]}return a}function i(A,y){var z=new u.StringBuilder();x.getPropertyDef(y,function(D){var B=v.escape(A.DisplayValue);if(!B){B=""}z.append("<div>");z.append("<div style='float:left;width:100%'>");if(A.Hidden==false){e(D.ValueList,A.Item);z.append("<img id='imgValueList_"+D.ValueList+"_"+A.Item+"' style='display:none;margin-right:2px;margin-top:-2px;float:left' src='");z.append(v.currentUrl+"REST/objects/"+D.ValueList+"/"+A.Item+"/valueListIcon.aspx");z.append("'/>")}z.append("<div style='float:left'");var C=k[D.ValueList];if(C&&C.RealObjectType&&A.Deleted==false&&A.Hidden==false){z.append(" class='propertiesPaneButton propertiesPaneButtonblack'");z.append(' onclick=\'MFNamespace("MFWA.Actions").showRelatedObject(');z.append(D.ValueList);z.append(",");z.append(A.Item);z.append(")'>")}else{z.append(">")}z.append(B);z.append("</div>");z.append("</div>");z.append("</div>")});return z.toString()}function e(y,z){x.hasValueListIcon(y,z,function(A){var B="imgValueList_"+y+"_"+z;if(A.Value==true){$("#"+B).show();c.push(B)}else{$("#"+B).hide()}})}function j(y,z,A){x.hasValueListIcon(z,A,function(B){var C=y+A;if(B.Value==true){$("#"+C).show();c.push(C)}else{$("#"+C).hide()}})}function g(z,B,A){var y=A?o.Comma:"";var C=l(z,B);if(!n.Controls.ShowHiddenProperties&&C.TypedValue.Lookup&&C.TypedValue.Lookup.Hidden){return""}else{return y+" "+v.escape(C.TypedValue.DisplayValue)}}function h(C,y,D,B,A,z){x.getUserID(function(aj){var ak=aj.Value;var N='<tr><td class="propertiesPaneNameOrTitle">'+v.escape(C.Title)+"</td></tr>";var L=g(y,w.Class);N+='<tr><td><div style="float:left"><img style="float:left" src="'+q.getObjectIcon(C)+'"></img><div style="float:left;padding-left:3px;padding-top:2px">'+L;N+=" "+v.format(o.PropertiesPane.IDAndVersion,C.DisplayID,C.ObjVer.Version)+"</div></div></td></tr>";var W=g(y,w.Created,false);W+=g(y,w.CreatedBy,true);var K='<tr><td class="dataname">'+v.escape(p(D,w.Created).Name)+o.Colon+"</td>";K+="<td>"+W+"</td></tr>";var S=g(y,w.LastModified,false);S+=g(y,w.LastModifiedBy,true);K+='<tr><td class="dataname">'+o.PropertiesPane.LastModified+"</td>";K+="<td>"+S+"</td></tr>";if(C.ObjectCheckedOut){K+='<tr><td class="dataname">'+o.PropertiesPane.Status+"</td>";K+="<td>"+o.PropertiesPane.CheckedOut+o.Comma+v.escape(C.CheckedOutTo);K+=" ["+v.escape(C.CheckedOutFrom)+"]</td></tr>";K+='<tr><td class="dataname">&nbsp;</td>';K+="<td>"+C.CheckedOutAtDisplayValue;K+="</td></tr>"}if(C.Deleted){var ah=g(y,w.Deleted,false);ah+=g(y,w.DeletedBy,true);K+='<tr><td class="dataname">'+v.escape(p(D,w.Deleted).Name)+o.Colon+"</td>";K+="<td>"+ah+"</td></tr>"}$("#propertiesPaneTitle").empty();$("#propertiesPaneTitle").append("<table>"+N+"</table>");$("#propertiesPaneTimestamps").empty();$("#propertiesPaneTimestamps").append("<table>"+K+"</table>");$("#propertiesPaneProperties").empty();$("#propertiesPaneProperties").append(f);var G=0;if(z&&z.NamePropertyDefID){G=z.NamePropertyDefID}for(var af=0;af<y.length;af++){var T="";var aa=null;if(y[af].PropertyDef==87){aa="hyperlink"}if(y[af].PropertyDef!=G&&MFWA.Dialogs.DocumentCard.Filters.showInPropertiesPane(y[af].PropertyDef)){var U=0;var ai=false;var H=false;T+='<tr><td class="dataname">'+v.escape(p(D,y[af].PropertyDef).Name)+":</td>";var Q="";if(y[af].TypedValue.DataType==MFWA.Enumerations.MFDataType.MultiSelectLookup){if(y[af].TypedValue.Lookups){for(var ae=0;ae<y[af].TypedValue.Lookups.length;ae++){H=(!y[af].TypedValue.Lookups[ae].Hidden)||n.Controls.ShowHiddenProperties;if(H&&y[af].TypedValue.Lookups[ae].Item==ak&&(y[af].PropertyDef==w.AssignedTo||y[af].PropertyDef==w.CompletedBy)){Q+='<div style="font-weight: bold;">';var J=v.escape(y[af].TypedValue.Lookups[ae].DisplayValue);if(!J){J=""}Q+=J;Q+="</div>"}else{if(H){Q+=i(y[af].TypedValue.Lookups[ae],y[af].PropertyDef)}else{U++}}}if(U==y[af].TypedValue.Lookups.length){ai=true}}}else{if(y[af].TypedValue.DataType==MFWA.Enumerations.MFDataType.Lookup){H=(y[af].TypedValue.Lookup&&!y[af].TypedValue.Lookup.Hidden)||(n.Controls.ShowHiddenProperties);if(y[af].TypedValue.Lookup&&H){Q+=i(y[af].TypedValue.Lookup,y[af].PropertyDef)}else{ai=true}}else{if(y[af].TypedValue.DataType==b.MFDataType.Text&&y[af].ContentType==2){var Z=v.escape(y[af].TypedValue.DisplayValue);if(Z){Q='<a href="'+Z+'" target="_blank">'+Z+"</a>"}}else{if(y[af].TypedValue.DataType==b.MFDataType.Text&&y[af].ContentType==1){var I=v.escape(y[af].TypedValue.DisplayValue);if(I){Q='<a href="mailto:'+I+'"">'+I+"</a>"}}else{var J=v.escape(y[af].TypedValue.DisplayValue);if(J){Q=J.replace(/\r/g,"");Q=Q.replace(/\n/g,"<br>")}}}}}if(!ai){if(!aa){T+="<td>"+Q+"</td></tr>"}else{T+="<td class='hyperlink' onclick='MFNamespace(\"MFWA.Actions\").showReport(\""+Q+"\")'>"+Q+"</td></tr>"}$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(T)}}}if(B.length>0){var V='<tr><td class="dataname">'+v.escape(p(D,w.VersionComment).Name)+o.Colon+"</td><td>";V+=v.escape(B[0].LastModifiedBy.TypedValue.DisplayValue)+":<br>";var Y=v.escape(B[0].Comment.TypedValue.DisplayValue);if(Y){var ad=Y.replace(/\r/g,"");ad=ad.replace(/\n/g,"<br>");V+=ad}if(B.length>1){V+="<br>";V+='<div class="morecomments" onclick=\'MFNamespace("MFWA.Actions").objectOperations("Comments")\'>';V+=o.PropertiesPane.MoreComments+"</div>"}V+="</td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(V)}var M=l(y,w.Workflow);if(M){var ag=-1;var X="";ag=(M.TypedValue.Lookup!=null)?M.TypedValue.Lookup.Item:-1;if(ag>0&&M.TypedValue.Lookup.Hidden==false){X=(M.TypedValue.Lookup!=null)?'<img id="workflowImage_'+ag+'" src="'+v.currentUrl+"REST/objects/"+b.MFBuiltInValueList.Workflows+"/"+ag+'/valueListIcon.aspx" style="margin-right: 2px; margin-top: -2px; float: left;display:none;" ></img>':""}var ab='<tr><td class="dataname">'+o.PropertiesPane.WorkFlow+"</td><td";if(C.ThisVersionLatestToThisUser==true&&n.Controls.ShowWorkFlowLinkInPropPane&&n.TaskPane.ViewAndModifyOptions.Workflow){ab+=" class=\"propertiesPaneButton\" onclick=\"MFNamespace('MFWA.Actions').objectOperations('Workflow')\"";ab+='><div style="float:left"><div class="propertiesPaneButton" style="float:left">'+X+v.escape(M.TypedValue.DisplayValue)+"</div></div></td></tr>"}else{ab+='><div style="float:left"><div style="float:left">'+X+M.TypedValue.DisplayValue+"</div></div></td></tr>"}H=(M.TypedValue.Lookup&&!M.TypedValue.Lookup.Hidden)||(n.Controls.ShowHiddenProperties);if(H){$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(ab)}if(X.length){j("workflowImage_",b.MFBuiltInValueList.Workflows,ag)}var P='<tr><td class="dataname">'+o.PropertiesPane.State+"</td>";var F=l(y,w.State);var ac="";X="";if(F.TypedValue.DisplayValue!=""){ac=v.escape(F.TypedValue.DisplayValue);var R=-1;R=(F.TypedValue.Lookup!=null)?F.TypedValue.Lookup.Item:-1;if(R>0&&F.TypedValue.Lookup.Hidden==false){X=(F.TypedValue.Lookup!=null)?'<img id="stateImage_'+R+'" src="'+v.currentUrl+"REST/objects/"+b.MFBuiltInValueList.States+"/"+R+'/valueListIcon.aspx" style="margin-right: 2px; margin-top: -2px; float: left;display:none;" ></img>':""}}else{ac="-"}P+="<td";if(C.ThisVersionLatestToThisUser==true&&n.Controls.ShowWorkFlowLinkInPropPane&&n.TaskPane.ViewAndModifyOptions.Workflow){P+=" class=\"propertiesPaneButton\" onclick=\"MFNamespace('MFWA.Actions').objectOperations('Workflow')\"";P+='><div style="float:left"><div class="propertiesPaneButton" style="padding:2px 0px;float:left">'+X+ac+"</div></div><td></tr>"}else{P+='><div style="float:left"><div style="padding:2px 0px;float:left">'+X+ac+"</div></div><td></tr>"}H=(!F.TypedValue.Lookup)||(!F.TypedValue.Lookup.Hidden||n.Controls.ShowHiddenProperties);if(H){$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(P)}if(X.length){j("stateImage_",b.MFBuiltInValueList.States,R)}}if(C.HasAssignments){var al='<tr><td class="dataname"></td>';al+='<td id="propertiesPaneAssignments" onclick="MFWA.Actions.objectOperations(\'GetAssignmentsForObject\');">';al+=v.escape(A)+"</td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(al)}var E=s($("#propertiesPaneProperties > div.propertiesPaneColumn tr"));t(E);$("#propertiesPaneProperties").empty();for(var af=0;af<E.length;af++){$("#propertiesPaneProperties").append('<div class="propertiesPaneColumn"></div>');var O="";for(var ae=0;ae<E[af].Rows.length;ae++){O+=E[af].Rows[ae].HTML}$("#propertiesPaneProperties > div.propertiesPaneColumn:eq("+af+")").append("<table>"+O+"</table>")}m()})}return{propPaneResized:function(){var H=a.length;if(H>0&&a[0].Rows.length>0){var y=$("#propertiesPane").height()-$("#propertiesPaneInfo").height()-parseInt($("#propertiesPaneMargin").css("margin-top"));var A=$("#propertiesPaneProperties").width();var z=$("#propertiesPaneTitle").outerWidth(true);var I=Math.floor(A/z);if(I==0){I=1}if(I<H){while(I<H){var B=a[H-2];var J=a[H-1];B.Rows.push.apply(B.Rows,J.Rows);B.Height+=J.Height;a.pop();B.Right=null;H=a.length}}else{if(I>H){while(I>H){var C=MFNamespace("MFWA.PropertiesPane.Column");a.push(C.createColumn());var F=a.length-1;a[F-1].Right=a[F];a[F].Left=a[F-1];H=a.length}}}for(var E=a.length;E>1;E--){var B=a[E-2];var J=a[E-1];B.Rows.push.apply(B.Rows,J.Rows);B.Height+=J.Height;J.Rows.splice(0,J.Rows.length);J.Height=0}t(a);$("#propertiesPaneProperties").empty();for(var E=0;E<a.length;E++){$("#propertiesPaneProperties").append('<div class="propertiesPaneColumn"></div>');var G="";for(var D=0;D<a[E].Rows.length;D++){G+=a[E].Rows[D].HTML}$("#propertiesPaneProperties .propertiesPaneColumn:eq("+E+")").append("<table>"+G+"</table>")}m()}},clear:function(){$("#propertiesPaneTitle").empty();$("#propertiesPaneTimestamps").empty();$("#propertiesPaneProperties").empty();a=new Array()},setProperties:function(y){var z=function(){r.clear()};x.getObjectVersionOrHandleError(y,function(A){x.getPropertiesForDisplay(y,function(B){x.getPropertyDefs(function(C){x.getVersionComments(y,function(D){x.getObjectsByType(function(E){k=E;x.getObjectType(10,function(F){var G=l(B,w.Class).TypedValue.Lookup.Item;x.getClass(G,function(H){h(A,B,C,D,F.NamePlural,H)},function(){h(A,B,C,D,F.NamePlural)})})})})})})},z)}}});MFNamespace("MFWA.Structs",function(a){var b=MFNamespace("MFWA.Enumerations");return{createNewTypedValue:function(c,f,e){if(c==b.MFDataType.MultiSelectLookup&&e.constructor!==Array){e=[e]}var d=new Object();d.DataType=c;d.DisplayValue=f;if(c==b.MFDataType.MultiSelectLookup){d.Lookups=e}else{if(c==b.MFDataType.Lookup){d.Lookup=e}else{d.Value=e}}if(e!=null){d.HasValue=true}else{d.HasValue=false}return d},createNewLookup:function(f,d,c){var e=new Object();e.Deleted=false;e.DisplayValue=f;e.Hidden=false;e.Item=d;e.Version=c;return e},createNewPropertyValue:function(c,e){var d=new Object();d.PropertyDef=c;d.Value=e;d.TypedValue=e;return d}}});if(jQuery){(function(){$.extend($.fn,{contextMenu:function(a,b){if(a.menu==undefined){return false}if(a.inSpeed==undefined){a.inSpeed=150}if(a.outSpeed==undefined){a.outSpeed=75}if(a.inSpeed==0){a.inSpeed=-1}if(a.outSpeed==0){a.outSpeed=-1}$(this).each(function(){var c=$(this);var d=$(c).offset();$("#"+a.menu).addClass("contextMenu");$(this).mousedown(function(g){var f=g;if(f.button==2&&a.activateLeft){return}f.stopPropagation();$(this).mouseup(function(o){o.stopPropagation();var t=$(this);$(this).unbind("mouseup");$.Menu.closeAll();$(".contextMenu").hide();$(".contextMenu").css("z-index","9999");if((f.button==2)||(a.activateLeft)){var i=$("#"+a.menu);if($(c).hasClass("disabled")){return false}var q={},w,v;var k,r,m,p,l,j;if(a.activateLeft){m=i.width();j=i.height()}else{m=$(".contextMenu").width();j=$(".contextMenu").height()}if(a.activateLeft){r=$(o.target).parent().offset().left;l=$(o.target).parent().offset().top}else{r=o.pageX;l=o.pageY}if(self.innerHeight){isPosition=true;k=self.innerWidth;p=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){isPosition=true;k=document.documentElement.clientWidth;p=document.documentElement.clientHeight}else{if(document.body){isPosition=true;k=document.body.clientWidth;p=document.body.clientHeight}}}if(isPosition){var n=k-r;var z=p-l;if(a.activateLeft){w=(n<m)?(k-(m+20)):r;v=(z<j)?(p-(j+20)):l+20}else{w=(n<m)?(r-m):r;v=(z<j)?(l-j):l}if(v<0){v=0}}$(i).css({top:v,left:w}).fadeIn(a.inSpeed);$("#contextMenuFrame").css("display","block");$("#contextMenuFrame").css({height:j+6,width:m,left:w,top:v});if(b){b(o.currentTarget.id)}$(document).keypress(function(x){switch(x.keyCode){case 38:if($(i).find("LI.hover").size()==0){$(i).find("LI:last").addClass("hover")}else{$(i).find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover");if($(i).find("LI.hover").size()==0){$(i).find("LI:last").addClass("hover")}}break;case 40:if($(i).find("LI.hover").size()==0){$(i).find("LI:first").addClass("hover")}else{$(i).find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover");if($(i).find("LI.hover").size()==0){$(i).find("LI:first").addClass("hover")}}break;case 13:$(i).find("LI.hover A").trigger("click");break;case 27:$(document).trigger("click");break}});var s=$("#"+a.menu).find("LI");var u=s.length;for(var h=0;h<u;h++){$(s[h]).unbind("click");$(s[h]).click(function(){if($($(this).find("div")[2]).hasClass("dimmed")){return false}else{if(b){var e=this.id;if(e==""){$(".contextMenu").show();return false}else{$(".contextMenu").hide();var x=MFNamespace("MFWA.Actions");x.objectOperations(e,null)}}}})}setTimeout(function(){$(document).mouseup(function(e){var x=false;if(a.activateLeft){x=$(e.target).hasClass("refinementImage")}if(e.button!=2&&!x){$(i).fadeOut(a.outSpeed);$("#contextMenuFrame").css("display","none")}return false})},0)}})});if($.browser.mozilla){$("#"+a.menu).each(function(){$(this).css({MozUserSelect:"none"})})}else{if($.browser.msie){$("#"+a.menu).each(function(){$(this).bind("selectstart.disableTextSelect",function(){return false})})}else{$("#"+a.menu).each(function(){$(this).bind("mousedown.disableTextSelect",function(){return false})})}}$(c).add($("UL.contextMenu")).bind("contextmenu",function(){return false})});return $(this)},disableContextMenuItems:function(a){if(a==undefined){$(this).find("LI").addClass("disabled");return($(this))}$(this).each(function(){if(a!=undefined){var c=a.split(",");for(var b=0;b<c.length;b++){$(this).find('A[href="'+c[b]+'"]').parent().addClass("disabled")}}});return($(this))},enableContextMenuItems:function(a){if(a==undefined){$(this).find("LI.disabled").removeClass("disabled");return($(this))}$(this).each(function(){if(a!=undefined){var c=a.split(",");for(var b=0;b<c.length;b++){$(this).find('A[href="'+c[b]+'"]').parent().removeClass("disabled")}}});return($(this))},disableContextMenu:function(){$(this).each(function(){$(this).addClass("disabled")});return($(this))},enableContextMenu:function(){$(this).each(function(){$(this).removeClass("disabled")});return($(this))},destroyContextMenu:function(){$(this).each(function(){$(this).unbind("mousedown").unbind("mouseup")});return($(this))}})})(jQuery)}(function($){var msOldDiv="";var dd=function(element,options){var confirmDialog=MFNamespace("MFWA.Dialogs.Confirm");var i18ns=MFNamespace("MFWA.I18n.Search");var util=MFNamespace("MFWA.Utils");var sElement=element;var $this=this;var options=$.extend({height:120,visibleRows:7,rowHeight:23,showIcon:true,zIndex:9999,mainCSS:"dd",useSprite:false,onInit:"",style:"",isAdvSearch:false,replaceDropDown:false,isHierarchy:false,currentItem:""},options);this.ddProp=new Object();var selectedValue="";var actionSettings={};actionSettings.insideWindow=true;actionSettings.keyboardAction=false;actionSettings.currentKey=null;var ddList=false;var config={postElementHolder:"_msddHolder",postID:"_msdd",postTitleID:"_title",postTitleTextID:"_titletext",postChildID:"_child",postAID:"_msa",postOPTAID:"_msopta",postInputID:"_msinput",postArrowID:"_arrow",postInputhidden:"_inp"};var styles={dd:options.mainCSS,ddTitle:"ddTitle",arrow:"arrow",ddChild:"ddChild",ddTitleText:"ddTitleText",disabled:0.3,ddOutOfVision:"ddOutOfVision"};var attributes={actions:"focus,blur,change,click,dblclick,mousedown,mouseup,mouseover,mousemove,mouseout,keypress,keydown,keyup",prop:"size,multiple,disabled,tabindex"};this.onActions=new Object();var elementid=$(sElement).attr("id");var inlineCSS=$(sElement).attr("style");options.style+=(inlineCSS==undefined)?"":inlineCSS;var allOptions=$(sElement).children();ddList=($(sElement).attr("size")>0||$(sElement).attr("multiple")==true)?true:false;if(ddList){options.visibleRows=$(sElement).attr("size")}if(options.replaceDropDown==false){$(".ddTitle").css("color","#ffffff")}var a_array={};var inputControl="";var currentImage="";var getPostID=function(id){return elementid+config[id]};var getOptionsProperties=function(option){var currentOption=option;var styles=$(currentOption).attr("style");return styles};var matchIndex=function(index){var selectedIndex=$("#"+elementid+" option:selected");if(selectedIndex.length>1){for(var i=0;i<selectedIndex.length;i++){if(index==selectedIndex[i].index){return true}}}else{if(selectedIndex.length==1){if(selectedIndex[0].index==index){return true}}}return false};var createA=function(currentOptOption,current,currentopt,tp){var aTag="";var aidoptfix=(tp=="opt")?getPostID("postOPTAID"):getPostID("postAID");var aid=(tp=="opt")?aidoptfix+"_"+(current)+"_"+(currentopt):aidoptfix+"_"+(current);var arrow="";var clsName="";if(options.useSprite!=false){clsName=" "+options.useSprite+" "+currentOptOption.className}else{var indentation="";if(options.replaceDropDown==true){indentation=$(currentOptOption).attr("indentation");if(!indentation){indentation=""}}arrow=$(currentOptOption).attr("title");arrow=(arrow.length==0)?"":indentation+'<img id="dropDownImg" src="'+arrow+'" align="absmiddle" /> '}var sText=$(currentOptOption).text();var sValue=$(currentOptOption).val();var sEnabledClass=($(currentOptOption).attr("disabled")==true)?"disabled":"enabled";a_array[aid]={html:arrow,value:sValue,text:sText,index:currentOptOption.index,id:aid};var innerStyle=getOptionsProperties(currentOptOption);if(matchIndex(currentOptOption.index)==true){aTag+='<a style="height:15px;" href="javascript:void(0);" class="selected '+sEnabledClass+clsName+'"'}else{aTag+='<a style="height:15px;" href="javascript:void(0);" class="'+sEnabledClass+clsName+'"'}if(innerStyle!==false&&innerStyle!==undefined){aTag+=" style='"+innerStyle+"'"}aTag+=' id="'+aid+'">';if(sText&&sText.length>0){sText=util.escape(sText)}aTag+=arrow+'<span class="'+styles.ddTitleText+'">'+sText+"</span></a>";return aTag};var createATags=function(){var childnodes=allOptions;if(childnodes.length==0){return""}var aTag="";var aidfix=getPostID("postAID");var aidoptfix=getPostID("postOPTAID");childnodes.each(function(current){var currentOption=childnodes[current];if(currentOption.nodeName=="OPTGROUP"){aTag+="<div class='opta'>";aTag+="<span style='font-weight:bold;font-style:italic; clear:both;'>"+$(currentOption).attr("label")+"</span>";var optChild=$(currentOption).children();optChild.each(function(currentopt){var currentOptOption=optChild[currentopt];aTag+=createA(currentOptOption,current,currentopt,"opt")});aTag+="</div>"}else{aTag+=createA(currentOption,current,"","")}});return aTag};var createChildDiv=function(){var id=getPostID("postID");var childid=getPostID("postChildID");var sStyle=options.style;sDiv="";sDiv+='<div id="'+childid+'" class="'+styles.ddChild+'"';if(!ddList){sDiv+=(sStyle!="")?' style="'+sStyle+'"':""}else{sDiv+=(sStyle!="")?' style="border-top:1px solid #c3c3c3;display:block;position:relative;'+sStyle+'"':""}sDiv+=">";return sDiv};var createTitleDiv=function(){var titleid=getPostID("postTitleID");var arrowid=getPostID("postArrowID");var titletextid=getPostID("postTitleTextID");var inputhidden=getPostID("postInputhidden");var sText="";var arrow="";if(document.getElementById(elementid)&&document.getElementById(elementid).options.length>0){sText=$("#"+elementid+" option:selected").text();arrow=$("#"+elementid+" option:selected").attr("title")}arrow=(arrow.length==0||arrow==undefined||options.showIcon==false||options.useSprite!=false)?"":'<img id="dropDownImg" src="'+arrow+'" align="top" /> ';var sDiv='<div id="'+titleid+'" class="'+styles.ddTitle+'"';sDiv+=">";inputControl='<input id="searchString" autocomplete="off" style="width:87%;_width:83%;border:0px;margin-top:0px;" type="text"  />';if(options.replaceDropDown==true){inputControl=""}sDiv+='<span id="'+arrowid+'" class="'+styles.arrow+'"></span><div class="'+styles.ddTitleText+'" id="'+titletextid+'" style="overflow:hidden;float:left;width:89%;_width:86%;" >'+arrow+inputControl+"</div></span></div>";return sDiv};var applyEventsOnA=function(){var childid=getPostID("postChildID");$("#"+childid+" a.enabled").bind("click",function(event){event.preventDefault();var selectedA=$(this).attr("id");var sValue="";if(selectedA!=undefined){sValue=a_array[selectedA].value}if(options.replaceDropDown){manageSelection(this);setInsideWindow(false);var sText=(options.showIcon==false)?$(this).text():$(this).html();sText=sText.replace(/^\s+/,"");setTitleText(sText);setValue();$this.close()}else{if(sValue=="clearHistory"){var opts=new Object();opts.message=i18ns.Filters.AlertMsg;opts.title=i18ns.Filters.AlertTile;confirmDialog.prompt(opts,function(confirmationResult){if(confirmationResult){$("#searchIn option").each(function(){if($(this).val()=="SearchInBoth"){var searchStringHolder=$("#searchString").val();$("#searchIn").msDropDown();$(".ddChild").hide();$("#searchString").val(searchStringHolder);return false}$(this).remove()})}})}else{if((sValue=="SearchInBoth")||(sValue=="SearchInMetadata")||(sValue=="SearchInFileContents")){manageSelection(this);if(!ddList){$("#"+childid).unbind("mouseover");setInsideWindow(false);if(sValue=="SearchInBoth"){$("#dropDownImg").attr("src","Images/metacard.png")}else{if(sValue=="SearchInMetadata"){$("#dropDownImg").attr("src","Images/metaalone.png")}else{$("#dropDownImg").attr("src","Images/filealone.png")}}$this.close()}setValue()}else{$("#searchString").val(sValue);$(".ddChild").hide();return}}}})};var createDropDown=function(){var changeInsertionPoint=false;var id=getPostID("postID");var titleid=getPostID("postTitleID");var titletextid=getPostID("postTitleTextID");var childid=getPostID("postChildID");var arrowid=getPostID("postArrowID");var iWidth=$("#"+elementid).width();iWidth=iWidth+2;var sStyle=options.style;if($("#"+id).length>0){$("#"+id).remove();changeInsertionPoint=true}if(options.replaceDropDown){sStyle+="width: 100%; margin-top: -20px"}var sDiv='<div id="'+id+'" class="'+styles.dd+'"';sDiv+=(sStyle!="")?' style="'+sStyle+'"':"";sDiv+=">";sDiv+=createTitleDiv();sDiv+="<div style='position:relative'>"+createChildDiv();sDiv+=createATags();sDiv+="</div></div>";sDiv+="</div>";if(changeInsertionPoint==true){var sid=getPostID("postElementHolder");$("#"+sid).after(sDiv)}else{$("#"+elementid).after(sDiv)}if(ddList){var titleid=getPostID("postTitleID");$("#"+titleid).hide()}if(iWidth<10){iWidth=348}if(options.replaceDropDown){$("#"+id).css("width","100%");$("#"+childid).css("width","99%")}else{$("#"+childid).css("width","100%")}if(options.replaceDropDown==true&&options.currentItem.length>0){setTitleText(options.currentItem)}if(allOptions.length>options.visibleRows){var margin=parseInt($("#"+childid+" a:first").css("padding-bottom"))+parseInt($("#"+childid+" a:first").css("padding-top"));var iHeight=((options.rowHeight)*options.visibleRows)-margin;$("#"+childid).css("height",iHeight+"px")}else{if(ddList){var iHeight=$("#"+elementid).height();$("#"+childid).css("height",iHeight+"px")}}if(changeInsertionPoint==false){setOutOfVision();addRefreshMethods(elementid)}if($("#"+elementid).attr("disabled")==true){$("#"+id).css("opacity",styles.disabled)}applyEvents();$("#"+titleid).bind("mouseover",function(event){hightlightArrow(1)});$("#"+titleid).bind("mouseout",function(event){hightlightArrow(0)});applyEventsOnA();$("#"+childid+" a.disabled").css("opacity",styles.disabled);if(ddList){$("#"+childid).bind("mouseover",function(event){if(!actionSettings.keyboardAction){actionSettings.keyboardAction=true;$(document).bind("keydown",function(event){var keyCode=event.keyCode;actionSettings.currentKey=keyCode;if(keyCode==39||keyCode==40){event.preventDefault();event.stopPropagation();next();setValue()}if(keyCode==37||keyCode==38){event.preventDefault();event.stopPropagation();previous();setValue()}})}})}$("#"+childid).bind("mouseout",function(event){setInsideWindow(false);$(document).unbind("keydown");actionSettings.keyboardAction=false;actionSettings.currentKey=null});$("#"+titleid).bind("click",function(event){setInsideWindow(false);if($("#"+childid+":visible").length==1){$("#"+childid).unbind("mouseover")}else{$("#"+childid).bind("mouseover",function(event){setInsideWindow(true)});$this.open()}});$("#"+titleid).bind("mouseout",function(evt){setInsideWindow(false)});if(options.showIcon&&options.useSprite!=false){setTitleImageSprite()}};var getByIndex=function(index){for(var i in a_array){if(a_array[i].index==index){return a_array[i]}}return -1};var manageSelection=function(obj){var childid=getPostID("postChildID");if(!ddList){$("#"+childid+" a.selected").removeClass("selected")}var selectedA=$("#"+childid+" a.selected").attr("id");if(selectedA!=undefined){var oldIndex=(actionSettings.oldIndex==undefined||actionSettings.oldIndex==null)?a_array[selectedA].index:actionSettings.oldIndex}if(obj&&!ddList){$(obj).addClass("selected")}if(ddList){var keyCode=actionSettings.currentKey;if($("#"+elementid).attr("multiple")==true){if(keyCode==17){actionSettings.oldIndex=a_array[$(obj).attr("id")].index;$(obj).toggleClass("selected")}else{if(keyCode==16){$("#"+childid+" a.selected").removeClass("selected");$(obj).addClass("selected");var currentSelected=$(obj).attr("id");var currentIndex=a_array[currentSelected].index;for(var i=Math.min(oldIndex,currentIndex);i<=Math.max(oldIndex,currentIndex);i++){$("#"+getByIndex(i).id).addClass("selected")}}else{$("#"+childid+" a.selected").removeClass("selected");$(obj).addClass("selected");actionSettings.oldIndex=a_array[$(obj).attr("id")].index}}}else{$("#"+childid+" a.selected").removeClass("selected");$(obj).addClass("selected");actionSettings.oldIndex=a_array[$(obj).attr("id")].index}}};var addRefreshMethods=function(id){var objid=id;if(!document.getElementById(objid)){return}document.getElementById(objid).refresh=function(e){$("#"+objid).msDropDown(options)}};var setInsideWindow=function(val){actionSettings.insideWindow=val};var getInsideWindow=function(){return actionSettings.insideWindow};var applyEvents=function(){var mainid=getPostID("postID");var actions_array=attributes.actions.split(",");for(var iCount=0;iCount<actions_array.length;iCount++){var action=actions_array[iCount];var actionFound=has_handler(action);if(actionFound==true){switch(action){case"focus":$("#"+mainid).bind("mouseenter",function(event){document.getElementById(elementid).focus()});break;case"click":$("#"+mainid).bind("click",function(event){$("#"+elementid).trigger("click")});break;case"dblclick":$("#"+mainid).bind("dblclick",function(event){$("#"+elementid).trigger("dblclick")});break;case"mousedown":$("#"+mainid).bind("mousedown",function(event){$("#"+elementid).trigger("mousedown")});break;case"mouseup":$("#"+mainid).bind("mouseup",function(event){$("#"+elementid).trigger("mouseup")});break;case"mouseover":$("#"+mainid).bind("mouseover",function(event){$("#"+elementid).trigger("mouseover")});break;case"mousemove":$("#"+mainid).bind("mousemove",function(event){$("#"+elementid).trigger("mousemove")});break;case"mouseout":$("#"+mainid).bind("mouseout",function(event){$("#"+elementid).trigger("mouseout")});break}}}};var setOutOfVision=function(){var sId=getPostID("postElementHolder");if(options.replaceDropDown){if(options.isAdvSearch){$("#"+elementid).after("<div class='"+styles.ddOutOfVision+"' style='overflow:hidden;position: relative; height: 100%; width: 100%; display: none;' id='"+sId+"'></div>")}else{$("#"+elementid).after("<div class='"+styles.ddOutOfVision+"' style='overflow:hidden;position: relative; height: 100%; width: 100%; visibility: hidden;' id='"+sId+"'></div>")}}else{$("#"+elementid).after("<div class='"+styles.ddOutOfVision+"' style='height:0px;overflow:hidden;position:absolute;' id='"+sId+"'></div>")}$("#"+elementid).appendTo($("#"+sId))};var setTitleText=function(sText){if(sText!=""){currentImage=sText}if(currentImage==""){currentImage='<img id="dropDownImg" src="'+$("#dropDownImg").attr("src")+'" align="absmiddle" />'}if(options.replaceDropDown&&sText==""){currentImage=""}sText=currentImage;var textIntext="";var titletextid=getPostID("postTitleTextID");if(options.replaceDropDown){sText=$.trim(sText)}else{textIntext=$("#searchString").val()}if(sText&&sText.length>0){sText=util.escape(sText)}$("#"+titletextid).html(sText+inputControl);if(!options.replaceDropDown){$("#searchString").val(textIntext)}$("#"+titletextid).css("white-space","nowrap")};var next=function(){var titletextid=getPostID("postTitleTextID");var childid=getPostID("postChildID");var allAs=$("#"+childid+" a.enabled");for(var current=0;current<allAs.length;current++){var currentA=allAs[current];var id=$(currentA).attr("id");if($(currentA).hasClass("selected")&&current<allAs.length-1){$("#"+childid+" a.selected").removeClass("selected");$(allAs[current+1]).addClass("selected");var selectedA=$("#"+childid+" a.selected").attr("id");if(!ddList){var sText=(options.showIcon==false)?a_array[selectedA].text:a_array[selectedA].html;setTitleText(sText)}if(parseInt(($("#"+selectedA).position().top+$("#"+selectedA).height()))>=parseInt($("#"+childid).height())){$("#"+childid).scrollTop(($("#"+childid).scrollTop())+$("#"+selectedA).height()+$("#"+selectedA).height())}break}}};var previous=function(){var titletextid=getPostID("postTitleTextID");var childid=getPostID("postChildID");var allAs=$("#"+childid+" a.enabled");for(var current=0;current<allAs.length;current++){var currentA=allAs[current];var id=$(currentA).attr("id");if($(currentA).hasClass("selected")&&current!=0){$("#"+childid+" a.selected").removeClass("selected");$(allAs[current-1]).addClass("selected");var selectedA=$("#"+childid+" a.selected").attr("id");if(!ddList){var sText=(options.showIcon==false)?a_array[selectedA].text:a_array[selectedA].html;setTitleText(sText)}if(parseInt(($("#"+selectedA).position().top+$("#"+selectedA).height()))<=0){$("#"+childid).scrollTop(($("#"+childid).scrollTop()-$("#"+childid).height())-$("#"+selectedA).height())}break}}};var setTitleImageSprite=function(){if(options.useSprite!=false){var titletextid=getPostID("postTitleTextID");var sClassName=document.getElementById(elementid).options[document.getElementById(elementid).selectedIndex].className;if(sClassName.length>0){var childid=getPostID("postChildID");var id=$("#"+childid+" a."+sClassName).attr("id");var backgroundImg=$("#"+id).css("background-image");var backgroundPosition=$("#"+id).css("background-position");var paddingLeft=$("#"+id).css("padding-left");if(backgroundImg!=undefined){$("#"+titletextid).find("."+styles.ddTitleText).attr("style","background:"+backgroundImg)}if(backgroundPosition!=undefined){$("#"+titletextid).find("."+styles.ddTitleText).css("background-position",backgroundPosition)}if(paddingLeft!=undefined){$("#"+titletextid).find("."+styles.ddTitleText).css("padding-left",paddingLeft)}$("#"+titletextid).find("."+styles.ddTitleText).css("background-repeat","no-repeat");$("#"+titletextid).find("."+styles.ddTitleText).css("padding-bottom","2px")}}};var setValue=function(){var childid=getPostID("postChildID");var allSelected=$("#"+childid+" a.selected");if(allSelected.length==1){var sText=$("#"+childid+" a.selected").text();var selectedA=$("#"+childid+" a.selected").attr("id");if(selectedA!=undefined){var sValue=a_array[selectedA].value;if(sValue=="clearHistory"){return}document.getElementById(elementid).selectedIndex=a_array[selectedA].index}if(options.showIcon&&options.useSprite!=false){setTitleImageSprite()}}else{if(allSelected.length>1){var alls=$("#"+elementid+" > option:selected").removeAttr("selected");for(var i=0;i<allSelected.length;i++){var selectedA=$(allSelected[i]).attr("id");var index=a_array[selectedA].index;document.getElementById(elementid).options[index].selected="selected"}}}var sIndex=document.getElementById(elementid).selectedIndex;$this.ddProp.selectedIndex=sIndex};var has_handler=function(name){if($("#"+elementid).attr("on"+name)!=undefined){return true}var evs=$("#"+elementid).data("events");if(evs&&evs[name]){return true}return false};var checkMethodAndApply=function(){var childid=getPostID("postChildID");if(has_handler("change")==true){var currentSelectedValue=a_array[$("#"+childid+" a.selected").attr("id")].text;if(selectedValue!=currentSelectedValue){$("#"+elementid).trigger("change")}}if(has_handler("mouseup")==true){$("#"+elementid).trigger("mouseup")}if(has_handler("blur")==true){$(document).bind("mouseup",function(evt){$("#"+elementid).focus();$("#"+elementid)[0].blur();setValue();$(document).unbind("mouseup")})}};var hightlightArrow=function(ison){var arrowid=getPostID("postArrowID");if(ison==1){$("#"+arrowid).css({backgroundPosition:"0 100%"})}else{$("#"+arrowid).css({backgroundPosition:"0 0"})}};var setOriginalProperties=function(){for(var i in document.getElementById(elementid)){if(typeof(document.getElementById(elementid)[i])!="function"&&document.getElementById(elementid)[i]!==undefined&&document.getElementById(elementid)[i]!==null){$this.set(i,document.getElementById(elementid)[i],true)}}};var setValueByIndex=function(prop,val){if(getByIndex(val)!=-1){document.getElementById(elementid)[prop]=val;var childid=getPostID("postChildID");$("#"+childid+" a.selected").removeClass("selected");$("#"+getByIndex(val).id).addClass("selected");var sText=getByIndex(document.getElementById(elementid).selectedIndex).html;if(options.replaceDropDown==true){setTitleText(sText)}else{if(val==0){$("#dropDownImg").attr("src","Images/metacard.png")}else{if(val==1){$("#dropDownImg").attr("src","Images/metaalone.png")}else{if(val==2){$("#dropDownImg").attr("src","Images/filealone.png")}}}}}};var addRemoveFromIndex=function(i,action){if(action=="d"){for(var key in a_array){if(a_array[key].index==i){delete a_array[key];break}}}var count=0;for(var key in a_array){a_array[key].index=count;count++}};this.open=function(){if(($this.get("disabled",true)==true)||($this.get("options",true).length==0)){return}var childid=getPostID("postChildID");if(msOldDiv!=""&&childid!=msOldDiv){$("#"+msOldDiv).slideUp("fast");$("#"+msOldDiv).css({zIndex:"0"})}if($("#"+childid).css("display")=="none"){$(document).bind("keydown",function(event){var keyCode=event.keyCode;if(keyCode==39||keyCode==40){event.preventDefault();event.stopPropagation();next()}if(keyCode==37||keyCode==38){event.preventDefault();event.stopPropagation();previous()}if(keyCode==27||keyCode==13){$this.close();if(keyCode==13){var selectedA=$("#"+childid+" a.enabled").attr("id");var sValue="";if(selectedA!=undefined){sValue=a_array[selectedA].value}if((sValue=="SearchInBoth")||(sValue=="SearchInMetadata")||(sValue=="SearchInFileContents")){setValue()}}}if($("#"+elementid).attr("onkeydown")!=undefined){document.getElementById(elementid).onkeydown()}});$(document).bind("keyup",function(event){if($("#"+elementid).attr("onkeyup")!=undefined){document.getElementById(elementid).onkeyup()}});$(document).bind("mouseup",function(evt){if(getInsideWindow()==false){$this.close()}});$("#"+childid).css({zIndex:options.zIndex});$("#"+childid).slideDown("fast",function(){if($this.onActions.onOpen!=null){eval($this.onActions.onOpen)($this)}var maxWidth=0;if(options.replaceDropDown){var anchorTags=$("#"+childid).find("a");anchorTags.each(function(index){var width=$(this).width();if(width>maxWidth){maxWidth=width}});if(maxWidth>185&&!options.isAdvSearch){$("#"+childid).addClass("overflowImportant");if(maxWidth<238){maxWidth=238}anchorTags.width(maxWidth)}else{$("#"+childid).css("min-width","99%");anchorTags.css("width","100%")}}});if(childid!=msOldDiv){msOldDiv=childid}}};this.close=function(){var childid=getPostID("postChildID");$(document).unbind("keydown");$(document).unbind("keyup");$(document).unbind("mouseup");$("#"+childid).slideUp("fast",function(event){checkMethodAndApply();$("#"+childid).css({zIndex:"0"});if($this.onActions.onClose!=null){eval($this.onActions.onClose)($this)}})};this.selectedIndex=function(i){$this.set("selectedIndex",i)};this.set=function(prop,val,isLocal){if(prop==undefined||val==undefined){throw {message:"set to what?"}}$this.ddProp[prop]=val;if(isLocal!=true){switch(prop){case"selectedIndex":setValueByIndex(prop,val);break;case"disabled":$this.disabled(val,true);break;case"multiple":document.getElementById(elementid)[prop]=val;ddList=($(sElement).attr("size")>0||$(sElement).attr("multiple")==true)?true:false;if(ddList){var iHeight=$("#"+elementid).height();var childid=getPostID("postChildID");$("#"+childid).css("height",iHeight+"px");var titleid=getPostID("postTitleID");$("#"+titleid).hide();var childid=getPostID("postChildID");$("#"+childid).css({display:"block",position:"relative"});applyEventsOnA()}break;case"size":document.getElementById(elementid)[prop]=val;if(val==0){document.getElementById(elementid).multiple=false}ddList=($(sElement).attr("size")>0||$(sElement).attr("multiple")==true)?true:false;if(val==0){var titleid=getPostID("postTitleID");$("#"+titleid).show();var childid=getPostID("postChildID");$("#"+childid).css({display:"none",position:"absolute"});var sText="";if(document.getElementById(elementid).selectedIndex>=0){var aObj=getByIndex(document.getElementById(elementid).selectedIndex);sText=aObj.html;manageSelection($("#"+aObj.id))}setTitleText(sText)}else{var titleid=getPostID("postTitleID");$("#"+titleid).hide();var childid=getPostID("postChildID");$("#"+childid).css({display:"block",position:"relative"})}break;default:try{document.getElementById(elementid)[prop]=val}catch(e){}break}}};this.get=function(prop,forceRefresh){if(prop==undefined&&forceRefresh==undefined){return $this.ddProp}if(prop!=undefined&&forceRefresh==undefined){return($this.ddProp[prop]!=undefined)?$this.ddProp[prop]:null}if(prop!=undefined&&forceRefresh!=undefined){return document.getElementById(elementid)[prop]}};this.visible=function(val){var id=getPostID("postID");if(val==true){$("#"+id).show()}else{if(val==false){$("#"+id).hide()}else{return $("#"+id).css("display")}}};this.add=function(opt,index){var objOpt=opt;var sText=objOpt.text;var sValue=(objOpt.value==undefined||objOpt.value==null)?sText:objOpt.value;var img=(objOpt.title==undefined||objOpt.title==null)?"":objOpt.title;var i=(index==undefined||index==null)?document.getElementById(elementid).options.length:index;document.getElementById(elementid).options[i]=new Option(sText,sValue);if(img!=""){document.getElementById(elementid).options[i].title=img}var ifA=getByIndex(i);if(ifA!=-1){var aTag=createA(document.getElementById(elementid).options[i],i,"","");$("#"+ifA.id).html(aTag)}else{var aTag=createA(document.getElementById(elementid).options[i],i,"","");var childid=getPostID("postChildID");$("#"+childid).append(aTag);applyEventsOnA()}};this.remove=function(i){document.getElementById(elementid).remove(i);if((getByIndex(i))!=-1){$("#"+getByIndex(i).id).remove();addRemoveFromIndex(i,"d")}if(document.getElementById(elementid).length==0){setTitleText("")}else{var sText=getByIndex(document.getElementById(elementid).selectedIndex).html;setTitleText(sText)}$this.set("selectedIndex",document.getElementById(elementid).selectedIndex)};this.disabled=function(dis,isLocal){document.getElementById(elementid).disabled=dis;var id=getPostID("postID");if(dis==true){$("#"+id).css("opacity",styles.disabled);$this.close()}else{if(dis==false){$("#"+id).css("opacity",1)}}if(isLocal!=true){$this.set("disabled",dis)}};this.form=function(){return(document.getElementById(elementid).form==undefined)?null:document.getElementById(elementid).form};this.item=function(){if(arguments.length==1){return document.getElementById(elementid).item(arguments[0])}else{if(arguments.length==2){return document.getElementById(elementid).item(arguments[0],arguments[1])}else{throw {message:"An index is required!"}}}};this.namedItem=function(nm){return document.getElementById(elementid).namedItem(nm)};this.multiple=function(is){if(is==undefined){return $this.get("multiple")}else{$this.set("multiple",is)}};this.size=function(sz){if(sz==undefined){return $this.get("size")}else{$this.set("size",sz)}};this.addMyEvent=function(nm,fn){$this.onActions[nm]=fn};this.fireEvent=function(nm){eval($this.onActions[nm])($this)};var updateCommonVars=function(){$this.set("version",$.msDropDown.version);$this.set("author",$.msDropDown.author)};var init=function(){createDropDown();setOriginalProperties();updateCommonVars();if(options.onInit!=""){eval(options.onInit)($this)}};init()};$.msDropDown={version:2.3,author:"Marghoob Suleman",create:function(id,opt){return $(id).msDropDown(opt).data("dd")}};$.fn.extend({msDropDown:function(options){return this.each(function(){var mydropdown=new dd(this,options);$(this).data("dd",mydropdown)})}})})(jQuery);(function(a){var b;a(document).ready(function(){b=(typeof a("body").get(0).innerText!="undefined")?"innerText":(typeof a("body").get(0).textContent!="undefined")?"textContent":null});a.fn.extend({unlimitCharWidth:function(){return a(this).each(function(){a(this).attr(b,a.data(this,"limitCharWidth"))})},limitCharWidth:function(c){c=a.extend({alternative:"...",width:null,set_title:false},c||{});return a(this).each(function(){var i=a(this).attr(b);if(!a.data(this,"limitCharWidth")){a.data(this,"limitCharWidth",i)}var j=a.data(this,"limitCharWidth");var g=c.width;if(!g){if(a(this).css("display")=="block"){g=a(this).attr(b,"").width()}else{return a(this)}}a(this).attr(b,j);var f=a(this).css("whiteSpace");a(this).css({whiteSpace:"nowrap"});var h=a(this).wrapInner("<span></span>").find("span");if(h.width()>g){h.attr(b,h.attr(b)+c.alternative)}while(h.width()>g){var e=h.attr(b).slice(0,-1*(c.alternative.length+1));e=a.trim(e);if(e){h.attr(b,e+c.alternative)}else{h.attr(b,"");break}}var d=false;if(h.text().indexOf(c.alternative)!=-1){d=true}if(d&&!this.title&&c.set_title){this.title=a.trim(i)}a(this).css({whiteSpace:f});a(this).attr(b,h.attr(b))})}})})(jQuery);(function(b){b.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};function a(d){if(typeof d.data!=="string"){return}var c=d.handler,e=d.data.toLowerCase().split(" ");d.handler=function(n){if(this!==n.target&&(/textarea|select/i.test(n.target.nodeName)||n.target.type==="text"||n.target.type==="password")){return}var h=n.type!=="keypress"&&b.hotkeys.specialKeys[n.which],o=String.fromCharCode(n.which).toLowerCase(),k,m="",g={};if(n.altKey&&h!=="alt"){m+="alt+"}if(n.ctrlKey&&h!=="ctrl"){m+="ctrl+"}if(n.metaKey&&!n.ctrlKey&&h!=="meta"){m+="meta+"}if(n.shiftKey&&h!=="shift"){m+="shift+"}if(h){g[m+h]=true}else{g[m+o]=true;g[m+b.hotkeys.shiftNums[o]]=true;if(m==="shift+"){g[b.hotkeys.shiftNums[o]]=true}}for(var j=0,f=e.length;j<f;j++){if(g[e[j]]){return c.apply(this,arguments)}}}}b.each(["keydown","keyup","keypress"],function(){b.event.special[this]={add:a}})})(jQuery);MFNamespace("MFWA.KeyHandler",function(h){var b=MFNamespace("MFWA.Filters");var c=MFNamespace("MFWA.Configurations");var g={Rename:"F2",Delete:"Del",ShowMembers:"Ctrl+Shift+L",CheckIn:"Ctrl+I",CheckinWithComments:"Ctrl+Shift+I",History:"Ctrl+H",Relationships:"Ctrl+L",Comments:"Ctrl+M"};var e=function(n){d=MFWA.Model.selectedItem.get();var l=b[n];var k=$("#menu_"+n+" > div.menuItemText");var j=$("#contextmenu_"+n+" > div.menuItemText");var m=l(d);if(m&&(c.ViewAndModifyOptions)&&(c.ViewAndModifyOptions[n]==false)){m=false}if(m&&n=="Properties"&&(c.Controls&&!c.Controls.ShowDocumentCard)){m=false}if(m&&n=="CheckInWithComments"&&(c.ViewAndModifyOptions)&&(c.ViewAndModifyOptions.CheckIn==false)){m=false}return m};var i=function(j){$(document).bind("keydown",j,function(k){a[j]();$.Menu.closeAll();k.stopPropagation();return false})};var a={};a[g.CheckIn]=function(){if(e("CheckIn")){MFWA.Actions.objectOperations("CheckIn")}};a[g.ShowMembers]=function(){MFWA.Actions.objectOperations("CollectionMembers")};a[g.Delete]=function(){if(e("Delete")){MFWA.Actions.objectOperations("Delete")}};a[g.Rename]=function(){if(e("Rename")){MFWA.Actions.objectOperations("Rename")}};a[g.CheckinWithComments]=function(){if(e("CheckInWithComments")){MFWA.Actions.objectOperations("CheckInWithComments")}};a[g.History]=function(){if(e("History")){MFWA.Actions.objectOperations("History")}};a[g.Relationships]=function(){if(e("Relationships")){MFWA.Actions.objectOperations("Relationships")}};a[g.Comments]=function(){if(e("Comments")){MFWA.Actions.objectOperations("Comments")}};a[g.CloseDocumentCard]=function(){if($(".window").is(":visible")){$(".window_cancel").focus();$(".window_cancel").click()}};for(var f in g){var d=g[f];i(d)}return{}});MFNamespace("MFWA.Layout",function(a){var b=MFNamespace("MFWA.PropertiesPane");var c=MFNamespace("MFWA.Configurations");var e=function(){if(c.Navigation&&c.Navigation.ShowTopMenu==false&&c.Navigation.ShowBreadCrumb==true){$("#breadCrumb").css("width",$("body").width()-10)}else{if(c.Navigation&&c.Navigation.ShowTopMenu==true&&c.Navigation.ShowBreadCrumb==true){$("#breadCrumb").css("width",$("body").width()-$("#menubarbg").width()-10)}}$("#breadCrumb_ul").width($("#breadCrumb").width())};var d=function(){if($("body").width()<830){$("#searchObjectType").css("width","204px");$("#searchIn_msdd").css("width","204px");$("#searchAdvanced select").css("width","204px");$(".mainSearch_Dropdown .dd").css("left","317px")}else{$("#searchObjectType").css("width","320px");$("#searchIn_msdd").css("width","320px");$("#searchAdvanced select").css("width","320px");$(".mainSearch_Dropdown .dd").css("left","433px")}};return{setDropDownWidth:d,resizeConfig:function(){var h=$(".rightContainer").width();var g=$(".settings-container1").width();var f=$(".settings-container1 .configHeader");if(h<g){f.css("width",(g-20))}else{f.css("width",(h-20))}},init:function(t){var k=170;var f=240;var v=$(".menu_container");var w=300;var j=$("#page");var p=$("#panel");var r=$("#tree");var l=$("#applet");var x=$("#rightPanel");var o=$("#taskpane");var s=$("#browse");var n=$("#search");var q=$("#browseBottom");var g=$("#taskPaneChildren");if(t){if(c.LayOut==0||c.LayOut==1){s.append(n);s.append(q);x.append(o);x.append(s);if(c.LayOut==0){p.prepend(r);p.append(l);j.append(p)}else{p.remove();j.append(r)}j.append(x)}else{if(c.LayOut==2||c.LayOut==3||c.LayOut==5){x.remove();s.remove();o.remove();l.remove();n.prepend("<div id='taskpaneTopic'></div>");n.append("<div class='search_bottom'></div>");n.addClass("search_top");v.append(n);if(c.LayOut==2){p.remove();j.append(r)}else{if(c.LayOut==3){p.append(r);var i=$('<div class="goTo_container">');MFWA.TaskPane.createGoToItems(i);p.append(i);j.append(p);$(".menu_container #resetSearchButton").css("margin-right","0px")}else{if(c.LayOut==5){p.remove();r.remove();MFWA.TaskPane.createGoToItems("");f=$("#mainContainer").width();w=-4}}}j.append(q)}else{r.remove();p.append(o);x.remove();j.addClass("notreeView");p.append(l);n.css("padding-left","1px");s.append(n);s.append(q);j.append(p);j.append(s);f=210}}if(c.LayOut!=3&&c.LayOut!=5){MFWA.TaskPane.createGoToItems($("#taskpaneGoToHolder"))}}if(c.LayOut<4){$("#taskpaneShadowBox2").height($(window).height()-$("#menubar").height()-$("#taskpaneTopic").height()-$("#taskpaneShadowBox").height())}if(!t||c.LayOut==0||c.LayOut==3||c.LayOut==4){$("#panel").splitter({splitHorizontal:true,outline:false,tabIndex:-1,sizeBottom:200,minBottom:200,maxBottom:200})}$("#browseBottom").splitter({splitHorizontal:true,outline:false,sizeBottom:true,minBottom:50,minTop:100}).bind("resize",function(){m()});$("#listing").css("position","relative");var h=null;var m=function(){if(h!=null){clearTimeout(h)}h=setTimeout(function(){resizeQueued=false;b.propPaneResized()},100)};if(!t||c.LayOut==0||c.LayOut==1){$("#rightPanel").splitter({splitVertical:true,outline:false,sizeLeft:k,minLeft:k,maxLeft:k})}if(!t||c.LayOut==0||c.LayOut==1||c.LayOut==4){$("#browse").splitter({splitHorizontal:true,outline:false,sizeTop:true,minTop:70,maxTop:200})}if(c.LayOut==4){$("#page").splitter({splitVertical:true,outline:false,sizeLeft:f,minLeft:210,maxLeft:210,resizeToWindow:true,anchorToWindow:true})}else{$("#page").splitter({splitVertical:true,outline:false,sizeLeft:f,minLeft:50,minRight:w,resizeToWindow:true,anchorToWindow:true})}a.resizePanels();if(t){if(c.LayOut==1||c.LayOut==2){$("#panel .hsplitbar").hide();if(c.LayOut==2){var u=MFWA.TaskPane.createLogout();$($("#searchBasic .searchRow")[0]).append(u)}}e();d();if(c.Navigation.ShowTopMenu==false&&c.Navigation.ShowBreadCrumb==false){if(c.LayOut==0||c.LayOut==1){v.css("height","0px")}}if(c.LayOut==4){q.css("border-left","solid #bbb 1px")}else{if(c.LayOut==5){var u=MFWA.TaskPane.createLogout();$($("#searchBasic .searchRow")[0]).append(u)}}}else{a.resizeConfig()}},refresh:function(){if(c.LayOut<4){$("#taskpaneShadowBox2").height($(window).height()-$("#menubar").height()-$("#taskpaneTopic").height()-$("#taskpaneShadowBox").height())}e();d();a.resizeConfig()},resizePanels:function(){$("#rightPanel").trigger("resize");$("#browse").trigger("resize");$("#browseBottom").trigger("resize");$("#panel").trigger("resize");$("#listing .listing-container").trigger("resize");$("#search").css("z-index","5");if(c.LayOut>0&&c.LayOut<4){$("#panel .hsplitbar").hide()}else{if(c.LayOut==5){$("#page .vsplitbar").hide()}}$().listing.adjustGroupingWidth();a.resizeConfig()},setHeight:function(f){$("#page").height(f);$("#page .vsplitbar").height(f);$("#browseBottom").height(f);if(c.LayOut==2){$("#tree").css("height",f)}else{$("#panel").css("height",f)}a.resizePanels()},enableApplet:function(g){var f=$("#appletObject");if(g){f.css("width","100%")}else{f.css("width",0)}}}});MFNamespace("MFWA.Validator",function(){var a=MFNamespace("MFWA.Utils");return{isIpAddressRange:function(b){var c=/^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\/([1-9]|[0,1,2][0-9]|3[0,1,2])$/;return(c.test(b))},isNumber:function(b){var c=/^\d+$/;return(c.test(b))},isSignedNumber:function(b){var c=/^([-+]?\d+)$/;return(c.test(b))},isSignedRealNumber:function(b){var c=/^([-+]?[0-9]*\.?[0-9]*)$/;return(c.test(b))}}});MFNamespace("MFWA.Common",function(b){var c=MFNamespace("MFWA.Data.Operations");var d=MFNamespace("MFWA.Data.Cache");var a=MFNamespace("MFWA.Utils");var e=function(f,g){if($.browser.mobile){var h=window.location.search.substring(1).split("&");if($.trim(h).length>0){if(f){f.css("visibility","visible")}return}d.getMobileSiteUsage(function(i){if(!i||(i&&i.Value)){setTimeout(function(){var j=new Object();j.message=MFWA.I18n.Alerts.SuggestMobileApplication;j.title=MFWA.I18n.Prompt.Title;MFWA.Dialogs.Confirm.prompt(j,function(k){if(k){c.putMobileSiteUsage("true");if(f){c.logout(function(l){window.location=g+"/m"})}else{window.location=g+"/m"}}else{c.putMobileSiteUsage("false");if(f){f.css("visibility","visible")}return true}})},100)}})}};return{suggestMobileSite:e}});MFNamespace("MFWA.BreadCrumb",function(b){var c=MFNamespace("MFWA.Model");var a=MFNamespace("MFWA.StringBuilder");var d=MFNamespace("MFWA.Configurations");return{makeBreadCrumb:function(j,h){var e=j.split("/");$("#breadCrumb").empty();var k="";var f=new a.StringBuilder();f.append("<ul id='breadCrumb_ul' onmousedown='return false;' onselectstart='return false;'>");for(var g=0;g<e.length;g++){k=k+e[g];var l=$("#tree").find("li[viewpath='"+k+"']");if(!$(l).attr("id")){continue}if(g==(e.length-1)){if(g==0){f.append("<li onmousedown='return false;' onselectstart='return false;' ><a onselectstart='return false;' style='cursor:default;background-image:url(\"");f.append(MFWA.Icons.Listing.VaultMounting);f.append("\")'")}else{f.append('<li onmousedown="return false;" onselectstart="return false;" ><a onselectstart="return false;" style="cursor:default;text-decoration:none;" ')}}else{if(g==0){f.append("<li onmousedown='return false;' onselectstart='return false;'><a onselectstart='return false;' style='background-image:url(\"");f.append(MFWA.Icons.Listing.VaultMounting);f.append("\")'")}else{f.append('<li onmousedown="return false;" onselectstart="return false;"><a onselectstart="return false;"')}f.append(" onclick=\"MFWA.BreadCrumb.navigateToView('");f.append(k);f.append("')\" ")}k=k+"/";f.append(">");f.append(MFWA.Utils.escape($(l).find("a:first").text()));f.append("</a></li>")}f.append("</ul>");$("#breadCrumb").append(f.toString());$("#breadCrumb").jBreadCrumb()},navigateToView:function(f){MFWA.Listing.ResetListingContainer();c.view.set({viewPath:f});var e={ActiveView:f,IsSearch:false};MFWA.Data.Operations.saveActiveView(e);MFWA.BreadCrumb.makeBreadCrumb(f)}}});
