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)},checkOut:function(objectVersion,callback,error){callJava("checkOut",callback,error,objectVersion)},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)},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)}}});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")}}}());function get_css(e,d,b){if(!document.styleSheets){return false}e=e.toLowerCase();d=d||0;for(var c=d;c<document.styleSheets.length;c++){var f=document.styleSheets[c];css_rules=document.styleSheets[c].cssRules||document.styleSheets[c].rules;if(!css_rules){continue}var a=0;do{if(css_rules.length&&a>css_rules.length+5){return false}if(css_rules[a].selectorText&&css_rules[a].selectorText.toLowerCase()==e){if(b==true){if(document.styleSheets[c].removeRule){document.styleSheets[c].removeRule(a)}if(document.styleSheets[c].deleteRule){document.styleSheets[c].deleteRule(a)}return true}else{return css_rules[a]}}}while(css_rules[++a])}return false}function add_css(b,a){b=b.toLowerCase();a=a||0;if(!document.styleSheets||get_css(b,a)){return false}(document.styleSheets[a].insertRule)?document.styleSheets[a].insertRule(b+" { }",0):document.styleSheets[a].addRule(b,null,0);return get_css(b,a)}function get_sheet_num(b){if(!document.styleSheets){return false}for(var a=0;a<document.styleSheets.length;a++){if(document.styleSheets[a].href&&document.styleSheets[a].href.toString().match(b)){return a}}return false}function remove_css(b,a){return get_css(b,a,true)}function add_sheet(a,c){if(document.createStyleSheet){document.createStyleSheet(a)}else{var b=document.createElement("link");b.rel="stylesheet";b.type="text/css";b.media=c||"all";b.href=a;document.getElementsByTagName("head")[0].appendChild(b)}}
/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Licensed under the MIT license.
 * http://docs.jquery.com/License
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},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(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Licensed under the MIT license.
 *  More information: http://sizzlejs.com/
 */
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<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>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
/*
 * 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.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Licensed under the MIT (MIT-LICENSE.txt) license.
 */
jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,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}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init: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()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);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.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-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():(i?0:b.scrollTop())))),left:(d-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():i?0:b.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(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,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}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.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(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.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(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){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=j.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 k=this.handles.split(",");this.handles={};for(var f=0;f<k.length;f++){var h=c.trim(k[f]),d="ui-resizable-"+h;var g=c('<div class="ui-resizable-handle '+d+'"></div>');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.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(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidth<k.width),l=a(k.height)&&h.maxHeight&&(h.maxHeight<k.height),g=a(k.width)&&h.minWidth&&(h.minWidth>k.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e<this._proportionallyResizeElements.length;e++){var g=this._proportionallyResizeElements[e];if(!this.borderDif){var d=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],h=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=c.map(d,function(k,m){var l=parseInt(k,10)||0,n=parseInt(h[m],10)||0;return l+n})}if(c.browser.msie&&!(!(c(f).is(":hidden")||c(f).parents(":hidden").length))){continue}g.css({height:(f.height()-this.borderDif[0]-this.borderDif[2])||0,width:(f.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var e=this.element,h=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,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.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),h=d.options,g=function(i){c(i).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(h.alsoResize)=="object"&&!h.alsoResize.parentNode&&!h.alsoResize.length){$each(h.alsoResize,function(i,j){g(i)})}else{g(h.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n,function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType&&!i.alsoResize.length){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";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"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel: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 ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},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){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(/([:\[\]\.])/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}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}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==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).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)},_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));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');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||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.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]+"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)}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(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);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,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}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(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));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||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_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);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(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.rangeStart=null;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")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().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.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_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=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.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-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}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}this._curInst=null},_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.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_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&&!$.browser.msie){inst.input[0].focus()}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;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;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{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].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);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.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/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;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){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};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"'":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",TIMESTAMP:"@",W3C:"yy-mm-dd",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":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,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"'":if(lookAhead("'")){output+="'"}else{literal=true}break;case"H":output+=formatNumber("H",date.getHours(),2);break;case"i":output+=formatNumber("i",date.getMinutes(),2);break;case"s":output+=formatNumber("s",date.getSeconds(),2);break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;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){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}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){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=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,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){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 stepBigMonths=this._get(inst,"stepBigMonths");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",true);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[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.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.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.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.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);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 calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;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 ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="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,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";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="";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||!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()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():"&#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()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" 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,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);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.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.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)&&(!(changeMonth&&changeYear))?"&#xa0;":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}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._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_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,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-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[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_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(!$.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")){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.7.2";window.DP_jQuery=$})(jQuery);(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||"&nbsp;",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("<div/>")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("<span/>").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(j){var e=c(window),g=c(document),h=g.scrollTop(),d=g.scrollLeft(),i=h,f=false;if(c.inArray(j,["center","top","right","bottom","left"])>=0){j=[j=="right"||j=="left"?j:"center",j=="top"||j=="bottom"?j:"middle"]}if(j.constructor!=Array){j=["center","middle"]}if(c.inArray(j[0],["right","center"])||c.inArray(j[1],["bottom","middle"])){f=this.uiDialog.is(":hidden");if(f){this.uiDialog.css("top",-6000)}this.uiDialog.show()}if(j[0].constructor==Number){d+=j[0]}else{switch(j[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(j[1].constructor==Number){h+=j[1]}else{switch(j[1]){case"top":h+=0;break;case"bottom":h+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":h+=(e.height()-this.uiDialog.outerHeight())/2}}if(f){this.uiDialog.hide()}h=Math.max(h,i);this.uiDialog.css({top:h,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||"&nbsp;");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(h){if(h.keyCode){if(h.keyCode==116){return}if(h.keyCode==17){return}if(h.keyCode==67||h.keyCode==86||h.keyCode==88){return}}var i=c(h.target).parents(".ui-dialog").css("zIndex")||0;var g=c(h.target).parents(".ui-datepicker").css("zIndex")||0;var f=i;if(g>f){f=g}return(f>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return c(window).height()+"px"}else{return e+"px"}}else{return c(document).height()+"px"}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px"}else{return d+"px"}}else{return c(document).width()+"px"}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this)});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
/*
 * jQuery Dimensions
 *
 * Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 *
 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
 */
(function(b){b.dimensions={version:"1.2"};b.each(["Height","Width"],function(d,c){b.fn["inner"+c]=function(){if(!this[0]){return}var f=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+c]:a(this,c.toLowerCase())+a(this,"padding"+f)+a(this,"padding"+e)};b.fn["outer"+c]=function(f){if(!this[0]){return}var h=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";f=b.extend({margin:false},f||{});var g=this.is(":visible")?this[0]["offset"+c]:a(this,c.toLowerCase())+a(this,"border"+h+"Width")+a(this,"border"+e+"Width")+a(this,"padding"+h)+a(this,"padding"+e);return g+(f.margin?(a(this,"margin"+h)+a(this,"margin"+e)):0)}});b.each(["Left","Top"],function(d,c){b.fn["scroll"+c]=function(e){if(!this[0]){return}return e!=undefined?this.each(function(){this==window||this==document?window.scrollTo(c=="Left"?e:b(window)["scrollLeft"](),c=="Top"?e:b(window)["scrollTop"]()):this["scroll"+c]=e}):this[0]==window||this[0]==document?self[(c=="Left"?"pageXOffset":"pageYOffset")]||b.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]}});b.fn.extend({position:function(){var h=0,g=0,f=this[0],i,c,e,d;if(f){e=this.offsetParent();i=this.offset();c=e.offset();i.top-=a(f,"marginTop");i.left-=a(f,"marginLeft");c.top+=a(e,"borderTopWidth");c.left+=a(e,"borderLeftWidth");d={top:i.top-c.top,left:i.left-c.left}}return d},offsetParent:function(){var c=this[0].offsetParent;while(c&&(!/^body|html$/i.test(c.tagName)&&b.css(c,"position")=="static")){c=c.offsetParent}return b(c)}});function a(c,d){return parseInt(b.curCSS(c.jquery?c[0]:c,d,true))||0}})(jQuery);
/*
 * jQuery.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");if(!a.browser.msie){d.trigger("resize")}}).trigger("resize")}else{if(c.resizeToWidth&&!a.browser.msie){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);
/*
 * jsTree 0.9.8 http://jstree.com/
 *
 * Copyright (c) 2009 Ivan Bozhanov (vakata.com)
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 */
(function(b){b.fn.tree=function(c){return this.each(function(){var d=b.extend({},c);if(a.inst&&a.inst[b(this).attr("id")]){a.inst[b(this).attr("id")].destroy()}if(d!==false){new a().init(this,d)}})};b.tree_create=function(){return new a()};b.tree_focused=function(){return a.inst[a.focused]};b.tree_reference=function(c){return a.inst[c]||null};b.tree_rollback=function(f){for(var e in f){if(typeof f[e]=="function"){continue}var d=a.inst[e];var c=!d.locked;if(c){d.lock(true)}if(d.inp){d.inp.val("").blur()}d.context.append=false;d.container.html(f[e].html).find(".dragged").removeClass("dragged").end().find("div.context").remove();if(f[e].selected){d.selected=b("#"+f[e].selected);d.selected_arr=[];d.container.find("a.clicked").each(function(){d.selected_arr.push(d.get_node(this))})}if(c){d.lock(false)}delete c;delete d}};function a(){if(typeof a.inst=="undefined"){a.cntr=0;a.inst={};a.drag_drop={isdown:false,drag_node:false,drag_help:false,init_x:false,init_y:false,moving:false,origin_tree:false,marker:false,move_type:false,ref_node:false,appended:false,foreign:false,droppable:[],open_time:false,scroll_time:false};a.mousedown=function(d){var c=b(d.target);if(a.drag_drop.droppable.length&&c.is("."+a.drag_drop.droppable.join(", ."))){a.drag_drop.drag_help=b("<div id='jstree-dragged' class='tree tree-default'><ul><li class='last dragged foreign "+d.target.className+"'><a href='#'>"+c.text()+"</a></li></ul></div>");a.drag_drop.drag_node=a.drag_drop.drag_help.find("li:eq(0)");a.drag_drop.isdown=true;a.drag_drop.foreign=c;c.blur();d.preventDefault();d.stopPropagation();return false}d.stopPropagation();return true};a.mouseup=function(e){var d=a.drag_drop;if(d.open_time){clearTimeout(d.open_time)}if(d.scroll_time){clearTimeout(d.scroll_time)}if(d.foreign===false&&d.drag_node&&d.drag_node.size()){d.drag_help.remove();if(d.move_type){var c=a.inst[d.ref_node.parents(".tree:eq(0)").attr("id")];if(c){c.moved(d.origin_tree.container.find("li.dragged"),d.ref_node,d.move_type,false,(d.origin_tree.settings.rules.drag_copy=="on"||(d.origin_tree.settings.rules.drag_copy=="ctrl"&&e.ctrlKey)))}}d.move_type=false;d.ref_node=false}if(d.drag_node&&d.foreign!==false){d.drag_help.remove();if(d.move_type){var c=a.inst[d.ref_node.parents(".tree:eq(0)").attr("id")];if(c){c.settings.callback.ondrop.call(null,d.foreign.get(0),c.get_node(d.ref_node).get(0),d.move_type,c)}}d.foreign=false;d.move_type=false;d.ref_node=false}a.drag_drop.marker.hide();d.drag_help=false;d.drag_node=false;d.isdown=false;d.init_x=false;d.init_y=false;d.moving=false;d.appended=false;b("li.dragged").removeClass("dragged");d.origin_tree=false;e.preventDefault();e.stopPropagation();return false};a.mousemove=function(c){var g=a.drag_drop;if(g.isdown){if(!g.moving&&Math.abs(g.init_x-c.pageX)<5&&Math.abs(g.init_y-c.pageY)<5){c.preventDefault();c.stopPropagation();return false}else{a.drag_drop.moving=true}if(g.open_time){clearTimeout(g.open_time)}if(!g.appended){if(g.foreign!==false){g.origin_tree=b.tree_focused()}b("body").append(g.drag_help);g.w=g.drag_help.width();g.appended=true}g.drag_help.css({left:(c.pageX-(g.origin_tree.settings.ui.rtl?g.w:-5)),top:(c.pageY+15)});if(c.target.tagName=="IMG"&&c.target.id=="marker"){return false}var j=b(c.target);var e=j.is(".tree")?j:j.parents(".tree:eq(0)");if(e.size()==0||!a.inst[e.attr("id")]){if(g.scroll_time){clearTimeout(g.scroll_time)}if(g.drag_help.find("IMG").size()==0){g.drag_help.find("li:eq(0)").append("<img style='position:absolute; "+(g.origin_tree.settings.ui.rtl?"right":"left")+":4px; top:0px; background:white; padding:2px;' src='"+g.origin_tree.settings.ui.theme_path+"remove.png' />")}g.move_type=false;g.ref_node=false;a.drag_drop.marker.hide();return false}var k=a.inst[e.attr("id")];k.off_height();if(g.foreign===false&&g.origin_tree.container.get(0)!=k.container.get(0)&&(!g.origin_tree.settings.rules.multitree||!k.settings.rules.multitree)){if(g.drag_help.find("IMG").size()==0){g.drag_help.find("li:eq(0)").append("<img style='position:absolute; "+(g.origin_tree.settings.ui.rtl?"right":"left")+":4px; top:0px; background:white; padding:2px;' src='"+g.origin_tree.settings.ui.theme_path+"remove.png' />")}g.move_type=false;g.ref_node=false;a.drag_drop.marker.hide();return false}if(g.scroll_time){clearTimeout(g.scroll_time)}g.scroll_time=setTimeout(function(){k.scrollCheck(c.pageX,c.pageY)},50);var l=false;var m=e.scrollTop();if(c.target.tagName=="A"){if(j.is("#jstree-dragged")){return false}if(k.get_node(c.target).hasClass("closed")){g.open_time=setTimeout(function(){k.open_branch(j)},500)}var f=j.offset();var d={x:(f.left-1),y:(c.pageY-f.top)};if(e.children("ul:eq(0)").hasClass("rtl")){d.x+=j.width()-8}var h=[];if(d.y<k.li_height/3+1){h=["before","inside","after"]}else{if(d.y>k.li_height*2/3-1){h=["after","inside","before"]}else{if(d.y<k.li_height/2){h=["inside","before","after"]}else{h=["inside","after","before"]}}}var i=false;b.each(h,function(n,o){if(k.checkMove(g.origin_tree.container.find("li.dragged"),j,o)){l=o;i=true;return false}});if(i){switch(l){case"before":d.y=f.top-2;if(e.children("ul:eq(0)").hasClass("rtl")){a.drag_drop.marker.attr("src",k.settings.ui.theme_path+"marker_rtl.gif").width(40)}else{a.drag_drop.marker.attr("src",k.settings.ui.theme_path+"marker.gif").width(40)}break;case"after":d.y=f.top-2+k.li_height;if(e.children("ul:eq(0)").hasClass("rtl")){a.drag_drop.marker.attr("src",k.settings.ui.theme_path+"marker_rtl.gif").width(40)}else{a.drag_drop.marker.attr("src",k.settings.ui.theme_path+"marker.gif").width(40)}break;case"inside":d.x-=2;if(e.children("ul:eq(0)").hasClass("rtl")){d.x+=36}d.y=f.top-2+k.li_height/2;a.drag_drop.marker.attr("src",k.settings.ui.theme_path+"plus.gif").width(11);break}g.move_type=l;g.ref_node=b(c.target);g.drag_help.find("IMG").remove();a.drag_drop.marker.css({left:d.x,top:d.y}).show()}}if((j.is(".tree")||j.is("ul"))&&j.find("li:eq(0)").size()==0){var f=j.offset();g.move_type="inside";g.ref_node=e.children("ul:eq(0)");g.drag_help.find("IMG").remove();a.drag_drop.marker.attr("src",k.settings.ui.theme_path+"plus.gif").width(11);a.drag_drop.marker.css({left:f.left+(e.children("ul:eq(0)").hasClass("rtl")?(e.width()-10):10),top:f.top+15}).show()}else{if(c.target.tagName!="A"||!i){if(g.drag_help.find("IMG").size()==0){g.drag_help.find("li:eq(0)").append("<img style='position:absolute; "+(g.origin_tree.settings.ui.rtl?"right":"left")+":4px; top:0px; background:white; padding:2px;' src='"+g.origin_tree.settings.ui.theme_path+"remove.png' />")}g.move_type=false;g.ref_node=false;a.drag_drop.marker.hide()}}c.preventDefault();c.stopPropagation();return false}return true}}return{cntr:++a.cntr,settings:{data:{type:"predefined",method:"GET",async:false,async_data:function(c,d){return{id:b(c).attr("id")||0}},url:false,json:false,xml:false},selected:false,opened:[],languages:[],path:false,cookies:false,ui:{dots:true,rtl:false,animation:0,hover_mode:true,scroll_spd:4,theme_path:false,theme_name:"default",context:[{id:"create",label:"Create",icon:"create.png",visible:function(c,d){if(c.length!=1){return false}return d.check("creatable",c)},action:function(c,d){d.create(false,d.get_node(c[0]))}},"separator",{id:"rename",label:"Rename",icon:"rename.png",visible:function(c,d){if(c.length!=1){return false}return d.check("renameable",c)},action:function(c,d){d.rename(c)}},{id:"delete",label:"Delete",icon:"remove.png",visible:function(c,d){var e=true;b.each(c,function(){if(d.check("deletable",this)==false){e=false}return false});return e},action:function(c,d){b.each(c,function(){d.remove(this)})}}]},rules:{multiple:false,metadata:false,type_attr:"rel",multitree:false,createat:"bottom",use_inline:false,clickable:"all",renameable:"all",deletable:"all",creatable:"all",draggable:"none",dragrules:"all",drag_copy:false,droppable:[],drag_button:"left"},lang:{new_node:"New folder",loading:"Loading ..."},callback:{beforechange:function(c,d){return true},beforeopen:function(c,d){return true},beforeclose:function(c,d){return true},beforemove:function(c,e,f,d){return true},beforecreate:function(c,e,f,d){return true},beforerename:function(c,e,d){return true},beforedelete:function(c,d){return true},onJSONdata:function(c,d){return c},onselect:function(c,d){},ondeselect:function(c,d){},onchange:function(c,d){},onrename:function(c,e,d,f){},onmove:function(c,e,g,d,f){},oncopy:function(c,e,g,d,f){},oncreate:function(c,e,g,d,f){},ondelete:function(c,d,e){},onopen:function(c,d){},onopen_all:function(c){},onclose:function(c,d){},error:function(d,c){},ondblclk:function(c,d){d.toggle_branch.call(d,c);d.select_branch.call(d,c)},onrgtclk:function(c,d,e){},onload:function(c){},onfocus:function(c){},ondrop:function(c,e,f,d){}}},init:function(h,d){var k=this;this.container=b(h);if(this.container.size==0){alert("Invalid container node!");return}a.inst[this.cntr]=this;if(!this.container.attr("id")){this.container.attr("id","jstree_"+this.cntr)}a.inst[this.container.attr("id")]=a.inst[this.cntr];a.focused=this.cntr;var g=b.extend({},d);if(g&&g.cookies){this.settings.cookies=b.extend({},this.settings.cookies,g.cookies);delete g.cookies;if(!this.settings.cookies.opts){this.settings.cookies.opts={}}}if(g&&g.callback){this.settings.callback=b.extend({},this.settings.callback,g.callback);delete g.callback}if(g&&g.data){this.settings.data=b.extend({},this.settings.data,g.data);delete g.data}if(g&&g.ui){this.settings.ui=b.extend({},this.settings.ui,g.ui);delete g.ui}if(g&&g.rules){this.settings.rules=b.extend({},this.settings.rules,g.rules);delete g.rules}if(g&&g.lang){this.settings.lang=b.extend({},this.settings.lang,g.lang);delete g.lang}this.settings=b.extend({},this.settings,g);if(this.settings.path==false){this.path="";b("script").each(function(){if(this.src.toString().match(/tree_component.*?js$/)){k.path=this.src.toString().replace(/tree_component.*?js$/,"")}})}else{this.path=this.settings.path}this.current_lang=this.settings.languages&&this.settings.languages.length?this.settings.languages[0]:false;if(this.settings.languages&&this.settings.languages.length){this.sn=get_sheet_num("tree_component.css");if(this.sn===false&&document.styleSheets.length){this.sn=document.styleSheets.length}var c=false;var j=this.container.attr("id")?"#"+this.container.attr("id"):".tree";for(var f=0;f<this.settings.languages.length;f++){c=add_css(j+" ."+this.settings.languages[f],this.sn);if(c!==false){if(this.settings.languages[f]==this.current_lang){c.style.display=""}else{c.style.display="none"}}}}if(this.settings.rules.droppable.length){for(var e in this.settings.rules.droppable){if(typeof this.settings.rules.droppable[e]=="function"){continue}a.drag_drop.droppable.push(this.settings.rules.droppable[e])}a.drag_drop.droppable=b.unique(a.drag_drop.droppable)}if(this.settings.ui.theme_path===false){this.settings.ui.theme_path=this.path+"themes/"}this.theme=this.settings.ui.theme_path;if(k.settings.ui.theme_name){this.theme+=k.settings.ui.theme_name+"/";if(k.settings.ui.theme_name!="themeroller"&&!a.def_style){add_sheet(k.settings.ui.theme_path+"default/style.css");a.def_style=true}add_sheet(k.theme+"style.css")}this.container.addClass("tree");if(k.settings.ui.theme_name!="themeroller"){this.container.addClass("tree-default")}if(this.settings.ui.theme_name&&this.settings.ui.theme_name!="default"){this.container.addClass("tree-"+k.settings.ui.theme_name)}if(this.settings.ui.theme_name=="themeroller"){this.container.addClass("ui-widget ui-widget-content")}if(this.settings.rules.multiple){this.selected_arr=[]}this.offset=false;this.context_menu();this.hovered=false;this.locked=false;if(this.settings.rules.draggable!="none"&&a.drag_drop.marker===false){var k=this;a.drag_drop.marker=b("<img>").attr({id:"marker",src:k.settings.ui.theme_path+"marker.gif"}).css({height:"5px",width:"40px",display:"block",position:"absolute",left:"30px",top:"30px",zIndex:"1000"}).hide().appendTo("body")}this.refresh();this.attachEvents();this.focus()},off_height:function(){if(this.offset===false){this.container.css({position:"relative"});this.offset=this.container.offset();var c=0;c=parseInt(b.curCSS(this.container.get(0),"paddingTop",true),10);if(c){this.offset.top+=c}c=parseInt(b.curCSS(this.container.get(0),"borderTopWidth",true),10);if(c){this.offset.top+=c}this.container.css({position:""})}if(!this.li_height){var c=this.container.find("ul li.closed, ul li.leaf").eq(0);this.li_height=c.height();if(c.children("ul:eq(0)").size()){this.li_height-=c.children("ul:eq(0)").height()}if(!this.li_height){this.li_height=18}}},context_menu:function(){this.context=false;if(this.settings.ui.context!=false){var e='<div class="tree-context tree-default-context tree-'+this.settings.ui.theme_name+'-context">';for(var c in this.settings.ui.context){if(typeof this.settings.ui.context[c]=="function"){continue}if(this.settings.ui.context[c]=="separator"){e+="<span class='separator'>&nbsp;</span>";continue}var d="";if(this.settings.ui.context[c].icon){d="background-image:url('"+(this.settings.ui.context[c].icon.indexOf("/")==-1?this.theme+this.settings.ui.context[c].icon:this.settings.ui.context[c].icon)+"');"}e+='<a rel="'+this.settings.ui.context[c].id+'" href="#" style="'+d+'">'+this.settings.ui.context[c].label+"</a>"}e+="</div>";this.context=b(e);this.context.hide();this.context.append=false}},refresh:function(f){if(this.locked){return this.error("LOCKED")}var h=this;this.is_partial_refresh=f?true:false;this.opened=Array();if(this.settings.cookies&&b.cookie(this.settings.cookies.prefix+"_open")){var g=b.cookie(this.settings.cookies.prefix+"_open");var e=g.split(",");b.each(e,function(){if(this.replace(/^#/,"").length>0){h.opened.push("#"+this.replace(/^#/,""))}});this.settings.opened=false}else{if(this.settings.opened!=false){b.each(this.settings.opened,function(j,k){if(this.replace(/^#/,"").length>0){h.opened.push("#"+this.replace(/^#/,""))}});this.settings.opened=false}else{this.container.find("li.open").each(function(j){if(this.id){h.opened.push("#"+this.id)}})}}if(this.selected){this.settings.selected=Array();if(f){b(f).find("li:has(a.clicked)").each(function(){$this=b(this);if($this.attr("id")){h.settings.selected.push("#"+$this.attr("id"))}})}else{if(this.selected_arr){b.each(this.selected_arr,function(){if(this.attr("id")){h.settings.selected.push("#"+this.attr("id"))}})}else{if(this.selected.attr("id")){this.settings.selected.push("#"+this.selected.attr("id"))}}}}else{if(this.settings.cookies&&b.cookie(this.settings.cookies.prefix+"_selected")){this.settings.selected=Array();var g=b.cookie(this.settings.cookies.prefix+"_selected");var e=g.split(",");b.each(e,function(){if(this.replace(/^#/,"").length>0){h.settings.selected.push("#"+this.replace(/^#/,""))}})}else{if(this.settings.selected!==false){var e=Array();if((typeof this.settings.selected).toLowerCase()=="object"){b.each(this.settings.selected,function(){if(this.replace(/^#/,"").length>0){e.push("#"+this.replace(/^#/,""))}})}else{if(this.settings.selected.replace(/^#/,"").length>0){e.push("#"+this.settings.selected.replace(/^#/,""))}}this.settings.selected=e}}}if(f&&this.settings.data.async){this.opened=Array();f=this.get_node(f);f.find("li.open").each(function(j){h.opened.push("#"+this.id)});if(f.hasClass("open")){f.removeClass("open").addClass("closed")}if(f.hasClass("leaf")){f.removeClass("leaf")}f.children("ul:eq(0)").html("");return this.open_branch(f,true,function(){h.reselect.apply(h)})}if(this.settings.data.type=="xml_flat"||this.settings.data.type=="xml_nested"){this.scrtop=this.container.get(0).scrollTop;var d=(this.settings.data.type=="xml_flat")?"flat.xsl":"nested.xsl";if(this.settings.data.xml){this.container.getTransform(this.path+d,this.settings.data.xml,{params:{theme_name:h.settings.ui.theme_name,theme_path:h.theme},meth:h.settings.data.method,dat:h.settings.data.async_data.apply(h,[f,h]),callback:function(){h.context_menu.apply(h);h.reselect.apply(h)}})}else{this.container.getTransform(this.path+d,this.settings.data.url,{params:{theme_name:h.settings.ui.theme_name,theme_path:h.theme},meth:h.settings.data.method,dat:h.settings.data.async_data.apply(h,[f,h]),callback:function(){h.context_menu.apply(h);h.reselect.apply(h)}})}return}else{if(this.settings.data.type=="json"){if(this.settings.data.json){var g="";if(this.settings.data.json.length){for(var c=0;c<this.settings.data.json.length;c++){g+=this.parseJSON(this.settings.data.json[c])}}else{g=this.parseJSON(this.settings.data.json)}this.container.html("<ul>"+g+"</ul>");this.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");this.container.find("li").not(".open").not(".closed").addClass("leaf");this.context_menu();this.reselect()}else{var h=this;b.ajax({type:this.settings.data.method,url:this.settings.data.url,data:this.settings.data.async_data(false,this),dataType:"json",success:function(k){k=h.settings.callback.onJSONdata.call(null,k,h);var l="";if(k.length){for(var j=0;j<k.length;j++){l+=h.parseJSON(k[j])}}else{l=h.parseJSON(k)}h.container.html("<ul>"+l+"</ul>");h.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");h.container.find("li").not(".open").not(".closed").addClass("leaf");h.context_menu.apply(h);h.reselect.apply(h)},error:function(j,k,i){h.error({code:i+" "+k,xhttp:j})}})}}else{this.container.children("ul:eq(0)");this.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");this.container.find("li").not(".open").not(".closed").addClass("leaf");this.reselect()}}},parseJSON:function(g){if(!g||!g.data){return""}var k="";k+="<li ";var d=false;if(g.attributes){for(var f in g.attributes){if(typeof g.attributes[f]=="function"){continue}if(f=="class"){k+=" class='"+g.attributes[f]+" ";if(g.state=="closed"||g.state=="open"){k+=" "+g.state+" "}k+="' ";d=true}else{k+=" "+f+"='"+g.attributes[f]+"' "}}}if(!d&&(g.state=="closed"||g.state=="open")){k+=" class='"+g.state+"' "}k+=">";if(this.settings.languages.length){for(var f=0;f<this.settings.languages.length;f++){var c={};c.href="#";c.style="";c["class"]=this.settings.languages[f];if(g.data[this.settings.languages[f]]&&(typeof g.data[this.settings.languages[f]].attributes).toLowerCase()!="undefined"){for(var e in g.data[this.settings.languages[f]].attributes){if(typeof g.data[this.settings.languages[f]].attributes[e]=="function"){continue}if(e=="style"||e=="class"){c[e]+=" "+g.data[this.settings.languages[f]].attributes[e]}else{c[e]=g.data[this.settings.languages[f]].attributes[e]}}}if(g.data[this.settings.languages[f]]&&g.data[this.settings.languages[f]].icon&&this.settings.theme_name!="themeroller"){var h=g.data[this.settings.languages[f]].icon.indexOf("/")==-1?this.theme+g.data[this.settings.languages[f]].icon:g.data[this.settings.languages[f]].icon;c.style+=" ; background-image:url('"+h+"'); "}k+="<a";for(var e in c){if(typeof c[e]=="function"){continue}k+=" "+e+'="'+c[e]+'" '}k+=">";if(g.data[this.settings.languages[f]]&&g.data[this.settings.languages[f]].icon&&this.settings.theme_name=="themeroller"){k+="<ins class='ui-icon "+g.data[this.settings.languages[f]].icon+"'>&nbsp;</ins>"}k+=((typeof g.data[this.settings.languages[f]].title).toLowerCase()!="undefined"?g.data[this.settings.languages[f]].title:g.data[this.settings.languages[f]])+"</a>"}}else{var c={};c.href="#";c.style="";c["class"]="";if((typeof g.data.attributes).toLowerCase()!="undefined"){for(var f in g.data.attributes){if(typeof g.data.attributes[f]=="function"){continue}if(f=="style"||f=="class"){c[f]+=" "+g.data.attributes[f]}else{c[f]=g.data.attributes[f]}}}if(g.data.icon&&this.settings.ui.theme_name!="themeroller"){var h=g.data.icon.indexOf("/")==-1?this.theme+g.data.icon:g.data.icon;c.style+=" ; background-image:url('"+h+"');"}k+="<a";for(var f in c){if(typeof c[e]=="function"){continue}k+=" "+f+'="'+c[f]+'" '}k+=">";if(g.data.icon&&this.settings.ui.theme_name=="themeroller"){k+="<ins class='ui-icon "+g.data.icon+"'>&nbsp;</ins>"}k+=((typeof g.data.title).toLowerCase()!="undefined"?g.data.title:g.data)+"</a>"}if(g.children&&g.children.length){k+="<ul>";for(var f=0;f<g.children.length;f++){k+=this.parseJSON(g.children[f])}k+="</ul>"}k+="</li>";return k},getJSON:function(q,l,n,c){var m=this;if(!q||b(q).size()==0){q=this.container.children("ul").children("li")}else{q=b(q)}if(q.size()>1){var k=[];q.each(function(){k.push(m.getJSON(this,l,n,c))});return k}if(!l){l=["id","rel","class"]}if(!n){n=[]}var g={attributes:{},data:false};for(var h in l){if(typeof l[h]=="function"){continue}var d=(l[h]=="class")?q.attr(l[h]).replace("last","").replace("leaf","").replace("closed","").replace("open",""):q.attr(l[h]);if(typeof d!="undefined"&&d.replace(" ","").length>0){g.attributes[l[h]]=d}delete d}if(this.settings.languages.length){g.data={};for(var h in this.settings.languages){if(typeof this.settings.languages[h]=="function"){continue}var o=q.children("a."+this.settings.languages[h]);if(c||n.length||o.get(0).style.backgroundImage.toString().length){g.data[this.settings.languages[h]]={};g.data[this.settings.languages[h]].title=o.text();if(o.get(0).style.backgroundImage.length){g.data[this.settings.languages[h]].icon=o.get(0).style.backgroundImage.replace("url(","").replace(")","")}if(this.settings.ui.theme_name=="themeroller"&&o.children("ins").size()){var f=o.children("ins").attr("class");var p=false;b.each(f.split(" "),function(j,r){if(r.indexOf("ui-icon-")==0){p=r;return false}});if(p){g.data[this.settings.languages[h]].icon=p}}if(n.length){g.data[this.settings.languages[h]].attributes={};for(var e in n){if(typeof n[e]=="function"){continue}var d=o.attr(n[e]);if(typeof d!="undefined"&&d.replace(" ","").length>0){g.data[this.settings.languages[h]].attributes[n[e]]=d}delete d}}}else{g.data[this.settings.languages[h]]=o.text()}}}else{var o=q.children("a");if(c||n.length||o.get(0).style.backgroundImage.toString().length){g.data={};g.data.title=o.text();if(o.get(0).style.backgroundImage.length){g.data.icon=o.get(0).style.backgroundImage.replace("url(","").replace(")","")}if(this.settings.ui.theme_name=="themeroller"&&o.children("ins").size()){var f=o.children("ins").attr("class");var p=false;b.each(f.split(" "),function(j,r){if(r.indexOf("ui-icon-")==0){p=r;return false}});if(p){g.data[this.settings.languages[h]].icon=p}}if(n.length){g.data.attributes={};for(var e in n){if(typeof n[e]=="function"){continue}var d=o.attr(n[e]);if(typeof d!="undefined"&&d.replace(" ","").length>0){g.data.attributes[n[e]]=d}delete d}}}else{g.data=o.text()}}if(q.children("ul").size()>0){g.children=[];q.children("ul").children("li").each(function(){g.children.push(m.getJSON(this,l,n,c))})}return g},getXML:function(p,r,k,m,d){var l=this;if(p!="flat"){p="nested"}if(!r||b(r).size()==0){r=this.container.children("ul").children("li")}else{r=b(r)}if(r.size()>1){var h="<root>";r.each(function(){h+=l.getXML(p,this,k,m,true)});h+="</root>";return h}if(!k){k=["id","rel","class"]}if(!m){m=[]}var h="";if(!d){h="<root>"}h+="<item ";if(p=="flat"){var n=r.parents("li:eq(0)").size()?r.parents("li:eq(0)").attr("id"):0;h+=' parent_id="'+n+'" ';delete n}for(var g in k){if(typeof k[g]=="function"){continue}var c=(k[g]=="class")?r.attr(k[g]).replace("last","").replace("leaf","").replace("closed","").replace("open",""):r.attr(k[g]);if(typeof c!="undefined"&&c.replace(" ","").length>0){h+=" "+k[g]+'="'+c+'" '}delete c}h+=">";h+="<content>";if(this.settings.languages.length){for(var g in this.settings.languages){if(typeof this.settings.languages[g]=="function"){continue}var o=r.children("a."+this.settings.languages[g]);h+="<name ";if(m.length||o.get(0).style.backgroundImage.toString().length||this.settings.ui.theme_name=="themeroller"){if(o.get(0).style.backgroundImage.length){h+=' icon="'+o.get(0).style.backgroundImage.replace("url(","").replace(")","")+'" '}if(this.settings.ui.theme_name=="themeroller"&&o.children("ins").size()){var f=o.children("ins").attr("class");var q=false;b.each(f.split(" "),function(j,s){if(s.indexOf("ui-icon-")==0){q=s;return false}});if(q){h+=' icon="'+q+'" '}}if(m.length){for(var e in m){if(typeof m[e]=="function"){continue}var c=o.attr(m[e]);if(typeof c!="undefined"&&c.replace(" ","").length>0){h+=" "+m[e]+'="'+c+'" '}delete c}}}h+="><![CDATA["+o.text()+"]]></name>"}}else{var o=r.children("a");h+="<name ";if(m.length||o.get(0).style.backgroundImage.toString().length||this.settings.ui.theme_name=="themeroller"){if(o.get(0).style.backgroundImage.length){h+=' icon="'+o.get(0).style.backgroundImage.replace("url(","").replace(")","")+'" '}if(this.settings.ui.theme_name=="themeroller"&&o.children("ins").size()){var f=o.children("ins").attr("class");var q=false;b.each(f.split(" "),function(j,s){if(s.indexOf("ui-icon-")==0){q=s;return false}});if(q){h+=' icon="'+q+'" '}}if(m.length){for(var e in m){if(typeof m[e]=="function"){continue}var c=o.attr(m[e]);if(typeof c!="undefined"&&c.replace(" ","").length>0){h+=" "+m[e]+'="'+c+'" '}delete c}}}h+="><![CDATA["+o.text()+"]]></name>"}h+="</content>";if(p=="flat"){h+="</item>"}if(r.children("ul").size()>0){r.children("ul").children("li").each(function(){h+=l.getXML(p,this,k,m,true)})}if(p=="nested"){h+="</item>"}if(!d){h+="</root>"}return h},focus:function(){if(this.locked){return false}if(a.focused!=this.cntr){a.focused=this.cntr;this.settings.callback.onfocus.call(null,this)}},show_context:function(d){this.context.show();var c=b(d).children("a:visible").offset();this.context.css({left:(c.left),top:(c.top+parseInt(d.children("a:visible").height())+2)})},hide_context:function(){if(this.context.to_remove&&this.context.apply_to){this.context.apply_to.children("a").removeClass("clicked")}this.context.apply_to=false;this.context.hide()},attachEvents:function(){var c=this;this.container.bind("mousedown.jstree",function(d){if(a.drag_drop.isdown){a.drag_drop.move_type=false;d.preventDefault();d.stopPropagation();d.stopImmediatePropagation();return false}}).bind("mouseup.jstree",function(d){setTimeout(function(){c.focus.apply(c)},5)}).bind("click.jstree",function(d){return true});b("#"+this.container.attr("id")+" li").live("click",function(d){if(d.target.tagName!="LI"){return true}c.off_height();if(d.pageY-b(d.target).offset().top>c.li_height){return true}c.toggle_branch.apply(c,[d.target]);d.stopPropagation();return false});b("#"+this.container.attr("id")+" li a").live("click.jstree",function(d){if(d.which&&d.which==3){return true}if(c.locked){d.preventDefault();d.target.blur();return c.error("LOCKED")}c.select_branch.apply(c,[d.target,d.ctrlKey||c.settings.rules.multiple=="on"]);if(c.inp){c.inp.blur()}d.preventDefault();d.target.blur();return false}).live("dblclick.jstree",function(d){if(c.locked){d.preventDefault();d.stopPropagation();d.target.blur();return c.error("LOCKED")}c.settings.callback.ondblclk.call(null,c.get_node(d.target).get(0),c);d.preventDefault();d.stopPropagation();d.target.blur()}).live("contextmenu.jstree",function(f){if(c.locked){f.target.blur();return c.error("LOCKED")}var j=c.settings.callback.onrgtclk.call(null,c.get_node(f.target).get(0),c,f);if(c.context){if(c.context.append==false){b("body").append(c.context);c.context.append=true;for(var d in c.settings.ui.context){if(typeof c.settings.ui.context[d]=="function"){continue}if(c.settings.ui.context[d]=="separator"){continue}(function(){var i=c.settings.ui.context[d].action;c.context.children("[rel="+c.settings.ui.context[d].id+"]").bind("click",function(k){if(!b(this).hasClass("disabled")){i.call(null,c.context.apply_to||null,c);c.hide_context()}k.stopPropagation();k.preventDefault();return false}).bind("mouseup",function(k){this.blur();if(b(this).hasClass("disabled")){k.stopPropagation();k.preventDefault();return false}}).bind("mousedown",function(k){k.stopPropagation();k.preventDefault()})})()}}var h=c.get_node(f.target);if(c.inp){c.inp.blur()}if(h){if(!h.children("a:eq(0)").hasClass("clicked")){c.context.apply_to=h;c.context.to_remove=true;c.context.apply_to.children("a").addClass("clicked");f.target.blur()}else{c.context.to_remove=false;c.context.apply_to=(c.selected_arr&&c.selected_arr.length>1)?c.selected_arr:c.selected}c.context.children("a").removeClass("disabled").show();var e=false;for(var d in c.settings.ui.context){if(typeof c.settings.ui.context[d]=="function"){continue}if(c.settings.ui.context[d]=="separator"){continue}var g=c.settings.ui.context[d].visible.call(null,c.context.apply_to,c);if(g===false){c.context.children("[rel="+c.settings.ui.context[d].id+"]").addClass("disabled")}if(g===-1){c.context.children("[rel="+c.settings.ui.context[d].id+"]").hide()}else{e=true}}if(e==true){c.show_context(h)}f.preventDefault();f.stopPropagation();return false}}return j}).live("mouseover.jstree",function(d){if(c.locked){d.preventDefault();d.stopPropagation();return c.error("LOCKED")}if((c.settings.ui.hover_mode||c.settings.ui.theme_name=="themeroller")&&c.hovered!==false&&d.target.tagName=="A"){c.hovered.children("a").removeClass("hover ui-state-hover");c.hovered=false}if(c.settings.ui.theme_name=="themeroller"){c.hover_branch.apply(c,[d.target])}});if(c.settings.ui.theme_name=="themeroller"){b("#"+this.container.attr("id")+" li a").live("mouseout",function(d){if(c.hovered){c.hovered.children("a").removeClass("hover ui-state-hover")}})}if(this.settings.rules.draggable!="none"){b("#"+this.container.attr("id")+" li a").live("mousedown.jstree",function(g){if(c.settings.rules.drag_button=="left"&&g.which&&g.which!=1){return true}if(c.settings.rules.drag_button=="right"&&g.which&&g.which!=3){return true}c.focus.apply(c);if(c.locked){return c.error("LOCKED")}var h=c.get_node(g.target);if(c.settings.rules.multiple!=false&&c.selected_arr.length>1&&h.children("a:eq(0)").hasClass("clicked")){var d=0;for(var f in c.selected_arr){if(typeof c.selected_arr[f]=="function"){continue}if(c.check("draggable",c.selected_arr[f])){c.selected_arr[f].addClass("dragged");a.drag_drop.origin_tree=c;d++}}if(d>0){if(c.check("draggable",h)){a.drag_drop.drag_node=h}else{a.drag_drop.drag_node=c.container.find("li.dragged:eq(0)")}a.drag_drop.isdown=true;a.drag_drop.drag_help=b("<div id='jstree-dragged' class='tree "+(c.container.hasClass("tree-default")?" tree-default":"")+(c.settings.ui.theme_name&&c.settings.ui.theme_name!="default"?" tree-"+c.settings.ui.theme_name:"")+"' />").append("<ul class='"+c.container.children("ul:eq(0)").get(0).className+"' />");var e=b(a.drag_drop.drag_node.get(0).cloneNode(true));if(c.settings.languages.length>0){e.find("a").not("."+c.current_lang).hide()}a.drag_drop.drag_help.children("ul:eq(0)").append(e);a.drag_drop.drag_help.find("li:eq(0)").removeClass("last").addClass("last").children("a").html("Multiple selection").end().children("ul").remove()}}else{if(c.check("draggable",h)){a.drag_drop.drag_node=h;a.drag_drop.drag_help=b("<div id='jstree-dragged' class='tree "+(c.container.hasClass("tree-default")?" tree-default":"")+(c.settings.ui.theme_name&&c.settings.ui.theme_name!="default"?" tree-"+c.settings.ui.theme_name:"")+"' />").append("<ul class='"+c.container.children("ul:eq(0)").get(0).className+"' />");var e=b(h.get(0).cloneNode(true));if(c.settings.languages.length>0){e.find("a").not("."+c.current_lang).hide()}a.drag_drop.drag_help.children("ul:eq(0)").append(e);a.drag_drop.drag_help.find("li:eq(0)").removeClass("last").addClass("last");a.drag_drop.isdown=true;a.drag_drop.foreign=false;a.drag_drop.origin_tree=c;h.addClass("dragged")}}a.drag_drop.init_x=g.pageX;a.drag_drop.init_y=g.pageY;h.blur();g.preventDefault();g.stopPropagation();return false});b(document).bind("mousedown.jstree",a.mousedown).bind("mouseup.jstree",a.mouseup).bind("mousemove.jstree",a.mousemove)}if(c.context){b(document).bind("mousedown",function(){c.hide_context()})}},checkMove:function(m,d,k){if(this.locked){return this.error("LOCKED")}var j=this;if(d.parents("li.dragged").size()>0||d.is(".dragged")){return this.error("MOVE: NODE OVER SELF")}if(m.size()==1){var e=m.eq(0);if(a.drag_drop.foreign){if(this.settings.rules.droppable.length==0){return false}if(!e.is("."+this.settings.rules.droppable.join(", ."))){return false}var l=false;for(var h in this.settings.rules.droppable){if(typeof this.settings.rules.droppable[h]=="function"){continue}if(e.is("."+this.settings.rules.droppable[h])){if(this.settings.rules.metadata){b.metadata.setType("attr",this.settings.rules.metadata);e.attr(this.settings.rules.metadata,"type: '"+this.settings.rules.droppable[h]+"'")}else{e.attr(this.settings.rules.type_attr,this.settings.rules.droppable[h])}l=true;break}}if(!l){return false}}if(!this.check("dragrules",[e,k,d.parents("li:eq(0)")])){return this.error("MOVE: AGAINST DRAG RULES")}}else{var l=true;m.each(function(o){if(l==false){return false}var p=d;var n=k;if(!j.check.apply(j,["dragrules",[b(this),n,p]])){l=false}});if(l==false){return this.error("MOVE: AGAINST DRAG RULES")}}if(this.settings.rules.use_inline&&this.settings.rules.metadata){var f=false;if(k=="inside"){f=d.parents("li:eq(0)")}else{f=d.parents("li:eq(1)")}if(f.size()){if(typeof f.metadata()["valid_children"]!="undefined"){var g=f.metadata()["valid_children"];var l=true;m.each(function(n){if(l==false){return false}if(b.inArray(j.get_type(this),g)==-1){l=false}});if(l==false){return this.error("MOVE: NOT A VALID CHILD")}}if(typeof f.metadata()["max_children"]!="undefined"){if((f.children("ul:eq(0)").children("li").not(".dragged").size()+m.size())>f.metadata().max_children){return this.error("MOVE: MAX CHILDREN REACHED")}}var c=0;m.each(function(n){var p=1;var o=b(this);while(p<100){o=o.children("ul").children("li");if(o.size()==0){break}p++}c=Math.max(p,c)});var l=true;if((typeof b(f).metadata().max_depth).toLowerCase()!="undefined"&&b(f).metadata().max_depth<c){l=false}else{f.parents("li").each(function(n){if(l==false){return false}if((typeof b(this).metadata().max_depth).toLowerCase()!="undefined"){if((n+c)>=b(this).metadata().max_depth){l=false}}})}if(l==false){return this.error("MOVE: MAX_DEPTH REACHED")}}}return true},reselect:function(e){var g=this;if(!e){this.cl_count=0}else{this.cl_count--}if(this.opened&&this.opened.length){var f=false;for(var c=0;this.opened&&c<this.opened.length;c++){if(this.settings.data.async){if(this.get_node(this.opened[c]).size()>0){f=true;var d=this.opened[c];delete this.opened[c];this.open_branch(d,true,function(){g.reselect.apply(g,[true])});this.cl_count++}}else{this.open_branch(this.opened[c],true)}}if(this.settings.data.async&&f){return}delete this.opened}if(this.cl_count>0){return}if(this.settings.ui.rtl){this.container.css("direction","rtl").children("ul:eq(0)").addClass("rtl")}else{this.container.css("direction","ltr").children("ul:eq(0)").addClass("ltr")}if(this.settings.ui.dots==false){this.container.children("ul:eq(0)").addClass("no_dots")}if(this.scrtop){this.container.scrollTop(g.scrtop);delete this.scrtop}if(this.settings.selected!==false){b.each(this.settings.selected,function(h){if(g.is_partial_refresh){g.select_branch(b(g.settings.selected[h],g.container),(g.settings.rules.multiple!==false))}else{g.select_branch(b(g.settings.selected[h],g.container),(g.settings.rules.multiple!==false&&h>0))}});this.settings.selected=false}if(this.settings.ui.theme_name=="themeroller"){this.container.find("a").addClass("ui-state-default")}this.settings.callback.onload.call(null,g)},get_node:function(c){var c=b(c);return c.is("li")?c:c.parents("li:eq(0)")},get_type:function(d){d=!d?this.selected:this.get_node(d);if(!d){return}if(this.settings.rules.metadata){b.metadata.setType("attr",this.settings.rules.metadata);var c=d.metadata().type;if(c){return c}}return d.attr(this.settings.rules.type_attr)},scrollCheck:function(d,j){var i=this;var f=i.container;var h=i.container.offset();var e=f.scrollTop();var c=f.scrollLeft();var g=(f.get(0).scrollWidth>f.width())?40:20;if(j-h.top<20){f.scrollTop(Math.max((e-i.settings.ui.scroll_spd),0))}if(f.height()-(j-h.top)<g){f.scrollTop(e+i.settings.ui.scroll_spd)}if(d-h.left<20){f.scrollLeft(Math.max((c-i.settings.ui.scroll_spd),0))}if(f.width()-(d-h.left)<40){f.scrollLeft(c+i.settings.ui.scroll_spd)}if(f.scrollLeft()!=c||f.scrollTop()!=e){i.moveType=false;i.moveRef=false;a.drag_drop.marker.hide()}a.drag_drop.scroll_time=setTimeout(function(){i.scrollCheck(d,j)},50)},check:function(k,c){if(this.locked){return this.error("LOCKED")}if(k!="dragrules"&&this.settings.rules.use_inline&&this.settings.rules.metadata){b.metadata.setType("attr",this.settings.rules.metadata);if(typeof this.get_node(c).metadata()[k]!="undefined"){return this.get_node(c).metadata()[k]}}if(!this.settings.rules[k]){return false}if(this.settings.rules[k]=="none"){return false}if(this.settings.rules[k]=="all"){return true}if(k=="dragrules"){var h=new Array();h[0]=this.get_type(c[0]);h[1]=c[1];h[2]=this.get_type(c[2]);for(var f=0;f<this.settings.rules.dragrules.length;f++){var g=this.settings.rules.dragrules[f];var l=(g.indexOf("!")===0)?false:true;if(!l){g=g.replace("!","")}var e=g.split(" ");for(var d=0;d<3;d++){if(e[d]==h[d]||e[d]=="*"){e[d]=true}}if(e[0]===true&&e[1]===true&&e[2]===true){return l}}return false}else{return(b.inArray(this.get_type(c),this.settings.rules[k])!=-1)?true:false}},hover_branch:function(g){if(this.locked){return this.error("LOCKED")}if(this.settings.ui.hover_mode==false&&this.settings.ui.theme_name!="themeroller"){return this.select_branch(g)}var h=this;var g=h.get_node(g);if(!g.size()){return this.error("HOVER: NOT A VALID NODE")}if(!h.check("clickable",g)){return this.error("SELECT: NODE NOT SELECTABLE")}if(this.hovered){this.hovered.children("A").removeClass("hover ui-state-hover")}this.hovered=g;this.hovered.children("a").removeClass("hover ui-state-hover").addClass(this.settings.ui.theme_name=="themeroller"?"hover ui-state-hover":"hover");var d=this.hovered.offset().top;var c=this.container.offset().top;var e=c+this.container.height();var f=(this.container.get(0).scrollWidth>this.container.width())?40:20;if(d+5<c){this.container.scrollTop(this.container.scrollTop()-(c-d+5))}if(d+f>e){this.container.scrollTop(this.container.scrollTop()+(d+f-e))}},select_branch:function(j,c){if(this.locked){return this.error("LOCKED")}if(!j&&this.hovered!==false){j=this.hovered}var k=this;j=k.get_node(j);if(!j.size()){return this.error("SELECT: NOT A VALID NODE")}j.children("a").removeClass("hover ui-state-hover");if(!k.check("clickable",j)){return this.error("SELECT: NODE NOT SELECTABLE")}if(k.settings.callback.beforechange.call(null,j.get(0),k)===false){return this.error("SELECT: STOPPED BY USER")}if(this.settings.rules.multiple!=false&&c&&j.children("a.clicked").size()>0){return this.deselect_branch(j)}if(this.settings.rules.multiple!=false&&c){this.selected_arr.push(j)}if(this.settings.rules.multiple!=false&&!c){for(var g in this.selected_arr){if(typeof this.selected_arr[g]=="function"){continue}this.selected_arr[g].children("A").removeClass("clicked ui-state-active");this.settings.callback.ondeselect.call(null,this.selected_arr[g].get(0),k)}this.selected_arr=[];this.selected_arr.push(j);if(this.selected&&this.selected.children("A").hasClass("clicked")){this.selected.children("A").removeClass("clicked ui-state-active");this.settings.callback.ondeselect.call(null,this.selected.get(0),k)}}if(!this.settings.rules.multiple){if(this.selected){this.selected.children("A").removeClass("clicked ui-state-active");this.settings.callback.ondeselect.call(null,this.selected.get(0),k)}}this.selected=j;if((this.settings.ui.hover_mode||this.settings.ui.theme_name=="themeroller")&&this.hovered!==false){this.hovered.children("A").removeClass("hover ui-state-hover");this.hovered=j}this.selected.children("a").removeClass("clicked ui-state-active").addClass(this.settings.ui.theme_name=="themeroller"?"clicked ui-state-active":"clicked").end().parents("li.closed").each(function(){k.open_branch(this,true)});var e=this.selected.offset().top;var d=this.container.offset().top;var f=d+this.container.height();var h=(this.container.get(0).scrollWidth>this.container.width())?40:20;if(e+5<d){this.container.scrollTop(this.container.scrollTop()-(d-e+5))}if(e+h>f){this.container.scrollTop(this.container.scrollTop()+(e+h-f))}this.set_cookie("selected");this.settings.callback.onselect.call(null,this.selected.get(0),k);this.settings.callback.onchange.call(null,this.selected.get(0),k)},deselect_branch:function(c){if(this.locked){return this.error("LOCKED")}var d=this;var c=this.get_node(c);c.children("a").removeClass("clicked ui-state-active");this.settings.callback.ondeselect.call(null,c.get(0),d);if(this.settings.rules.multiple!=false&&this.selected_arr.length>1){this.selected_arr=[];this.container.find("a.clicked").filter(":first-child").parent().each(function(){d.selected_arr.push(b(this))});if(c.get(0)==this.selected.get(0)){this.selected=this.selected_arr[0];this.set_cookie("selected")}}else{if(this.settings.rules.multiple!=false){this.selected_arr=[]}this.selected=false;this.set_cookie("selected")}if(this.selected){this.settings.callback.onchange.call(null,this.selected.get(0),d)}else{this.settings.callback.onchange.call(null,false,d)}},toggle_branch:function(c){if(this.locked){return this.error("LOCKED")}var c=this.get_node(c);if(c.hasClass("closed")){return this.open_branch(c)}if(c.hasClass("open")){return this.close_branch(c)}},open_branch:function(e,c,g){if(this.locked){return this.error("LOCKED")}var e=this.get_node(e);if(!e.size()){return this.error("OPEN: NO SUCH NODE")}if(e.hasClass("leaf")){return this.error("OPEN: OPENING LEAF NODE")}if(this.settings.data.async&&e.find("li").size()==0){if(this.settings.callback.beforeopen.call(null,e.get(0),this)===false){return this.error("OPEN: STOPPED BY USER")}var f=this;e.children("ul:eq(0)").remove().end().append("<ul><li class='last'><a class='loading' href='#'>"+(f.settings.lang.loading||"Loading ...")+"</a></li></ul>");e.removeClass("closed").addClass("open");if(this.settings.data.type=="xml_flat"||this.settings.data.type=="xml_nested"){var d=(this.settings.data.type=="xml_flat")?"flat.xsl":"nested.xsl";e.children("ul:eq(0)").getTransform(this.path+d,this.settings.data.url,{params:{theme_path:f.theme},meth:this.settings.data.method,dat:this.settings.data.async_data(e,this),repl:true,callback:function(i,h){if(i.length<15){e.removeClass("closed").removeClass("open").addClass("leaf").children("ul").remove();if(g){g.call()}return}f.open_branch.apply(f,[e]);if(g){g.call()}},error:function(){e.removeClass("open").addClass("closed").children("ul:eq(0)").remove()}})}else{b.ajax({type:this.settings.data.method,url:this.settings.data.url,data:this.settings.data.async_data(e,this),dataType:"json",success:function(j,l){j=f.settings.callback.onJSONdata.call(null,j,f);if(!j||j.length==0){e.removeClass("closed").removeClass("open").addClass("leaf").children("ul").remove();if(g){g.call()}return}var k="";if(j.length){for(var h=0;h<j.length;h++){k+=f.parseJSON(j[h])}}else{k=f.parseJSON(j)}if(k.length>0){e.children("ul:eq(0)").replaceWith("<ul>"+k+"</ul>");e.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");e.find("li").not(".open").not(".closed").addClass("leaf");f.open_branch.apply(f,[e])}else{e.removeClass("closed").removeClass("open").addClass("leaf").children("ul").remove()}if(g){g.call()}},error:function(i,j,h){e.removeClass("open").addClass("closed").children("ul:eq(0)").remove();f.error({code:h+" "+j,xhttp:i})}})}return true}else{if(!this.settings.data.async){if(this.settings.callback.beforeopen.call(null,e.get(0),this)===false){return this.error("OPEN: STOPPED BY USER")}}if(this.settings.ui.theme_name=="themeroller"){e.find("a").not(".ui-state-default").addClass("ui-state-default")}if(parseInt(this.settings.ui.animation)>0&&!c){e.children("ul:eq(0)").css("display","none");e.removeClass("closed").addClass("open");e.children("ul:eq(0)").slideDown(parseInt(this.settings.ui.animation),function(){b(this).css("display","");if(g){g.call()}})}else{e.removeClass("closed").addClass("open");if(g){g.call()}}this.set_cookie("open");this.settings.callback.onopen.call(null,e.get(0),this);return true}},close_branch:function(d,c){if(this.locked){return this.error("LOCKED")}var e=this;var d=this.get_node(d);if(!d.size()){return this.error("CLOSE: NO SUCH NODE")}if(e.settings.callback.beforeclose.call(null,d.get(0),e)===false){return this.error("CLOSE: STOPPED BY USER")}if(parseInt(this.settings.ui.animation)>0&&!c&&d.children("ul:eq(0)").size()==1){d.children("ul:eq(0)").slideUp(parseInt(this.settings.ui.animation),function(){if(d.hasClass("open")){d.removeClass("open").addClass("closed")}e.set_cookie("open");b(this).css("display","")})}else{if(d.hasClass("open")){d.removeClass("open").addClass("closed")}this.set_cookie("open")}if(this.selected&&d.children("ul:eq(0)").find("a.clicked").size()>0){d.find("li:has(a.clicked)").each(function(){e.deselect_branch(this)});if(d.children("a.clicked").size()==0){this.select_branch(d,(this.settings.rules.multiple!=false&&this.selected_arr.length>0))}}this.settings.callback.onclose.call(null,d.get(0),this)},open_all:function(d,f){if(this.locked){return this.error("LOCKED")}var e=this;d=d?this.get_node(d).parent():this.container;var c=d.find("li.closed").size();if(!f){this.cl_count=0}else{this.cl_count--}if(c>0){this.cl_count+=c;d.find("li.closed").each(function(){var g=this;e.open_branch.apply(e,[this,true,function(){e.open_all.apply(e,[g,true])}])})}else{if(this.cl_count==0){this.settings.callback.onopen_all.call(null,this)}}},close_all:function(){if(this.locked){return this.error("LOCKED")}var c=this;this.container.find("li.open").each(function(){c.close_branch(this,true)})},show_lang:function(d){if(this.locked){return this.error("LOCKED")}if(this.settings.languages[d]==this.current_lang){return true}var c=false;var e=this.container.attr("id")?"#"+this.container.attr("id"):".tree";c=get_css(e+" ."+this.current_lang,this.sn);if(c!==false){c.style.display="none"}c=get_css(e+" ."+this.settings.languages[d],this.sn);if(c!==false){c.style.display=""}this.current_lang=this.settings.languages[d];return true},cycle_lang:function(){if(this.locked){return this.error("LOCKED")}var c=b.inArray(this.current_lang,this.settings.languages);c++;if(c>this.settings.languages.length-1){c=0}this.show_lang(c)},create:function(d,h,f){if(this.locked){return this.error("LOCKED")}var n=false;if(h==-1){n=true;h=this.container}else{h=h?this.get_node(h):this.selected}if(!n&&(!h||!h.size())){return this.error("CREATE: NO NODE SELECTED")}var m=f;var e=h;if(f=="before"){f=h.parent().children().index(h);h=h.parents("li:eq(0)")}if(f=="after"){f=h.parent().children().index(h)+1;h=h.parents("li:eq(0)")}if(!n&&h.size()==0){n=true;h=this.container}if(!n){if(!this.check("creatable",h)){return this.error("CREATE: CANNOT CREATE IN NODE")}if(h.hasClass("closed")){if(this.settings.data.async&&h.children("ul").size()==0){var g=this;return this.open_branch(h,true,function(){g.create.apply(g,[d,h,f])})}else{this.open_branch(h,true)}}}var j=false;if(!d){d={}}else{d=b.extend(true,{},d)}if(!d.attributes){d.attributes={}}if(this.settings.rules.metadata){if(!d.attributes[this.settings.rules.metadata]){d.attributes[this.settings.rules.metadata]='{ "type" : "'+(this.get_type(e)||"")+'" }'}}else{if(!d.attributes[this.settings.rules.type_attr]){d.attributes[this.settings.rules.type_attr]=this.get_type(e)||""}}if(this.settings.languages.length){if(!d.data){d.data={};j=true}for(var c=0;c<this.settings.languages.length;c++){if(!d.data[this.settings.languages[c]]){d.data[this.settings.languages[c]]=((typeof this.settings.lang.new_node).toLowerCase()!="string"&&this.settings.lang.new_node[c])?this.settings.lang.new_node[c]:this.settings.lang.new_node}}}else{if(!d.data){d.data=this.settings.lang.new_node;j=true}}var k=b(this.parseJSON(d));if(k.children("ul").size()){if(!k.is(".open")){k.addClass("closed")}}else{k.addClass("leaf")}k.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");k.find("li").not(".open").not(".closed").addClass("leaf");if(!n&&this.settings.rules.use_inline&&this.settings.rules.metadata){var p=this.get_type(k)||"";b.metadata.setType("attr",this.settings.rules.metadata);if(typeof h.metadata()["valid_children"]!="undefined"){if(b.inArray(p,h.metadata()["valid_children"])==-1){return this.error("CREATE: NODE NOT A VALID CHILD")}}if(typeof h.metadata()["max_children"]!="undefined"){if((h.children("ul:eq(0)").children("li").size()+1)>h.metadata().max_children){return this.error("CREATE: MAX_CHILDREN REACHED")}}var l=true;if((typeof b(h).metadata().max_depth).toLowerCase()!="undefined"&&b(h).metadata().max_depth===0){l=false}else{h.parents("li").each(function(q){if(b(this).metadata().max_depth){if((q+1)>=b(this).metadata().max_depth){l=false;return false}}})}if(!l){return this.error("CREATE: MAX_DEPTH REACHED")}}if((typeof f).toLowerCase()=="undefined"||f=="inside"){f=(this.settings.rules.createat=="top")?0:h.children("ul:eq(0)").children("li").size()}if(h.children("ul").size()==0||(n==true&&h.children("ul").children("li").size()==0)){if(!n){var o=this.moved(k,h.children("a:eq(0)"),"inside",true)}else{var o=this.moved(k,this.container.children("ul:eq(0)"),"inside",true)}}else{if(m=="before"&&h.children("ul:eq(0)").children("li:nth-child("+(f+1)+")").size()){var o=this.moved(k,h.children("ul:eq(0)").children("li:nth-child("+(f+1)+")").children("a:eq(0)"),"before",true)}else{if(m=="after"&&h.children("ul:eq(0)").children("li:nth-child("+(f)+")").size()){var o=this.moved(k,h.children("ul:eq(0)").children("li:nth-child("+(f)+")").children("a:eq(0)"),"after",true)}else{if(h.children("ul:eq(0)").children("li:nth-child("+(f+1)+")").size()){var o=this.moved(k,h.children("ul:eq(0)").children("li:nth-child("+(f+1)+")").children("a:eq(0)"),"before",true)}else{var o=this.moved(k,h.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after",true)}}}}if(o===false){return this.error("CREATE: ABORTED")}if(j){this.select_branch(k.children("a:eq(0)"));this.rename()}return k},rename:function(e){if(this.locked){return this.error("LOCKED")}e=e?this.get_node(e):this.selected;var f=this;if(!e||!e.size()){return this.error("RENAME: NO NODE SELECTED")}if(!this.check("renameable",e)){return this.error("RENAME: NODE NOT RENAMABLE")}if(!this.settings.callback.beforerename.call(null,e.get(0),f.current_lang,f)){return this.error("RENAME: STOPPED BY USER")}e.parents("li.closed").each(function(){f.open_branch(this)});if(this.current_lang){e=e.find("a."+this.current_lang).get(0)}else{e=e.find("a:first").get(0)}last_value=e.innerHTML;f.inp=b("<input type='text' autocomplete='off' />");f.inp.val(last_value.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")).bind("mousedown",function(g){g.stopPropagation()}).bind("mouseup",function(g){g.stopPropagation()}).bind("click",function(g){g.stopPropagation()}).bind("keyup",function(h){var g=h.keyCode||h.which;if(g==27){this.value=last_value;this.blur();return}if(g==13){this.blur();return}});var d={};d[this.container.attr("id")]=this.get_rollback();f.inp.blur(function(g){if(this.value==""){this.value=last_value}b(e).text(b(e).parent().find("input").eq(0).attr("value")).get(0).style.display="";b(e).prevAll("span").remove();f.settings.callback.onrename.call(null,f.get_node(e).get(0),f.current_lang,f,d);f.inp=false});var c=b("<span />").addClass(e.className).append(f.inp);c.attr("style",b(e).attr("style"));e.style.display="none";b(e).parent().prepend(c);f.inp.get(0).focus();f.inp.get(0).select()},remove:function(f){if(this.locked){return this.error("LOCKED")}var e={};e[this.container.attr("id")]=this.get_rollback();if(f&&(!this.selected||this.get_node(f).get(0)!=this.selected.get(0))){f=this.get_node(f);if(f.size()){if(!this.check("deletable",f)){return this.error("DELETE: NODE NOT DELETABLE")}if(!this.settings.callback.beforedelete.call(null,f.get(0),g)){return this.error("DELETE: STOPPED BY USER")}$parent=f.parent();f=f.remove();$parent.children("li:last").addClass("last");if($parent.children("li").size()==0){$li=$parent.parents("li:eq(0)");$li.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove();this.set_cookie("open")}this.settings.callback.ondelete.call(null,f.get(0),this,e)}}else{if(this.selected){if(!this.check("deletable",this.selected)){return this.error("DELETE: NODE NOT DELETABLE")}if(!this.settings.callback.beforedelete.call(null,this.selected.get(0),g)){return this.error("DELETE: STOPPED BY USER")}$parent=this.selected.parent();var f=this.selected;if(this.settings.rules.multiple==false||this.selected_arr.length==1){var d=true;var c=(this.selected.prev("li:eq(0)").size())?this.selected.prev("li:eq(0)"):this.selected.parents("li:eq(0)")}f=f.remove();$parent.children("li:last").addClass("last");if($parent.children("li").size()==0){$li=$parent.parents("li:eq(0)");$li.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove();this.set_cookie("open")}this.settings.callback.ondelete.call(null,f.get(0),this,e);if(d&&c){this.select_branch(c)}if(this.settings.rules.multiple!=false&&!d){var g=this;this.selected_arr=[];this.container.find("a.clicked").filter(":first-child").parent().each(function(){g.selected_arr.push(b(this))});if(this.selected_arr.length>0){this.selected=this.selected_arr[0];this.remove()}}}else{return this.error("DELETE: NO NODE SELECTED")}}},next:function(d,c){d=this.get_node(d);if(!d.size()){return false}if(c){return(d.nextAll("li").size()>0)?d.nextAll("li:eq(0)"):false}if(d.hasClass("open")){return d.find("li:eq(0)")}else{if(d.nextAll("li").size()>0){return d.nextAll("li:eq(0)")}else{return d.parents("li").next("li").eq(0)}}},prev:function(d,c){d=this.get_node(d);if(!d.size()){return false}if(c){return(d.prevAll("li").size()>0)?d.prevAll("li:eq(0)"):false}if(d.prev("li").size()){var d=d.prev("li").eq(0);while(d.hasClass("open")){d=d.children("ul:eq(0)").children("li:last")}return d}else{return d.parents("li:eq(0)").size()?d.parents("li:eq(0)"):false}},parent:function(c){c=this.get_node(c);if(!c.size()){return false}return c.parents("li:eq(0)").size()?c.parents("li:eq(0)"):false},children:function(c){c=this.get_node(c);if(!c.size()){return false}return c.children("ul:eq(0)").children("li")},get_next:function(c){var d=this.hovered||this.selected;return c?this.select_branch(this.next(d)):this.hover_branch(this.next(d))},get_prev:function(c){var d=this.hovered||this.selected;return c?this.select_branch(this.prev(d)):this.hover_branch(this.prev(d))},get_left:function(c,e){if(this.settings.ui.rtl&&!e){return this.get_right(c,true)}var d=this.hovered||this.selected;if(d){if(d.hasClass("open")){this.close_branch(d)}else{return c?this.select_branch(this.parent(d)):this.hover_branch(this.parent(d))}}},get_right:function(c,e){if(this.settings.ui.rtl&&!e){return this.get_left(c,true)}var d=this.hovered||this.selected;if(d){if(d.hasClass("closed")){this.open_branch(d)}else{return c?this.select_branch(d.find("li:eq(0)")):this.hover_branch(d.find("li:eq(0)"))}}},toggleDots:function(){if(this.settings.ui.dots){this.settings.ui.dots=false;this.container.children("ul:eq(0)").addClass("no_dots")}else{this.settings.ui.dots=true;this.container.children("ul:eq(0)").removeClass("no_dots")}},toggleRTL:function(){if(this.settings.ui.rtl){this.settings.ui.rtl=false;this.container.css("direction","ltr").children("ul:eq(0)").removeClass("rtl").addClass("ltr")}else{this.settings.ui.rtl=true;this.container.css("direction","rtl").children("ul:eq(0)").removeClass("ltr").addClass("rtl")}},set_cookie:function(c){if(this.settings.cookies===false){return false}if(this.settings.cookies[c]===false){return false}switch(c){case"selected":if(this.settings.rules.multiple!=false&&this.selected_arr.length>1){var e=Array();b.each(this.selected_arr,function(){if(this.attr("id")){e.push(this.attr("id"))}});e=e.join(",")}else{var e=this.selected?this.selected.attr("id"):false}b.cookie(this.settings.cookies.prefix+"_selected",e,this.settings.cookies.opts);break;case"open":var d="";this.container.find("li.open").each(function(f){if(this.id){d+=this.id+","}});b.cookie(this.settings.cookies.prefix+"_open",d.replace(/,$/ig,""),this.settings.cookies.opts);break}},get_rollback:function(){var c={};if(this.context.to_remove&&this.context.apply_to){this.context.apply_to.children("a").removeClass("clicked")}c.html=this.container.html();if(this.context.to_remove&&this.context.apply_to){this.context.apply_to.children("a").addClass("clicked")}c.selected=this.selected?this.selected.attr("id"):false;return c},moved:function(p,l,q,c,r,d){var p=b(p);var f=b(p).parents("ul:eq(0)");var g=b(l);if(!d){var d={};d[this.container.attr("id")]=this.get_rollback();if(!c){var k=p.size()>1?p.eq(0).parents(".tree:eq(0)"):p.parents(".tree:eq(0)");if(k.get(0)!=this.container.get(0)){k=a.inst[k.attr("id")];d[k.container.attr("id")]=k.get_rollback()}delete k}}if(q=="inside"&&this.settings.data.async&&this.get_node(g).hasClass("closed")){var m=this;return this.open_branch(this.get_node(g),true,function(){m.moved.apply(m,[p,l,q,c,r,d])})}if(p.size()>1){var m=this;var k=this.moved(p.eq(0),l,q,false,r,d);p.each(function(j){if(j==0){return}if(k){k=m.moved(this,k.children("a:eq(0)"),"after",false,r,d)}});return}if(r){_what=p.clone();_what.each(function(j){this.id=this.id+"_copy";b(this).find("li").each(function(){this.id=this.id+"_copy"});b(this).removeClass("dragged").find("a.clicked").removeClass("clicked ui-state-active").end().find("li.dragged").removeClass("dragged")})}else{_what=p}if(c){if(!this.settings.callback.beforecreate.call(null,this.get_node(p).get(0),this.get_node(l).get(0),q,this)){return false}}else{if(!this.settings.callback.beforemove.call(null,this.get_node(p).get(0),this.get_node(l).get(0),q,this)){return false}}if(!c){var k=p.parents(".tree:eq(0)");if(k.get(0)!=this.container.get(0)){k=a.inst[k.attr("id")];if(k.settings.languages.length){var n=[];if(this.settings.languages.length==0){n.push("."+k.current_lang)}else{for(var h in this.settings.languages){if(typeof this.settings.languages[h]=="function"){continue}for(var e in k.settings.languages){if(typeof k.settings.languages[e]=="function"){continue}if(this.settings.languages[h]==k.settings.languages[e]){n.push("."+this.settings.languages[h])}}}}if(n.length==0){return this.error("MOVE: NO COMMON LANGUAGES")}p.find("a").not(n.join(",")).remove()}p.find("a.clicked").removeClass("clicked ui-state-active")}}p=_what;switch(q){case"before":g.parents("ul:eq(0)").children("li.last").removeClass("last");g.parent().before(p.removeClass("last"));g.parents("ul:eq(0)").children("li:last").addClass("last");break;case"after":g.parents("ul:eq(0)").children("li.last").removeClass("last");g.parent().after(p.removeClass("last"));g.parents("ul:eq(0)").children("li:last").addClass("last");break;case"inside":if(g.parent().children("ul:first").size()){if(this.settings.rules.createat=="top"){g.parent().children("ul:first").prepend(p.removeClass("last")).children("li:last").addClass("last")}else{g.parent().children("ul:first").children(".last").removeClass("last").end().append(p.removeClass("last")).children("li:last").addClass("last")}}else{p.addClass("last");g.parent().append("<ul/>").removeClass("leaf").addClass("closed");g.parent().children("ul:first").prepend(p)}if(g.parent().hasClass("closed")){this.open_branch(g)}break;default:break}if(f.find("li").size()==0){var o=f.parent();o.removeClass("open").removeClass("closed").addClass("leaf");if(!o.is(".tree")){o.children("ul").remove()}o.parents("ul:eq(0)").children("li.last").removeClass("last").end().children("li:last").addClass("last");this.set_cookie("open")}else{f.children("li.last").removeClass("last");f.children("li:last").addClass("last")}if(r){this.settings.callback.oncopy.call(null,this.get_node(p).get(0),this.get_node(l).get(0),q,this,d)}else{if(c){this.settings.callback.oncreate.call(null,this.get_node(p).get(0),(g.is("ul")?-1:this.get_node(l).get(0)),q,this,d)}else{this.settings.callback.onmove.call(null,this.get_node(p).get(0),this.get_node(l).get(0),q,this,d)}}return p},error:function(c){if(typeof c=="string"){c={code:c,data:null}}this.settings.callback.error.call(null,c,this);return false},lock:function(c){this.locked=c;if(this.locked){this.container.children("ul:eq(0)").addClass("locked")}else{this.container.children("ul:eq(0)").removeClass("locked")}},cut:function(c){if(this.locked){return this.error("LOCKED")}c=c?this.get_node(c):this.container.find("a.clicked").filter(":first-child").parent();if(!c||!c.size()){return this.error("CUT: NO NODE SELECTED")}this.copy_nodes=false;this.cut_nodes=c},copy:function(c){if(this.locked){return this.error("LOCKED")}c=c?this.get_node(c):this.container.find("a.clicked").filter(":first-child").parent();if(!c||!c.size()){return this.error("COPY: NO NODE SELECTED")}this.copy_nodes=c;this.cut_nodes=false},paste:function(g,c){if(this.locked){return this.error("LOCKED")}var e=false;if(g==-1){e=true;g=this.container}else{g=g?this.get_node(g):this.selected}if(!e&&(!g||!g.size())){return this.error("PASTE: NO NODE SELECTED")}if(!this.copy_nodes&&!this.cut_nodes){return this.error("PASTE: NOTHING TO DO")}var i=this;var h=c;if(c=="before"){c=g.parent().children().index(g);g=g.parents("li:eq(0)")}else{if(c=="after"){c=g.parent().children().index(g)+1;g=g.parents("li:eq(0)")}else{if((typeof c).toLowerCase()=="undefined"||c=="inside"){c=(this.settings.rules.createat=="top")?0:g.children("ul:eq(0)").children("li").size()}}}if(!e&&g.size()==0){e=true;g=this.container}if(this.copy_nodes&&this.copy_nodes.size()){var f=true;if(!f){return this.error("Invalid paste")}if(!e&&!this.checkMove(this.copy_nodes,g.children("a:eq(0)"),"inside")){return false}if(g.children("ul").size()==0||(e==true&&g.children("ul").children("li").size()==0)){if(!e){var d=this.moved(this.copy_nodes,g.children("a:eq(0)"),"inside",false,true)}else{var d=this.moved(this.copy_nodes,this.container.children("ul:eq(0)"),"inside",false,true)}}else{if(h=="before"&&g.children("ul:eq(0)").children("li:nth-child("+(c+1)+")").size()){var d=this.moved(this.copy_nodes,g.children("ul:eq(0)").children("li:nth-child("+(c+1)+")").children("a:eq(0)"),"before",false,true)}else{if(h=="after"&&g.children("ul:eq(0)").children("li:nth-child("+(c)+")").size()){var d=this.moved(this.copy_nodes,g.children("ul:eq(0)").children("li:nth-child("+(c)+")").children("a:eq(0)"),"after",false,true)}else{if(g.children("ul:eq(0)").children("li:nth-child("+(c+1)+")").size()){var d=this.moved(this.copy_nodes,g.children("ul:eq(0)").children("li:nth-child("+(c+1)+")").children("a:eq(0)"),"before",false,true)}else{var d=this.moved(this.copy_nodes,g.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after",false,true)}}}}this.copy_nodes=false}if(this.cut_nodes&&this.cut_nodes.size()){var f=true;g.parents().andSelf().each(function(){if(i.cut_nodes.index(this)!=-1){f=false;return false}});if(!f){return this.error("Invalid paste")}if(!e&&!this.checkMove(this.cut_nodes,g.children("a:eq(0)"),"inside")){return false}if(g.children("ul").size()==0||(e==true&&g.children("ul").children("li").size()==0)){if(!e){var d=this.moved(this.cut_nodes,g.children("a:eq(0)"),"inside")}else{var d=this.moved(this.cut_nodes,this.container.children("ul:eq(0)"),"inside")}}else{if(h=="before"&&g.children("ul:eq(0)").children("li:nth-child("+(c+1)+")").size()){var d=this.moved(this.cut_nodes,g.children("ul:eq(0)").children("li:nth-child("+(c+1)+")").children("a:eq(0)"),"before")}else{if(h=="after"&&g.children("ul:eq(0)").children("li:nth-child("+(c)+")").size()){var d=this.moved(this.cut_nodes,g.children("ul:eq(0)").children("li:nth-child("+(c)+")").children("a:eq(0)"),"after")}else{if(g.children("ul:eq(0)").children("li:nth-child("+(c+1)+")").size()){var d=this.moved(this.cut_nodes,g.children("ul:eq(0)").children("li:nth-child("+(c+1)+")").children("a:eq(0)"),"before")}else{var d=this.moved(this.cut_nodes,g.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after")}}}}this.cut_nodes=false}},search:function(g){var i=this;if(!g||(this.srch&&g!=this.srch)){this.srch="";this.srch_opn=false;this.container.find("a.search").removeClass("search ui-state-highlight")}this.srch=g;if(!g){return}if(this.settings.data.async){if(!this.srch_opn){var d=b.extend({search:g},this.settings.data.async_data(false,this));b.ajax({type:this.settings.data.method,url:this.settings.data.url,data:d,dataType:"text",success:function(j){i.srch_opn=b.unique(j.split(","));i.search.apply(i,[g])}})}else{if(this.srch_opn.length){if(this.srch_opn&&this.srch_opn.length){var h=false;for(var e=0;e<this.srch_opn.length;e++){if(this.get_node("#"+this.srch_opn[e]).size()>0){h=true;var f="#"+this.srch_opn[e];delete this.srch_opn[e];this.open_branch(f,true,function(){i.search.apply(i,[g])})}}if(!h){this.srch_opn=[];i.search.apply(i,[g])}}}else{var c="a";if(this.settings.languages.length){c+="."+this.current_lang}this.container.find(c+":contains('"+g+"')").addClass(this.settings.ui.theme_name=="themeroller"?"search ui-state-highlight":"search");this.srch_opn=false}}}else{var c="a";if(this.settings.languages.length){c+="."+this.current_lang}this.container.find(c+":contains('"+g+"')").addClass(this.settings.ui.theme_name=="themeroller"?"search ui-state-highlight":"search").parents("li.closed").each(function(){i.open_branch(this,true)})}},destroy:function(){this.hide_context();this.container.unbind(".jstree");b("#"+this.container.attr("id")).die("click.jstree").die("dblclick.jstree").die("contextmenu.jstree").die("mouseover.jstree").die("mouseout.jstree").die("mousedown.jstree");this.container.removeClass("tree ui-widget ui-widget-content tree-default tree-"+this.settings.ui.theme_name).children("ul").removeClass("no_dots rtl ltr locked").find("li").removeClass("leaf").removeClass("open").removeClass("closed").removeClass("last").children("a").removeClass("clicked hover search ui-state-active ui-state-hover ui-state-highlight ui-state-default");if(this.cntr==a.focused){for(var c in a.inst){if(c!=this.cntr&&c!=this.container.attr("id")){a.inst[c].focus();break}}}a.inst[this.cntr]=false;a.inst[this.container.attr("id")]=false;delete a.inst[this.cntr];delete a.inst[this.container.attr("id")];a.cntr--}}}})(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 e=[],l=[],j=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],k=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(m){this.menus=[];this.init(m)}});f.extend(f.MenuCollection,{prototype:{init:function(m){if(m&&m.length){for(var n=0;n<m.length;n++){this.addMenu(m[n]);m[n].menuCollection=this}}},addMenu:function(n){if(n instanceof f.Menu){this.menus.push(n)}n.menuCollection=this;var m=this;f(n.target).hover(function(){if(n.visible){return}for(var o=0;o<m.menus.length;o++){if(m.menus[o].visible){m.menus[o].hide();n.show();return}}},function(){})}}});f.extend({Menu:function(o,m,n){this.menuItems=[];this.subMenus=[];this.visible=false;this.active=false;this.parentMenuItem=null;this.settings=f.extend({},d,n);this.target=o;this.$eDIV=null;this.$eUL=null;this.timer=null;this.menuCollection=null;this.openTimer=null;this.init();if(m&&m.constructor==Array){this.addItems(m)}}});f.extend(f.Menu,{checkMouse:function(n){var m=n.target;if(l.length&&m==l[0].target){return}while(m.parentNode&&m.parentNode!=h[0]){m=m.parentNode}if(!f(l).filter(function(){return this.$eDIV[0]==m}).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(!j){j=l[0]}var o=j;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(j){j.selectNextItem(-1)}break;case 39:if(!j){j=l[0]}var n,o=j,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(!j){if(l.length&&l[0].menuItems.length){l[0].menuItems[0].hoverIn()}}else{j.selectNextItem()}break}if(s.keyCode>36&&s.keyCode<41){return false}},closeAll:function(){while(l.length){l[0].hide()}},setDefaults:function(m){f.extend(d,m)},prototype:{init:function(){var m=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(n){m.onClick(n)}).hover(function(n){m.setActive();if(m.settings.hoverOpenDelay){m.openTimer=setTimeout(function(){if(!m.visible){m.onClick(n)}},m.settings.hoverOpenDelay)}},function(){if(!m.visible){f(this).removeClass("activetarget")}if(m.openTimer){clearTimeout(m.openTimer)}})}else{this.$eDIV.hover(function(){m.setActive()},function(){})}},setActive:function(){if(!this.parentMenuItem){f(this.target).addClass("activetarget")}else{this.active=true}},addItem:function(m){if(m instanceof f.MenuItem){if(f.inArray(m,this.menuItems)==-1){this.$eUL.append(m.$eLI);this.menuItems.push(m);m.parentMenu=this;if(m.subMenu){this.subMenus.push(m.subMenu)}}}else{this.addItem(new f.MenuItem(m,this.settings))}},addItems:function(m){for(var n=0;n<m.length;n++){this.addItem(m[n])}},removeItem:function(m){var n=f.inArray(m,this.menuItems);if(n>-1){this.menuItems.splice(n,1)}m.parentMenu=null},hide:function(){if(!this.visible){return}var m,n=f.inArray(this,l);this.$eDIV.hide();if(n>=0){l.splice(n,1)}this.visible=this.active=false;f(this.target).removeClass("activetarget");for(m=0;m<this.subMenus.length;m++){this.subMenus[m].hide()}for(m=0;m<this.menuItems.length;m++){if(this.menuItems[m].active){this.menuItems[m].setInactive()}}if(!l.length){f(document).unbind("mousedown",f.Menu.checkMouse).unbind("keydown",f.Menu.checkKey)}if(j==this){j=null}if(this.settings.onClose){this.settings.onClose.call(this)}},show:function(o){if(this.visible){return}var n,m=this.parentMenuItem;if(this.menuItems.length){if(m){n=parseInt(m.parentMenu.$eDIV.css("z-index"));this.$eDIV.css("z-index",(isNaN(n)?1:n+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)}}this.setPosition();this.$eDIV.css({display:"none",visibility:""}).show();if(f.browser.msie){this.$eUL.css("width",parseInt(f.browser.version)==6?this.$eDIV.width()-7:this.$eUL.width())}if(this.settings.onOpen){this.settings.onOpen.call(this)}}if(l.length==0){f(document).bind("mousedown",f.Menu.checkMouse).bind("keydown",f.Menu.checkKey)}this.visible=true;l.push(this)},setPosition:function(){var t,r,p,m,w,x,s,u=f(window).width(),n=f(window).height(),y=this.parentMenuItem,z=this.$eDIV[0].clientHeight,q=this.$eDIV[0].clientWidth,v;if(y){r=y.$eLI.offset();p=r.left+y.$eLI.width();m=r.top}else{t=f(this.target);r=t.offset();p=r.left+this.settings.offsetLeft;m=r.top+t.height()+this.settings.offsetTop}if(f.fn.scrollTop){x=f(window).scrollTop();if(n<z){m=x}else{if(n+x<m+z){if(y){w=y.parentMenu.$eDIV.offset();v=y.parentMenu.$eDIV[0].clientHeight;if(z<=v){m=w.top+v-z}else{m=w.top}if(n+x<m+z){m-=m+z-(n+x)}}else{m-=m+z-(n+x)}}}}if(f.fn.scrollLeft){s=f(window).scrollLeft();if(u+s<p+q){if(y){p-=y.$eLI.width()+q;if(p<s){p=s}}else{p-=p+q-(u+s)}}}this.$eDIV.css({left:p,top:m})},onClick:function(m){if(this.visible){this.hide();this.setActive()}else{f.Menu.closeAll();this.show(m)}},addTimer:function(o,n){var m=this;this.timer=setTimeout(function(){o.call(m);m.timer=null},n)},removeTimer:function(){if(this.timer){clearTimeout(this.timer);this.timer=null}},selectNextItem:function(q){var m,r=0,n=this.menuItems.length,p=q||1;for(m=0;m<n;m++){if(this.menuItems[m].active){r=m;break}}this.menuItems[r].hoverOut();do{r+=p;if(r>=n){r=0}else{if(r<0){r=n-1}}}while(this.menuItems[r].separator);this.menuItems[r].hoverIn(true)},inMenuCollection:function(){var n=this;while(n.parentMenuItem){n=n.parentMenuItem.parentMenu}return n.menuCollection?n:null},destroy:function(){var n,m;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){m=this.menuItems[0];m.destroy();delete m}if((n=f.inArray(this,e))>-1){e.splice(n,1)}if(this.menuCollection){if((n=f.inArray(this,this.menuCollection.menus))>-1){this.menuCollection.menus.splice(n,1)}}this.$eDIV.remove()}}});f.extend({MenuItem:function(n,m){if(typeof n=="string"){n={src:n}}this.src=n.src||"";this.url=n.url||null;this.urlTarget=n.target||null;this.addClass=n.addClass||null;this.data=n.data||null;this.$eLI=null;this.parentMenu=null;this.subMenu=null;this.settings=f.extend({},d,m);this.active=false;this.enabled=true;this.separator=false;this.init();if(n.subMenu){new f.Menu(this,n.subMenu,m)}}});f.extend(f.MenuItem,{prototype:{init:function(){var o,n,p=this.src,m=this;this.$eLI=f(k.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(p==""){this.$eLI.addClass("menu-separator");this.separator=true}else{n=typeof p=="string";if(n&&this.url){p=f('<a href="'+this.url+'"'+(this.urlTarget?'target="'+this.urlTarget+'"':"")+">"+p+"</a>")}else{if(n||!p.length){p=[p]}}for(o=0;o<p.length;o++){if(typeof p[o]=="string"){elem=document.createElement("span");elem.innerHTML=p[o];this.$eLI[0].firstChild.appendChild(elem)}else{this.$eLI[0].firstChild.appendChild(p[o].cloneNode(1))}}}this.$eLI.click(function(q){m.click(q,this)});this.bindHover()},click:function(n,m){if(this.enabled&&this.settings.onClick){this.settings.onClick.call(m,n,this)}},bindHover:function(){var m=this;this.$eLI.hover(function(){m.hoverIn()},function(){m.hoverOut()})},hoverIn:function(n){this.removeTimer();var o,q=this.parentMenu.subMenus,p=this.parentMenu.menuItems,m=this;if(this.parentMenu.timer){this.parentMenu.removeTimer()}if(!this.enabled){return}for(o=0;o<p.length;o++){if(p[o].active){p[o].setInactive()}}this.setActive();j=this.parentMenu;for(o=0;o<q.length;o++){if(q[o].visible&&q[o]!=this.subMenu&&!q[o].timer){q[o].addTimer(function(){this.hide()},q[o].settings.hideDelay)}}if(this.subMenu&&!n){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 m=this.parentMenu.parentMenuItem;if(m&&!m.active){m.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(n){if(this.subMenu){return}this.subMenu=n;if(this.parentMenu&&f.inArray(n,this.parentMenu.subMenus)==-1){this.parentMenu.subMenus.push(n)}if(this.settings.arrowSrc){var m=i.cloneNode(0);m.setAttribute("src",this.settings.arrowSrc);this.$eLI[0].firstChild.appendChild(m)}}}});f.extend(f.fn,{menuFromElement:function(n,p,o){var m=function(x){var t=[],v,s,A,y,u,z,r,w,q=null;A=g(x,"LI");for(u=0;u<A.length;u++){v=[];if(!A[u].childNodes.length){t.push(new f.MenuItem("",n));continue}if((z=a(A[u],"UL"))){v=m(z);f(z).remove()}y=f(A[u]);if(y[0].childNodes.length==1&&y[0].childNodes[0].nodeType==3){w=y[0].childNodes[0].nodeValue}else{w=y[0].childNodes}if(n&&n.copyClassAttr){q=y.attr("class")}s=new f.MenuItem({src:w,addClass:q},n);t.push(s);if(v.length){new f.Menu(s,v,n)}}return t};return this.each(function(){var r,q;if(p||(r=a(this,"UL"))){r=p?f(p).clone(true)[0]:r;menuItems=m(r);if(menuItems.length){q=new f.Menu(this,menuItems,n);if(o){o.addMenu(q)}}f(r).hide()}})},menuBarFromUL:function(m){return this.each(function(){var o,n=g(this,"LI");if(n.length){bar=new f.MenuCollection();for(o=0;o<n.length;o++){f(n[o]).menuFromElement(m,null,bar)}}})},menu:function(n,m){return this.each(function(){if(m&&m.constructor==Array){new f.Menu(this,m,n)}else{if(this.nodeName.toUpperCase()=="UL"){f(this).menuBarFromUL(n)}else{f(this).menuFromElement(n,m)}}})}});var a=function(o,m){if(!o){return null}var p=o.firstChild;for(;p;p=p.nextSibling){if(p.nodeType==1&&p.nodeName.toUpperCase()==m){return p}}return null};var g=function(p,m){if(!p){return[]}var o=[],q=p.firstChild;for(;q;q=q.nextSibling){if(q.nodeType==1&&q.nodeName.toUpperCase()==m){o[o.length]=q}}return o}})(jQuery);(function(c){function b(){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};c.extend(this._defaults,this.regional[""])}var d="timeEntry";c.extend(b.prototype,{markerClassName:"hasTimeEntry",setDefaults:function(e){a(this._defaults,e||{});return this},_connectTimeEntry:function(h,m){var k=c(h);if(k.hasClass(this.markerClassName)){return}var g={};g.options=c.extend({},m);g._selectedHour=0;g._selectedMinute=0;g._selectedSecond=0;g._field=0;g.input=c(h);c.data(h,d,g);var e=this._get(g,"spinnerImage");var i=this._get(g,"spinnerText");var j=this._get(g,"spinnerSize");var f=this._get(g,"appendText");var l=(!e?null:c('<span class="timeEntry_control" style="display: inline-block; background: url(\''+e+"') 0 0 no-repeat; width: "+j[0]+"px; height: "+j[1]+"px;"+(c.browser.mozilla&&c.browser.version<"1.9"?" padding-left: "+j[0]+"px; padding-bottom: "+(j[1]-18)+"px;":"")+'"></span>'));k.wrap('<span class="timeEntry_wrap"></span>').after(f?'<span class="timeEntry_append">'+f+"</span>":"").after(l||"");k.addClass(this.markerClassName).bind("focus.timeEntry",this._doFocus).bind("blur.timeEntry",this._doBlur).bind("click.timeEntry",this._doClick).bind("keydown.timeEntry",this._doKeyDown).bind("keypress.timeEntry",this._doKeyPress);if(c.browser.mozilla){k.bind("input.timeEntry",function(n){c.timeentry._parseTime(g)})}if(c.browser.msie){k.bind("paste.timeEntry",function(n){setTimeout(function(){c.timeentry._parseTime(g)},1)})}if(this._get(g,"useMouseWheel")&&c.fn.mousewheel){k.mousewheel(this._doMouseWheel)}if(l){l.mousedown(this._handleSpinner).mouseup(this._endSpinner).mouseover(this._expandSpinner).mouseout(this._endSpinner).mousemove(this._describeSpinner)}},_enableTimeEntry:function(e){this._enableDisable(e,false)},_disableTimeEntry:function(e){this._enableDisable(e,true)},_enableDisable:function(e,f){var g=c.data(e,d);if(!g){return}e.disabled=f;if(e.nextSibling&&e.nextSibling.nodeName.toLowerCase()=="span"){c.timeEntry._changeSpinner(g,e.nextSibling,(f?5:-1))}c.timeEntry._disabledInputs=c.map(c.timeEntry._disabledInputs,function(h){return(h==e?null:h)});if(f){c.timeEntry._disabledInputs.push(e)}},_isDisabledTimeEntry:function(e){return c.inArray(e,this._disabledInputs)>-1},_changeTimeEntry:function(e,f){var h=c.data(e,d);if(h){var g=this._extractTime(h);a(h.options,f||{});if(g){this._setTime(h,new Date(0,0,0,g[0],g[1],g[2]))}}c.data(e,d,h)},_destroyTimeEntry:function(e){$input=c(e);if(!$input.hasClass(this.markerClassName)){return}$input.removeClass(this.markerClassName).unbind(".timeEntry");if(c.fn.mousewheel){$input.unmousewheel()}this._disabledInputs=c.map(this._disabledInputs,function(f){return(f==e?null:f)});$input.parent().replaceWith($input);c.removeData(e,d)},_setTimeTimeEntry:function(e,g){var f=c.data(e,d);if(f){this._setTime(f,g?(typeof g=="object"?new Date(g.getTime()):g):null)}},_getTimeTimeEntry:function(e){var g=c.data(e,d);var f=(g?this._extractTime(g):null);return(!f?null:new Date(0,0,0,f[0],f[1],f[2]))},_doFocus:function(g){var e=(g.nodeName&&g.nodeName.toLowerCase()=="input"?g:this);if(c.timeEntry._lastInput==e||c.timeEntry._isDisabledTimeEntry(e)){c.timeEntry._focussed=false;return}var f=c.data(e,d);c.timeEntry._focussed=true;c.timeEntry._lastInput=e;c.timeEntry._blurredInput=null;var h=c.timeEntry._get(f,"beforeShow");a(f.options,(h?h.apply(e,[e]):{}));c.data(e,d,f);c.timeEntry._parseTime(f);setTimeout(function(){c.timeEntry._showField(f)},10)},_doBlur:function(e){c.timeEntry._blurredInput=c.timeEntry._lastInput;c.timeEntry._lastInput=null},_doClick:function(f){var m=f.target;var i=c.data(m,d);if(!c.timeEntry._focussed){var n=c.timeEntry._get(i,"separator").length+2;i._field=0;if(m.selectionStart!=null){for(var l=0;l<=Math.max(1,i._secondField,i._ampmField);l++){var g=(l!=i._ampmField?(l*n)+2:(i._ampmField*n)+c.timeEntry._get(i,"ampmPrefix").length+c.timeEntry._get(i,"ampmNames")[0].length);i._field=l;if(m.selectionStart<g){break}}}else{if(m.createTextRange){var e=c(f.srcElement);var j=m.createTextRange();var k=function(o){return{thin:2,medium:4,thick:6}[o]||o};var h=f.clientX+document.documentElement.scrollLeft-(e.offset().left+parseInt(k(e.css("border-left-width")),10))-j.offsetLeft;for(var l=0;l<=Math.max(1,i._secondField,i._ampmField);l++){var g=(l!=i._ampmField?(l*n)+2:(i._ampmField*n)+c.timeEntry._get(i,"ampmPrefix").length+c.timeEntry._get(i,"ampmNames")[0].length);j.collapse();j.moveEnd("character",g);i._field=l;if(h<j.boundingWidth){break}}}}}c.data(m,d,i);c.timeEntry._showField(i);c.timeEntry._focussed=false},_doKeyDown:function(e){if(e.keyCode>=48){return true}var f=c.data(e.target,d);switch(e.keyCode){case 9:return(e.shiftKey?c.timeEntry._changeField(f,-1,true):c.timeEntry._changeField(f,+1,true));case 35:if(e.ctrlKey){c.timeEntry._setValue(f,"")}else{f._field=Math.max(1,f._secondField,f._ampmField);c.timeEntry._adjustField(f,0)}break;case 36:if(e.ctrlKey){c.timeEntry._setTime(f)}else{f._field=0;c.timeEntry._adjustField(f,0)}break;case 37:c.timeEntry._changeField(f,-1,false);break;case 38:c.timeEntry._adjustField(f,+1);break;case 39:c.timeEntry._changeField(f,+1,false);break;case 40:c.timeEntry._adjustField(f,-1);break;case 46:c.timeEntry._setValue(f,"");break}return false},_doKeyPress:function(f){var e=String.fromCharCode(f.charCode==undefined?f.keyCode:f.charCode);if(e<" "){return true}var g=c.data(f.target,d);c.timeEntry._handleKeyPress(g,e);return false},_doMouseWheel:function(e,g){if(c.timeEntry._isDisabledTimeEntry(e.target)){return}g=(c.browser.opera?-g/Math.abs(g):(c.browser.safari?g/Math.abs(g):g));var f=c.data(e.target,d);f.input.focus();if(!f.input.val()){c.timeEntry._parseTime(f)}c.timeEntry._adjustField(f,g);e.preventDefault()},_expandSpinner:function(h){var l=c.timeEntry._getSpinnerTarget(h);var j=c.data(c.timeEntry._getInput(l),d);var g=c.timeEntry._get(j,"spinnerBigImage");if(g){j._expanded=true;var k=c(l).offset();var i=null;c(l).parents().each(function(){var m=c(this);if(m.css("position")=="relative"||m.css("position")=="absolute"){i=m.offset()}return !i});var f=c.timeEntry._get(j,"spinnerSize");var e=c.timeEntry._get(j,"spinnerBigSize");c('<div class="timeEntry_expand" style="position: absolute; left: '+(k.left-(e[0]-f[0])/2-(i?i.left:0))+"px; top: "+(k.top-(e[1]-f[1])/2-(i?i.top:0))+"px; width: "+e[0]+"px; height: "+e[1]+"px; background: transparent url("+g+') no-repeat 0px 0px; z-index: 10;"></div>').mousedown(c.timeEntry._handleSpinner).mouseup(c.timeEntry._endSpinner).mouseout(c.timeEntry._endExpand).mousemove(c.timeEntry._describeSpinner).insertAfter(l)}},_getInput:function(e){return c(e).siblings("."+c.timeEntry.markerClassName)[0]},_describeSpinner:function(e){var g=c.timeEntry._getSpinnerTarget(e);var f=c.data(c.timeEntry._getInput(g),d);g.title=c.timeEntry._get(f,"spinnerTexts")[c.timeEntry._getSpinnerRegion(f,e)]},_handleSpinner:function(f){var j=c.timeEntry._getSpinnerTarget(f);var e=c.timeEntry._getInput(j);if(c.timeEntry._isDisabledTimeEntry(e)){return}if(e==c.timeEntry._blurredInput){c.timeEntry._lastInput=e;c.timeEntry._blurredInput=null}var h=c.data(e,d);c.timeEntry._doFocus(e);var i=c.timeEntry._getSpinnerRegion(h,f);c.timeEntry._changeSpinner(h,j,i);c.timeEntry._actionSpinner(h,i);c.timeEntry._timer=null;c.timeEntry._handlingSpinner=true;var g=c.timeEntry._get(h,"spinnerRepeat");if(i>=3&&g[0]){c.timeEntry._timer=setTimeout(function(){c.timeEntry._repeatSpinner(h,i)},g[0]);c(j).one("mouseout",c.timeEntry._releaseSpinner).one("mouseup",c.timeEntry._releaseSpinner)}},_actionSpinner:function(e,f){if(!e.input.val()){c.timeEntry._parseTime(e)}switch(f){case 0:this._setTime(e);break;case 1:this._changeField(e,-1,false);break;case 2:this._changeField(e,+1,false);break;case 3:this._adjustField(e,+1);break;case 4:this._adjustField(e,-1);break}},_repeatSpinner:function(e,f){if(!c.timeEntry._timer){return}c.timeEntry._lastInput=c.timeEntry._blurredInput;this._actionSpinner(e,f);this._timer=setTimeout(function(){c.timeEntry._repeatSpinner(e,f)},this._get(e,"spinnerRepeat")[1])},_releaseSpinner:function(e){clearTimeout(c.timeEntry._timer);c.timeEntry._timer=null},_endExpand:function(f){c.timeEntry._timer=null;var h=c.timeEntry._getSpinnerTarget(f);var e=c.timeEntry._getInput(h);var g=c.data(e,d);c(h).remove();g._expanded=false},_endSpinner:function(f){c.timeEntry._timer=null;var h=c.timeEntry._getSpinnerTarget(f);var e=c.timeEntry._getInput(h);var g=c.data(e,d);if(!c.timeEntry._isDisabledTimeEntry(e)){c.timeEntry._changeSpinner(g,h,-1)}if(c.timeEntry._handlingSpinner){c.timeEntry._lastInput=c.timeEntry._blurredInput}if(c.timeEntry._lastInput&&c.timeEntry._handlingSpinner){c.timeEntry._showField(g)}c.timeEntry._handlingSpinner=false},_getSpinnerTarget:function(e){return e.target||e.srcElement},_getSpinnerRegion:function(k,g){var p=this._getSpinnerTarget(g);var m=(c.browser.opera||c.browser.safari?c.timeEntry._findPos(p):c(p).offset());var h=(c.browser.safari?c.timeEntry._findScroll(p):[document.documentElement.scrollLeft||document.body.scrollLeft,document.documentElement.scrollTop||document.body.scrollTop]);var f=this._get(k,"spinnerIncDecOnly");var i=(f?99:g.clientX+h[0]-m.left-(c.browser.msie?2:0));var n=g.clientY+h[1]-m.top-(c.browser.msie?2:0);var l=this._get(k,(k._expanded?"spinnerBigSize":"spinnerSize"));var o=(f?99:l[0]-1-i);var e=l[1]-1-n;if(l[2]>0&&Math.abs(i-o)<=l[2]&&Math.abs(n-e)<=l[2]){return 0}var j=Math.min(i,n,o,e);return(j==i?1:(j==o?2:(j==n?3:4)))},_changeSpinner:function(e,g,f){c(g).css("background-position","-"+((f+1)*this._get(e,(e._expanded?"spinnerBigSize":"spinnerSize"))[0])+"px 0px")},_findPos:function(g){var f=curTop=0;if(g.offsetParent){f=g.offsetLeft;curTop=g.offsetTop;while(g=g.offsetParent){var e=f;f+=g.offsetLeft;if(f<0){f=e}curTop+=g.offsetTop}}return{left:f,top:curTop}},_findScroll:function(g){var f=false;c(g).parents().each(function(){f|=c(this).css("position")=="fixed"});if(f){return[0,0]}var h=g.scrollLeft;var e=g.scrollTop;while(g=g.parentNode){h+=g.scrollLeft||0;e+=g.scrollTop||0}return[h,e]},_get:function(f,e){return(f.options[e]!=null?f.options[e]:c.timeEntry._defaults[e])},_parseTime:function(h){var g=this._extractTime(h);var f=this._get(h,"showSeconds");if(g){h._selectedHour=g[0];h._selectedMinute=g[1];h._selectedSecond=g[2]}else{var e=this._constrainTime(h);h._selectedHour=e[0];h._selectedMinute=e[1];h._selectedSecond=(f?e[2]:0)}h._secondField=(f?2:-1);h._ampmField=(this._get(h,"show24Hours")?-1:(f?3:2));h._lastChr="";h._field=Math.max(0,Math.min(Math.max(1,h._secondField,h._ampmField),this._get(h,"initialField")));if(h.input.val()!=""){this._showTime(h)}},_extractTime:function(l){var o=l.input.val();var k=this._get(l,"separator");var f=o.split(k);if(k==""&&o!=""){f[0]=o.substring(0,2);f[1]=o.substring(2,4);f[2]=o.substring(4,6)}var e=this._get(l,"ampmNames");var n=this._get(l,"show24Hours");if(f.length>=2){var m=!n&&(o.indexOf(e[0])>-1);var j=!n&&(o.indexOf(e[1])>-1);var i=parseInt(f[0],10);i=(isNaN(i)?0:i);i=((m||j)&&i==12?0:i)+(j?12:0);var h=parseInt(f[1],10);h=(isNaN(h)?0:h);var g=(f.length>=3?parseInt(f[2],10):0);g=(isNaN(g)||!this._get(l,"showSeconds")?0:g);return this._constrainTime(l,[i,h,g])}return null},_constrainTime:function(l,f){var k=(f!=null);if(!k){var g=this._determineTime(this._get(l,"defaultTime"))||new Date();f=[g.getHours(),g.getMinutes(),g.getSeconds()]}var j=false;var e=this._get(l,"timeSteps");for(var h=0;h<e.length;h++){if(j){f[h]=0}else{if(e[h]>1){f[h]=Math.round(f[h]/e[h])*e[h];j=true}}}return f},_showTime:function(g){var e=this._get(g,"show24Hours");var h=this._get(g,"separator");var f=(this._formatNumber(e?g._selectedHour:((g._selectedHour+11)%12)+1)+h+this._formatNumber(g._selectedMinute)+(this._get(g,"showSeconds")?h+this._formatNumber(g._selectedSecond):"")+(e?"":this._get(g,"ampmPrefix")+this._get(g,"ampmNames")[(g._selectedHour<12?0:1)]));this._setValue(g,f);this._showField(g)},_showField:function(i){var h=i.input[0];if(i.input.is(":hidden")||c.timeEntry._lastInput!=h){return}var j=this._get(i,"separator");var e=j.length+2;var k=(i._field!=i._ampmField?(i._field*e):(i._ampmField*e)-j.length+this._get(i,"ampmPrefix").length);var f=k+(i._field!=i._ampmField?2:this._get(i,"ampmNames")[0].length);if(h.setSelectionRange){h.setSelectionRange(k,f)}else{if(h.createTextRange){var g=h.createTextRange();g.moveStart("character",k);g.moveEnd("character",f-i.input.val().length);g.select()}}if(!h.disabled){h.focus()}},_formatNumber:function(e){return(e<10?"0":"")+e},_setValue:function(f,e){if(e!=f.input.val()){f.input.val(e).trigger("change")}},_changeField:function(f,h,g){var e=(f.input.val()==""||f._field==(h==-1?0:Math.max(1,f._secondField,f._ampmField)));if(!e){f._field+=h}this._showField(f);f._lastChr="";c.data(f.input[0],d,f);return(e&&g)},_adjustField:function(f,g){if(f.input.val()==""){g=0}var e=this._get(f,"timeSteps");this._setTime(f,new Date(0,0,0,f._selectedHour+(f._field==0?g*e[0]:0)+(f._field==f._ampmField?g*12:0),f._selectedMinute+(f._field==1?g*e[1]:0),f._selectedSecond+(f._field==f._secondField?g*e[2]:0)))},_setTime:function(i,j){j=this._determineTime(j);var e=this._constrainTime(i,j?[j.getHours(),j.getMinutes(),j.getSeconds()]:null);j=new Date(0,0,0,e[0],e[1],e[2]);var j=this._normaliseTime(j);var f=this._normaliseTime(this._determineTime(this._get(i,"minTime")));var h=this._normaliseTime(this._determineTime(this._get(i,"maxTime")));j=(f&&j<f?f:(h&&j>h?h:j));var g=this._get(i,"beforeSetTime");if(g){j=g.apply(i.input[0],[this._getTimeTimeEntry(i.input[0]),j,f,h])}i._selectedHour=j.getHours();i._selectedMinute=j.getMinutes();i._selectedSecond=j.getSeconds();this._showTime(i);c.data(i.input[0],d,i)},_determineTime:function(g){var f=function(i){var h=new Date();h.setTime(h.getTime()+i*1000);return h};var e=function(n){var l=new Date();var h=l.getHours();var m=l.getMinutes();var i=l.getSeconds();var k=/([+-]?[0-9]+)\s*(s|S|m|M|h|H)?/g;var j=k.exec(n);while(j){switch(j[2]||"s"){case"s":case"S":i+=parseInt(j[1],10);break;case"m":case"M":m+=parseInt(j[1],10);break;case"h":case"H":h+=parseInt(j[1],10);break}j=k.exec(n)}l=new Date(0,0,10,h,m,i,0);if(/^!/.test(n)){if(l.getDate()>10){l=new Date(0,0,10,23,59,59)}else{if(l.getDate()<10){l=new Date(0,0,10,0,0,0)}}}return l};return(g?(typeof g=="string"?e(g):(typeof g=="number"?f(g):g)):null)},_normaliseTime:function(e){if(!e){return null}e.setFullYear(1900);e.setMonth(0);e.setDate(0);return e},_handleKeyPress:function(j,i){if(i==this._get(j,"separator")){this._changeField(j,+1,false)}else{if(i>="0"&&i<="9"){var n=parseInt(i,10);var m=parseInt(j._lastChr+i,10);var l=this._get(j,"show24Hours");var h=(j._field!=0?j._selectedHour:(l?(m<24?m:n):(m>=1&&m<=12?m:(n>0?n:j._selectedHour))%12+(j._selectedHour>=12?12:0)));var g=(j._field!=1?j._selectedMinute:(m<60?m:n));var f=(j._field!=j._secondField?j._selectedSecond:(m<60?m:n));var k=this._constrainTime(j,[h,g,f]);this._setTime(j,new Date(0,0,0,k[0],k[1],k[2]));j._lastChr=i}else{if(!this._get(j,"show24Hours")){var e=this._get(j,"ampmNames");if((i==e[0].substring(0,1).toLowerCase()&&j._selectedHour>=12)||(i==e[1].substring(0,1).toLowerCase()&&j._selectedHour<12)){var o=j._field;j._field=j._ampmField;this._adjustField(j,+1);j._field=o;this._showField(j)}}}}}});function a(g,f){c.extend(g,f);for(var e in f){if(f[e]==null){g[e]=null}}return g}c.fn.timeEntry=function(f){var e=Array.prototype.slice.call(arguments,1);if(typeof f=="string"&&(f=="isDisabled"||f=="getTime")){return c.timeEntry["_"+f+"TimeEntry"].apply(c.timeEntry,[this[0]].concat(e))}return this.each(function(){var h=this.nodeName.toLowerCase();if(h=="input"){if(typeof f=="string"){c.timeEntry["_"+f+"TimeEntry"].apply(c.timeEntry,[this].concat(e))}else{var g=(c.fn.metadata?c(this).metadata():{});c.timeEntry._connectTimeEntry(this,c.extend(g,f))}}})};c.timeEntry=new b()})(jQuery);(function(a){a.fn.bgIframe=a.fn.bgiframe=function(c){if(a.browser.msie&&/6.0/.test(navigator.userAgent)){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},c||{});var d=function(e){return e&&e.constructor==Number?e+"px":e},b='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(c.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":d(c.top))+";left:"+(c.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":d(c.left))+";width:"+(c.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":d(c.width))+";height:"+(c.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":d(c.height))+';"/>';return this.each(function(){if(a("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(b),this.firstChild)}})}return this}})(jQuery);MFNamespace("MFWA.Utils",function(c){var b=MFNamespace("MFWA.Debug.Assert");var a=0;return{extend:function(d,f){for(var e in f.prototype){d.prototype[e]=f.prototype[e]}d.prototype.base=f},unique:function(d){return d+a++},extractPath:function(g,e){g=g.split(".");var f=e;for(var d in g){if(!f){break}var h=g[d];f=f[h]}return f},getUTCTime:function(e){var d=e.getTimezoneOffset();e.setTime(e.getTime()-d*60*1000);return e},strToDate:function(i,e){var g=/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)\.?(\d{0,3}d?)\d*\s*(.*)/;var k=g.exec(i);b.exists(k,"Invalid date "+i);b.isTrue(k[8]=="Z","Date must be UTC but instead is '"+k[8]+"'");var d=k[7];while(d.length<3){d+=0}var f=new Date(+k[1],+k[2]-1,+k[3],+k[4],+k[5],+k[6],+k[7]);if(!e){var j=f.getTime();var l=f.getTimezoneOffset()*60000;var h=j-l;f.setTime(h)}return f},dateToStr:function(d){return d.toJSON()},copyLocalToUTCDate:function(d){var e=new Date();e.setUTCDate(d.getDate());e.setUTCMonth(d.getMonth());e.setUTCFullYear(d.getFullYear());e.setUTCHours(d.getHours());e.setUTCMinutes(d.getMinutes());e.setUTCSeconds(d.getSeconds());e.setUTCMilliseconds(d.getMilliseconds());return e},copyUTCToLocalDate:function(e){var d=new Date();d.setDate(e.getUTCDate());d.setMonth(e.getUTCMonth());d.setFullYear(e.getUTCFullYear());d.setHours(e.getUTCHours());d.setMinutes(e.getUTCMinutes());d.setSeconds(e.getUTCSeconds());d.setMilliseconds(e.getUTCMilliseconds());return d},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(f){var e=/\{\d+\}/g;var d=arguments;return f.replace(e,function(g){return d[g.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(d){if(typeof d==="object"&&d!==null&&d.constructor!=Date){var f;if(d.constructor===Array){f=[]}else{f={}}for(var e in d){f[e]=c.copy(d[e])}return f}else{return d}},escape:function(g){if(!g){return null}var d=new Array(g.length);for(var e=0;e<g.length;e++){var h=g.charAt(e);if(h=="<"){d[e]="&lt;"}else{if(h==">"){d[e]="&gt;"}else{if(h=="&"){d[e]="&amp;"}else{if(h=='"'){d[e]="&quot;"}else{d[e]=h}}}}}var f=d.join("");return f},encodeURIPart:function(g){if(g=="$0"){return g}var f=encodeURIComponent(g);var d="";for(var e=0;e<f.length;e++){switch(f[e]){case"_":d=d.concat("_u");break;case"%":d=d.concat("_p");break;case"*":d=d.concat("_a");break;case".":d=d.concat("_s");break;case"'":d=d.concat("_q");break;default:d=d.concat(f.charAt(e));break}}return d},getBrowserLocale:function(){if(navigator){var e=navigator.language;var g=navigator.browserLanguage;var f=navigator.systemLanguage;var d=navigator.userLanguage;if(e){return e}else{if(g){return g}else{if(f){return f}else{if(d){return d}}}}}return""},getBrowserTimeZoneOffset:function(){var d=new Date();var e=d.getTimezoneOffset()*60000;return e},typedValueExists:function(d){if(d){if(d.Value||d.Value===0||d.Value===false||d.Lookup||d.Lookups){return true}else{return false}}return false},ACLequals:function(d,f){if(!d||!f){return false}if(d.length!=f.length){return false}if(d.length>1){d.sort(function(h,g){return h.UserOrGroupID-g.UserOrGroupID})}if(f.length>1){f.sort(function(h,g){return h.UserOrGroupID-g.UserOrGroupID})}for(var e=0;e<d.length;++e){if((d[e].UserOrGroupID!=f[e].UserOrGroupID)||(d[e].IsGroup!=f[e].IsGroup)||(d[e].ChangePermissionsPermission!=f[e].ChangePermissionsPermission)||(d[e].EditPermission!=f[e].EditPermission)||(d[e].ReadPermission!=f[e].ReadPermission)){return false}}return true},getSearchResultLimit:function(){var e=MFWA.Utils.getBrowserVersion();var d=500;if(e.msie){if(e.realIEversion=="IE6"){d=50}else{if(e.realIEversion=="IE7"){d=200}else{d=300}}}return d},getBrowserVersion:function(){var d={realIEversion:null};if($.browser.msie){if($.browser.version<7){d.realIEversion="IE6"}else{if($.browser.version<8&&!/Trident/.exec(navigator.userAgent)){d.realIEversion="IE7"}else{if($.browser.version<9){d.realIEversion="IE8"}else{d.realIEversion="IEnew"}}}}return $.extend({},$.browser,d)}}});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(n){var m=this.get();var l=this;if(n==m){return}b.save(function(){l._set(n)},function(){l._set(m)})}};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="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="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(j,k){d.updateObject(j,k)},addItem:function(j){d.addItem(j)},updateItem:function(j){d.updateItem(j)},removeItem:function(j){d.removeItem(j)},setFolderListing:function(j){d.setFolderListing(j)},getListingMode:function(){return d.getViewMode()},setListingMode:function(j){d.setViewMode(j)},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){window.location="login.aspx?timeout=true"}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(q){var i=MFNamespace("MFWA.Data.Ajax");var f=MFNamespace("MFWA.StringBuilder");var b=MFNamespace("MFWA.Debug");var j=MFNamespace("MFWA.Utils");var n=i.get;var k=null;var c=null;var g={};var a={};var m={};var p=null;var l=null;var e={};var d={};var o={};function h(t,x,w,u,s){var r="./REST/valuelists";if(t==true){r+="bypropdefid"}r+="/"+x+"/items.aspx";var v=new Array();if(u){if(u.text){v.push("filter="+u.text)}if(u.item&&u.item.values.length>0){v.push("filterItem="+u.item.type+":"+u.item.values.join(","))}}if(s){v.push("selected="+s)}if(v.length>0){r=r+"?"+v.join("&")}return n(r,w)}return{getClassesByGroup:function(r,s){r=r*1;if(!m[r]){return n("./REST/objects/"+r+"/classes.aspx?byGroup=true",function(t){m[r]=t;s(t)})}else{s(m[r])}},getClass:function(s,t,r){if(!e[s]){return n("./REST/structure/classes/"+s+".aspx",function(u){e[s]=u;t(u)},r)}else{t(e[s])}},getClassInfo:function(s,t){if(!e[s]||!d[s]||!o[s]){return n("./REST/structure/classes/"+s+"/full.aspx",function(u){e[s]=u;d[s]=u.Templates;o[s]=u.AssociatedPropertyDefs;t(u)})}else{var r=e[s];r.Templates=d[s];r.AssociatedPropertyDefs=o[s];t(e[s])}},resolvePropertyDefs:function(w,x,s,y){var v={};var r=new Array();for(var u=0;u<w.length;u++){var t=w[u][x];if(k[t]){w[u][s]=k[t]}else{v[t]=w[u];r.push(t)}}if(r.length==0){y()}else{return n("./REST/structure/propertyDefs.aspx",function(A){for(var z=0;z<A.length;z++){var B=A[z];k[B.ID]=B;if(v[B.ID]){v[B.ID][s]=B}}y()})}},ensureObjectProperties:function(r,s){if(r.Properties){s(r)}else{return q.getProperties(r.ObjVer,function(t){s({ObjectVersion:r,Properties:t})})}},getPropertyDefs:function(r){if(k){r(k)}else{return n("./REST/structure/propertyDefs.aspx",function(s){k=s;r(s)})}},getPropertyDefsByID:function(r){if(c){r(c)}else{q.getPropertyDefs(function(s){if(!c){c={};for(var t in s){c[s[t].ID]=s[t];g[s[t].ID]=s[t]}}r(c)})}},getPropertyDef:function(s,r){if(g[s]){r(g[s])}else{return n("./REST/structure/propertyDefs/"+s+".aspx",function(t){g[s]=t;r(t)})}},getValueList:function(r,s){if(a[r]){s(a[r])}else{return n("./REST/valueLists/"+r+".aspx",function(t){a[r]=t;s(t)})}},getObjectType:function(r,s){if(a[r]){s(a[r])}else{return n("./REST/objects/"+r+".aspx",function(t){a[r]=t;s(t)})}},getValueListItems:function(t,u,s,r){return h(false,t,u,s,r)},getValueListItemsByPropDefID:function(r,u,t,s){return h(true,r,u,t,s)},getWorkflows:function(r){if(l){r(l)}else{return n("./REST/structure/workflows.aspx",function(s){l=s;r(s)})}},getWorkflowsForObject:function(r,s){return n("./REST/structure/workflows.aspx?object="+r.Type+","+r.ID+","+r.Version,s)},getStatesForWorkflow:function(s,r,t){if(t){return n("./REST/structure/workflows/"+s+"/states/"+r+".aspx",t)}else{return n("./REST/structure/workflows/"+s+"/states.aspx",r)}},getNACLs:function(r){return n("./REST/structure/namedacls.aspx",r)},getObjectVersion:function(s,u,r,t){if(!r&&!t){t=u;r=s.Version;u=s.ID;s=s.Type}else{if(!t){t=r;r="latest"}}return n("./REST/objects/"+s+"/"+u+"/"+r+".aspx",t)},getObjectVersionOrHandleError:function(s,u,v){var t=s.Type;var w=s.ID;var r=s.Version;return n("./REST/objects/"+t+"/"+w+"/"+r+".aspx",u,v)},getProperties:function(t,v,r,u,s){if(!r&&!u&&!s){u=v;r=t.Version;v=t.ID;t=t.Type}else{if(!u&&!s){u=r;r="latest"}}return n("./REST/objects/"+t+"/"+v+"/"+r+"/properties.aspx",u,s)},getPropertiesForDisplay:function(s,u,r,t){if(!r&&!t){t=u;r=s.Version;u=s.ID;s=s.Type}else{if(!t){t=r;r="latest"}}return n("./REST/objects/"+s+"/"+u+"/"+r+"/displayproperties.aspx",t)},getPropertiesOfMultipleObjects:function(s,t){if(s&&s.length>0){return i.post("./REST/objects/getpropsofmultipleobjects.aspx",s,t)}else{var r=[];t(r)}},getVersionComments:function(s,u,r,t){if(!r&&!t){t=u;r=s.Version;u=s.ID;s=s.Type}else{if(!t){t=r;r="latest"}}return n("./REST/objects/"+s+"/"+u+"/"+r+"/comments.aspx",t)},getNACL:function(s,u,r,t){return n("./REST/objects/"+s+"/"+u+"/"+r+"/nacl.aspx",t)},getWorkflowState:function(s,u,r,t){if(!r&&!t){t=u;r=s.Version;u=s.ID;s=s.Type}else{if(!t){t=r;r="latest"}}return n("./REST/objects/"+s+"/"+u+"/"+r+"/workflowstate.aspx",t)},getViewContents:function(s,t){var r=j.getSearchResultLimit();return n("./REST/views"+s+"/folders.aspx?limit="+r,t)},performSearch:function(s,w){var G={SearchInMetadata:"qm",SearchInFileContents:"qf",SearchInBoth:"qb"};var z={AnyWord:"n",Boolean:"b",AllWords:"a"};var y={isNot:"!=",isNotEmpty:"!=",">":">>=",greaterThan:">>=",isAfter:">>=","<":"<<=",lessThan:"<<=",isBefore:"<<=",greaterOrEqualThan:">=",">=":">=",lessOrEqualThan:"<=","<=":"<=",contains:"*=",startsWith:"^=",is:"=",isEmpty:"=",today:"=",withinTheLastWeek:"=",withinTheLastMonth:"=",withinTheLastYear:"="};var x=new f.StringBuilder();for(var E=0;E<s.array.length;E++){var t=s.array[E];if(t.SearchString!=""){x.append("&").append(E).append("_");x.append(G[t.SearchIn]);if(t.SearchType){x.append(z[t.SearchType])}else{x.append(z.AllWords)}x.append("=");var I=j.encodeURIPart(t.SearchString);x.append(I)}if(t.SearchObjectType!="All"){x.append("&").append(E).append("_o=");x.append(t.SearchObjectType)}var C=t.PropertyCriteria;for(var D=0;D<C.length;D++){var r=C[D];var u=new f.StringBuilder();if(r.Property!="empty"){var v=r.Property.substring(0,2);var B=r.Property.substring(3);if(v=="VL"){u.append("vl").append(B)}else{if(v=="PV"){if(r.DataType){u.append("p").append(r.DataType).append(B)}else{u.append("p").append(B)}}else{continue}}if(r.DataFunction){u.append("f").append(r.DataFunction)}u.append(y[r.Condition]);var H=j.encodeURIPart(r.TypedValue);u.append(H)}u=u.toString();if(u!=""){x.append("&").append(String(E)).append(String(D)).append("_").append(u)}}}x=x.toString();if(x.length>0){x=x.substring(1)}var A="";if(s.path){A=s.path}else{A="/_tempsearch"}if(x.length>0){x="&"+x}var F=j.getSearchResultLimit();return n("./REST/views"+A+"/search.aspx?limit="+F+x,w)},getUserID:function(r){if(p){r(p)}else{return n("./REST/session/userid.aspx",function(s){p=s;r(s)})}},getComputerName:function(r){return n("./REST/session/computername.aspx",r)},canForceUndoCheckout:function(r){return n("./REST/session/canforceundocheckout.aspx",r)},getCurrentTimestamp:function(r){return n("./REST/structure/currenttimestamp.aspx",r)},Commands:{logout:function(r){return n("./REST/session.aspx?_method=DELETE",r)}}}});MFNamespace("MFWA.Data.Operations",function(a){var f=MFNamespace("MFWA.Data.Ajax");var e=MFNamespace("MFWA.MFWA");var d=f.get;var c=function(){return function(g){if(g.Status==403){window.location="login.aspx"}else{alerts.ShowError(g)}}};var b=function(){return function(g){e.setSessionInfo(g)}};return{logout:function(g){return f.del("./REST/session.aspx",g)},loginUser:function(l,i,j,h,k,g){return f.put("./REST/session.aspx",{Username:l,Password:i,Domain:j,WindowsUser:h},k,g)},loginVault:function(h,i,g){return f.put("./REST/session/vault.aspx",h,i,g)},putTimezoneOffset:function(g){return f.put("./REST/session/timezoneoffset.aspx",g)},putLocale:function(g){return f.put("./REST/session/locale.aspx",g)},updateSessionInfo:function(){return d("./REST/session/sessioninfo.aspx",b(),c())},addEmptyFile:function(j,g,k,i){var h=g.title+"."+g.extension;return f.put("./REST/objects/"+j.Type+"/"+j.ID+"/"+j.Version+"/addemptyfile.aspx",h,k,i)},commitUpload:function(g,i,j,h){return f.put("./REST/files/"+g.uploadID+"/"+i.ID+"/"+i.Version+"/"+g.size+"/commit.aspx",null,j,h)},changePassword:function(h,j,k,i){var g={NewPassword:j,OldPassword:h};return f.put("./REST/session/password.aspx",g,k,i)},getObjectHistory:function(h,i,g){return d("./REST/objects/"+h.Type+"/"+h.ID+"/history.aspx",i,g)},getCollectionMembers:function(h,i,g){return d("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/collectionmembers.aspx",i,g)},getRelationships:function(h,i,g){return d("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/relationships.aspx",i,g)},getSubobjects:function(h,i,g){return d("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/subobjects.aspx",i,g)},getMFDContents:function(i,h,g){return d("./REST/objects/"+i.objVer.Type+"/"+i.objVer.ID+"/"+i.objVer.Version+"/mfdcontents.aspx?parentView="+i.parentViewSettingsID,h,g)},setProperties:function(h,i,j,g){if(h.ObjVer){h=h.ObjVer}return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/properties.aspx",i,j,g)},setWorkflowState:function(h,i,j,g){return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/setworkflowstate.aspx",i,j,g)},setNACL:function(h,i,j,g){return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/nacl.aspx",i,j,g)},setSingleFileObject:function(i,h,j,g){if(h==true){return d("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/setsinglefile.aspx",j,g)}else{return d("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/setmultifile.aspx",j,g)}},markComplete:function(h,i,g){return d("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/markcomplete.aspx",i,g)},renameObject:function(i,g,j,h){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/rename.aspx",g,j,h)},renameFile:function(i,j,g,k,h){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/files/"+j.ID+"/"+j.Version+"/rename.aspx",g,k,h)},createObject:function(k,j,m,g){if(typeof k=="number"){k={objType:k}}var i={checkIn:k.checkIn};var l="";for(var h in i){if(l.length==0){l="?"}else{l+="&"}l+=h+"="+i[h]}return f.post("./REST/objects/"+k.objType+".aspx"+l,j,m,g)},deleteObject:function(h,i,g){return f.del("./REST/objects/"+h.Type+"/"+h.ID+".aspx",i,g)},deleteFile:function(h,i,j,g){return f.del("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/files/"+i.ID+"/"+i.Version+".aspx",j,g)},checkOut:function(h,i,g){return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/checkedout.aspx",true,i,g)},checkIn:function(h,i,g){return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/checkedout.aspx",false,i,g)},undoCheckout:function(h,i,g){return f.del("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/checkedout.aspx",i,g)},forceUndoCheckout:function(h,i,g){return d("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/forceundocheckout.aspx",i,g)},addValueListItem:function(i,h,j,g){if(typeof h=="string"){h={Name:h}}return f.post("./REST/valuelists/"+i+"/items.aspx",h,j,g)},setVersionComment:function(i,g,j,h){return f.put("./REST/objects/"+i.Type+"/"+i.ID+"/"+i.Version+"/addcomment.aspx",g,j,h)},setColumnInfos:function(i,h,j,g){return f.put("./REST/viewsettings/"+i+"/columns.aspx",h,j,g)},setViewMode:function(g,h){return f.put("./REST/viewsettings/"+g+"/viewmode.aspx",h)}}});MFNamespace("MFWA.Handlers.PropertyHandlers",function(j){var e=MFNamespace("MFWA.Data.Cache");var a=MFNamespace("MFWA.Data.Operations");var h=MFNamespace("MFWA.Dialogs.DocumentCard");var c=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var g=MFNamespace("MFWA.Dialogs.Alerts");var b=MFNamespace("MFWA.MFWA");var i=MFNamespace("MFWA.Utils");var d=function(l,r){var n={};for(var k in l){var q=l[k];n[q.PropertyDef]=q}var p=[];for(var k in r.AssociatedPropertyDefs){var o=r.AssociatedPropertyDefs[k];if(!o.Required){continue}if(!c.shownInProperties(o.PropertyDef)||!c.usedInCreation(o.PropertyDef)){continue}if(n[o.PropertyDef].IsAutomatic){continue}var m=n[o.PropertyDef].TypedValue;if(!i.typedValueExists(m)){p.push(o)}}return p};var f=function(k,l){return function(m){var n=m.window;var p=m.result;var q=d(p.Properties,p.Class);if(q.length>0){g.RequiredPropertyMissing(q[0].PropertyDef);if(l){l()}return false}for(var o in p.Properties){p.Properties[o]={PropertyDef:p.Properties[o].PropertyDef,TypedValue:p.Properties[o].TypedValue}}a.setProperties(k,p.Properties,function(r){a.setNACL(r.ObjectVersion.ObjVer,p.AccessControlList,function(s){if(l&&s.VisibleAfterOperation){l(s)}else{if(l){l(null)}}n.close()})});return false}};return{getMissingProperties:d,getMissingProperty:function(k,m){var l=d(k,m);if(l.length>0){return l[0]}else{return null}},editObject:function(k,l){e.getObjectType(k.ObjVer.Type,function(m){h.ShowEditObjectWindow({objectVersion:k,objType:m},f(k,l))})}}});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<1000&&(b!=22&&b!=26&&b!=38&&b!=39)){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!=36&&b!=37&&(b<41||b>47)){return false}return true},isAdditionalProperty:function(b){if(b<1000&&b!=34&&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==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==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 d=MFNamespace("MFWA.I18n");var c=MFNamespace("MFWA.I18n.DocumentCard");var b=MFNamespace("MFWA.I18n.Upload");return{createDocumentCard:function(){var S=$('<div id="doccard" class="documentcard"/>');var r=$('<div class="doccard_top" />');var n=a.unique("doccard");var o=$('<label for="'+n+'">'+c.Class+"</label>");var N=$('<select id="'+n+'" class="doccard_class" />');r.append($('<div class="doccard_class" />').append($('<div class="label_group">').append(o)).append($('<div class="wrap" />').append(N)));var A=a.unique("doccard");var V=a.unique("doccard");var G=a.unique("doccard");var K=$('<input type="checkbox" id="'+V+'" name="'+A+'" value="template" />');var H=$('<label for="'+V+'">'+c.UseTemplate+"</label>");var P=$('<input type="radio" id="'+G+'" name="'+A+'" value="template" />');var f=$('<label for="'+G+'">'+c.UseTemplate+"</label>");var h=$('<select class="doccard_template" />');K.click(function(){if(K.is(":checked")){h.attr("disabled",false)}else{h.attr("disabled",true)}});var C=$('<div class="label_group" id="template_radio_label">').append(P).append(f);var q=$('<div class="label_group" id="template_checkbox_label">').append(K).append(H);var E=$('<div class="doccard_template" />').append(C).append(q).append($('<div class="wrap">').append(h));r.append(E);var B=a.unique("doccard");var Q=$('<input type="radio" id="'+B+'" name="'+A+'" value="mfd" />');var g=$('<label for="'+B+'">'+c.CreateEmptyMFD+"</label>");var F=$('<div class="doccard_emptyMFD">').append($('<div class="label_group">').append(Q).append(g));r.append(F);var O=a.unique("doccard");var s=$('<input type="radio" id="'+O+'" name="'+A+'" value="sfd" />');var x=$('<label for="'+O+'">'+c.CreateEmptySFD+"</label>");$([]).add(P).add(s).add(Q).click(function(){h.attr("disabled",this!==P[0])});var j=$('<div class="doccard_emptySFD">').append($('<div class="label_group">').append(s).append(x));r.append(j);var p=$('<div class="doccard_properties_label">'+c.Properties+"</div>");var t=$('<table class="doccard_middle"/>');var L=$('<div class="doccard_middle" />').append(t);var i=$('<div class="doccard_bottom">');var w=$('<button class="doccard_relationships">'+c.Relationships+"</button>");var R=$('<button class="doccard_moreProperties">'+c.MoreProperties+"</button>");i.append($('<div class="doccard_buttons" />').append(w).append(R));var e=$("<label>"+c.Permissions+"</label>");var k=$('<select class="doccard_permissions" />');var D=$('<div class="doccard_permissions" />').append($('<div class="label_group">').append(e)).append($('<div class="wrap" />').append(k));i.append(D);var W=$("<label>"+c.Workflow+"</label>");var v=$('<select class="doccard_wf" />');var y=$('<div class="doccard_wf" />').append($('<div class="label_group">').append(W)).append($('<div class="wrap" />').append(v));i.append(y);var U=a.unique("doccard");var z=$('<input type="checkbox" id="'+U+'">');var T=$('<label for="'+U+'">'+c.OpenForEditing+"</label>");var u=$('<div class="left" />').append(z).append(T);var l=a.unique("doccard");var M=$('<input type="checkbox" id="'+l+'">');var m=$('<label for="'+l+'">'+c.CheckInImmediately+"</label>");M.click(function(){if(z.is(":checked")&&M.is(":checked")){z.attr("checked",false)}});z.click(function(){if(z.is(":checked")&&M.is(":checked")){M.attr("checked",false)}});var J=$('<div class="right" />').append(M).append(m);var I=$('<div class="doccard_checkboxes">').append(u).append(J);i.append(I);S.append(r,p,L,i);return{documentcard:S,top:r,middle:L,bottom:i,middleContent:t,classSelect:N,templateSelect:h,radioGroupName:A,templateRadio:P,templateCheck:K,templateRadioLabelGroup:C,templateCheckLabelGroup:q,sfdRadio:s,mfdRadio:Q,relationships:w,moreProperties:R,checkInCheck:M,openCheck:z,permissions:k,workflow:v,groups:{template:E,sfd:j,mfd:F,relationships:w,permissions:D,workflow:y,open:u,checkIn:J,checkboxes:I}}},createMorePropertiesWindow:function(){var i=a.unique("doccard");var e=$('<select size="9" id="'+i+'" class="more_properties" />');var g=$("<button>"+d.Add+"</button>");var f=$("<button>"+d.Close+"</button>");e.dblclick(function(){g.click()});var h=$('<div class="more_properties"/>');h.append(e,f,g);return{window:h,list:e,add:g,close:f}},createUploadDialog:function(){var f=$("<div>"+b.Help+"</div>");var h=$('<iframe src="UploadFrame.aspx">').css({width:"100%",height:60});var e=$('<ul style="height:150px;overflow:auto;"/>');var g=$('<div class="upload"/>').append(f,h,e);return{dialog:g,upload:h,fileList:e}},createUploadFileItem:function(i,e){var k=$("<div>");var h=i.title;if(i.extension&&i.extension!=""){h+="."+i.extension}var g=h+" ("+a.formatSize(i.size)+")";k.append(g);var f=$("<button>"+b.Remove+"</button>");var j=$("<li>").append(k,f);f.click(function(){j.remove();if(e){e()}});return j},createCommentsDialog:function(){var g=$('<div class="commentsDialog"/>');var h=$('<div id="commentArea"/>');var j=$('<div class="commentHeader"/>');var e=$("<textarea/>");h.append(j);h.append(e);g.append(h);var f=$('<div id="commentHistoryArea"/>');var i=$('<div id="commentHistory"/>');f.append('<div class="commentHeader">'+d.CommentsDialog.CommentHistory+"</div>");f.append(i);g.append(f);return{commentsDialog:g,newComment:e,newCommentArea:h,newCommentHeader:j,commentHistory:i,commentHistoryArea:f}},createChangePasswordDialog:function(){var e=$('<div class="changePassword"/>');var f=$('<input type="password" class="passwordField">');e.append($('<div class="changePasswordText">'+d.ChangePasswordDialog.OldPassword+"</div>"));e.append(f);var g=$('<input type="password" class="passwordField">');e.append($('<div class="changePasswordText">'+d.ChangePasswordDialog.NewPassword+"</div>"));e.append(g);var h=$('<input type="password" class="passwordField">');e.append($('<div class="changePasswordText">'+d.ChangePasswordDialog.NewPassword2+"</div>"));e.append(h);return{changePasswordDialog:e,oldPassword:f,newPassword:g,newPassword2:h}},createWorkflowDialog:function(){var i=$('<div class="workflowDialog"/>');var f=$('<div id="workflowArea"/>');var h=$('<div class="workflowHeader"/>');var n=$('<select id="workflow" onChange="MFNamespace(\'MFWA.Dialogs.Workflow\').updateStates();" />');f.append(h);f.append(n);var k=$('<div id="stateArea"/>');var j=$('<div class="workflowHeader"/>');var g=$('<select id="state"/>');k.append(j);k.append(g);var m=$('<div id="commentArea"/>');var e=$('<div class="workflowHeader"/>');var l=$('<textarea id="comment"/>');m.append(e);m.append(l);i.append(f);i.append(k);i.append(m);return{workflowDialog:i,workflowHeader:h,workflow:n,stateHeader:j,state:g,commentHeader:e,comment:l}},createErrorDialog:function(){var m=$('<div class="errorDialog"/>');var j=$('<div class="errorContextArea"/>');var g=$('<div class="shortErrorArea"/>');var l=$('<div class="openLongErrorArea">'+d.ErrorDialog.DetailsButton+"</div>");var e=$('<div class="longErrorDescription">'+d.ErrorDialog.DetailsText+"</div>");var i=$('<div class="longErrorArea"/>');var h=$('<div class="copyToClipboardContainer"></div>');var k=$("<button>"+d.ErrorDialog.CopyToClipboard+"</button>");var f=$('<div style="height:40px;"/>');m.append(j);m.append(g);m.append(l);if(window.clipboardData&&window.clipboardData.setData){m.append(h.append(k))}m.append(e);m.append(i);m.append(f);l.click(function(){e.toggle();i.toggle();h.toggle()});k.click(function(){window.clipboardData.setData("text",i.text())});return{errorDialog:m,errorContextArea:j,shortErrorArea:g,openLongErrorArea:l,longErrorArea:i,longErrorDescription:e}}}});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");return{RequiredPropertyMissing:function(f){b.getPropertyDef(f,function(g){c.ShowError(a.format(e.RequiredPropertyMissing,a.escape(g.Name)))})},PropertyValueNotFound:function(g,f){c.ShowError({Message:a.format(e.PropertyValueNotFound,a.escape(g)),Stack:f})},SelectOwnerPropertyFirst:function(f){b.getPropertyDef(f,function(g){c.ShowError(a.format(e.OwnerPropertyNotSelected,a.escape(g.Name)))})},CantAddNewValue:function(){c.ShowError(e.CantAddNewValue)},CantAddNewValueNotAllowed:function(){c.ShowError(e.CantAddNewValueNotAllowed)},CantAddNewValueAccessDenied:function(){c.ShowError(e.CantAddNewValueAccessDenied)},ShowError:function(f){if(typeof f=="string"){f={message:f}}else{f={stack:f.Stack,message:f.Message}}d.show(f)},ShowNotification:function(f){d.show({message:f,isNotification:true})}}});MFNamespace("MFWA.Dialogs.Error",function(){var h=MFNamespace("MFWA.I18n");var c=MFNamespace("MFWA.Window");var e=MFNamespace("MFWA.Pooling");var d=MFNamespace("MFWA.Dialogs.Templates");var b=MFNamespace("MFWA.Utils");function g(k){var l=k.substr(k.length-5,k.length-2);var j=parseInt(l);if(isFinite(j)==true){var i=k.substr(0,j);var m=k.substring(j,k.length-6);return{message:i,stack:m}}else{return{message:k,stack:null}}}function f(){return e.get("ErrorDialog",function(){var j=d.createErrorDialog();var i={jq:j,jqNode:j.errorDialog,resize:function(){},initialize:function(p){p=$.extend({},a,p);if(p.isNotification){p.title=h.Prompt.Title}var k=p.context;if(k){j.errorContextArea.append(k)}var l=p.message;if(l){j.shortErrorArea.append(l)}if(p.stack||p.rawstack){var o=(p.stack||p.rawstack);o=o.replace(/\r/g,"");var n=o.split("\n");for(var m in n){if(n[m]!=""){if(p.stack){j.longErrorArea.append("<div>"+b.escape(n[m])+"</div>")}else{j.longErrorArea.append("<div>"+n[m]+"</div>")}}}}return p}};return i})}var a={title:h.ErrorDialog.Title,context:"",stack:"",icon:null};return{show:function(j,l,i){var k=f();var j=k.initialize(j);return c.show(j.title,k,{width:550,noheight:true,position:["center",100],resizable:false,ok:function(m){if(l){return l(m)}else{return true}},buttons:{ok:true,cancel:false}})},extractMessages:g}});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,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"),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(y.nowidth==false){u.dialog("option","width",w);u.width(w-30)}else{u.dialog("option","width","auto")}if(u.dialog("option","resizable")!=y.resizable){u.dialog("option","resizable",y.resizable)}r={ok:y.ok,cancel:y.cancel};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","")}u.dialog("option","position",y.position);t({width:w,height:v});u.dialog("option","title",z);l.empty();l.append(x.jqNode);u.dialog("open");n=true;c+=1;if(i){i(c)}},close:function(){if(!n){return}n=false;o=new Array();u.dialog("close");l.empty()},okButtonPressed:false};u.dialog({modal:true,closeOnEscape:false,bgiframe:true,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)},close:function(){c-=1;if(i){i(c)}f.push(q)}});var m=function(v){return{close:function(){if(v){v.close()}},invalidate:function(){v=null},id:v.id}};q.ok=function(){if(q.okButtonPressed==true){return}q.okButtonPressed=true;setTimeout(function(){q.okButtonPressed=false},500);if(!r.ok){q.close()}var v=m(q);if(r.ok(v)!==false){v.invalidate();q.close()}};q.cancel=function(){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(b){var d=MFNamespace("MFWA.Pooling");var f=MFNamespace("MFWA.I18n");var e=MFNamespace("MFWA.Window");var a=MFNamespace("MFWA.Utils");var g=function(l){var m="empty";var h=null;var k=$('<div class="prompt"><div class="title"></div><input type="text" class="prompt"><div class="buttons"><button class="cancel">'+f.Cancel+'</button><button class="ok">'+f.OK+"</button></div></div>");var p=k.children("div.title");var q=k.children("input.prompt");var o=k.find("button.ok");var r=k.find("button.cancel");var j={window:k,title:p,input:q,ok:o,cancel:r};j.window.dialog({bgiframe:true,modal:true,closeOnEscape:true,resizable:false});var s=null;var i=function(){if(s!=null&&m(s,n)===false){s=null;return false}e.windowHidden();s=null;l.dispose();return true};j.window.bind("dialogbeforeclose",i);j.cancel.click(function(){s=null;if(h){h()}j.window.dialog("close")});j.ok.click(function(){s=j.input.val();j.window.dialog("close")});var n={jq:j,show:function(u,t){m=u;h=t;s=null;j.window.dialog("open");e.windowShown()},close:function(){s=null;if(cancelCallback){cancelCallback()}j.window.dialog("close")},initialize:function(t){j.window.dialog("option","title",t.title);j.title.html(t.message);j.ok.toggle(t.ok);j.cancel.toggle(t.cancel);j.input.val(t.value)}};return n};var c={title:f.Prompt.Title,message:f.Prompt.Message,ok:true,cancel:true,value:""};return{prompt:function(k,l,h){var i=d.get("Prompt",g);if(typeof k=="string"){var j=k;k=c;k.message=j}else{k=$.extend({},c,k)}i.initialize(k);i.show(l,h)}}});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="checkoutprompt"><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:true,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){j.find("div.namePrompt").html(a.format(f.CheckOutPrompt.PromptText,a.escape(q)).replace(/\n\n/g," "))}}};return{prompt:function(i,h){var g=d.get("CheckOutPrompt",b);g.initialize(i);g.show(h)}}});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:true});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(A){var a=MFNamespace("MFWA.Utils"),f=MFNamespace("MFWA.Debug.Assert"),n=MFNamespace("MFWA.Nulls"),u=MFNamespace("MFWA.Debug"),v=MFNamespace("MFWA.Dialog.Alerts"),r=MFNamespace("MFWA.I18n"),x=MFNamespace("MFWA.I18n.DocumentCard"),z=MFNamespace("MFWA.Data.Cache"),t=MFNamespace("MFWA.Pooling"),d=MFNamespace("MFWA.Enumerations"),i=MFNamespace("MFWA.Window"),g=MFNamespace("MFWA.Dialogs.Templates"),e=MFNamespace("MFWA.Dialogs.DocumentCard.MoreProperties"),p=MFNamespace("MFWA.Dialogs.DocumentCard.Filters"),y=MFNamespace("MFWA.Icons");viewItem=MFNamespace("MFWA.ViewItem");var s=function(){return t.get("DocumentCard",function(){var Q,U=g.createDocumentCard(),P,R,B=0,I=0;var S=function(X,Y,V){f.doesNotHaveValue(Q.propertiesByID,X.PropertyDef,"The property already exists in the datamodel.");var W=A.PropertyDef.create(X,Y);return L(W,V)};var L=function(W,V){f.doesNotHaveValue(Q.propertiesByID,W.PropertyID,"The property already exists in the datamodel.");Q.properties.push(W);Q.propertiesByID[W.PropertyID]=W;if(!V){T(W)}return W};var T=function(V){f.hasValue(Q.propertiesByID,V.PropertyID,"The property does not exist in the datamodel.");if(V.jq){if(A.Filters.isReadOnlyProperty(V.PropertyID)){U.middleContent.append(V.jq);if(!P){P=V.jq}}else{if(P){P.before(V.jq)}else{U.middleContent.append(V.jq)}}}};var J=function(X,V){if(typeof(X)=="object"){for(var W=0;W<Q.properties.length;W++){if(Q.properties[W]==X){X=W}}}if(typeof(X)=="number"){var Y=Q.properties[X];if(Y.boundProperty){Y.boundProperty.Observers[Y.PropertyID]=null}Q.properties.splice(X,1);Q.propertiesByID[Y.PropertyID]=null;if(Y.jq){Y.jq.remove()}return Y}else{return null}};var E=function(V,W){if(!W){return}if(W.Deleted||W.Hidden){return}z.getObjectType(V.PropertyDef.ValueList,function(X){if(X.RealObjectType){z.getProperties(V.PropertyDef.ValueList,W.Item,"latest",function(Y){z.getPropertyDefsByID(function(aa){f.exists(V.control);var ae={};var ac={};for(var af=0;af<Y.length;af++){var Z=Y[af];ae[Z.PropertyDef]=Z;var ab=Q.propertiesByID[Z.PropertyDef];if(Z.TypedValue&&Z.TypedValue.HasValue){if(!ac[aa[Z.PropertyDef].ValueList]){ac[aa[Z.PropertyDef].ValueList]=[]}ac[aa[Z.PropertyDef].ValueList].push(Z)}if(!ab||!ab.control){continue}if(A.Filters.isReadOnlyProperty(ab.PropertyID)){continue}if(ab.PropertyDef.DataType!=d.MFDataType.Lookup&&ab.PropertyDef.DataType!=d.MFDataType.MultiSelectLookup){continue}if(V.boundProperty&&V.boundProperty==ab){continue}var ad=ab.control.get();if(ad!=null){continue}if(profiling||confirm(a.format(x.AutoFillConfirm,W.DisplayValue,ab.PropertyDef.Name,Z.TypedValue.DisplayValue))){ab.control.set(Z.TypedValue,Z.ValueSource)}}if(V.boundProperty){var ag=function(ah){z.getValueList(V.boundProperty.PropertyDef.ValueList,function(ak){var ai=ah.control.get();if(ai.Lookup||ai.Lookups){return}var aj;if(ak.HasOwner&&ak.Owner==V.boundProperty.PropertyDef.ValueList){aj=ae[ak.OwnerPropertyDef];if(aj){ah.control.set(aj.TypedValue,V.control.getSource())}}else{if(ac[ak.ID]&&ac[ak.ID].length==1){aj=ac[ak.ID][0].TypedValue;var al;if(aj.DataType==d.MFDataType.MultiSelectLookup){al=aj.Lookups[0]}else{al=aj.Lookup}aj={DisplayValue:al.DisplayValue,DataType:ah.PropertyDef.DataType};if(aj.DataType==d.MFDataType.MultiSelectLookup){aj.Lookups=[al]}else{aj.Lookup=al}ah.control.set(aj,V.control.getSource())}}})}(V.boundProperty)}})},function(Y){MFWA.Dialogs.Alerts.PropertyValueNotFound(W.DisplayValue,Y.Stack)})}else{if(!X.HasOwner){return}z.getValueListItems(V.PropertyDef.ValueList,function(Y){for(var Z=0;Z<Y.length;++Z){if(Y[Z].ID==W.Item){z.getValueListItems(V.boundProperty.PropertyDef.ValueList,function(ab){for(var ad=0;ad<ab.length;++ad){if(ab[ad].ID==Y[Z].OwnerID){var ae=null;var ac=null;var aa=null;if(V.boundProperty.PropertyDef.DataType==d.MFDataType.MultiSelectLookup){aa=d.MFDataType.MultiSelectLookup;ac=[{Item:ab[ad].ID,DisplayValue:ab[ad].Name,Version:-1,Deleted:false,Hidden:false}]}else{aa=d.MFDataType.Lookup;ae={Item:ab[ad].ID,DisplayValue:ab[ad].Name,Version:-1,Deleted:false,Hidden:false}}V.boundProperty.control.set({DataType:aa,DisplayValue:ab[ad].Name,Lookup:ae,Lookups:ac},V.control.getSource());break}}});break}}})}})};var M=function(V){Q.properties=[];Q.propertiesByID={};P=null;if(!V){U.middleContent.empty()}};var G=function(V){z.getPropertyDefsByID(function(W){for(var X in Q.properties){var Y=Q.properties[X];Y.PropertyDef=W[Y.PropertyID]}V()})};var K=function(ad){var ah=Q.properties;var aa=[];for(var ac=0;ac<ah.length;ac++){ah[ac].Observers={};ah[ac].boundProperty=null}for(var ac=0;ac<ah.length;ac++){var X=ah[ac];var ag=X.PropertyDef;if(!X.jq){continue}if(!ag){continue}var Y=X.jq.children("td.property_name");var V=X.PropertyDef.Name;var aj=X.jq.children("td.property_control");var ae=false;if(!X.control||X.control.type!=ag.DataType){ae=true;aj.empty();var af=function(am){var al=0;am.control=A.Controls.getControl(ag,{change:function(ap,ao){for(var an in am.Observers){am.Observers[an](am,ap,ao)}if(am.PropertyDef.OwnerPropertyDef&&am.PropertyDef.OwnerPropertyDef.ID>0){var aq=Q.propertiesByID[am.PropertyDef.OwnerPropertyDef.ID];aq.control.filteredChanged(am.PropertyDef,ap)}},select:function(ap,ao,an){if(ao&&ao.Lookups&&ao.Lookups.length>1){return}if(!!an){D(an,ap.DisplayValue)}if(am.PropertyDef.DataType==d.MFDataType.Lookup||am.PropertyDef.DataType==d.MFDataType.MultiSelectLookup){E(am,ap)}},getBoundPropertyValue:function(){var an=am.boundProperty;if(!an){return null}return{ID:an.PropertyID,ValueList:an.PropertyDef.ValueList,Value:an.control.get()}}})}(X);aj.append(X.control.jq);if(X.Required){X.control.jq.append($('<div class="required">*</div>'))}var ab=false;if(Q.objectClass.AssociatedPropertyDefs){for(var ai=0;ai<Q.objectClass.AssociatedPropertyDefs.length;ai++){if(X.PropertyID==Q.objectClass.AssociatedPropertyDefs[ai].PropertyDef){ab=true;break}}}if(!ab&&!X.Required){var af=function(al){al.control.jq.append($('<div class="remove" style="background-image: url(\''+y.Commands.RemoveProperty+"');\"></div>").click(function(){J(al);K()}))}(X)}aa.push(X)}if(!ae&&ad){aa.push(X)}if(ag.OwnerPropertyDef){var ak=function(ao,al){var am=Q.propertiesByID[al.ID];var an=function(ar,aq,ap){ao.control.filter(ar,aq,ap)};am.Observers[ao.PropertyID]=an};var W=ag.OwnerPropertyDef;if(W.ID>0){var Z=Q.propertiesByID[W.ID];if(Z){f.exists(Z.PropertyDef);X.boundProperty=Z;ak(X,X.PropertyDef.OwnerPropertyDef)}}else{if(W.ID==-106){var af=function(al){z.getValueList(ag.ValueList,function(am){if(!am.HasOwner){return}var ap=false;var ao=null;for(var an=0;an<ah.length;an++){if((ah[an].PropertyDef.DataType==d.MFDataType.Lookup||ah[an].PropertyDef.DataType==d.MFDataType.MultiSelectLookup)&&ah[an].PropertyDef.ValueList==am.Owner){ao=ah[an]}if(ah[an].ID==al.propertyID){ap=true}if(ao&&ap){break}}if(ao){f.exists(ao.PropertyDef);al.boundProperty=ao;ak(al,ao.PropertyDef)}})}(X)}}}Y.text(V)}for(var ac in aa){aa[ac].control.set(aa[ac].TypedValue,aa[ac].ValueSource)}};var C=function(){for(var W=0;W<Q.properties.length;W++){var V=Q.properties[W];if(V.propertySource=="template"&&V.ValueSource!="user"){J(W)}}};var N=function(W,V){$.getJSON("./REST/objects/"+W+"/"+V+"/latest/full.aspx",function(ab){var ac=Q.propertiesByID;var X={};for(var aa=0;aa<ab.Properties.length;aa++){var ad=ab.Properties[aa];X[ad.PropertyDef]=ad;if(!A.Filters.includedFromTemplate(ad.PropertyDef)){continue}if(!ac[ad.PropertyDef]){var Z=S(ad,{valueSource:"template",propertySource:"template"})}else{var Y=ac[ad.PropertyDef];if(!!Y.control&&!!Y.control.isAutomaticProperty){continue}if(a.typedValueExists(ad.TypedValue)&&Y.ValueSource!="user"){if(Y.control){Y.control.set(ad.TypedValue,"template")}Y.TypedValue=ad.TypedValue;Y.ValueSource="template"}}}Q.template={objectAndProperties:ab,propertiesByID:X};G(function(){K(true)})})};var D=function(Z,W){if(!Z){return}if(Z.IsNamedACL){var Y=U.permissions.find('option[value="'+Z.ID+'"]');if(Y.length>0){Y.attr("selected","true")}}else{var V=r.Custom;if(!!W&&W.length>0){var X="("+W+")";V+=X}var Y=U.permissions.find('option[value="'+V+'"]');if(Y.length==0){U.permissions.append($('<option value="'+V+'" selected="true">'+V+"</option>"));Q.nacls.push(Z);Q.naclsByID[V]=Z}else{Y.attr("selected","true")}}};var F=function(W,V,ac){U.moreProperties.attr("disabled",false);if(W==n.Class){try{U.classSelect.find("option[value="+Q.objectClassID+"]").attr("selected",true)}catch(ad){}return}var Z=null;try{Z=U.classSelect.find("option[value="+W+"]");Z.attr("selected",true)}catch(ad){}var aa=Z.data("item");if(aa){D(aa.DefaultNamedACLForObject,aa.Name);if(aa.Hidden===true||aa.Deleted===true){Q.objectClassID=W;Q.objectClass=aa;U.middleContent.empty();P=null;if(V==false){for(var ab=0;ab<Q.properties.length;ab++){if(p.requiredPropertyForHiddenOrDeletedClass(Q.properties[ab].PropertyID)){Q.properties[ab].Required=true}T(Q.properties[ab])}}else{var Y=Q.properties;Q.properties=[];Q.propertiesByID={};for(var ab=0;ab<Y.length;ab++){var X=Y[ab];if(p.requiredPropertyForHiddenOrDeletedClass(X.PropertyID)){X.Required=true}if(X.Required||a.typedValueExists(X.TypedValue)){S({PropertyDef:X.PropertyID,Required:X.Required},{PropertyDef:X.PropertyDef,oldProperty:{TypedValue:X.TypedValue,ValueSource:"user"},propertySource:"user"},false)}}}G(function(){K(true)});if(ac){ac()}return}}z.getClassInfo(W,function(ap){ap=a.copy(ap);if(Q.options.objType.ID==d.MFBuiltInObjectType.DocumentCollection){ap.AssociatedPropertyDefs.push({PropertyDef:d.MFBuiltInPropertyDef.CollectionMemberDocuments,Required:false});ap.AssociatedPropertyDefs.push({PropertyDef:d.MFBuiltInPropertyDef.CollectionMemberCollections,Required:false})}Q.objectClassID=W;Q.objectClass=ap;var af=Q.properties;var ah=Q.propertiesByID;M(true);for(var aj=0;aj<af.length;aj++){var am=af[aj];if(am.control){am.TypedValue=am.control.get();u.write(am.PropertyID);if(a.typedValueExists(am.TypedValue)||!V){am.ValueSource=am.control.getSource()}else{am.ValueSource=null}}}for(var aj=0;aj<ap.AssociatedPropertyDefs.length;aj++){var al=ap.AssociatedPropertyDefs[aj];var ao=S(al,{propertySource:"class",oldProperty:ah[al.PropertyDef]},true)}for(var aj in af){var ag=af[aj];if(!(Q.objectClass.NamePropertyDef!=d.MFBuiltInPropertyDef.NameOrTitle&&ag.PropertyID==d.MFBuiltInPropertyDef.NameOrTitle)){if(a.typedValueExists(ag.TypedValue)||!V){if(Q.propertiesByID[ag.PropertyID]){var ae=Q.propertiesByID[ag.PropertyID];ae.TypedValue=ag.TypedValue;ae.ValueSource=ag.ValueSource}else{S({PropertyDef:ag.PropertyID,Required:ag.Required},{PropertyDef:ag.PropertyDef,oldProperty:{TypedValue:ag.TypedValue,ValueSource:"user"},propertySource:"user"},true)}}}}U.middleContent.empty();for(var aj=0;aj<Q.properties.length;aj++){T(Q.properties[aj])}var ai=null;if(U.groups.template.css("display")!="none"){U.templateSelect.empty();for(var aj=0;aj<ap.Templates.length;aj++){var an=ap.Templates[aj];if(Q.options.objType.ID===an.ObjVer.Type){var ak=$('<option value="'+an.ObjVer.Type+","+an.ObjVer.ID+'" />');ak.text(an.Title);U.templateSelect.append(ak);if(!ai){ai={type:an.ObjVer.Type,id:an.ObjVer.ID}}}}if(!ai){C();U.templateSelect.attr("disabled",true);U.templateRadio.attr("disabled",true);U.templateCheck.attr("checked",false);U.templateCheck.attr("disabled",true);if(U.groups.sfd.css("display")!="none"){if(U.templateRadio.is(":checked")||!(U.mfdRadio.is(":checked")||U.sfdRadio.is(":checked"))){U.sfdRadio.click()}}}}G(function(){K(true);if(ai){N(ai.type,ai.id);U.templateRadio.attr("disabled",false);U.templateSelect.attr("disabled",false);U.templateCheck.attr("disabled",false);U.templateCheck.attr("checked",true);U.templateRadio.click()}});H();if(ac){ac()}})};var H=function(){if(Q.workflows){U.workflow.empty();var X=$('<option value="'+n.Workflow+'">'+r.Empty+"</option>");U.workflow.append(X);var W=n.WorkflowObjectClass;var Z=null;if(Q.objectClass){W=Q.objectClass.ID;Z=Q.objectClass.Workflow}for(var V=0;V<Q.workflows.length;V++){var aa=Q.workflows[V];if(aa.item.ObjectClass==n.WorkflowObjectClass||aa.item.ObjectClass==W){U.workflow.append(aa.node);if(aa.item.ID==Z){X=aa.node}}}if(X){try{X.attr("selected",true)}catch(Y){}}}};var O=function(W,V,X){z.getPropertyDefsByID(function(ac){M();Q.immutableProperties=[];var Z=null;for(var Y in W){var aa=W[Y];var ab=ac[aa.PropertyDef];if(V&&ab.ID==d.MFBuiltInPropertyDef.VersionComment){continue}if(A.Filters.shownInProperties(ab.ID)){S(aa,{PropertyDef:ab,Value:aa.TypedValue,valueSource:"old"},true)}else{Q.immutableProperties.push(aa)}if(ab.ID==d.MFBuiltInPropertyDef.SingleFileObject){if(aa.TypedValue.Value){U.sfdRadio.click()}else{U.mfdRadio.click()}}if(ab.ID==d.MFBuiltInPropertyDef.Class){Z=aa}}if(Z!==null){Q.objectClassID=Z.TypedValue.Lookup.Item*1;Q.objectClass={ID:Z.TypedValue.Lookup.Item*1,Name:Z.TypedValue.Lookup.DisplayValue,Hidden:Z.TypedValue.Lookup.Hidden,Deleted:Z.TypedValue.Lookup.Deleted}}if(X){X()}})};U.classSelect.change(function(V){F(U.classSelect.val(),true)});U.templateSelect.change(function(W){var V=U.templateSelect.val().split(",");N(V[0],V[1])});U.moreProperties.click(function(){e.getNewProperty(Q.objectClass.ObjType,Q.propertiesByID,function(V){if(V){S({PropertyDef:V.ID,Required:false},{PropertyDef:V});K(false,[V.ID])}return true})});documentCard={jq:U,jqNode:U.documentcard,setProperties:O,setPermissions:D,resize:function(V){U.middle.width(V.width-23);U.middle.height(V.height-(B+I));U.middle.children("table").width(V.width-23-20)},initialize:function(V,X,W,Y){f.hasValue(V,"objType","The object type has not been set");U.moreProperties.attr("disabled",true);g_PendingLookupRequestCounter=0;Q={objectClass:null,objectClassID:null,properties:[],immutableProperties:[],propertiesByID:{},options:V,workflows:null,nacls:null};M();R=false;if(V.checkIn===true){U.checkInCheck.attr("checked",true)}else{U.checkInCheck.attr("checked",false)}z.getWorkflows(function(ab){Q.workflows=[];Q.workflowsByID={};for(var aa=0;aa<ab.length;aa++){var ac=ab[aa];var Z={item:ac,node:$('<option value="'+ac.ID+'">'+a.escape(ac.Name)+"</option>")};Q.workflows.push(Z);Q.workflowsByID[ac.ID]=Z}H();z.getNACLs(function(ae){Q.nacls=ae;Q.naclsByID=[];if(Y==true){U.permissions.append($('<option value="empty" selected="selected"></option>'))}for(var ad=0;ad<ae.length;ad++){U.permissions.append($('<option value="'+ae[ad].ID+'">'+a.escape(ae[ad].Name)+"</option>"));Q.naclsByID[ae[ad].ID+""]=ae[ad]}if(V.objType.HasOwner&&X){z.getObjectType(V.objType.Owner,function(af){z.getPropertyDef(af.OwnerPropertyDef,function(ag){X({DataType:ag.DataType,PropertyDef:ag.ID,Required:true,TypedValue:{DataType:ag.DataType,HasValue:false}},function(){documentCard.loadClasses(V.objType.ID,W)})})})}else{if(X){X(null,function(){documentCard.loadClasses(V.objType.ID,W)})}else{this.loadClasses(V.objType.ID,W)}}})})},preload:function(X,V,W){if(!X.Properties){z.getProperties(X.ObjVer,function(Y){O(Y,V,W)})}else{O(X.Properties,V,W)}z.getNACL(X.ObjVer.Type,X.ObjVer.ID,X.ObjVer.Version,function(Y){D(Y,"")})},loadClasses:function(W,V){if(W==d.MFBuiltInObjectType.DocumentCollection){W=d.MFBuiltInObjectType.Document}z.getClassesByGroup(W,function(Z){U.classSelect.empty();var ab=null;var ac=null;var ad=0;U.classSelect.append($('<option value="'+n.Class+'">'+x.ChooseClass+"</option>"));for(var Y=0;Y<Z.length;Y++){if(Z[Y].Name==""){ac=Z[Y].Classes;continue}var ae=$('<optgroup label="'+Z[Y].Name+'" />');U.classSelect.append(ae);for(var X=0;X<Z[Y].Classes.length;X++){if(!ab){ab=Z[Y].Classes[X].ID}var aa=$('<option value="'+Z[Y].Classes[X].ID+'">'+a.escape(Z[Y].Classes[X].Name)+"</option>");aa.data("item",Z[Y].Classes[X]);ae.append(aa);ad++}}if(ac){for(var X=0;X<ac.length;X++){if(!ab){ab=ac[X].ID}var aa=$('<option value="'+ac[X].ID+'">'+a.escape(ac[X].Name)+"</option>");aa.data("item",ac[X]);U.classSelect.append(aa);ad++}}R=true;if(Q.objectClass&&(Q.objectClass.Hidden===true||Q.objectClass.Deleted===true)){var aa=$('<option value="'+Q.objectClass.ID+'">'+a.escape(Q.objectClass.Name)+"</option>");aa.data("item",Q.objectClass);U.classSelect.append(aa)}if(ad==1&&!Q.objectClass){Q.objectClassID=ab}if(typeof(Q.objectClassID)=="number"){F(Q.objectClassID,false,V)}else{if(V){V()}}})},loadClass:F,getWindowResults:function(){if(!(Q.properties&&Q.objectClass&&Q.workflows)){return null}var ah={};for(var aa in Q.immutableProperties){var af=Q.immutableProperties[aa];ah[af.PropertyDef]=af}for(var aa in Q.properties){var af=Q.properties[aa];if(!af.jq){continue}if(Q.options.filter&&!Q.options.filter(af.PropertyID)){continue}var ae=af.control.get();var ab=false;if(af.control.isAutomaticProperty){ab=af.control.isAutomaticProperty()}var X=af.PropertyID;ah[af.PropertyID]={PropertyDef:X,IsAutomatic:ab,TypedValue:ae}}ah[d.MFBuiltInPropertyDef.Class]={PropertyDef:d.MFBuiltInPropertyDef.Class,TypedValue:{DisplayValue:Q.objectClass.Name,Lookup:{Item:Q.objectClass.ID,DisplayValue:Q.objectClass.Name,Hidden:false,Version:-1,Deleted:false},DataType:d.MFDataType.Lookup}};var W=U.top.find("input[@name='"+U.radioGroupName+"']:checked:visible").val();var Z=null;var ad=null;switch(W){case"template":if(Q.template){ad=Q.template.objectAndProperties;Z=Q.template.propertiesByID[d.MFBuiltInPropertyDef.SingleFileObject].TypedValue.Value}break;case"sfd":Z=true;break;case"mfd":Z=false;break;default:Z=null;break}u.write("SFD: "+Z);if(Z!==null){ah[d.MFBuiltInPropertyDef.SingleFileObject]={PropertyDef:d.MFBuiltInPropertyDef.SingleFileObject,TypedValue:{DisplayValue:Z?r.Yes:r.No,Value:Z,DataType:d.MFDataType.Boolean}}}var ag=Q.naclsByID[U.permissions.val()];var ac=null;if(U.workflow.is(":visible")){ac=Q.workflowsByID[U.workflow.val()*1]}if(ac){ac=ac.item;ah[d.MFBuiltInPropertyDef.Workflow]={PropertyDef:d.MFBuiltInPropertyDef.Workflow,Value:ac.ID}}var Y=[];for(var V in ah){Y.push(ah[V])}return{Properties:Y,AccessControlList:ag,Workflow:ac,Class:Q.objectClass,Template:ad,CheckIn:U.checkInCheck.is(":checked"),Open:U.openCheck.is(":checked")}},setVisibleItems:function(V){B=30;I=85;U.groups.template.toggle(!!V.template);if(V.template){B+=25}if(V.template&&!V.singleFile){U.templateCheckLabelGroup.show();U.templateRadioLabelGroup.hide()}else{U.templateCheckLabelGroup.hide();U.templateRadioLabelGroup.show()}U.groups.sfd.toggle(!!V.singleFile);U.groups.mfd.toggle(!!V.singleFile);if(V.singleFile){B+=50}U.groups.relationships.toggle(!!V.relationships);U.groups.permissions.toggle(!!V.permissions);if(V.permissions){I+=25}U.groups.workflow.toggle(!!V.workflow);if(V.workflow){I+=25}U.groups.open.toggle(!!V.open);U.groups.checkIn.toggle(!!V.checkIn);U.groups.checkboxes.toggle(!!V.open||!!V.checkIn);if(V.open||V.checkIn){I+=25}}};return documentCard})};var k=function(B){return'<img style="vertical-align:middle;margin-right:5px" src="REST/objects/'+B+'/icon.ashx?size=16">'};var q=function(B){return'<img style="vertical-align:middle;margin-right:5px" src="'+viewItem.getObjectIcon(B)+'">'};var m=function(E,D,C,B){return i.show(E,D,{minwidth:450,minheight:500,resizable:true,gradient:true,ok:function(F){if(C){var G=D.getWindowResults();return C({window:F,result:G})}else{return true}},cancel:function(F){if(B){return B(F)}else{return true}}})};var j=function(C,B){z.getUserID(function(D){z.getValueListItems(d.MFBuiltInValueList.Users,function(E){z.getCurrentTimestamp(function(I){var F="";for(var G=0;G<E.length;++G){if(D.Value==E[G].ID){F=E[G].Name;break}}var H=new Date();var J=[{PropertyDef:d.MFBuiltInPropertyDef.Created,TypedValue:I},{PropertyDef:d.MFBuiltInPropertyDef.CreatedBy,TypedValue:{DataType:d.MFDataType.Text,HasValue:true,DisplayValue:F,SerializedValue:"",Value:F}},{PropertyDef:d.MFBuiltInPropertyDef.LastModified,TypedValue:I},{PropertyDef:d.MFBuiltInPropertyDef.LastModifiedBy,TypedValue:{DataType:d.MFDataType.Text,HasValue:true,DisplayValue:F,SerializedValue:"",Value:F}}];if(C){J.push({PropertyDef:d.MFBuiltInPropertyDef.NameOrTitle,TypedValue:{DataType:d.MFDataType.Text,HasValue:true,DisplayValue:C,SerializedValue:"",Value:C}})}B(J)})})})};var b=function(G,C,L,R){if(!C){C={}}var D=C.filename;var M=C.properties;var P=C.makingCopy;var N=C.creatingFromFile;var Q=C.workflow;var F=C.NACL;if(typeof(G)=="number"){z.getObjectType(G,function(S){return b(S,C,L,R)})}else{var I=s();var E=false;var B=false;var O=(G.ID==d.MFBuiltInObjectType.Document);var H=true;if(!N&&!P){E=true;B=(G.ID==d.MFBuiltInObjectType.Document)}I.setVisibleItems({template:E,singleFile:B,permissions:true,workflow:true,open:O,checkIn:true});var J=true;if(G.ID==d.MFBuiltInObjectType.Document){J=false}else{if(P){J=false}}var K=null;if(P){K=function(){if(Q){I.jq.find("select.doccard_wf option[value="+Q+"]").attr("selected","true")}if(F){I.setPermissions(F,"")}}}I.initialize({objType:G,checkIn:J},function(T,S){j(D,function(Z){if(M){var U={};for(var V in Z){var Y=Z[V];U[Y.PropertyDef]=Y}for(var X in M){var Y=M[X];U[Y.PropertyDef]=Y}Z=[];for(var W in U){Z.push(U[W])}}if(T){Z.push(T)}I.setProperties(Z,H,S)})},K,true);return m(k(G.ID)+a.escape(G.Name),I,L,R)}};var o=function(D,C,B){b(D,null,C,B)};var c=function(F,C,E,B){var D={properties:C};b(F,D,E,B)};var w=function(G,C,D,F,B){var E={filename:C,creatingFromFile:true,properties:D};b(G,E,F,B)};var l=function(I,F,C,H,B){var G={properties:F,NACL:C,makingCopy:true};for(var E in F){if(F[E].PropertyDef==d.MFBuiltInPropertyDef.Workflow){var D=F[E];G.workflow=F[E].TypedValue.Lookup.Item}}b(I,G,H,B)};var h=function(D,C,B){if(!D.objType){z.getObjectType(D.ObjVer.Type,function(E){return h({objectVersion:D,objType:E},C,B)})}else{z.getUserID(function(F){var E=s();E.setVisibleItems({permissions:true,singleFile:(D.objType.ID==d.MFBuiltInObjectType.Document)});E.initialize({objType:D.objType},function(H,G){E.preload(D.objectVersion,D.objectVersion.CheckedOutToUserID!=F.Value,G)});return m(q(D.objectVersion)+a.escape(D.objectVersion.Title),E,C,B)})}};return{ShowNewObjectWindow:o,ShowNewObjectWindowWithProperties:c,ShowNewObjectWindowFromFile:w,ShowNewObjectWindowFromAnotherObject:l,ShowEditObjectWindow:h}});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(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.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(j,i){return d.Lookups.msluConstructor(j,i)};g[h.MFDataType.Lookup]=function(j,i){return d.Lookups.ssluConstructor(j,i)};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){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 o=""+j.val();if(m.DataType==h.MFDataType.Floating){o=o.replace(f.DecimalPoint,".")}var p=m.DataType==h.MFDataType.Text?o:o*1;if(typeof p=="number"&&isNaN(p)){p=o}return{DisplayValue:o,Value:p,DataType:m.DataType}}else{return a(m.DataType)}},getSource:function(){return l},set:function(p,q){if(p&&p.Value){b.equals(p.DataType,m.DataType);l=q;var o=""+p.Value;if(m.DataType==h.MFDataType.Floating){o=o.replace(".",f.DecimalPoint)}j.val(o)}else{l=null;j.val("")}},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.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" readonly="true">');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" readonly="true">');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(m,k,j){var i=m.DataType;if(e.isReadOnlyProperty(m.ID)){i=h.MFDataType.ReadOnly}else{if(m.AutomaticValueType!=h.MFAutomaticValueType.None){i=h.MFDataType.Automatic}}if(g[i]){var l=g[i](m,k)}else{b.fail("Unknown data type: "+i)}l.type=i;return l}}});MFNamespace("MFWA.Dialogs.DocumentCard.Controls.Lookups",function(r){var i=MFNamespace("MFWA.Debug");var m=MFNamespace("MFWA.Utils");var a=MFNamespace("MFWA.Enumerations");var f=MFNamespace("MFWA.I18n");var n=MFNamespace("MFWA.I18n.DocumentCard");var q=MFNamespace("MFWA.Data.Cache");var e=MFNamespace("MFWA.Nulls");var b=MFNamespace("MFWA.Debug.Assert");var g=MFNamespace("MFWA.Dialogs.Prompt");var l=MFNamespace("MFWA.Data.Operations");var o=MFNamespace("MFWA.Icons");var j=MFNamespace("MFWA.Dialogs.Alerts");var k=MFNamespace("MFWA.StringBuilder");var i=MFNamespace("MFWA.Debug");var d=function(s){return function(u,t){if(s.change){s.change(u,t)}}};var p=function(s){return function(v,u,t){if(s.select){if(!u){if(v){u={DisplayValue:v.DisplayValue,Lookup:v,DataType:a.MFDataType.Lookup}}else{u={DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}}s.select(v,u,t)}}};var c=function(s){return function(t){if(s.remove){s.remove(t)}}};var h=function(u,I,x){if(!I){I={}}var C=null;var A=null;var v=null;var w={};var D=d(I);var G=p(I);var t=c(I);var J=I;var F={id:m.unique("mslu")};var s=function(K){if(!K){return null}if(K.Lookup){K=K.Lookup}if(K.Item){K=K.Item}if(typeof(K)=="number"){return K}else{return null}};F.jq=$('<div class="lookup" />');F.select=$('<select class="lookup" />').change(function(){C="user";var L=F.value;F.value=F.get();var K=s(F.value);if(s(L)!=K){if(K==e.ClearFilter){F.filterText("");F.set(L);return}D(F.value,C);if(F.value.Lookup){G(F.value.Lookup,null,F.valuesByID[K].defaultACL)}}});F.jq.append(F.select);var E=$('<div class="addItem" style="background-image: url(\''+o.Commands.AddValue+"');\"></div>");var H=$('<div class="filter" style="background-image: url(\''+o.Commands.SetFilter+"');\"></div>");F.jq.append(E,H);if(I.remove){F.minusMark=$('<div class="mslu_minus" style="background-image: url(\''+o.Commands.AddRemove+"');\"></div>").click(function(){t(F)});F.jq.append(F.minusMark)}var y=function(){g.prompt(n.SetFilter,function(K){if(K){F.filterText(K)}return true})};H.click(y);E.click(function(){q.getObjectType(u.ValueList,function(L){var M={};if(L.RealObjectType){M.NotAllowed=f.Alerts.CantAddNewObjectNotAllowed;M.AccessDenied=f.Alerts.CantAddNewObjectAccessDenied;M.Alert=f.Alerts.CantAddNewObject}else{M.NotAllowed=f.Alerts.CantAddNewValueNotAllowed;M.AccessDenied=f.Alerts.CantAddNewValueAccessDenied;M.Alert=f.Alerts.CantAddNewValue}if(L.Name==""){j.ShowError(M.AccessDenied);return}if(L.AllowAdding==false){j.ShowError(m.format(M.NotAllowed,m.escape(L.Name)));return}var K={Value:null};if(L.HasOwner){if(!J.getBoundPropertyValue){j.ShowError("Internal error: lookup callbacks not set!");return}K=J.getBoundPropertyValue();if(!K){j.ShowError(M.Alert);return}if(K.Value.Lookups){K.Value=s(K.Value.Lookups[0])}else{K.Value=s(K.Value.Lookup)}if(K.ValueList!=L.Owner){if(!L.RealObjectType){j.ShowError(M.Alert);return}else{K.Value=null}}if(!K.Value&&!L.RealObjectType){j.SelectOwnerPropertyFirst(K.ID);return}}if(!L.RealObjectType){g.prompt(n.AddNewValueToList,function(O,N){if(O){l.addValueListItem(u.ValueList,{Name:O,OwnerID:K.Value,HasOwner:!!K.Value},function(P){F.set({DataType:a.MFDataType.Lookup,DisplayValue:O,Lookup:{Item:P.ID,DisplayValue:O,Version:-1,Deleted:false,Hidden:false}},"user");F.refresh();N.close()})}return false})}else{MFWA.Actions.newObject(u.ValueList,{callback:function(N){if(N){F.set({DataType:a.MFDataType.Lookup,DisplayValue:N.Title,Lookup:{Item:N.ObjVer.ID,DisplayValue:N.Title,Version:N.ObjVer.Version,Deleted:false,Hidden:false}},"user");F.refresh()}}})}})});F.get=function(){var L=F.select.val();if(L!=e.Lookup&&F.valuesByID){var M=F.select.val()*1;var K=F.valuesByID[M];return{DisplayValue:K.value.DisplayValue,Lookup:K.value,DataType:a.MFDataType.Lookup}}else{return{DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}};F.getSource=function(){return C};F.set=function(M,O){if(!M){M={DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}b.equals(M.DataType,a.MFDataType.Lookup);C=O;var K=null;if(M&&M.Lookup){if(F.values&&F.valuesByID[M.Lookup.Item]){try{$("#"+F.valuesByID[M.Lookup.Item].option).attr("selected",true)}catch(N){}K=F.valuesByID[M.Lookup.Item].defaultACL}else{var L=$('<option value="'+M.Lookup.Item+'" selected>'+m.escape(M.Lookup.DisplayValue)+"</option>");F.select.append(L);F.valuesByID={};F.valuesByID[M.Lookup.Item]={value:M.Lookup};try{L[0].attr("selected",true)}catch(N){}}}else{if(F.values){try{F.select.children()[0].attr("selected",true)}catch(N){}}else{F.select.empty()}}if(s(F.value)!=s(M)){F.value=M;D(M,C);if(M.Lookup){G(M.Lookup,null,K)}}};var B=function(Z,K){v=null;var R=F.select.outerWidth();var V=false;F.values=new Array();F.valuesByID={};var L=new k.StringBuilder(3+Z.length*8);L.append('<option value="').append(e.Lookup).append('"></option>');for(var W=0;W<Z.length;W++){var S=Z[W];if(S.ID<0&&!S.IsClearItem){continue}var aa={Item:S.ID,DisplayValue:S.Name,Hidden:false,Version:-1,Deleted:false};var Y=m.escape(aa.DisplayValue);if(S.IsClearItem){Y=S.Name}var X=function(ac,ae){if(Z[ae].HasParent==true){ac="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ac;for(var ad=ae;ad>=0;ad--){if(Z[ae].ParentID==Z[ad].ID){ac=X(ac,ad);break}}}return ac};var M=X("",W);var N=M.length/6;var P=Y;if(Y.length+N>35){P=P.substr(0,33-N)+"..."}P=M+P;var ab=m.unique("option");L.append('<option id="').append(ab).append('" value="').append(aa.Item).append('" title="');if(s(F.value)==aa.Item){V=true;L.append('" selected>')}else{if(S.IsClearItem){L.append('" style="font-weight:bold">')}else{L.append('">')}}L.append(P).append("</option>");var O={value:aa,option:ab,defaultACL:S.DefaultNamedACLForObject};F.values.push(O);F.valuesByID[aa.Item]=O}F.select.html(L.toString());F.select.css("cursor","wait");var U=F.value;if(!V){if(K||!(F.value&&F.value.Lookup)){U={DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}else{U=F.value;var Q=U.Lookup.DisplayValue;var T=$('<option value="'+U.Lookup.Item+'" selected>'+m.escape(Q)+"</option>");var O={value:U.Lookup,option:T};F.values.push(O);F.valuesByID[U.Lookup.Item]=O;F.select.append(T)}}if(navigator.appVersion.indexOf("MSIE")!=-1){F.select.width(R)}if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}if(g_PendingLookupRequestCounter==0){$("#doccard, #doccard *").css("cursor","default")}};var z=function(L){if(w.text){var K={ID:e.ClearFilter,Name:n.ClearFilter+"'"+w.text+"'",IsClearItem:true};L.splice(0,0,K)}B(L)};F.filterText=function(K){w.text=K;if(v){v.cancel=true;if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}}++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard, #doccard *").css("cursor","wait")}v=q.getValueListItemsByPropDefID(u.ID,z,{item:w.item,text:w.text})};F.filter=function(O,M,L){var N=Array();if(M.DataType==a.MFDataType.MultiSelectLookup){for(var K in M.Lookups){if(M.Lookups[K]!=null&&M.Lookups[K].Item!=e.Lookup){N.push(M.Lookups[K].Item)}}}else{if(M.Lookup&&M.Lookup.Item!=e.Lookup){N.push(M.Lookup.Item)}}if(v){v.cancel=true;if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}}w.item={type:O.PropertyDef.ValueList,values:N};++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard, #doccard *").css("cursor","wait")}v=q.getValueListItemsByPropDefID(u.ID,function(P){B(P,L=="user")},{item:w.item,text:w.text})};F.refresh=function(){if(v){v.cancel=true;if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}}++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard, #doccard *").css("cursor","wait")}v=q.getValueListItemsByPropDefID(u.ID,B,{item:w.item,text:w.text})};F.filteredChanged=function(L,K){};F.canRemove=function(K){if(K){F.minusMark.show()}else{F.minusMark.hide()}};F.enabled=function(K){if(K){F.select.removeAttr("disabled")}else{F.select.attr("disabled","disabled")}};if(x){F.filter(x.property,x.value,x.source)}else{++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard, #doccard *").css("cursor","wait")}v=q.getValueListItemsByPropDefID(u.ID,B)}return F};return{ssluConstructor:function(t,s){var u=h(t,s);return{jq:u.jq,get:function(){return u.get()},getSource:function(){return u.getSource()},set:function(w,v){u.set(w,v)},filter:function(x,w,v){u.filter(x,w,v)},filteredChanged:function(w,v){u.filteredChanged(w,v)},enabled:function(v){u.enabled(v)}}},msluConstructor:function(E,z){var C=new Array();var s=null;var u=null;var A=d(z);var B=p(z);var t=z;var F=function(J){var I=false;for(var H=0;H<C.length;H++){if(C[H]==J){var K=C[H].get();if(K!=null&&K!=e.Lookup){I=true}C.splice(H,1);H--}}if(C.length==1){C[0].canRemove(false)}J.jq.remove();if(I){A(x.get(),x.getSource())}};var w=false;var G={remove:F,change:function(){s="user";if(!w){A(x.get(),x.getSource())}},select:function(J,I,H){if(!w){B(J,x.get(),H)}},getBoundPropertyValue:function(){if(t.getBoundPropertyValue){return t.getBoundPropertyValue()}return null}};var y=function(){var H=h(E,G,u);C.push(H);D.append(H.jq);C[0].canRemove(true)};var D=$('<div class="mslu" />');var v=$('<div class="mslu_plus" style="background-image: url(\''+o.Commands.AddRemove+"');\"></div>").click(function(){y()});D.append(v);y();C[0].canRemove(false);var x={jq:D,get:function(){var K={};for(var I=0;I<C.length;I++){var L=C[I].get();if(L.Lookup){K[L.Lookup.Item]=L}}var H={DisplayValue:new Array(),Lookups:new Array(),DataType:a.MFDataType.MultiSelectLookup};for(var J in K){H.DisplayValue.push(K[J].DisplayValue);H.Lookups.push(K[J].Lookup)}H.DisplayValue=H.DisplayValue.join("; ");if(H.Lookups.length==0){H.Lookups=null}return H},getSource:function(){return s},set:function(K,N){if(!K||!K.Lookups){K={DisplayValue:"",Lookups:new Array(),DataType:a.MFDataType.MultiSelectLookup}}b.equals(K.DataType,a.MFDataType.MultiSelectLookup);var H=x.get();while(K.Lookups.length>C.length){y()}while(K.Lookups.length<C.length&&C.length>1){F(C.pop())}w=true;if(K.Lookups.length==0){C[0].set({DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup})}else{for(var J=0;J<K.Lookups.length;J++){C[J].set({DisplayValue:K.Lookups[J].DisplayValue,Lookup:K.Lookups[J],DataType:a.MFDataType.Lookup},N)}}w=false;s=N;var M=x.get();var I=false;if(!H||!H.Lookups){H=new Array()}else{H=H.Lookups}if(!M||!M.Lookups){M=new Array()}else{M=M.Lookups}if(M.length!=H.length){I=true}else{var L={};for(var J in M){L[M[J].Item]=true}var O={};for(var J in H){O[H[J].Item]=true}for(var J in O){if(!L[J]){I=true}}}if(I){A(K,s);if(K.Lookups&&K.Lookups.length==1){B(K.Lookups[0],null,C[0].valuesByID[K.Lookups[0].Item].defaultACL)}}},filter:function(K,J,I){u={property:K,value:J,source:I};for(var H=0;H<C.length;H++){C[H].filter(K,J,I)}},filteredChanged:function(I,H){},enabled:function(I){for(var H in C){C[H].enabled(I)}}};return x}}});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:true,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")});var k={jq:n,show:function(){i=null;n.window.dialog("open")},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.ObjectType!=0&&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.Upload",function(l){var e=MFNamespace("MFWA.Utils"),b=MFNamespace("MFWA.Debug.Assert"),i=MFNamespace("MFWA.Nulls"),m=MFNamespace("MFWA.I18n"),k=MFNamespace("MFWA.I18n.Upload"),c=MFNamespace("MFWA.Data.Cache"),g=MFNamespace("MFWA.Pooling"),a=MFNamespace("MFWA.Enumerations"),d=MFNamespace("MFWA.Window"),h=MFNamespace("MFWA.Dialogs.Templates"),j=MFNamespace("MFWA.Dialogs.DocumentCard.MoreProperties");var f=function(){var n,o=h.createUploadDialog();o.upload.load(function(){b.exists(this.contentWindow);var p=this.contentWindow.fileData;var q=this.contentWindow.objectVersion;if(p){n.files[p.uploadID]=p}if(q){n.objectVersion=q}if(p||q){if(n.singleFile){n.ok()}else{if(p){jqFile=h.createUploadFileItem(this.contentWindow.fileData,function(){n.files[p.uploadID]=null});o.fileList.append(jqFile)}}}});return{jq:o,jqNode:o.dialog,initialize:function(s){var p=s.singleFile;var r="";if(s.objVer!==undefined){var q=s.objVer;r=["&objectType=",q.Type,"&objectID=",q.ID,"&objectVersion=",q.Version].join("")}var t="";if(s.fileID!==undefined){t="&fileID="+s.fileID}o.upload.attr("src","UploadFrame.aspx?type="+s.type+r+t);n={type:s.type,files:{},objectVersion:null,singleFile:p,ok:s.ok};o.fileList.empty();o.fileList.toggle(!p)},resize:function(p){o.dialog.width(p.width);o.dialog.height(p.height)},getUploadResults:function(){if(n.type=="store"){var p=[];for(fId in n.files){p.push(n.files[fId])}return p}else{return n.objectVersion}}}};return{addFile:function(p,r,o){var q=g.get("upload",f);var n;q.initialize({type:"add",singleFile:true,ok:function(){n.ok()},objVer:p});n=d.show(k.Title,q,{width:400,height:150,ok:function(t){if(r){var s=q.getUploadResults();return r(t,s)}},cancel:function(s){if(o){return o(s)}},buttons:{cancel:true}})},replaceFile:function(q,n,s,p){var r=g.get("upload",f);var o;r.initialize({type:"replace",singleFile:true,ok:function(){o.ok()},objVer:q,fileID:n});o=d.show(k.Title,r,{width:400,height:150,ok:function(u){if(s){var t=r.getUploadResults();return s(u,t)}},cancel:function(t){if(p){return p(t)}},buttons:{cancel:true}})},singleFile:function(q,o){var p=g.get("upload",f);var n;p.initialize({type:"store",singleFile:true,ok:function(){n.ok()}});n=d.show(k.Title,p,{width:400,height:150,ok:function(s){if(q){var r=p.getUploadResults();return q(s,r)}},cancel:function(r){if(o){return o(r)}},buttons:{cancel:true}})},multipleFiles:function(p,n){var o=g.get("upload",f);o.initialize({type:"store"});return d.show(k.Title,o,{width:400,height:300,ok:function(r){if(p){var q=o.getUploadResults();return p(r,q)}else{return true}},cancel:function(q){if(n){return n(q)}else{return true}}})}}});MFNamespace("MFWA.Dialogs.Comments",function(){var g=MFNamespace("MFWA.I18n");var f=MFNamespace("MFWA.Data.Cache");var b=MFNamespace("MFWA.Window");var d=MFNamespace("MFWA.Pooling");var c=MFNamespace("MFWA.Dialogs.Templates");var h=MFNamespace("MFWA.Enumerations");var a=MFNamespace("MFWA.Utils");function e(){return d.get("CommentsDialog",function(){var j=c.createCommentsDialog();var i={jq:j,jqNode:j.commentsDialog,resize:function(k){j.commentHistory.height(k.height-220)},initialize:function(k,l){f.getPropertyDef(h.MFBuiltInPropertyDef.VersionComment,function(o){j.newCommentHeader.append(a.escape(o.Name)+":");var p="";for(var n=0;n<k.length;n++){if(l.ObjectCheckedOutToThisUser==true&&k[n].ObjVer.Version==l.ObjVer.Version){var m=a.escape(k[n].Comment.TypedValue.DisplayValue);if(m){j.newComment.append(m)}continue}p+='<div class="commentRow">';p+='<div class="commentTimestamp">'+a.escape(k[n].StatusChanged.TypedValue.DisplayValue)+g.Comma+a.escape(k[n].LastModifiedBy.TypedValue.DisplayValue)+"</div>";p+='<div class="commentText">'+a.escape(k[n].Comment.TypedValue.DisplayValue)+"</div>";p+="</div>"}j.commentHistory.append(p)})},getWindowResults:function(){return j.newComment.val()}};return i})}return{show:function(k,j,i){f.getVersionComments(k.ObjVer,function(m){var l=e();l.initialize(m,k);return b.show(g.CommentsDialog.Title+" - "+a.escape(k.Title),l,{minwidth:450,minheight:500,ok:function(n){if(j){var o=l.getWindowResults();return j(n,o)}else{return true}},cancel:function(n){if(i){return i(n)}else{return true}}})})}}});MFNamespace("MFWA.Dialogs.Workflow",function(){var j=MFNamespace("MFWA.I18n");var c=MFNamespace("MFWA.Data.Cache");var e=MFNamespace("MFWA.Window");var f=MFNamespace("MFWA.Pooling");var h=MFNamespace("MFWA.Dialogs.Templates");var a=MFNamespace("MFWA.Enumerations");var g=MFNamespace("MFWA.Nulls");var i=MFNamespace("MFWA.Utils");var b=function(m){var k=$(".workflowDialog #workflow").val();var l=$(".workflowDialog select#state");l.empty();l.append('<option value="-1"></option>');if(m){c.getStatesForWorkflow(k,m,function(n){for(var o=0;o<n.length;o++){if(n[o].ID==m){l.append('<option value="'+n[o].ID+'" selected>'+i.escape(n[o].Name)+"</option>")}else{if(n[o].Selectable==true){l.append('<option value="'+n[o].ID+'">'+i.escape(n[o].Name)+"</option>")}else{l.append('<option value="'+n[o].ID+'" disabled>'+i.escape(n[o].Name)+"</option>")}}}})}else{c.getStatesForWorkflow(k,function(n){for(var o=0;o<n.length;o++){if(n[o].Selectable==true){l.append('<option value="'+n[o].ID+'">'+i.escape(n[o].Name)+"</option>")}else{l.append('<option value="'+n[o].ID+' disabled">'+i.escape(n[o].Name)+"</option>")}}})}};function d(){return f.get("WorkflowDialog",function(){var l=h.createWorkflowDialog();var k={jq:l,jqNode:l.workflowDialog,resize:function(m){l.comment.height(m.height-180)},initialize:function(o,n){var q="";var m="";var p="";c.getPropertyDefsByID(function(r){q=i.escape(r[a.MFBuiltInPropertyDef.Workflow].Name);m=i.escape(r[a.MFBuiltInPropertyDef.State].Name);p=i.escape(r[a.MFBuiltInPropertyDef.VersionComment].Name);l.workflowHeader.append(q+j.Colon);l.stateHeader.append(m+j.Colon);l.commentHeader.append(p+j.Colon);c.getWorkflowsForObject(n,function(t){l.workflow.empty();l.workflow.append('<option value="-1"></option>');var u=null;if(o.Workflow.TypedValue.Lookup){u=o.Workflow.TypedValue.Lookup.Item}for(var s=0;s<t.length;s++){if(u==t[s].ID){l.workflow.append('<option value="'+t[s].ID+'" selected>'+i.escape(t[s].Name)+"</option>")}else{l.workflow.append('<option value="'+t[s].ID+'">'+i.escape(t[s].Name)+"</option>")}}var v=null;if(o.State.TypedValue.Lookup){v=o.State.TypedValue.Lookup.Item}b(v)})});return q},getWindowResults:function(){var m=$(".workflowDialog #workflow").val();var n=$(".workflowDialog #state").val();var o=$(".workflowDialog #comment").val();return{workflow:m,state:n,comment:o}}};return k})}return{show:function(m,l,k){c.getWorkflowState(m.ObjVer,function(n){var p=d();var o=p.initialize(n,m.ObjVer);return e.show(o+" - "+i.escape(m.Title),p,{minwidth:400,minheight:350,ok:function(q){if(l){var r=p.getWindowResults();return l(q,r)}else{return true}},cancel:function(q){if(k){return k(q)}else{return true}}})})},updateStates:function(k){b(k)}}});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);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:true});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:true,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 c=MFNamespace("MFWA.Listing.ViewMode");var d=MFNamespace("MFWA.MFWA");var b=MFNamespace("MFWA.Icons");clearViewModeMenuItemIcons=function(){var e=new Array("menu_ViewList","menu_ViewThumbnails");for(var f in e){$("#"+e[f]+" .menuItemIcon").css("background-image","")}};return{UpdateMenuItemStates:function(g){for(var h in a){if(h=="_namespace"){continue}var f=a[h];var e=$("#menu_"+h+" > div.menuItemText");if(f(g)){e.removeClass("dimmed")}else{e.addClass("dimmed")}}},RefreshViewModeMenuItems:function(f){var e=d.getListingMode();var g;switch(e){case c.List:g="ViewList";break;case c.Thumbnails:g="ViewThumbnails";break}var h="menu_"+g;clearViewModeMenuItemIcons();var i=$("#"+h);$("#"+h+" .menuItemIcon").css("background-image","url('"+b.Commands.Checked+"')")},RefreshColumnSettingMenuItems:function(e){$(".menuColumnInfoEnabler").css("background-image","");var e=d.getCurrentColumns();for(var f=0;f<e.length;f++){$("#menu_columnvisibility_"+e[f].PropertyID+" .menuItemIcon").css("background-image","url('"+b.Commands.Checked+"')")}}}});MFNamespace("MFWA.ViewItem",function(o){var n=MFNamespace("MFWA.Icons");var b=MFNamespace("MFWA.Debug.Assert");var a=MFNamespace("MFWA.Enumerations");var l=MFNamespace("MFWA.Utils");var k=MFNamespace("MFWA.Consts.ViewItem");var d=MFNamespace("MFWA.Debug");var h;var f;var c=function(p){if(!h){h={};h.T=a.MFDataType.Text;h.B=a.MFDataType.Boolean;h.M=a.MFDataType.MultiLineText;h.L=a.MFDataType.Lookup;h.S=a.MFDataType.MultiSelectLookup;h.D=a.MFDataType.Date;h.C=a.MFDataType.Time;h.I=a.MFDataType.Integer;h.O=a.MFDataType.Integer64;h.R=a.MFDataType.Floating;h.E=a.MFDataType.FILETIME;h.P=a.MFDataType.Timestamp;f={};for(var q in h){f[h[q]]=q}}return f[p]};var e={};e[false]="User";e[true]="Common";var i={};i[false]="";i[true]="Overlapping";var m=function(p){return{itemType:k.ItemType.ObjectVersion,objectType:p.ObjVer.Type,id:p.ObjVer.ID,version:p.ObjVer.Version,file:0}};var j=function(q){if(q.SingleFile){extension=q.Files[0].Extension.toLowerCase();var p=n.Extensions[extension];if(!p||p===""){p=n.Listing.Default}return p}else{return"REST/objects/"+q.ObjVer.Type+"/icon.aspx"}};var g=function(q){q.children=[];if(q.objectVersion&&!q.objectVersion.SingleFile){for(var p in q.objectVersion.Files){childItem=o.ViewItem({FolderContentItemType:a.MFFolderContentItemType.ObjectFile,ObjectFile:q.objectVersion.Files[p]},q.path,q);q.children.push(childItem)}}};return{getObjectIcon:j,ViewItem:function(y,t,x){var z=t;if(!z){z=""}if(z[z.length-1]!="/"){z+="/"}var q;var v;var p;if(y.View){var s=false;q=y.View.Name;itemType=k.ItemType.View;if(y.View.ViewLocation&&y.View.ViewLocation.Overlapping){s=true;itemType=k.ItemType.PropertyFolder;if(y.View.Name==""){q=y.View.ViewLocation.OverlappedFolder.DisplayValue}}z+="V"+y.View.ID;p={itemType:itemType,objectType:0,id:y.View.ID,version:0,file:0};var w=e[y.View.Common]+i[s]+"ViewFolder";v=n.Listing[w]}else{if(y.PropertyFolder){q=y.PropertyFolder.DisplayValue;z+=c(y.PropertyFolder.DataType);if(y.PropertyFolder.SerializedValue){z+=y.PropertyFolder.SerializedValue}v=n.Listing.PropertyFolder;p={itemType:k.ItemType.PropertyFolder,objectType:0,id:z,version:0,file:0}}else{if(y.ObjectVersion){q=y.ObjectVersion.Title;z+="O"+y.ObjectVersion.ObjVer.Type+"-"+y.ObjectVersion.ObjVer.ID+"-"+y.ObjectVersion.ObjVer.Version;if(y.ObjectVersion.SingleFile){var r=y.ObjectVersion.Files[0].Extension;if(r&&r!=""){q+="."+r}}p=m(y.ObjectVersion);v=j(y.ObjectVersion)}else{if(y.ObjectFile){q=y.ObjectFile.Name;var r=y.ObjectFile.Extension;if(r){q+="."+r}v=n.Extensions[r.toLowerCase()];if(!v||v===""){v=n.Listing.Default}z+="F"+y.ObjectFile.ID;p={itemType:k.ItemType.ObjectVersion,objectType:x.objectVersion.ObjVer.Type,id:x.objectVersion.ObjVer.ID,version:x.objectVersion.ObjVer.Version,file:y.ObjectFile.ID};if(!v){v=n.Extensions.defaultExtension}}else{if(y.TraditionalFolder){q=y.TraditionalFolder.DisplayValue;z+="Y"+y.TraditionalFolder.Item;v=n.Listing.TraditionalFolder;p={itemType:k.ItemType.TraditionalFolder,objectType:0,id:y.TraditionalFolder.Item,version:0,file:0}}else{b.fail("Unknown view type")}}}}}var u={type:y.FolderContentItemType,view:y.View,propertyFolder:y.PropertyFolder,objectVersion:y.ObjectVersion,objectFile:y.ObjectFile,traditionalFolder:y.TraditionalFolder,name:q,icon:v,path:z,children:[],ids:p,parent:x,pending:false,updateObject:function(A){this.name=A.Title;if(A.SingleFile&&A.Files[0].Extension){this.name+="."+A.Files[0].Extension}this.objectVersion=A;this.icon=j(A);this.ids=m(A);d.write("Resetting pending flag");this.pending=false;g(this)},updatePending:function(){this.pending=true}};g(u);return u}}});MFNamespace("MFWA.Listing.ViewMode",{List:1,Thumbnails:2});(function(j){var h=MFNamespace("MFWA.StringBuilder");var c=MFNamespace("MFWA.Debug");var b=MFNamespace("MFWA.Debug.Assert");var n=MFNamespace("MFWA.Utils");var p=MFNamespace("MFWA.I18n");var o=MFNamespace("MFWA.Icons");var f=MFNamespace("MFWA.Listing.ViewMode");var a=MFNamespace("MFWA.Enumerations");var l={};var i=function(s){var r;var q;if(s.ondblclick&&s.onclick){addClickHandlers=function(u,t){u.append(" ondblclick=\"$().listing.handlers.OnDblClick('");u.append(t);u.append("')\" onclick=\"$().listing.handlers.OnClick('");u.append(t);u.append("')\"")};q=5}else{if(s.ondblclick){addClickHandlers=function(u,t){u.append(" ondblclick=\"$().listing.handlers.OnDblClick('");u.append(t);u.append("')\"")};q=3}else{if(s.onclick){addClickHandlers=function(u,t){u.append(" onclick=\"$().listing.handlers.OnClick('");u.append(t);u.append("')\"")};q=3}else{addClickHandlers=function(){}}}}return{handler:r,elements:q}};var k=function(r,t,w,s,q){if(!t){t=r.data("listing")}var v=n.unique("listing");var u=[t.id,v].join("_row_");s.row=u;w.append("<").append(t.rowtag);w.append(' class="listing-item" id="').append(u).append('"');if(s.parent&&!s.parent.childrenVisible){w.append(' style="display:none;"')}addClickHandlers(w,u);w.append(">");w.append(r.listing(t.getItemFunc,s));w.append("</").append(t.rowtag).append(">");t.items.push(s);t.itemsByID[u]=s};j.fn.listing=function(s){var q=[];for(var r=1;r<arguments.length;r++){q.push(arguments[r])}var t;this.each(function(){if(t!==undefined){return}if(typeof s=="string"){var u=s;t=e[u].apply(this,q)}else{b.exists(s,"columns");s=j.extend({},j.fn.listing.defaults,s);b.exists(s,"columns");m(this,s)}});return t};var m=function(v,r){var w=j(v);var y={jq:null,value:null};w.empty();w.addClass("listing");var z=j('<tr class="header" style="height:0px;"></tr>');var t=j('<table class="listing-headers" style="position:absolute"></table>');var A=j('<tr class="header"></tr>');var s=j('<div class="listing-container" style="position:relative;top:20px;overflow:auto"></div>');w.before(t.append(j("<thead></thead>").append(A)));w.before(s);s.append(w);var q=j('<div id="refreshListing" style="background-image: url(\''+o.Commands.Refresh+"')\"></div>");s.append(q);if(r.onrefresh){q.click(r.onrefresh)}var u=w.attr("id");if(!u||u==""){u=n.unique("listing");w.attr("id",u)}s.parent().bind("resize",function(){var C=j(this);s.width(C.width());s.height(C.height()-t.height())});s.parent().trigger("resize");s.parent().css("overflow","hidden");s.bind("scroll",function(){t.css("left",-s.scrollLeft())});var x=j("<div>");x.css({width:"90%",height:"90%","background-image":'url("Images/load.gif")',display:"none","background-position":"center","background-repeat":"no-repeat"});s.append(x);var B={node:w,opts:r,content:{},columns:[],header:z,fixedHeader:A,selected:null,items:[],itemsByID:{},id:u,getItemFunc:"_getItem_thumbnail",rowtag:"",loadLayer:x,scrollParent:s};l[u]=w;w.data("listing",B);w.listing("setListingMode",f.Thumbnails);w.listing("setColumns",r.columns,B.opts.columnchangedcb);w.listing("setData",r.data)};var d=function(s,r,q){s.sort(function(v,t){var u=r.comparer(v,t,r,q);if(q){return u}else{return -u}})};var e={setSorting:function(u,s){var r=j(this);var t=r.data("listing");t.opts.sortColumn=u;t.opts.sortAscending=s;j(".column-header-sortimage").attr("style","display: none;");var q="column-header-sortimage-"+t.opts.sortColumn;if(t.opts.sortAscending){j("#"+q).attr("src",o.Listing.ArrowUp)}else{j("#"+q).attr("src",o.Listing.ArrowDown)}j("#"+q).attr("style","display: block;")},setColumns:function(s,w){var u=j(this);var v=u.data("listing");var q=[];v.fixedHeader.empty();v.header.empty();for(var r in s){var t=s[r];if(typeof(t)=="string"){t={path:t}}if(typeof t.title=="undefined"){t.title=t.path}if(t.title===""){t.title="&nbsp;"}t=j.extend({},j.fn.listing.column_defaults,t);var x=function(z,A){var E,D,B,G;var F="column-header-sortimage-"+A;var y='<div class="column-header-title">'+z.title+'</div><div class="column-header-sortdir"><img class="column-header-sortimage" id="'+F+'" style="display:none;" src="'+o.Listing.ArrowUp+'" /></div>';E=j('<div class="header ui-state-default">'+y+"</div>").bind("onselectstart",function(){return false}).hover(function(){j(this).addClass("ui-state-hover")},function(){j(this).removeClass("ui-state-hover")}).width(z.currentWidth).click(function(){if(v.suppressSort){return}if(v.opts.sortColumn==A){v.opts.sortAscending=!v.opts.sortAscending}else{v.opts.sortColumn=A;v.opts.sortAscending=true}u.listing("sort")});D=j('<th class="header"></th>').height(0);B=j('<th class="header"></th>').height(0);B.append(E);G=j('<div style="border-left:1px solid white;border-right: 1px solid white"></div>').height(0);D.prepend(G);v.fixedHeader.append(B);v.header.append(D);D.data("listing",z);var C=G.add(D.add(B)).width(z.currentWidth);c.write("Resizing will affect "+C.length+" elements");E.resizable({handles:"e",minWidth:z.minWidth,maxWidth:z.maxWidth,alsoResize:C,start:function(){v.suppressSort=true},stop:function(){setTimeout(function(){v.suppressSort=false},0);z.currentWidth=E[0].offsetWidth;z.onColumnResize()}});E.parent().draggable({axis:"x",containment:"window",opacity:0.5,zIndex:2000,stop:function(K,L){var I=[];var H=0;for(var J=0;J<q.length;J++){I.push(H);H+=q[J].opts.currentWidth;H+=1}I[A]+=L.position.left;w(I)}});v.header.height(0);v.header.parent().height(0);q.push({node:D,opts:z})}(t,r)}v.opts.columns=q;v.opts.columnchangedcb=w},setData:function(s){var v=new MFWA.Timer(function(C){c.write("SetData preparations @ jquery.listing: "+C)});var y=new MFWA.Timer(function(C){c.write("SetData string building @ jquery.listing: "+C)});var z=new MFWA.Timer(function(C){c.write("SetData finalizing @ jquery.listing: "+C)});v.start();var q=j(this);var B=q.data("listing");B.items=[];B.itemsByID={};var t=B.content;t.empty();B.opts.data=s;B.selected=null;if(!s){return}d(s,B.opts.columns[B.opts.sortColumn].opts,B.opts.sortAscending);var u=7;var w=i(B.opts);u+=w.elements;w=w.handler;var x=new h.StringBuilder(s.length*u);v.report();y.start();for(var r in s){var A=s[r];k(q,B,x,A,w)}y.report();z.start();q.listing("updatePending",false);t.html(x.toString());z.report()},sort:function(t,s){var r=j(this);var u=r.data("listing");if(typeof t!="undefined"){u.opts.sortColumn=t}if(typeof s!="undefined"){u.opts.sortAscending=s}r.listing("setSorting",u.opts.sortColumn,u.opts.sortAscending);var w=u.opts.data;d(w,u.opts.columns[u.opts.sortColumn].opts,u.opts.sortAscending);var v=[];for(var q in w){v.push(j("#"+w[q].row))}v=j(v);v.appendTo(u.content);for(var q in u.opts.columns){if((u.opts.columns[q].opts.sorting)!==0&&(u.opts.sortColumn!==q)){u.opts.columns[q].opts.sorting=0;u.opts.columns[q].opts.onColumnSort()}}if(u.opts.sortAscending){u.opts.columns[u.opts.sortColumn].opts.sorting=1}else{u.opts.columns[u.opts.sortColumn].opts.sorting=2}u.opts.columns[u.opts.sortColumn].opts.onColumnSort()},select:function(u){var q=j(this);var t=q.data("listing");if(t.selected){t.selected.jq.removeClass("highlight")}var s=j("#"+u);var r=q.listing("getItemByID",u);s.addClass("highlight");t.selected={jq:s,item:r}},unselect:function(){var q=j(this);var r=q.data("listing");if(r.selected){r.selected.jq.removeClass("highlight")}r.selected=null},updatePending:function(s){var q=j(this);var r=q.data("listing");r.loadLayer.toggle(s)},getSelected:function(){var q=j(this);var r=q.data("listing");if(r.selected){return r.selected.item}else{return null}},getItemByID:function(q){return j(this).data("listing").itemsByID[q]},_getItem_list:function(B){var r=j(this);var C=r.data("listing");var v=new Array(C.opts.columns.length);var x=0;if(C.opts.columns.length==0){return""}for(var u in C.opts.columns){var w=new h.StringBuilder(12);var s=C.opts.columns[u];var y=s.opts.func(B,s.opts);var q=null;if(typeof y=="object"&&y.id){q=y.id;y=y.text}var D=s.opts.cssClass;if(!D){D=""}w.append(u);w.append(" ");w.append(D);w.append('">');if(q){w.append('<div class="column-wrapper"><div id="');w.append(q);w.append('" class="listing-column column-')}else{w.append('<div class="column-wrapper"><div class="listing-column column-')}w.append(u);w.append(" ");w.append(D);w.append('">');if(y&&y.constructor==Date){var A=j.datepicker.formatDate(p.DateTime.ShortDateTimeFormat,y);w.append(A)}else{if(y){w.append(y)}}v[x]=w.toString();x++}var z=["<",' onselectstart="return false" onmousedown="return false" class="listing-column column-'].join("td");var t=["</div></div></",">"].join("td");return[z,v.join(t+z),t].join("")},_getItem_thumbnail:function(r){var s=new h.StringBuilder();if(r.objectVersion){if(r.objectVersion.ObjVer.Type==a.MFBuiltInObjectType.Document){if(r.objectVersion.SingleFile&&r.objectVersion.Files.length==1){s.append('<div class="imageframe">');s.append('<img class="thumbnail" src="./REST/objects/');s.append(r.objectVersion.ObjVer.Type);s.append("/");s.append(r.objectVersion.ObjVer.ID);s.append("/");s.append(r.objectVersion.ObjVer.Version);s.append("/files/");s.append(r.objectVersion.Files[0].ID);s.append("/");s.append(r.objectVersion.Files[0].Version);s.append("/");s.append("thumbnail.aspx")}else{s.append('<div class="iconframe">');s.append('<img class="thumbnail" src="');s.append(o.Listing.MultiFileDocument48)}}else{if(r.objectVersion.ObjVer.Type==a.MFBuiltInObjectType.DocumentCollection){s.append('<div class="iconframe">');s.append('<img class="thumbnail" src="');s.append(o.Listing.DocumentCollection48)}else{s.append('<div class="iconframe">');s.append('<img class="thumbnail" src="./REST/objects/');s.append(r.objectVersion.ObjVer.Type);s.append("/icon.aspx?size=48")}}}if(r.objectFile){s.append('<div class="imageframe">');if(r.parent&&r.parent.objectVersion){s.append('<img class="thumbnail" src="./REST/objects/');s.append(r.parent.objectVersion.ObjVer.Type);s.append("/");s.append(r.parent.objectVersion.ObjVer.ID);s.append("/");s.append(r.parent.objectVersion.ObjVer.Version);s.append("/files/");s.append(r.objectFile.ID);s.append("/");s.append(r.objectFile.Version);s.append("/");s.append("thumbnail.aspx")}else{s.append('<img class="thumbnail" src="')}}else{if(r.view){s.append('<div class="iconframe">');s.append('<img class="thumbnail" src="');if(r.view.Common){if(r.view.ViewLocation&&r.view.ViewLocation.Overlapping){s.append(o.Listing.CommonOverlappingViewFolder48)}else{s.append(o.Listing.CommonViewFolder48)}}else{if(r.view.ViewLocation&&r.view.ViewLocation.Overlapping){s.append(o.Listing.UserOverlappingViewFolder48)}else{s.append(o.Listing.UserViewFolder48)}}}else{if(r.propertyFolder){s.append('<div class="iconframe">');s.append('<img class="thumbnail" src="');s.append(o.Listing.PropertyFolder48)}else{if(r.traditionalFolder){s.append('<div class="iconframe">');s.append('<img class="thumbnail" src="');s.append(o.Listing.TraditionalFolder48)}}}}s.append('">');if(r.pending){s.append('<img class="overlay" src="');if(j.browser.msie&&j.browser.version=="6.0"){s.append(o.Overlays.Pending48c8)}else{s.append(o.Overlays.Pending48c32)}s.append('">')}else{if(r.objectVersion||(r.parent&&r.parent.objectVersion)){var q=r.objectVersion||r.parent.objectVersion;if(!q.ThisVersionLatestToThisUser){s.append('<img class="overlay" src="');if(j.browser.msie&&j.browser.version=="6.0"){s.append(o.Overlays.PreviousVersion48c8)}else{s.append(o.Overlays.PreviousVersion48c32)}s.append('">')}else{if(q.ObjectCheckedOutToThisUser){s.append('<img class="overlay" src="');if(j.browser.msie&&j.browser.version=="6.0"){s.append(o.Overlays.CheckedOutCurrent48c8)}else{s.append(o.Overlays.CheckedOutCurrent48c32)}s.append('">')}else{if(q.ObjectCheckedOut){s.append('<img class="overlay" src="');if(j.browser.msie&&j.browser.version=="6.0"){s.append(o.Overlays.CheckedOutOther48c8)}else{s.append(o.Overlays.CheckedOutOther48c32)}s.append('">')}}}}}s.append("</div>");s.append('<div class="titleframe">');s.append(n.escape(r.name));s.append("</div>");return s.toString()},setItem:function(t,s){var q=j(this);var r=q.data("listing");var u=j("#"+t);u.empty();u.append(q.listing(r.getItemFunc,s))},addItemsAfter:function(u,q){var s=j(this);var t=s.data("listing");if(q.constructor!==Array){q=[];for(var r=1;r<arguments.length;r++){q.push(arguments[r])}}s.listing("_addItems",{items:q,afterItem:u})},addItem:function(r){var q=j(this);q.listing("_addItems",{items:[r]})},_addItems:function(r){var t=j(this);var u=t.data("listing");var q=r.items;if(q.length>1){d(q,u.opts.columns[u.opts.sortColumn].opts,u.opts.sortAscending)}var v=i(u.opts);var w=new h.StringBuilder(q.length*(7+v.elements));v=v.handler;for(var s=0;s<q.length;s++){k(t,u,w,q[s],v)}if(r.afterItem){j("#"+r.afterItem.row).after(w.toString())}else{if(r.beforeItem){j("#"+r.beforeItem.row).before(w.toString())}else{u.content.append(w.toString())}}},removeItem:function(t){var r=j(this);var s=r.data("listing");j("#"+t.row).remove();s.itemsByID[t.row]=null;for(var q=0;q<s.items.length;q++){if(s.items[q].row==t.row){s.items.splice(q,1);return}}},setRowCss:function(r){var u=j(this);var v=u.data("listing");var t="";for(var s in r){t=t+"#"+u.attr("id")+" "+s+" {\n";for(var q in r[s]){var w=r[s][q];if(typeof w==="number"&&q=="z-index"){w=w+"px"}t=t+q+":"+w+";\n"}t=t+"}\n"}c.write("Inserting style: "+t);t="<style>"+t+"</style>";if(v._currentCss){v._currentCss.remove()}var x=j(t);v._currentCss=x;j("head").append(x)},selectNext:function(){var s=j(this);var t=s.data("listing");var r=t.selected;if(r){var q=r.jq.next();while(q.length==1&&q.css("display")=="none"){q=q.next()}if(q.length==1){j().listing.handlers.OnClick(q.attr("id"))}}else{if(t.opts.data.length>0){j().listing.handlers.OnClick(t.opts.data[0].row)}}},selectPrev:function(){var r=j(this);var t=r.data("listing");var q=t.selected;if(q){var s=q.jq.prev();while(s.length==1&&s.css("display")=="none"){s=s.prev()}if(s.length==1){j().listing.handlers.OnClick(s.attr("id"))}}else{if(t.opts.data.length>0){j().listing.handlers.OnClick(t.opts.data[0].row)}}},setListingMode:function(v){var s=j(this);var t=s.data("listing");s.empty();var u;var r;var q;if(v==f.Thumbnails){u=j("<div></div>");r=j('<div style="height:0px;overflow:hidden;"></div>');q=j("<div></div>");t.rowtag="div";t.getItemFunc="_getItem_thumbnail"}else{u=j("<table></table>");r=j('<thead style="height:0px;overflow:hidden;"></thead>');r.append(t.header);q=j("<tbody></tbody>");t.rowtag="tr";t.getItemFunc="_getItem_list"}u.append(r);u.append(q);s.append(u);t.content=q}};j.fn.listing.defaults={data:[],ondblclick:null,onclick:null,sortColumn:0,sortAscending:true};j.fn.listing.column_defaults={currentWidth:100,path:"",func:function(r,q){return n.extractPath(q.path,r)},comparer:function(r,q,s){var u=this.func(r,s);var t=this.func(q,s);if(u==t){return 0}if(u<t){return -1}else{return 1}}};j.fn.listing.getListing=function(q){return l[q]};j.fn.listing.getListingItem=function(s){var r=s.lastIndexOf("_");var q=s.substr(0,r-4);var t=j().listing.getListing(q);return[t,t.listing("getItemByID",s)]};var g;j.fn.listing.handlers={OnClick:function(t){var u=j().listing.getListingItem(t);var v=u[0],r=u[1];var q=v.data("listing").opts;var s=v.listing("getSelected");if(s&&s.row==r.row){if(q.onrename){if(g){clearTimeout(g)}g=setTimeout(function(){g=null;q.onrename(r)},1000)}}else{if(g){clearTimeout(g)}q.onclick&&q.onclick(r)}},OnDblClick:function(r){if(g){clearTimeout(g);g=null}var s=j().listing.getListingItem(r);var t=s[0],q=s[1];t.data("listing").opts.ondblclick(q)}}})(jQuery);MFNamespace("MFWA.Listing",function(k){var o=MFNamespace("MFWA.StringBuilder");var l=MFNamespace("MFWA.Debug");var q=MFNamespace("MFWA.Utils");var t=MFNamespace("MFWA.Data.Cache");var p=MFNamespace("MFWA.Data.Operations");var j=MFNamespace("MFWA.Handlers.PropertyHandlers");var h=MFNamespace("MFWA.Java");var g=MFNamespace("MFWA.ViewItem");var c=MFNamespace("MFWA.Model");var b=MFNamespace("MFWA.Enumerations");var r=MFNamespace("MFWA.I18n.Listing");var s=MFNamespace("MFWA.Icons");var m=MFNamespace("MFWA.Status");var e=MFNamespace("MFWA.Notifications");var d=MFNamespace("MFWA.Listing.ViewMode");var a=MFNamespace("MFWA.Menu");var n=d.List;var f={View:1,Search:2,History:3,CollectionMembers:4,Relationships:5,Subobjects:6,MFDContents:7};var i={viewPath:f.View,searchCriteria:f.Search,objectHistory:f.History,collectionMembers:f.CollectionMembers,relationships:f.Relationships,subobjects:f.Subobjects,mfdcontents:f.MFDContents};return{makeListing:function(D,z){var N;var ae={};var aj=null;var Y=[];var w=[];var M=[];var ab=[];var U=[];var H=true;var G="";var T={};var v=null;var an=function(au){if(!au){au=c.view.get()}var at=null;for(var av in au){if(at!==null){assert.fail("There are two active views.")}at=av}if(at===null){return}if(v){clearTimeout(v);v=null}D.listing("updatePending",true);D.listing("setData",null);c.selectedItem.set(null);var ar=i[at];I[ar](au[at])};c.view.observe(k,an);var I={};I[f.View]=function(ar){if(typeof ar=="undefined"){assert.fail("Refreshing view with no path");return}if(N){N.cancel=true}N=t.getViewContents(ar,x)};I[f.Search]=function(ar){t.performSearch(ar,function(at){u(at)})};I[f.History]=function(ar){p.getObjectHistory(ar,function(at){u(at)})};I[f.CollectionMembers]=function(ar){p.getCollectionMembers(ar,function(at){u(at)})};I[f.Relationships]=function(ar){p.getRelationships(ar,function(at){u(at)})};I[f.Subobjects]=function(ar){p.getSubobjects(ar,function(at){u(at)})};I[f.MFDContents]=function(ar){p.getMFDContents(ar,function(at){u(at)})};var ak=function(ay){var az=c.view.get();var au="";if(az&&az.viewPath){au=az.viewPath}var av=[];av.ObjectVersion=ay;var ax=g.ViewItem(av,au);var at=ay.ObjVer;if(!ae[at.Type]){ae[at.Type]={}}ae[at.Type][at.ID]=ax;D.listing("addItem",ax);for(var ar in ax.children){var aw=ax.children[ar];D.listing("addItem",aw)}};var aa=function(ar){D.listing("setItem",ar.row,ar)};var A=function(at){D.listing("removeItem",at);for(var ar in at.children){D.listing("removeItem",at.children[ar])}};var X=function(at,az){var ay;if(ae[at.Type]){ay=ae[at.Type][at.ID]}if(!ay){return}var ar=ay.objectVersion.ObjVer;if(ar.Version!=at.Version){return}var aw=false;var ax=c.selectedItem.get();if(ax.objectVersion){var au=ax.objectVersion;if(ar.Type==au.ObjVer.Type&&ar.ID==au.ObjVer.ID&&ar.Version==au.ObjVer.Version){aw=true}}for(var av in ay.children){D.listing("removeItem",ay.children[av])}ay.updateObject(az);D.listing("setItem",ay.row,ay);D.listing("addItemsAfter",ay,ay.children);if(aw){c.selectedItem.set(ay)}else{c.selectedItem.set(null)}ad(true)};var u=function(ar){if(N){N.cancel=true}x(ar)};var x=function(aC){var av=aC.Path;var ar=aC.ViewSettingsID;var at=[];var ay=null;ae={};Y=[];w=[];M=[];ab=[];U=[];var aD=new MFWA.Timer(function(aE){l.write("ParseViewContentsListing @ Listing, without setData: "+aE)});aD.start();if(aC.IsMFDContents){if(aC.Items.length>0){var aA=aC.Items[0];var aB=g.ViewItem(aA,av);if(aA.ObjectVersion){ay=aA.ObjectVersion.ObjVer;aB.childrenVisible=true;for(var au in aB.children){at.push(aB.children[au])}}}}else{for(var ax in aC.Items){var aA=aC.Items[ax];var aB=g.ViewItem(aA,av);if(aB.view&&!MFWA.Dialogs.DocumentCard.Filters.visibleView(aB.view.ID)){continue}at.push(aB);if(aA.ObjectVersion){if(!ae[aA.ObjectVersion.ObjVer.Type]){ae[aA.ObjectVersion.ObjVer.Type]={}}ae[aA.ObjectVersion.ObjVer.Type][aA.ObjectVersion.ObjVer.ID]=aB;for(var au in aB.children){at.push(aB.children[au])}}}}aD.report();if(!aC.ColumnInfos){aC.ColumnInfos=new Array()}if(aC.ColumnInfos.length==0){aC.ColumnInfos=P(av)}V(aC.ColumnInfos,ar);G=ar;T=aC.ColumnInfos;D.listing("setListingMode",aC.ViewMode);n=aC.ViewMode;a.RefreshViewModeMenuItems();c.selectedItem.set(null);if(ay){MFWA.PropertiesPane.setProperties(ay)}if(at){D.listing("setData",at)}m.setStatus(aC.Items.length+" objects");if(aC.MoreResults){var aw=aC.Items.length;var az=q.format(r.MoreResultsText,aw);e.queue(r.MoreResultsTitle,az)}ad(true)};var P=function(at){var ar=[];if(at!="/"){ar.push({PropertyID:-17,MinColumnWidth:12,CurrentColumnWidth:12,MaxColumnWidth:12,Sorting:0})}ar.push({PropertyID:-1,MinColumnWidth:50,CurrentColumnWidth:250,MaxColumnWidth:1000,Sorting:((at!="_history")?1:0)});ar.push({PropertyID:-2,MinColumnWidth:50,CurrentColumnWidth:150,MaxColumnWidth:1000,Sorting:0});if(at!="/"){ar.push({PropertyID:-14,MinColumnWidth:50,CurrentColumnWidth:150,MaxColumnWidth:1000,Sorting:0})}if(at=="_history"){ar.push({PropertyID:-8,MinColumnWidth:10,CurrentColumnWidth:55,MaxColumnWidth:1000,Sorting:2})}return ar};var V=function(ar,ax){var au=[];var ay=0;var aw=true;for(var av in ar){var at=ar[av].PropertyID;var az=function(aA){au.push({title:Z(at),minWidth:aA.MinColumnWidth,currentWidth:aA.CurrentColumnWidth,maxWidth:aA.MaxColumnWidth,func:L(at),sorting:aA.Sorting,comparer:C(at),onColumnResize:function(){aA.CurrentColumnWidth=this.currentWidth;p.setColumnInfos(ax,ar)},onColumnSort:function(){aA.Sorting=this.sorting;p.setColumnInfos(ax,ar)}})}(ar[av]);if(ar[av].Sorting!=0){ay=av;aw=(ar[av].Sorting==1)}}D.listing("setColumns",au,function(aA){for(var aB=0;aB<T.length;aB++){T[aB].tempPos=aA[aB]}T.sort(function(aD,aC){return aD.tempPos-aC.tempPos});for(var aB=0;aB<T.length;aB++){delete T[aB].tempPos}p.setColumnInfos(ax,T);V(T,ax);D.listing("setData",D.data("listing").opts.data)});D.listing("setSorting",ay,aw)};var Z=function Q(at){switch(at){case -1:return r.Columns.Name;case -2:return r.Columns.Type;case -3:return r.Columns.Size;case -4:return r.Columns.Status;case -5:return r.Columns.CheckedOutTo;case -6:return r.Columns.CheckoutTime;case -7:return r.Columns.ID;case -8:return r.Columns.Version;case -9:return"Date-Time";case -10:return"User";case -11:return"Location";case -12:return"Relative Location";case -13:return r.Columns.DateCreated;case -14:return r.Columns.DateModified;case -15:return"Score";case -16:return"Description";case -17:return"";case -18:return"Target Version";case -19:return r.Columns.ObjectType;case -20:r.Columns.Permissions;case -21:return r.Columns.Type;default:if(at>=0){var au=q.unique("headercell");var ar=null;t.getPropertyDefsByID(function(av){var aw=" ";if(av[at]){aw=av[at].Name}if(!aw){aw=""}if(ar===null){ar=q.escape(aw)}else{$("#"+au).text(aw)}});if(ar===null){ar='<span id="'+au+'">...</span>'}return ar}else{return""}}};var L=function ac(ax){switch(ax){case -1:return function ay(aI){var aK=new o.StringBuilder(15);if(aI.parent){aK.append('<div class="nameIndent">')}if(aI.objectVersion&&!aI.objectVersion.SingleFile&&aI.objectVersion.Files.length>0){aK.append('<div class="nameExpand" id="');aK.append(aI.row);aK.append('_plus" onclick="MFWA.Listing.PlusClick(\'');aK.append(aI.row);aK.append("')\" style=\"background-image: url('");if(aI.childrenVisible){aK.append("Res/minus.gif")}else{aK.append("Res/plusik.gif")}aK.append("');\"></div>")}aK.append('<img style="display:block" src="');aK.append(aI.icon);aK.append('" class="nameIcon">');if(aI.pending){aK.append('<img class="history-overlay overlay" src="');if($.browser.msie&&$.browser.version=="6.0"){aK.append(s.Overlays.PendingGIF)}else{aK.append(s.Overlays.Pending)}aK.append('">')}else{if(aI.objectVersion||(aI.parent&&aI.parent.objectVersion)){var aH=aI.objectVersion||aI.parent.objectVersion;if(!aH.ThisVersionLatestToThisUser){aK.append('<img class="history-overlay overlay" src="');if($.browser.msie&&$.browser.version=="6.0"){aK.append(s.Overlays.PreviousVersionGIF)}else{aK.append(s.Overlays.PreviousVersion)}aK.append('">')}else{if(aH.ObjectCheckedOutToThisUser){aK.append('<img class="history-overlay overlay" src="');if($.browser.msie&&$.browser.version=="6.0"){aK.append(s.Overlays.CheckedOutCurrentGIF)}else{aK.append(s.Overlays.CheckedOutCurrent)}aK.append('">')}else{if(aH.ObjectCheckedOut){aK.append('<img class="history-overlay overlay" src="');if($.browser.msie&&$.browser.version=="6.0"){aK.append(s.Overlays.CheckedOutOtherGIF)}else{aK.append(s.Overlays.CheckedOutOther)}aK.append('">')}}}}}var aG;if((aI.objectVersion&&aI.objectVersion.SingleFile)||aI.objectFile){var aH=(aI.objectVersion||aI.parent.objectVersion);var aJ=(aI.objectFile||aI.objectVersion.Files[0]);var aF=(aH.ThisVersionLatestToThisUser?"latest":aH.ObjVer.Version);aG="REST/objects/"+aH.ObjVer.Type+"/"+aH.ObjVer.ID+"/"+aF+"/files/"+aJ.ID+"/download.aspx"}if(aG){aK.append('<a href="').append(aG).append('" onclick="return false" class="nameText">')}else{aK.append('<div class="nameText">')}aK.append(q.escape(aI.name));if(aG){aK.append("</a>")}else{aK.append("</div>")}if(aI.parent){aK.append("</div>")}return aK.toString()};case -17:return function aD(aG){if(aG.objectVersion){var aI=aG.objectVersion.HasRelationshipsFrom;var aH=aG.objectVersion.HasRelationshipsTo;var aF;if(aI&&aH){aF=s.Listing.RelationshipsFromAndTo}else{if(aI){aF=s.Listing.RelationshipsFrom}else{if(aH){aF=s.Listing.RelationshipsTo}else{return""}}}return['<img src="','">'].join(aF)}else{return""}};case -8:return function aB(aF){if(aF.objectVersion){return aF.objectVersion.ObjVer.Version}else{return""}};case -2:case -21:return function at(aG){if(aG.objectVersion){var aH=q.unique("listingcell");var aF=null;t.getObjectType(aG.objectVersion.ObjVer.Type,function(aI){var aJ=aI.Name;if(!aJ){aJ=""}if(aF===null){aF=q.escape(aJ)}else{$("#"+aH).text(aJ)}});if(aF===null){aF={id:aH}}return aF}else{if(aG.objectFile){return r.ListingItemTypes.File}else{if(aG.propertyFolder){return r.ListingItemTypes.PropertyFolder}else{if(aG.view){return r.ListingItemTypes.View}else{if(aG.traditionalFolder){return r.ListingItemTypes.TraditionalFolder}else{return""}}}}}};case -3:return function aw(aF){if(aF.objectVersion){if(aF.objectVersion.SingleFile){return""+q.formatSize(aF.objectVersion.Files[0].Size)}else{return""}}else{if(aF.objectFile){return""+q.formatSize(aF.objectFile.Size)}else{return""}}};case -5:return function aE(aF){if(aF.objectVersion&&aF.objectVersion.ObjectCheckedOut){return aF.objectVersion.CheckedOutTo}else{return""}};case -14:return function av(aF){if(aF.objectVersion){return aF.objectVersion.LastModifiedDisplayValue}else{if(aF.objectFile){return aF.objectFile.LastModifiedDisplayValue}else{return""}}};case -6:return function aC(aF){if(aF.objectVersion&&aF.objectVersion.ObjectCheckedOut){return aF.objectVersion.CheckedOutAtDisplayValue}else{return""}};case -13:return function aA(aF){if(aF.objectVersion){return aF.objectVersion.CreatedDisplayValue}else{return""}};case -7:return function au(aF){if(aF.objectVersion){return aF.objectVersion.DisplayID}else{return""}};case -19:return function az(aG){if(aG.objectVersion){var aH=q.unique("listingcell");var aF=null;t.getObjectType(aG.objectVersion.ObjVer.Type,function(aI){var aJ=aI.Name;if(!aJ){aJ=""}if(aF===null){aF=q.escape(aJ)}else{$("#"+aH).text(aJ)}});if(aF===null){aF='<span id="'+aH+'"></span>'}return aF}else{return""}};case -9:case -10:case -11:case -4:case -12:case -15:case -16:case -18:case -20:default:if(ax>=0){return function ar(aI){if(aI.objectVersion){var aF=aI.objectVersion.ObjVer;if(!Y[aF.Type]){Y[aF.Type]=[]}if(!Y[aF.Type][aF.ID]){Y[aF.Type][aF.ID]=[]}if(!Y[aF.Type][aF.ID][aF.Version]){Y[aF.Type][aF.ID][aF.Version]=1;w.push(aF)}else{if(!U[aF.Type]){U[aF.Type]=[]}if(!U[aF.Type][aF.ID]){U[aF.Type][aF.ID]=[]}var aH=U[aF.Type][aF.ID][aF.Version];if(aH){for(var aG=0;aG<aH.length;aG++){if(aH[aG].PropertyDef==ax){return aH[aG].TypedValue.DisplayValue}}return""}}var aJ=q.unique("listingcell");M.push({objver:aF,propertyID:ax,htmlID:aJ});ad(false);return'<span id="'+aJ+'">...</span>'}return""}}else{return function(aF){return""}}}};var C=function C(ar){switch(ar){case -1:return am(function(at){if(at.propertyFolder){return at.propertyFolder.SortingKey}return""},function(at){return at.name});case -17:return am(function(au){if(!au.objectVersion){return 0}var at=au.objectVersion;if(at.HasRelationshipsTo&&at.HasRelationshipsFrom){return 3}if(at.HasRelationshipsFrom){return 2}if(at.HasRelationshipsTo){return 1}return 0});case -8:return am(function(at){if(at.objectVersion){return at.objectVersion.ObjVer.Version}return 0});case -3:return am(function(at){if(at.objectVersion){if(at.objectVersion.SingleFile){return at.objectVersion.Files[0].Size}else{return 0}}else{if(at.objectFile){return at.objectFile.Size}else{return 0}}});case -7:return am(function(au){if(au.objectVersion){var at=parseInt(au.objectVersion.DisplayID);if(at!=NaN){return at}else{return au.objectVersion.DisplayID}}else{return 0}});case -13:return am(function(at){if(at.objectVersion){return at.objectVersion.CreatedUtc}else{return""}});case -14:return am(function(at){if(at.objectVersion){return at.objectVersion.LastModifiedUtc}else{if(at.objectFile){return at.objectFile.LastModified}else{return""}}});case -6:case -5:case -10:return am(function(at){return L(ar)(at)});case -19:case -2:case -21:return am(function(at){return L(ar)(at)});case -4:case -9:case -11:case -12:case -15:case -16:case -18:case -20:return am(function(at){return 0});default:return am(function(ax){if(ar>=0){if(ax.objectVersion){var at=ax.objectVersion.ObjVer;if(U[at.Type]&&U[at.Type][at.ID]){var aw=U[at.Type][at.ID][at.Version];if(aw){for(var av=0;av<aw.length;av++){var au=aw[av];if(au.PropertyDef==ar){var ay=au.TypedValue;if(ay.SortingKey){return ay.SortingKey}return ay.DisplayValue}}}}}}return""})}};var ad=function ad(au){if((au&&(w.length>0||M.length>0))||w.length>100){var at=w;w=[];var ar=M;M=[];t.getPropertiesOfMultipleObjects(at,function(av){if(at.length!=av.length){assert.fail("Inconsistent number of properties.")}for(var az in at){var ay=at[az];if(!U[ay.Type]){U[ay.Type]=[]}if(!U[ay.Type][ay.ID]){U[ay.Type][ay.ID]=[]}U[ay.Type][ay.ID][ay.Version]=av[az]}for(var az in ab){ar.push(ab[az])}ab=[];for(var az in ar){var aw=ar[az].objver;var ax=U[aw.Type][aw.ID][aw.Version];if(ax){var aB=false;for(var aA=0;aA<ax.length;aA++){if(ax[aA].PropertyDef==ar[az].propertyID){$("#"+ar[az].htmlID).text(ax[aA].TypedValue.DisplayValue);aB=true;break}}if(aB==false){$("#"+ar[az].htmlID).text("")}}else{ab.push(ar[az])}}})}};var W=function(ar){if(ar.objectVersion){if(ar.objectVersion.SingleFile){MFWA.Actions.objectOperations("OpenFile",ar)}else{t.getObjectType(ar.objectVersion.ObjVer.Type,function(at){if(at.CanHaveFiles){c.view.set({mfdcontents:{objVer:ar.objectVersion.ObjVer,parentViewSettingsID:G}})}else{j.editObject(ar.objectVersion)}})}}else{if(ar.objectFile){MFWA.Actions.objectOperations("OpenFile",ar)}else{c.view.set({viewPath:ar.path})}}};c.selectedItem.observe(k,function(ar){if(ar){D.listing("select",ar.row)}else{D.listing("unselect")}});var ao=40;var al=38;var ai=37;var ah=39;var aq=13;$("body").keydown(function(au){if(!H){return}var at=null;if(au.which==ao){at=function(){D.listing("selectNext")};au.preventDefault()}else{if(au.which==al){at=function(){D.listing("selectPrev")};au.preventDefault()}else{if(au.which==aq){var ar=D.listing("getSelected");if(ar){at=function(){W(ar)}}}else{return true}}}if(at){if(v){clearTimeout(v)}v=setTimeout(at,25)}return true});var B=function(ar){n=ar;D.listing("setListingMode",n);D.listing("setData",D.data("listing").opts.data);p.setViewMode(G,ar);ad(true)};var ap=function(){return n};var K=function(){return T};var J=function(ar){T.push({MinColumnWidth:50,CurrentColumnWidth:150,MaxColumnWidth:1000,Sorting:0,PropertyID:ar});p.setColumnInfos(G,T);V(T,G);D.listing("setData",D.data("listing").opts.data);ad(true)};var O=function(au){if(au!=-1){var ar=[];var av=false;for(var at=0;at<T.length;at++){if(T[at].PropertyID!=au){ar.push(T[at])}}T=ar;p.setColumnInfos(G,T);V(T,G);D.listing("setData",D.data("listing").opts.data)}};var af=function(au,ar,ay,ax,aw){if((!au.parent&&!ar.parent)||(au.parent==ar.parent)){return aw(au,ar,ay)}var av=au;var at=ar;if(av.parent){av=av.parent}if(at.parent){at=at.parent}if(av==at){if(au.parent){return ax?1:-1}else{return ax?-1:1}}return aw(av,at,ay)};var am=function(){var ar=[];for(var at=0;at<arguments.length;at++){ar.push(arguments[at])}if(ar.length==0){ar=[function(av,au){return au.func(av,au)}]}ar.unshift(S);ar.push(y);ar.push(F);ar.push(E);ar.push(ag);return function(av,au,ax,aw){return af(av,au,ax,aw,function(aC,aA,aD){for(var az=0;az<ar.length;az++){keyFunction=ar[az];var aB=keyFunction(aC,aD);var ay=keyFunction(aA,aD);if(typeof aB=="string"){aB=aB.toLowerCase()}if(typeof ay=="string"){ay=ay.toLowerCase()}if(aB<ay){return -1}if(aB>ay){return 1}}return 0})}};var S=function(ar){return ar.ids.itemType};var y=function(ar){return ar.ids.objectType};var F=function(ar){return ar.ids.id};var E=function(ar){return ar.ids.version};var ag=function(ar){return ar.ids.file};var R=[];R.push({title:"",cssClass:"",minWidth:50,currentWidth:100,maxWidth:200,sorting:0,func:function(ar){return""},comparer:am(function(ar){return 0}),onColumnResize:function(){},onColumnSort:function(){}});D.listing({columns:R,ondblclick:W,onclick:function(ar){c.selectedItem.set(ar)},onrefresh:function(){an()}});return{setViewMode:B,getViewMode:ap,getCurrentColumns:K,addColumnToListing:J,hideColumnFromListing:O,setFolderListing:u,refresh:an,addItem:ak,updateItem:aa,removeItem:A,updateObject:X,enableKeys:function(ar){H=ar}}},PlusClick:function(x){var u=$("#"+x+"_plus");var w=$().listing.getListingItem(x)[1];w.childrenVisible=!w.childrenVisible;if(w.childrenVisible){u.css("background-image","url('Res/minus.gif')")}else{u.css("background-image","url('Res/plusik.gif')")}for(var v in w.children){$("#"+w.children[v].row).toggle(w.childrenVisible)}}}});MFNamespace("MFWA.Tree",function(d){var c=MFNamespace("MFWA.Utils");var h=MFNamespace("MFWA.Enumerations");var b=MFNamespace("MFWA.ViewItem");var e=MFNamespace("MFWA.Model");var a=MFNamespace("MFWA.Debug.Assert");var f=MFNamespace("MFWA.Icons");var g=MFNamespace("MFWA.Data.Ajax");return{makeTree:function(l,m){var j={};var k=null;var o=null;var p=false;var i=null;var n=l.attr("id");if(!n){n=c.unique("tree");l.attr("id",n)}l.tree({data:{type:"json",async:true,url:"MFWS.ashx",async_data:function(q){var r=$(q).attr("viewPath");if(typeof r=="undefined"){return{restPath:"views/baseroot.aspx"}}else{return{restPath:"views"+r+"/folders.aspx"}}}},ui:{dots:false,theme_path:"css/themes/",context:[]},callback:{onJSONdata:function(s,y){if(s.Status>=400){s.handleError(s);return}var x=[];if(typeof s.Name!="undefined"){i=c.unique("tree");x.push({attributes:{id:i,viewPath:"",type:h.MFFolderContentItemType.ViewFolder},children:["lazy"],data:{title:c.escape(s.Name),icon:f.Listing.VaultMounting}});j["/"]=i;setTimeout(function(){$.tree_reference(n).select_branch($("#"+i))},0);setTimeout(function(){$.tree_reference(n).open_branch($("#"+i))},0)}else{for(var t in s.Items){var r=s.Items[t];var w=b.ViewItem(r,s.Path);if(!w||w.type==h.MFFolderContentItemType.ObjectVersion){continue}if(w.type==h.MFFolderContentItemType.ViewFolder&&!MFWA.Dialogs.DocumentCard.Filters.visibleView(w.ids.id)){continue}var q=c.unique("tree");j[w.path]=q;x.push({attributes:{id:q,viewPath:w.path,type:w.type},children:["lazy"],data:{title:c.escape(w.name),icon:w.icon}});if(k){if(k==w.path){var v=function(z){setTimeout(function(){p=true;$.tree_reference(n).select_branch($("#"+z));p=false},0)}(q);k=""}else{if(k.substr(0,w.path.length)==w.path){var v=function(z){setTimeout(function(){$.tree_reference(n).open_branch($("#"+z))},0)}(q)}}}}var u=function(z){if(z==h.MFFolderContentItemType.ViewFolder||z==h.MFFolderContentItemType.PropertyFolder){return 1}if(z==h.MFFolderContentItemType.TraditionalFolder){return 2}if(z==h.MFFolderContentItemType.ObjectVersion){return 3}a.fail("Unknown folder content item type");return 10};x.sort(function(C,B){var A=u(C.attributes.type);var z=u(B.attributes.type);if(A!=z){return A-z}if(C.data.title<B.data.title){return -1}if(C.data.title>B.data.title){return 1}if(C.data.title==B.data.title){return 0}})}return x},error:function(s,q){var r=g.createErrorHandler();r(s.xhttp)},onchange:function(s,q){if(!p){o=s;if(!s){return}var t=$(s).attr("viewPath");var r=e.view.get();if(r&&r.viewPath==t&&false){return}e.view.set({viewPath:t})}}}});e.view.observe(d,function(q){if(typeof q.viewPath!="undefined"){var t=q.viewPath;if(t===""){t="/"}p=true;var u=j[t];if(typeof u!="undefined"){var s=$("#"+u);$.tree_reference(n).select_branch(s)}else{var r=t;while(typeof u=="undefined"&&r.length>0){r=r.substr(0,r.lastIndexOf("/"));u=j[r]}if(typeof u=="undefined"){u=i}var s=$("#"+u);$.tree_reference(n).open_branch(s);k=t}p=false}else{$.tree_reference(n).deselect_branch($(o))}})}}});MFNamespace("MFWA.Actions",function(u){var e=MFNamespace("MFWA.MFWA");var q=MFNamespace("MFWA.Data.Cache");var A=MFNamespace("MFWA.Data.Operations");var f=MFNamespace("MFWA.Model");var d=MFNamespace("MFWA.Enumerations");var v=MFNamespace("MFWA.Debug");var m=MFNamespace("MFWA.I18n");var E=MFNamespace("MFWA.Utils");var w=MFNamespace("MFWA.Dialogs.Alerts");var B=MFNamespace("MFWA.Dialogs.CheckOutPrompt");var D=MFNamespace("MFWA.Dialogs.Upload");var p=MFNamespace("MFWA.Dialogs.DocumentCard");var n=MFNamespace("MFWA.Dialogs.Comments");var y=MFNamespace("MFWA.Dialogs.Workflow");var j=MFNamespace("MFWA.Dialogs.ChangePassword");var H=MFNamespace("MFWA.Dialogs.UndoCheckout");var s=MFNamespace("MFWA.Dialogs.ForceUndoCheckout");var t=MFNamespace("MFWA.Dialogs.Confirm");var h=MFNamespace("MFWA.Dialogs.Upload");var z=MFNamespace("MFWA.Dialogs.Error");var r=MFNamespace("MFWA.Dialogs.Prompt");var k=MFNamespace("MFWA.Structs");var x=MFNamespace("MFWA.Handlers");var l=MFNamespace("MFWA.Filters");var F=MFNamespace("MFWA.Listing");var b=MFNamespace("MFWA.Menu");var i={CheckOut:true,CheckIn:true,UndoCheckout:true,Rename:true,Delete:true,MarkComplete:true,ConvertToSFD:true,ConvertToMFD:true,AddFile:true};var C=function(I){return function(K){if(K.Status==403){window.location="login.aspx"}else{w.ShowError(K)}if(I){I.pending=false;e.updateItem(I);for(var J in I.children){I.children[J].pending=false;e.updateItem(I.children[J])}}}};var c=function(I){return function(K){if(K){var J=I;if(I.objectFile){J=I.parent}if(K.ObjectVersion){K=K.ObjectVersion}if(f.view.get().objectHistory){e.refreshListing()}else{e.updateObject(J.objectVersion.ObjVer,K)}}else{e.removeItem(I)}}};var G=function(L,J,K,M,I){return function(O){if(O==true){if(J){if(M.getAppletInitialized()){MFWA.Java.deleteFile(K,J,c(L),C(L))}else{I.deleteFile(K.ObjVer,J,c(L),C(L))}}else{q.getObjectType(K.ObjVer.Type,function(Q){if(Q.HasSubTypes==true){var P=new Object();P.message=m.DeleteDialog.MessageSubObjects;P.title=m.DeleteDialog.Title;t.prompt(P,function(S){if(S==true){if(M.getAppletInitialized()){MFWA.Java.deleteObject(K,c(L),C(L))}else{I.deleteObject(K.ObjVer,function(T){M.removeItem(L)},C(L))}}else{L.pending=false;M.updateItem(L);for(var R in L.children){L.children[R].pending=false;M.updateItem(L.children[R])}}})}else{if(M.getAppletInitialized()){MFWA.Java.deleteObject(K,c(L),C(L))}else{I.deleteObject(K.ObjVer,function(R){M.removeItem(L)},C(L))}}})}}else{L.pending=false;M.updateItem(L);for(var N in L.children){L.children[N].pending=false;M.updateItem(L.children[N])}}}};var g=function(I,K,J){return function(Q){var N=I.ObjVer;var P=k.createNewLookup(I.Title,N.ID,-1);var L=k.createNewTypedValue(10,I.Title,P);var O=Q.DefaultPropertyDef;var M=k.createNewPropertyValue(O,L);if(J.properties==null){J.properties=new Array()}J.properties.push(M);q.getObjectType(K,a(J))}};var a=function(I){return function(J){p.ShowNewObjectWindowWithProperties(J,I.properties,o(I,J),I.cancelCallback)}};var o=function(J,K){var I=new Array();return function(R){if(J.validate){J.validate(R)}var O=R.window;var P=R.result;var M=x.PropertyHandlers.getMissingProperty(P.Properties,P.Class);if(M){w.RequiredPropertyMissing(M.PropertyDef);return false}var U={};var N=[];for(var Q in P.Properties){var L=P.Properties[Q];L={PropertyDef:L.PropertyDef,TypedValue:L.TypedValue};U[L.PropertyDef]=L;if(p.Filters.usedInCreation(L.PropertyDef)){N.push(L)}}var S=function(ab,aa){var V=[];if(J.objectFiles){V=J.objectFiles}for(var Y in aa){V.push({Title:aa[Y].title,Extension:aa[Y].extension,UploadID:aa[Y].uploadID,Size:aa[Y].size})}I=new Array();for(var Y in V){I.push({title:V[Y].Title,extension:V[Y].Extension,uploadID:V[Y].UploadID,size:V[Y].Size})}var Z=null;if(P.Template&&P.Template.ObjectVersion){Z=P.Template.ObjectVersion.ObjVer}else{if(J.templateForFiles){Z=J.templateForFiles}}var X=null;if(P.AccessControlList&&P.AccessControlList.AccessControlList){X=P.AccessControlList.AccessControlList}var W=null;if(typeof K=="number"){W=K}else{W=K.ID}A.createObject({objType:W,checkIn:P.CheckIn},{PropertyValues:N,Workflow:P.Workflow,TemplateForFiles:Z,Files:V,ACL:X},function(ac){if(J.addToList!==false){e.addItem(ac)}if(ab){ab.close()}if(J.closeDocumentCard!==false){O.close()}if(J.allowOpenFile!==false&&ac.SingleFile&&!P.CheckIn&&P.Open){MFWA.Java.openFile(ac,ac.Files[0])}if(J.callback){J.callback(ac)}},C())};if(P.Template||J.files===false){S(null,[])}else{var T=U[d.MFBuiltInPropertyDef.SingleFileObject];if(T){T=T.TypedValue.Value}if(T){if(I.length==1){S(null,I)}else{D.singleFile(S)}}else{if(K.ID==d.MFBuiltInObjectType.Document){if(I.length>0){S(null,I)}else{D.multipleFiles(S)}}else{S(null,[])}}}return false}};return{newObject:function(M,J){if(!J){J={}}var L=f.selectedItem.get();if(M==d.MFBuiltInObjectType.Assignment&&L&&L.objectVersion){var K=L.objectVersion.ObjVer;if(K.Type!=d.MFBuiltInObjectType.Assignment){var I=K.Type;q.getObjectType(I,g(L.objectVersion,M,J))}else{q.getObjectType(M,a(J))}}else{q.getObjectType(M,a(J))}q.getObjectType(M,function(){})},newDragDocument:function(M,K,J,L,I){q.getObjectType(0,function(O){var N;p.ShowNewObjectWindowFromFile(0,M,J,o({validate:function(P){N=E.copy(P);P.result.CheckIn=false},callback:function(P){L({args:N,objectVersion:P})},files:false,addToList:false,closeDocumentCard:false,objectFiles:K,allowOpenFile:false},O),I)})},uploadDocument:function(I){q.getObjectType(I);D.show(function(J,K){var L=q.getObjectType(I);p.showNewObjectWindow(L,function(M,N){w.ShowNotification("Creating object with "+K.length+" files and "+N.length+" properties!")})})},goTo:function(I){f.view.set({viewPath:I})},objectOperations:function(K,W){if(!W){W=f.selectedItem.get()}if(W){var J=f.selectedItem.get();var S=J.objectVersion;var P=J.objectFile;if(!S&&J.objectFile&&J.parent&&J.parent.objectVersion){S=J.parent.objectVersion}if(!S){return}if(i[K]){if(J.pending){v.write("Canceling '"+K+"' because of a pending update.");return}if(l[K]&&!l[K](J)){v.write("Canceling '"+K+"' because the command is not valid in the item's current state.");return}J.updatePending();e.updateItem(J);for(var N=0;N<J.children.length;N++){J.children[N].updatePending();e.updateItem(J.children[N])}}switch(K){case"CheckOut":if(e.getAppletInitialized()){MFWA.Java.checkOut(S,c(J),C(J))}else{A.checkOut(S.ObjVer,c(J),C(J))}break;case"CheckIn":if(e.getAppletInitialized()){MFWA.Java.checkIn(S,c(J),C(J))}else{A.checkIn(S.ObjVer,c(J),C(J))}break;case"UndoCheckout":var I={message:E.format(m.UndoCheckoutDialog.Message,S.Title,S.CheckedOutTo,S.CheckedOutFrom)};H.prompt(I,function(X){if(X==true){q.getObjectVersion(S.ObjVer.Type,S.ObjVer.ID,"latest",function(Z){q.canForceUndoCheckout(function(aa){q.getUserID(function(ab){if(Z.ObjectCheckedOutToThisUser==true){if(e.getAppletInitialized()){MFWA.Java.undoCheckout(S,c(J),C(J))}else{A.undoCheckout(S.ObjVer,c(J),C(J))}}else{if(aa.Value==true||Z.CheckedOutToUserID==ab.Value){var ad={message:E.format(m.ForceUndoCheckoutDialog.Message,E.escape(S.Title),E.escape(S.CheckedOutTo),E.escape(S.CheckedOutFrom))};s.prompt(ad,function(ae){if(ae==true){if(e.getAppletInitialized()){MFWA.Java.forceUndoCheckout(S,c(J),C(J))}else{A.forceUndoCheckout(S.ObjVer,c(J),C(J))}}else{J.pending=false;e.updateItem(J);for(var af in J.children){J.children[af].pending=false;e.updateItem(J.children[af])}}})}else{w.ShowError(m.Alerts.CannotUndoCheckout);J.pending=false;e.updateItem(J);for(var ac in J.children){J.children[ac].pending=false;e.updateItem(J.children[ac])}}}})})})}else{J.pending=false;e.updateItem(J);for(var Y in J.children){J.children[Y].pending=false;e.updateItem(J.children[Y])}}});break;case"Comments":n.show(S,function(X,Y){if(Y==""&&S.ObjectCheckedOut==false){X.close()}else{A.setVersionComment(S.ObjVer,Y,function(Z){X.close();e.updateObject(S.ObjVer,Z.ObjectVersion)},C(J))}return false});break;case"CheckInWithComments":n.show(S,function(X,Y){if(Y!=""){A.setVersionComment(S.ObjVer,Y,function(){X.close();if(e.getAppletInitialized()){MFWA.Java.checkIn(S,c(J),C(J))}else{A.checkIn(S.ObjVer,c(J),C(J))}},C(J))}else{X.close();if(e.getAppletInitialized()){MFWA.Java.checkIn(S,c(J),C(J))}else{A.checkIn(S.ObjVer,c(J),C(J))}}return false});break;case"Workflow":case"ChangeState":y.show(S,function(X,Y){A.setWorkflowState(S.ObjVer,Y,function(Z){X.close();c(J)(Z)},C(J));return false});break;case"Properties":x.PropertyHandlers.editObject(S,c(J),C(J));break;case"Delete":var I=new Object();if(P){I.message=m.DeleteDialog.MessageItem}else{I.message=m.DeleteDialog.MessageObject}I.title=m.DeleteDialog.Title;t.prompt(I,G(J,P,S,e,A));break;case"MarkComplete":A.markComplete(S.ObjVer,c(J),C(J));break;case"ConvertToSFD":if(e.getAppletInitialized()){MFWA.Java.setSingleFileObject(S,true,c(J),C(J))}else{A.setSingleFileObject(S.ObjVer,true,c(J),C(J))}break;case"ConvertToMFD":if(e.getAppletInitialized()){MFWA.Java.setSingleFileObject(S,false,c(J),C(J))}else{A.setSingleFileObject(S.ObjVer,false,c(J),C(J))}break;case"History":f.view.set({objectHistory:S.ObjVer});break;case"Rename":var I={title:m.Commands.Rename,value:""};if(P||S.SingleFile==true){if(S.SingleFile==true){P=S.Files[0]}I.value=P.Name;if(P.Extension!=""){I.value+="."+P.Extension}}else{I.value=S.Title}r.prompt(I,function(Y,X){if(Y!==null&&Y!==undefined&&Y!==""){if(P){if(e.getAppletInitialized()){MFWA.Java.renameFile(S,P,Y,c(J),C(J))}else{A.renameFile(S.ObjVer,P,Y,c(J),C(J))}}else{if(e.getAppletInitialized()){MFWA.Java.renameObject(S,Y,c(J),C(J))}else{A.renameObject(S.ObjVer,Y,c(J),C(J))}}return true}return false},function(){J.pending=false;e.updateItem(J);for(var X in J.children){J.children[X].pending=false;e.updateItem(J.children[X])}});break;case"OpenFile":var V=P;if(S.SingleFile==true){V=S.Files[0]}if(!e.getAppletInitialized()){var O=S.ObjVer;window.location="REST/objects/"+O.Type+"/"+O.ID+"/"+O.Version+"/files/"+V.ID+"/download.aspx"}else{var R=false;if(S.ObjectCheckedOut==true){R=true}var Q=e.getSessionInfo();if(!Q.LicenseAllowsModifications){R=true}if(R){if(S.SingleFile==true){MFWA.Java.openFile(S,S.Files[0])}else{if(P){MFWA.Java.openFile(S,P)}}}else{B.prompt(S.Title,function(X){if(X==null){return true}if(X=="checkout"){A.checkOut(S.ObjVer,function(ac){e.updateObject(S.ObjVer,ac);var Y=ac.Files;var ab;var ad;var Z=0;for(Z=0;Z<Y.length;Z++){ad=Y[Z];if(ad.ID===V.ID){ab=ad;break}}if(ab){MFWA.Java.openFile(ac,ab)}else{var aa={context:m.CheckOutPrompt.NotFoundErrroMessage};z.show(aa)}},C(J))}else{MFWA.Java.openFile(S,V)}return true})}}break;case"DownloadFile":var V=P;if(S.SingleFile==true){V=S.Files[0]}var O=S.ObjVer;window.location="REST/objects/"+O.Type+"/"+O.ID+"/"+O.Version+"/files/"+V.ID+"/download.aspx";break;case"AddFile":h.addFile(S.ObjVer,function(X,Y){c(J)(Y);return true},function(X){J.pending=false;e.updateItem(J);for(var Y in J.children){J.children[Y].pending=false;e.updateItem(J.children[Y])}return true});break;case"ReplaceFile":var M={};M.ID=P.ID;M.Version=P.Version;h.replaceFile(S.ObjVer,M.ID,function(X,Y){c(J)(Y);return true},function(X){J.pending=false;e.updateItem(J);for(var Y in J.children){J.children[Y].pending=false;e.updateItem(J.children[Y])}return true});break;case"GetAssignmentsForObject":var U={SearchIn:"SearchInMetadata",SearchString:"",SearchWithinThisFolder:false,CurrentFolder:null,SearchType:null,SearchObjectType:"10",PropertyCriteria:new Array()};var T={Property:"VL_"+S.ObjVer.Type,Condition:"is",TypedValue:S.ObjVer.ID+"",DataFunction:null,DataType:null};U.PropertyCriteria.push(T);var L={path:"",array:[]};L.array.push(U);f.view.set({searchCriteria:L});break;case"CollectionMembers":f.view.set({collectionMembers:S.ObjVer});break;case"Relationships":f.view.set({relationships:S.ObjVer});break;case"Subobjects":f.view.set({subobjects:S.ObjVer});break;case"MakeCopy":q.getProperties(S.ObjVer.Type,S.ObjVer.ID,S.ObjVer.Version,function(X){q.getNACL(S.ObjVer.Type,S.ObjVer.ID,S.ObjVer.Version,function(Y){var Z={templateForFiles:S.ObjVer,files:false};p.ShowNewObjectWindowFromAnotherObject(S.ObjVer.Type,X,Y,o(Z,S.ObjVer.Type),null,C(J))})});break;default:w.ShowError("Unknown command: "+K);break}}},settings:function(J){var I="menu_"+J;switch(J){case"ViewList":e.setListingMode(F.ViewMode.List);b.RefreshViewModeMenuItems();break;case"ViewThumbnails":e.setListingMode(F.ViewMode.Thumbnails);b.RefreshViewModeMenuItems();break;case"LogOut":A.logout(function(K){if(K.Value==true){window.location="login.aspx?logout=true"}});break;case"ChangePassword":j.show(function(K){K.close()});break;default:w.ShowError("Unknown command: "+J);break}},columnsettings:function(K){var I=e.getCurrentColumns();var L=false;for(var J=0;J<I.length;J++){if(I[J].PropertyID==K){L=true;break}}if(L){e.hideColumnFromListing(K)}else{e.addColumnToListing(K)}},updateColumnSettingsMenu:function(){b.RefreshColumnSettingMenuItems()},browseRelationships:function(J){var I=f.selectedItem.get().objectVersion;q.getObjectType(I.ObjVer.Type,function(L){var K=L.objectTypeTargetsForBrowsing;var M="/V13";var O;for(var N=0;N<K.length;N++){if(K[N].TargetObjectType==J){O=K[N].ViewCollection}}if(O){M+="/V"+O;q.getViewContents(M,function(P){if(P.Items.length>0){M+="/V"+P.Items[0].View.ID;q.getViewContents(M,function(Q){if(Q.Items.length>0){var R=I.ObjVer.ID%1000;var S=(I.ObjVer.ID-R)/1000;if(Q.Items[S]){M+="/I"+S+"/L"+I.ObjVer.ID;f.view.set({viewPath:M})}}})}})}})}}});MFNamespace("MFWA.Filters",function(a){var c=function(d){return function(e){if(!e||!e.objectVersion){return false}else{return d(e.objectVersion)}}};var b=function(d){return function(e){if(!e){return false}else{if(e.objectVersion){return d(e.objectVersion,false)}else{if(e.objectFile&&e.parent&&e.parent.objectVersion){return d(e.parent.objectVersion,true)}else{return false}}}}};return{CheckOut:c(function(d){if(!d||d.ObjectCheckedOut==true||d.ThisVersionLatestToThisUser==false||d.Deleted==true){return false}return true}),CheckIn:c(function(d){if(!d||d.ObjectCheckedOutToThisUser==false||d.ThisVersionLatestToThisUser==false){return false}return true}),CheckInWithComments:c(function(d){if(!d||d.ObjectCheckedOutToThisUser==false||d.ThisVersionLatestToThisUser==false){return false}return true}),UndoCheckout:c(function(d){if(!d||d.ObjectCheckedOut==false||d.ThisVersionLatestToThisUser==false){return false}return true}),Properties:c(function(d){return true}),History:c(function(d){if(!d){return false}return true}),Relationships:c(function(d){if(!d){return false}return true}),Comments:c(function(d){if(!d){return false}return true}),Workflow:c(function(d){if(!d){return false}return true}),Rename:b(function(e,d){if(!e||e.Deleted==true){return false}else{if(d){if(e.ObjectCheckedOutToThisUser==true){return true}else{return false}}else{if(e.ObjectCheckedOut==false||e.ObjectCheckedOutToThisUser==true){return true}else{return false}}}}),Delete:b(function(e,d){if(!e||e.Deleted==true){return false}else{if(d){if(e.ObjectCheckedOutToThisUser==true){return true}else{return false}}else{if(e.ObjectCheckedOut==false||e.ObjectCheckedOutToThisUser==true){return true}else{return false}}}}),ConvertToSFD:c(function(d){if(!d||d.SingleFile==true||d.ObjectCheckedOutToThisUser==false||d.Files.length!=1){return false}return true}),ConvertToMFD:c(function(d){if(!d||d.SingleFile==false||d.ObjectCheckedOutToThisUser==false){return false}return true}),OpenFile:b(function(e,d){if(!e){return false}else{if(d){return true}else{if(e.SingleFile==true){return true}else{return false}}}})}});MFNamespace("MFWA.TaskPane",function(n){var c=MFNamespace("MFWA.MFWA");var m=MFNamespace("MFWA.Data.Cache");var r=MFNamespace("MFWA.Data.Operations");var s=MFNamespace("MFWA.Dialogs.Upload");var k=MFNamespace("MFWA.Dialogs.DocumentCard");var p=MFNamespace("MFWA.Dialogs.Alerts");var i=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var l=MFNamespace("MFWA.Handlers.PropertyHandlers");var a=MFNamespace("MFWA.Enumerations");var g=MFNamespace("MFWA.Model");var j=MFNamespace("MFWA.Actions");var o=false;var h={};var q=function(v){var u=v.metadata();if(u.action){v.click(function(){if(o){return}var w=j[u.action];w.apply(j,u.params||[]);o=true;setTimeout(function(){o=false},50)})}};var d=function(u){u.find(".taskpaneButton").each(function(){q($(this))})};var e=function(u){return function(v){if(v.CanHaveFiles){if(u.objectVersion.SingleFile==true){$("#taskpaneAddFile").hide();$("#taskpaneOpenFile").show();$("#taskpaneDownloadFile").show()}else{if(u.objectVersion.SingleFile==false){$("#taskpaneDownloadFile").hide();$("#taskpaneOpenFile").hide();if(u.objectVersion.ObjectCheckedOutToThisUser==true){$("#taskpaneAddFile").show()}else{$("#taskpaneAddFile").hide()}}}}else{$("#taskpaneAddFile").hide();$("#taskpaneDownloadFile").hide();$("#taskpaneOpenFile").hide()}if(!c.getAppletInitialized()){$("#taskpaneDownloadFile").hide()}}};var f={taskpaneCheckOut:function(u){return u.ThisVersionLatestToThisUser&&!u.ObjectCheckedOut&&!u.Deleted},taskpaneCheckIn:function(u){return u.ThisVersionLatestToThisUser&&u.ObjectCheckedOutToThisUser},taskpaneUndoCheckout:function(u){return u.ThisVersionLatestToThisUser&&u.ObjectCheckedOut},taskpaneCollectionMembers:function(u){return u.ObjVer.Type==9},taskpaneReplaceFile:false,taskpaneProperties:true,taskpaneHistory:true,taskpaneRelationships:true,taskpaneSubobjects:true,taskpaneWorkflow:true,taskpaneMakeCopy:true,taskpaneViewAndModify:true};var t={taskpaneCheckOut:false,taskpaneCheckIn:false,taskpaneUndoCheckout:false,taskpaneMarkComplete:false,taskpaneCollectionMembers:false,taskpaneHistory:false,taskpaneRelationships:false,taskpaneCollectionMembers:false,taskpaneSubobjects:false,taskpaneWorkflow:false,taskpaneMakeCopy:false,taskpaneBrowse:false,taskpaneProperties:true};MFWA.Model.selectedItem.observe(this,function(u){if(u&&u.objectVersion){for(var x in f){var w=f[x];if(typeof w=="function"){w=w(u.objectVersion)}$("#"+x).toggle(w)}if(u.objectVersion.ObjVer.Type==10){m.getUserID(function(y){m.getProperties(10,u.objectVersion.ObjVer.ID,u.objectVersion.ObjVer.Version,function(C){var z=false;for(var B=0;B<C.length;B++){if(C[B].PropertyDef==a.MFBuiltInPropertyDef.AssignedTo){if(!C[B].TypedValue.Lookups){break}for(var A=0;A<C[B].TypedValue.Lookups.length;A++){if(y.Value==C[B].TypedValue.Lookups[A].Item){z=true;break}}break}}if(z==true&&u.objectVersion.ThisVersionLatestToThisUser==true&&u.objectVersion.Deleted==false){$("#taskpaneMarkComplete").show()}else{$("#taskpaneMarkComplete").hide()}})})}else{$("#taskpaneMarkComplete").hide()}m.getObjectType(u.objectVersion.ObjVer.Type,e(u));m.getObjectType(u.objectVersion.ObjVer.Type,function(B){var y=B.objectTypeTargetsForBrowsing;if(y.length>0){$("#taskpaneBrowse .taskpaneButton").hide();for(var z=0;z<y.length;z++){var A="taskpaneBrowseObjectType_"+y[z].TargetObjectType;$("#"+A).show()}$("#taskpaneBrowse").show()}else{$("#taskpaneBrowse").hide()}})}else{if(u&&u.objectFile){for(var x in t){var w=t[x];if(typeof w=="function"){w=w(u.objectFile)}$("#"+x).toggle(w)}if(u.parent&&u.parent.objectVersion){var v=u.parent.objectVersion;if(v.ObjectCheckedOutToThisUser==true){$("#taskpaneAddFile").show();$("#taskpaneDownloadFile").show();$("#taskpaneOpenFile").show();$("#taskpaneReplaceFile").show()}else{$("#taskpaneAddFile").hide();$("#taskpaneDownloadFile").show();$("#taskpaneOpenFile").show();$("#taskpaneReplaceFile").hide()}$("#taskpaneViewAndModify").show()}else{$("#taskpaneViewAndModify").hide()}}else{$("#taskpaneViewAndModify").hide();$("#taskpaneBrowse").hide()}}b(u)});var b=function(y){var x=$("#taskpaneThumbnail");if(!y){x.hide();return}var u=null;if(y.objectFile&&y.parent&&y.parent.objectVersion){var w=y.parent.objectVersion.ObjVer;var v=y.objectFile;u="REST/objects/"+w.Type+"/"+w.ID+"/"+w.Version+"/files/"+v.ID+"/"+v.Version+"/preview.aspx?size=150&force=true"}else{if(y.objectVersion){var w=y.objectVersion.ObjVer;u="REST/objects/"+w.Type+"/"+w.ID+"/"+w.Version+"/preview.aspx?size=150&force=true"}}if(u){x.attr("src",u);x.show()}else{x.hide()}};return{create:function(u){u.find(".taskpaneArea").each(function(){d($(this))})}}});MFNamespace("MFWA.Search",function(){var c=MFNamespace("MFWA.Debug.Assert");var d=MFNamespace("MFWA.Model");var q=MFNamespace("MFWA.Utils");var t=MFNamespace("MFWA.Data.Cache");var i=MFNamespace("MFWA.Enumerations.MFDataType");var h=MFNamespace("MFWA.I18n");var a=MFNamespace("MFWA.I18n.Search");var r=MFNamespace("MFWA.Listing");var b=MFNamespace("MFWA.MFWA");function m(u){$(u+" .searchConditionType").empty()}function o(u){m(u);var v='<option value="is">'+a.Conditions.same+"</option>";v+='<option value="isNot">'+a.Conditions.notSame+"</option>";v+='<option value="isEmpty">'+a.Conditions.isEmpty+"</option>";v+='<option value="isNotEmpty">'+a.Conditions.isNotEmpty+"</option>";$(u+" .searchConditionType").append(v)}function n(u){m(u);var v='<option value="is">'+a.Conditions.same+"</option>";v+='<option value="contains">'+a.Conditions.contains+"</option>";v+='<option value="startsWith">'+a.Conditions.startsWith+"</option>";v+='<option value="isEmpty">'+a.Conditions.isEmpty+"</option>";v+='<option value="isNotEmpty">'+a.Conditions.isNotEmpty+"</option>";$(u+" .searchConditionType").append(v)}function e(u){m(u);var v='<option value="is">'+a.Conditions.same+"</option>";v+='<option value="isNot">'+a.Conditions.notSame+"</option>";v+='<option value="greaterThan">'+a.Conditions.greaterThan+"</option>";v+='<option value="greaterOrEqualThan">'+a.Conditions.greaterOrEqualThan+"</option>";v+='<option value="lessThan">'+a.Conditions.lessThan+"</option>";v+='<option value="lessOrEqualThan">'+a.Conditions.lessOrEqualThan+"</option>";v+='<option value="isEmpty">'+a.Conditions.isEmpty+"</option>";v+='<option value="isNotEmpty">'+a.Conditions.isNotEmpty+"</option>";$(u+" .searchConditionType").append(v)}function j(u){m(u);var v='<option value="is">'+a.Conditions.same+"</option>";v+='<option value="isAfter">'+a.Conditions.isAfter+"</option>";v+='<option value="isBefore">'+a.Conditions.isBefore+"</option>";v+='<option value="today">'+a.Conditions.today+"</option>";v+='<option value="withinTheLastWeek">'+a.Conditions.withinTheLastWeek+"</option>";v+='<option value="withinTheLastMonth">'+a.Conditions.withinTheLastMonth+"</option>";v+='<option value="withinTheLastYear">'+a.Conditions.withinTheLastYear+"</option>";v+='<option value="isEmpty">'+a.Conditions.isEmpty+"</option>";v+='<option value="isNotEmpty">'+a.Conditions.isNotEmpty+"</option>";$(u+" .searchConditionType").append(v)}function s(u){$(u+" .searchTypedValue").remove();$(u+" .ui-datepicker-trigger").remove()}function l(v){var u='<select class="searchTypedValue"></select>';$(v).append(u)}function f(v){var u='<input class="searchTypedValue"></select>';$(v).append(u)}function k(v){var u='<input class="searchTypedValue"></select>';$(v).append(u);$(v+" .searchTypedValue").datepicker({dateFormat:h.DateTime.ShortDateFormat,changeMonth:true,changeYear:true,duration:"fast",gotoCurrent:true,buttonImage:"res/calendar.png",buttonText:"Choose",buttonImageOnly:true,showOn:"both"}).datepicker("setDate","+0")}function g(v,u){t.getValueListItems(u,function(y){var w="";for(var x=0;x<y.length;x++){w+='<option value="'+y[x].ID+'">'+y[x].Name+"</option>"}$(v+" .searchTypedValue").append(w)})}function p(v){var u='<option value="true">'+a.Conditions.booleanTrue+"</option>";u+='<option value="false">'+a.Conditions.booleanFalse+"</option>";$(v+" .searchTypedValue").append(u)}d.view.observe(this,function(u){if(u&&(u.viewPath||u.searchCriteria)){$("#searchWithinThisFolder").removeAttr("disabled")}else{$("#searchWithinThisFolder").attr("disabled",true);$("#searchWithinThisFolder").removeAttr("checked")}});return{ResetSearch:function(){$('#searchIn option[value="SearchInBoth"]').attr("selected","selected");$("#searchWithinThisFolder").removeAttr("checked");$("#searchString").attr("value","");$("#searchAllWordsButton").click();$('#searchObjectType option[value="All"]').attr("selected","selected");for(var u=1;u<=2;u++){$("#searchPropertyCriterion"+u+" .searchExpression").val("empty");$("#searchPropertyCriterion"+u+" .searchConditionType").empty();s("#searchPropertyCriterion"+u)}},OpenSearch:function(){if($("#searchAdvanced").css("display")=="none"){$("#browse").trigger("resize",[200]);$("#searchAdvanced").css("display","block");$("#taskpaneShadowBox").css("background-image","none");$("#searchBasic").css("background-image","none");$("#openSearchButton .searchIcon").css("background-image","url('Images/Icons/up_small.gif')")}else{$("#browse").trigger("resize",[70]);$("#searchAdvanced").css("display","none");$("#taskpaneShadowBox").css("background-image","url('Images/TaskPaneShadow.png')");$("#searchBasic").css("background-image","url('Images/SearchPaneBasicShadow.png')");$("#openSearchButton .searchIcon").css("background-image","url('Images/Icons/down_small.gif')")}},PerformSearch:function(){var C={SearchIn:$("#searchIn").val(),SearchString:$("#searchString").val(),SearchWithinThisFolder:$("#searchWithinThisFolder").attr("checked"),CurrentFolder:null,SearchType:null,SearchObjectType:"All",PropertyCriteria:new Array()};var E=true;if($("#searchAdvanced").css("display")=="none"){E=false}if(E){C.SearchType=$('[name="searchTypeGroup"]:checked').val();C.SearchObjectType=$("#searchObjectType").val();for(var x=1;x<=2;x++){var B=$("#searchPropertyCriterion"+x+" .searchExpression").val();var v=$("#searchPropertyCriterion"+x+" .searchConditionType").val();if(v=="isEmpty"||v=="isNotEmpty"){var A={Property:B,Condition:v,TypedValue:"$0",DataFunction:null,DataType:null};C.PropertyCriteria.push(A)}else{if($("#searchPropertyCriterion"+x+" .hasDatepicker").length==1){var F=$("#searchPropertyCriterion"+x+" .hasDatepicker").datepicker("getDate");var u="d";var z="d";switch(v){case"today":F=new Date();break;case"withinTheLastWeek":case"withinTheLastMonth":case"withinTheLastYear":var D=365;if(v=="withinTheLastMonth"){D=30}else{if(v=="withinTheLastWeek"){D=7}}var G={Property:B,Condition:"lessOrEqualThan",TypedValue:q.getUTCTime(new Date()).getTime(),DataFunction:"d",DataType:"d"};C.PropertyCriteria.push(G);u="m";v="lessOrEqualThan";F=D;z="i";break;case"isAfter":case"isBefore":case"is":default:break}var A={Property:B,Condition:v,TypedValue:null,DataFunction:u,DataType:z};if(u=="m"){A.TypedValue=F}else{A.TypedValue=q.getUTCTime(F).getTime()}C.PropertyCriteria.push(A)}else{var A={Property:B,Condition:v,TypedValue:$("#searchPropertyCriterion"+x+" .searchTypedValue").val(),DataFunction:null,DataType:null};C.PropertyCriteria.push(A)}}}}var w;if(C.SearchWithinThisFolder==false||!d.view.get()||!d.view.get().searchCriteria){w={path:"",array:[]}}else{w=d.view.get().searchCriteria}if(C.SearchWithinThisFolder){var y=d.view.get();if(typeof y.viewPath!="undefined"){w.path=y.viewPath}else{if(y.searchCriteria){w.path=y.searchCriteria.path}else{c.fail("Cannot search within this view")}}}w.array.push(C);d.view.set({searchCriteria:w})},UpdateConditionField:function(y){var x="#searchPropertyCriterion"+y;var w=$(x+" .searchExpression").val();s(x);if(w=="empty"){m(x)}else{if(w.substring(0,2)=="VL"){var v=w.substring(3);o(x);l(x);g(x,v)}else{if(w.substring(0,2)=="PV"){var u=w.substring(3);t.getPropertyDef(u,function(A){switch(A.DataType){case i.Lookup:case i.MultiSelectLookup:var z=A.ValueList;o(x);l(x);g(x,z);break;case i.Text:n(x);f(x);break;case i.Integer:case i.Floating:e(x);f(x);break;case i.Date:case i.Timestamp:j(x);k(x);break;case i.Boolean:o(x);l(x);p(x);break;case i.Uninitialized:case i.Time:case i.Integer64:case i.FILETIME:case i.MultiLineText:case i.ACL:default:m(x)}})}}}},UpdateTypedValueField:function(v){var u="#searchPropertyCriterion"+v;var w=$(u+" .searchConditionType").val();switch(w){case"isEmpty":case"isNotEmpty":case"today":case"withinTheLastWeek":case"withinTheLastMonth":case"withinTheLastYear":$(u+" .searchTypedValue").css("display","none");$(u+" .ui-datepicker-trigger").css("display","none");break;default:$(u+" .searchTypedValue").css("display","inline");$(u+" .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(m){var h=MFNamespace("MFWA.Data.Cache");var l=MFNamespace("MFWA.Utils");var n=MFNamespace("MFWA.I18n");var e=MFNamespace("MFWA.Enumerations.MFBuiltInPropertyDef");var a=MFNamespace("MFWA.Enumerations");var f=MFNamespace("MFWA.PropertiesPane.Column");var g=new Array();var d='<div class="propertiesPaneColumn"><table></table></div>';function c(p,q){for(var o=0;o<p.length;o++){if(p[o].PropertyDef==q){return p[o]}}return null}function j(q,o){for(var p=0;p<q.length;p++){if(q[p].ID==o){return q[p]}}return null}function k(p){if(p[0].Rows.length>0){var q=$("#propertiesPane").height()-$("#propertiesPaneInfo").height()-parseInt($("#propertiesPaneMargin").css("margin-top"));var o=p[0].Rows[p[0].Rows.length-1].Height;while(p[0].pushRight(o,p[0].Height,q)!=false){o=p[0].Rows[p[0].Rows.length-1].Height}}}function b(q){g=new Array();var o=$("#propertiesPaneProperties").width();var s=$("#propertiesPaneTitle").outerWidth(true);var r=Math.floor(o/s);g.push(f.createColumn(q));for(var p=1;p<r;p++){g.push(f.createColumn());g[p-1].Right=g[p];g[p].Left=g[p-1]}return g}function i(s,o,t,r,q,p){h.getUserID(function(Q){var R=Q.Value;var C='<tr><td class="propertiesPaneNameOrTitle">'+l.escape(s.Title)+"</td></tr>";var A=c(o,e.Class).TypedValue.DisplayValue;C+="<tr><td>"+l.escape(A);C+=" "+l.format(n.PropertiesPane.IDAndVersion,s.DisplayID,s.ObjVer.Version)+"</td></tr>";var J=l.escape(c(o,e.Created).TypedValue.DisplayValue);J+=n.Comma;J+=l.escape(c(o,e.CreatedBy).TypedValue.DisplayValue);var y='<tr><td class="dataname">'+l.escape(j(t,e.Created).Name)+n.Colon+"</td>";y+="<td>"+J+"</td></tr>";var G=l.escape(c(o,e.LastModified).TypedValue.DisplayValue);G+=n.Comma;G+=l.escape(c(o,e.LastModifiedBy).TypedValue.DisplayValue);y+='<tr><td class="dataname">'+n.PropertiesPane.LastModified+"</td>";y+="<td>"+G+"</td></tr>";if(s.ObjectCheckedOut){y+='<tr><td class="dataname">'+n.PropertiesPane.Status+"</td>";y+="<td>"+n.PropertiesPane.CheckedOut+n.Comma+l.escape(s.CheckedOutTo);y+=" ["+l.escape(s.CheckedOutFrom)+"]</td></tr>";y+='<tr><td class="dataname">&nbsp;</td>';y+="<td>"+s.CheckedOutAtDisplayValue;y+="</td></tr>"}if(s.Deleted){var P=l.escape(c(o,e.Deleted).TypedValue.DisplayValue);P+=n.Comma;P+=l.escape(c(o,e.DeletedBy).TypedValue.DisplayValue);y+='<tr><td class="dataname">'+l.escape(j(t,e.Deleted).Name)+n.Colon+"</td>";y+="<td>"+P+"</td></tr>"}$("#propertiesPaneTitle").empty();$("#propertiesPaneTitle").append("<table>"+C+"</table>");$("#propertiesPaneTimestamps").empty();$("#propertiesPaneTimestamps").append("<table>"+y+"</table>");$("#propertiesPaneProperties").empty();$("#propertiesPaneProperties").append(d);var w=0;if(p&&p.NamePropertyDefID){w=p.NamePropertyDefID}for(var O=0;O<o.length;O++){if(o[O].PropertyDef!=w&&MFWA.Dialogs.DocumentCard.Filters.showInPropertiesPane(o[O].PropertyDef)){var H='<tr><td class="dataname">'+l.escape(j(t,o[O].PropertyDef).Name)+":</td>";var F="";if(o[O].TypedValue.DataType==MFWA.Enumerations.MFDataType.MultiSelectLookup){if(o[O].TypedValue.Lookups){for(var N=0;N<o[O].TypedValue.Lookups.length;N++){if(o[O].TypedValue.Lookups[N].Item==R&&(o[O].PropertyDef==e.AssignedTo||o[O].PropertyDef==e.CompletedBy)){F+='<div style="font-weight: bold;">'}else{F+="<div>"}var z=l.escape(o[O].TypedValue.Lookups[N].DisplayValue);if(!z){z=""}F+=z;F+="</div>"}}}if(o[O].TypedValue.DataType==MFWA.Enumerations.MFDataType.Lookup){if(o[O].TypedValue.Lookup){F+="<div>";var z=l.escape(o[O].TypedValue.Lookup.DisplayValue);if(!z){z=""}F+=z;F+="</div>"}}else{if(o[O].TypedValue.DataType==a.MFDataType.Text&&o[O].ContentType==2){var L=l.escape(o[O].TypedValue.DisplayValue);if(L){F='<a href="'+L+'" target="_blank">'+L+"</a>"}}else{if(o[O].TypedValue.DataType==a.MFDataType.Text&&o[O].ContentType==1){var x=l.escape(o[O].TypedValue.DisplayValue);if(x){F='<a href="mailto:'+x+'"">'+x+"</a>"}}else{var z=l.escape(o[O].TypedValue.DisplayValue);if(z){F=z.replace(/\r/g,"");F=F.replace(/\n/g,"<br>")}}}}H+="<td>"+F+"</td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(H)}}if(r.length>0){var I='<tr><td class="dataname">'+l.escape(j(t,e.VersionComment).Name)+n.Colon+"</td><td>";I+=l.escape(r[0].LastModifiedBy.TypedValue.DisplayValue)+":<br>";var K=l.escape(r[0].Comment.TypedValue.DisplayValue);if(K){var M=K.replace(/\r/g,"");M=M.replace(/\n/g,"<br>");I+=M}if(r.length>1){I+="<br>";I+='<div class="morecomments" onclick=\'MFNamespace("MFWA.Actions").objectOperations("Comments")\'>';I+=n.PropertiesPane.MoreComments+"</div>"}I+="</td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(I)}var B=c(o,e.Workflow);if(B){var E='<tr><td class="dataname">'+n.PropertiesPane.State+"</td><td>";var v=c(o,e.State);if(v.TypedValue.DisplayValue!=""){E+=l.escape(v.TypedValue.DisplayValue)}else{E+="-"}E+=" ("+l.escape(B.TypedValue.DisplayValue)+")</td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(E)}if(s.HasAssignments){var S='<tr><td class="dataname"></td>';S+='<td id="propertiesPaneAssignments" onclick="MFWA.Actions.objectOperations(\'GetAssignmentsForObject\');">';S+=l.escape(q)+"</td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(S)}var u=b($("#propertiesPaneProperties > div.propertiesPaneColumn tr"));k(u);$("#propertiesPaneProperties").empty();for(var O=0;O<u.length;O++){$("#propertiesPaneProperties").append('<div class="propertiesPaneColumn"></div>');var D="";for(var N=0;N<u[O].Rows.length;N++){D+=u[O].Rows[N].HTML}$("#propertiesPaneProperties > div.propertiesPaneColumn:eq("+O+")").append("<table>"+D+"</table>")}})}return{propPaneResized:function(){var x=g.length;if(x>0&&g[0].Rows.length>0){var o=$("#propertiesPane").height()-$("#propertiesPaneInfo").height()-parseInt($("#propertiesPaneMargin").css("margin-top"));var q=$("#propertiesPaneProperties").width();var p=$("#propertiesPaneTitle").outerWidth(true);var y=Math.floor(q/p);if(y==0){y=1}if(y<x){while(y<x){var r=g[x-2];var z=g[x-1];r.Rows.push.apply(r.Rows,z.Rows);r.Height+=z.Height;g.pop();r.Right=null;x=g.length}}else{if(y>x){while(y>x){var s=MFNamespace("MFWA.PropertiesPane.Column");g.push(s.createColumn());var v=g.length-1;g[v-1].Right=g[v];g[v].Left=g[v-1];x=g.length}}}for(var u=g.length;u>1;u--){var r=g[u-2];var z=g[u-1];r.Rows.push.apply(r.Rows,z.Rows);r.Height+=z.Height;z.Rows.splice(0,z.Rows.length);z.Height=0}k(g);$("#propertiesPaneProperties").empty();for(var u=0;u<g.length;u++){$("#propertiesPaneProperties").append('<div class="propertiesPaneColumn"></div>');var w="";for(var t=0;t<g[u].Rows.length;t++){w+=g[u].Rows[t].HTML}$("#propertiesPaneProperties .propertiesPaneColumn:eq("+u+")").append("<table>"+w+"</table>")}}},clear:function(){$("#propertiesPaneTitle").empty();$("#propertiesPaneTimestamps").empty();$("#propertiesPaneProperties").empty();g=new Array()},setProperties:function(o){var p=function(){m.clear()};h.getObjectVersionOrHandleError(o,function(q){h.getPropertiesForDisplay(o,function(r){h.getPropertyDefs(function(s){h.getVersionComments(o,function(t){h.getObjectType(10,function(u){var v=c(r,e.Class).TypedValue.Lookup.Item;h.getClass(v,function(w){i(q,r,s,t,u.NamePlural,w)},function(){i(q,r,s,t,u.NamePlural)})})})})})},p)}}});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}}});MFNamespace("MFWA.Layout",function(a){var b=MFNamespace("MFWA.PropertiesPane");return{refresh:function(){$("#taskpaneShadowBox2").height($(window).height()-$("#menubar").height()-$("#taskpaneTopic").height()-$("#taskpaneShadowBox").height())},init:function(){$("#taskpaneShadowBox2").height($(window).height()-$("#menubar").height()-$("#taskpaneTopic").height()-$("#taskpaneShadowBox").height());$("#panel").splitter({splitHorizontal:true,outline:false,sizeBottom:200,minBottom:200,maxBottom:200});$("#browseBottom").splitter({splitHorizontal:true,outline:false,tabIndex:-1,sizeBottom:true,minBottom:50,minTop:100}).bind("resize",function(){d()});var c=null;var d=function(){if(c!=null){clearTimeout(c)}c=setTimeout(function(){resizeQueued=false;b.propPaneResized()},100)};$("#rightPanel").splitter({splitVertical:true,outline:false,sizeLeft:170,minLeft:170,maxLeft:170});$("#browse").splitter({splitHorizontal:true,outline:false,sizeTop:true,minTop:70,maxTop:200});$("#page").splitter({splitVertical:true,outline:false,sizeLeft:250,minLeft:50,minRight:300,resizeToWindow:true,anchorToWindow:true});$("#rightPanel").trigger("resize");$("#browse").trigger("resize");$("#browseBottom").trigger("resize");$("#panel").trigger("resize");$("#listing .listing-container").trigger("resize");$("#applet applet").css({position:"relative",display:"block",height:"100%",width:"100%"})}}});