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)},removeTemporaryFile:function(objectVersion,callback,error){callJava("removeTemporaryFile",callback,error,objectVersion)},deleteFile:function(objectVersion,objectFile,callback,error){callJava("deleteFile",callback,error,objectVersion,objectFile)},renameFile:function(objectVersion,objectFile,newTitle,callback,error){callJava("renameFile",callback,error,objectVersion,objectFile,newTitle)},renameObject:function(objectVersion,newTitle,callback,error){callJava("renameObject",callback,error,objectVersion,newTitle)},setSingleFileObject:function(objectVersion,convertToSFD,callback,error){callJava("setSingleFileObject",callback,error,objectVersion,convertToSFD)},testError:function(callback,error){callJava("errorful",callback,error)}}});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")}})})();(function(){var a={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(e){for(var b=0;b<e.length;b++){var c=e[b].string;var d=e[b].prop;this.versionSearchString=e[b].versionSearch||e[b].identity;if(c){if(c.indexOf(e[b].subString)!=-1){return e[b].identity}}else{if(d){return e[b].identity}}}},searchVersion:function(c){var b=c.indexOf(this.versionSearchString);if(b==-1){return}return parseFloat(c.substring(b+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};a.init();window.$.client={os:a.OS,browser:a.browser,browserversion:a.version}})();
/*
 * 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 j=false;var e=[],m=[],k=activeItem=null,c=f('<div class="menu-div outerbox" style="position:absolute;top:0;left:0;display:none;"><div class="shadowbox1"></div><div class="shadowbox2"></div><div class="shadowbox3"></div></div>')[0],b=f('<ul class="menu-ul innerbox"></ul>')[0],l=f('<li style="position:relative;"><div class="menu-item"></div></li>')[0],i=f('<img class="menu-item-arrow" />')[0],h=f('<div id="root-menu-div" style="position:absolute;top:0;left:0;"></div>'),d={showDelay:200,hideDelay:200,hoverOpenDelay:0,offsetTop:0,offsetLeft:0,minWidth:0,onOpen:null,onClose:null,onClick:null,arrowSrc:null,addExpando:false,copyClassAttr:false};f(function(){h.appendTo("body")});f.extend({MenuCollection:function(n){this.menus=[];this.init(n)}});f.extend(f.MenuCollection,{prototype:{init:function(n){if(n&&n.length){for(var o=0;o<n.length;o++){this.addMenu(n[o]);n[o].menuCollection=this}}},addMenu:function(o){if(o instanceof f.Menu){this.menus.push(o)}o.menuCollection=this;var n=this;f(o.target).hover(function(){if(o.visible){return}for(var p=0;p<n.menus.length;p++){if(n.menus[p].visible){n.menus[p].hide();o.show();return}}},function(){})}}});f.extend({Menu:function(p,n,o){this.menuItems=[];this.subMenus=[];this.visible=false;this.active=false;this.parentMenuItem=null;this.settings=f.extend({},d,o);this.target=p;this.$eDIV=null;this.$eUL=null;this.timer=null;this.menuCollection=null;this.openTimer=null;this.init();if(n&&n.constructor==Array){this.addItems(n)}}});f.extend(f.Menu,{checkMouse:function(o){var n=o.target;if(m.length&&n==m[0].target){return}while(n.parentNode&&n.parentNode!=h[0]){n=n.parentNode}if(!f(m).filter(function(){return this.$eDIV[0]==n}).length){f.Menu.closeAll()}},checkKey:function(s){switch(s.keyCode){case 13:if(activeItem){activeItem.click(s,activeItem.$eLI[0])}break;case 27:f.Menu.closeAll();break;case 37:if(!k){k=m[0]}var o=k;if(o&&o.parentMenuItem){var q=o.parentMenuItem;q.$eLI.unbind("mouseout").unbind("mouseover");o.hide();q.hoverIn(true);setTimeout(function(){q.bindHover()})}else{if(o&&o.menuCollection){var t,p=o.menuCollection.menus;if((t=f.inArray(o,p))>-1){if(--t<0){t=p.length-1}f.Menu.closeAll();p[t].show();p[t].setActive();if(p[t].menuItems.length){p[t].menuItems[0].hoverIn(true)}}}}break;case 38:if(k){k.selectNextItem(-1)}break;case 39:if(!k){k=m[0]}var n,o=k,r=activeItem?activeItem.subMenu:null;if(o){if(r&&r.menuItems.length){r.show();r.menuItems[0].hoverIn()}else{if((o=o.inMenuCollection())){var t,p=o.menuCollection.menus;if((t=f.inArray(o,p))>-1){if(++t>=p.length){t=0}f.Menu.closeAll();p[t].show();p[t].setActive();if(p[t].menuItems.length){p[t].menuItems[0].hoverIn(true)}}}}}break;case 40:if(!k){if(m.length&&m[0].menuItems.length){m[0].menuItems[0].hoverIn()}}else{k.selectNextItem()}break}if(s.keyCode>36&&s.keyCode<41){return false}},closeAll:function(){f("#menuFrame").css("display","none");f("#subMenuFrame").css("display","none");f("#insertColumnFrame").css("display","none");while(m.length){m[0].hide()}},isActive:function(){return(m!=null&&m.length>0)},setDefaults:function(n){f.extend(d,n)},prototype:{init:function(){var n=this;if(!this.target){return}else{if(this.target instanceof f.MenuItem){this.parentMenuItem=this.target;this.target.addSubMenu(this);this.target=this.target.$eLI}}e.push(this);this.$eDIV=f(c.cloneNode(1));this.$eUL=f(b.cloneNode(1));this.$eDIV[0].appendChild(this.$eUL[0]);h[0].appendChild(this.$eDIV[0]);if(!this.parentMenuItem){f(this.target).click(function(o){n.onClick(o)}).hover(function(o){n.setActive();if(n.settings.hoverOpenDelay){n.openTimer=setTimeout(function(){if(!n.visible){n.onClick(o)}},n.settings.hoverOpenDelay)}},function(){if(!n.visible){f(this).removeClass("activetarget")}if(n.openTimer){clearTimeout(n.openTimer)}})}else{this.$eDIV.hover(function(){n.setActive()},function(){})}},setActive:function(){if(!this.parentMenuItem){f(this.target).addClass("activetarget")}else{this.active=true}},addItem:function(n){if(n instanceof f.MenuItem){if(f.inArray(n,this.menuItems)==-1){this.$eUL.append(n.$eLI);this.menuItems.push(n);n.parentMenu=this;if(n.subMenu){this.subMenus.push(n.subMenu)}}}else{this.addItem(new f.MenuItem(n,this.settings))}},addItems:function(n){for(var o=0;o<n.length;o++){this.addItem(n[o])}},removeItem:function(n){var o=f.inArray(n,this.menuItems);if(o>-1){this.menuItems.splice(o,1)}n.parentMenu=null},hide:function(){if(!this.visible){return}var n,o=f.inArray(this,m);this.$eDIV.hide();if(o>=0){m.splice(o,1)}this.visible=this.active=false;f(this.target).removeClass("activetarget");for(n=0;n<this.subMenus.length;n++){this.subMenus[n].hide()}for(n=0;n<this.menuItems.length;n++){if(this.menuItems[n].active){this.menuItems[n].setInactive()}}if(!m.length){f(document).unbind("mousedown",f.Menu.checkMouse).unbind("keydown",f.Menu.checkKey)}if(k==this){k=null}if(this.settings.onClose){this.settings.onClose.call(this)}},show:function(p){if(this.visible){return}var o,n=this.parentMenuItem;f("#menuFrame").css("display","block");if(this.menuItems.length){if(n){o=parseInt(n.parentMenu.$eDIV.css("z-index"));this.$eDIV.css("z-index",(isNaN(o)?1:o+1))}this.$eDIV.css({visibility:"hidden",display:"block"});if(this.settings.minWidth){if(this.$eDIV.width()<this.settings.minWidth){this.$eDIV.css("width",this.settings.minWidth);f("#menuFrame").css("width",this.settings.minWidth);f("#subMenuFrame").css("width",this.settings.minWidth)}}this.setPosition();this.$eDIV.css({display:"none",visibility:""}).show();if(f.browser.msie){this.$eUL.css("width",parseInt(f.browser.version)==6?this.$eDIV.width()-7:this.$eUL.width());f("#menuFrame").css("width",parseInt(f.browser.version)==6?this.$eDIV.width()-7:this.$eUL.width())}if(!n){f("#menuFrame").css("height",(this.$eDIV[0].offsetHeight));j=false}else{if(j){f("#insertColumnFrame").css("height",(this.$eDIV[0].offsetHeight));f("#insertColumnFrame").css("display","block")}else{f("#subMenuFrame").css("height",(this.$eDIV[0].offsetHeight));j=true;f("#subMenuFrame").css("display","block")}}if(this.settings.onOpen){this.settings.onOpen.call(this)}}if(m.length==0){f(document).bind("mousedown",f.Menu.checkMouse).bind("keydown",f.Menu.checkKey)}this.visible=true;m.push(this)},setPosition:function(){var u,s,q,n,x,y,t,v=f(window).width(),p=f(window).height(),z=this.parentMenuItem,A=this.$eDIV[0].clientHeight,r=this.$eDIV[0].clientWidth,w;if(z){s=z.$eLI.offset();q=s.left+z.$eLI.width();n=s.top}else{u=f(this.target);s=u.offset();q=s.left+this.settings.offsetLeft;n=s.top+u.height()+this.settings.offsetTop}if(f.fn.scrollTop){y=f(window).scrollTop();if(p<A){}else{if(p+y<n+A){if(z){x=z.parentMenu.$eDIV.offset();w=z.parentMenu.$eDIV[0].clientHeight;if(A<=w){n=x.top+w-A}else{n=x.top}if(p+y<n+A){n-=n+A-(p+y)}}else{n-=n+A-(p+y)}}}}if(f.fn.scrollLeft){t=f(window).scrollLeft();if(v+t<q+r){if(z){q-=z.$eLI.width()+r;if(q<t){q=t}}else{q-=q+r-(v+t)}}}this.$eDIV.css({left:q,top:n});if(!z){f("#menuFrame").css({left:q,top:n})}else{if(j){f("#insertColumnFrame").css({left:q,top:n})}else{f("#subMenuFrame").css({left:q,top:n})}}},onClick:function(n){if(this.visible){this.hide();this.setActive()}else{f.Menu.closeAll();this.show(n)}},addTimer:function(p,o){var n=this;this.timer=setTimeout(function(){p.call(n);n.timer=null},o)},removeTimer:function(){if(this.timer){clearTimeout(this.timer);this.timer=null}},selectNextItem:function(r){var n,s=0,p=this.menuItems.length,q=r||1;for(n=0;n<p;n++){if(this.menuItems[n].active){s=n;break}}this.menuItems[s].hoverOut();do{s+=q;if(s>=p){s=0}else{if(s<0){s=p-1}}}while(this.menuItems[s].separator);this.menuItems[s].hoverIn(true)},inMenuCollection:function(){var n=this;while(n.parentMenuItem){n=n.parentMenuItem.parentMenu}return n.menuCollection?n:null},destroy:function(){var o,n;this.hide();if(!this.parentMenuItem){f(this.target).unbind("click").unbind("mouseover").unbind("mouseout")}else{this.$eDIV.unbind("mouseover").unbind("mouseout")}while(this.menuItems.length){n=this.menuItems[0];n.destroy();delete n}if((o=f.inArray(this,e))>-1){e.splice(o,1)}if(this.menuCollection){if((o=f.inArray(this,this.menuCollection.menus))>-1){this.menuCollection.menus.splice(o,1)}}this.$eDIV.remove()}}});f.extend({MenuItem:function(o,n){if(typeof o=="string"){o={src:o}}this.src=o.src||"";this.url=o.url||null;this.urlTarget=o.target||null;this.addClass=o.addClass||null;this.data=o.data||null;this.$eLI=null;this.parentMenu=null;this.subMenu=null;this.settings=f.extend({},d,n);this.active=false;this.enabled=true;this.separator=false;this.init();if(o.subMenu){new f.Menu(this,o.subMenu,n)}}});f.extend(f.MenuItem,{prototype:{init:function(){var p,o,q=this.src,n=this;this.$eLI=f(l.cloneNode(1));if(this.addClass){this.$eLI[0].setAttribute("class",this.addClass)}if(this.settings.addExpando&&this.data){this.$eLI[0].menuData=this.data}if(q==""){this.$eLI.addClass("menu-separator");this.separator=true}else{o=typeof q=="string";if(o&&this.url){q=f('<a href="'+this.url+'"'+(this.urlTarget?'target="'+this.urlTarget+'"':"")+">"+q+"</a>")}else{if(o||!q.length){q=[q]}}for(p=0;p<q.length;p++){if(typeof q[p]=="string"){elem=document.createElement("span");elem.innerHTML=q[p];this.$eLI[0].firstChild.appendChild(elem)}else{this.$eLI[0].firstChild.appendChild(q[p].cloneNode(1))}}}this.$eLI.click(function(r){n.click(r,this)});this.bindHover()},click:function(o,n){if(this.enabled&&this.settings.onClick){this.settings.onClick.call(n,o,this)}},bindHover:function(){var n=this;this.$eLI.hover(function(){n.hoverIn()},function(){n.hoverOut()})},hoverIn:function(o){this.removeTimer();var p,r=this.parentMenu.subMenus,q=this.parentMenu.menuItems,n=this;if(this.parentMenu.timer){this.parentMenu.removeTimer()}if(!this.enabled){return}for(p=0;p<q.length;p++){if(q[p].active){q[p].setInactive()}}this.setActive();k=this.parentMenu;for(p=0;p<r.length;p++){if(r[p].visible&&r[p]!=this.subMenu&&!r[p].timer){r[p].addTimer(function(){this.hide()},r[p].settings.hideDelay)}}if(this.subMenu&&!o){this.subMenu.addTimer(function(){this.show()},this.subMenu.settings.showDelay)}},hoverOut:function(){this.removeTimer();if(!this.enabled){return}if(!this.subMenu||!this.subMenu.visible){this.setInactive()}},removeTimer:function(){if(this.subMenu){this.subMenu.removeTimer()}},setActive:function(){this.active=true;this.$eLI.addClass("active");var n=this.parentMenu.parentMenuItem;if(n&&!n.active){n.setActive()}activeItem=this},setInactive:function(){this.active=false;this.$eLI.removeClass("active");if(this==activeItem){activeItem=null}},enable:function(){this.$eLI.removeClass("disabled");this.enabled=true},disable:function(){this.$eLI.addClass("disabled");this.enabled=false},destroy:function(){this.removeTimer();this.$eLI.remove();this.$eLI.unbind("mouseover").unbind("mouseout").unbind("click");if(this.subMenu){this.subMenu.destroy();delete this.subMenu}this.parentMenu.removeItem(this)},addSubMenu:function(o){if(this.subMenu){return}this.subMenu=o;if(this.parentMenu&&f.inArray(o,this.parentMenu.subMenus)==-1){this.parentMenu.subMenus.push(o)}if(this.settings.arrowSrc){var n=i.cloneNode(0);n.setAttribute("src",this.settings.arrowSrc);this.$eLI[0].firstChild.appendChild(n)}}}});f.extend(f.fn,{menuFromElement:function(o,q,p){var n=function(y){var u=[],w,t,B,z,v,A,s,x,r=null;B=g(y,"LI");for(v=0;v<B.length;v++){w=[];if(!B[v].childNodes.length){u.push(new f.MenuItem("",o));continue}if((A=a(B[v],"UL"))){w=n(A);f(A).remove()}z=f(B[v]);if(z[0].childNodes.length==1&&z[0].childNodes[0].nodeType==3){x=z[0].childNodes[0].nodeValue}else{x=z[0].childNodes}if(o&&o.copyClassAttr){r=z.attr("class")}t=new f.MenuItem({src:x,addClass:r},o);u.push(t);if(w.length){new f.Menu(t,w,o)}}return u};return this.each(function(){var s,r;if(q||(s=a(this,"UL"))){s=q?f(q).clone(true)[0]:s;menuItems=n(s);if(menuItems.length){r=new f.Menu(this,menuItems,o);if(p){p.addMenu(r)}}f(s).hide()}})},menuBarFromUL:function(n){return this.each(function(){var p,o=g(this,"LI");if(o.length){bar=new f.MenuCollection();for(p=0;p<o.length;p++){f(o[p]).menuFromElement(n,null,bar)}}})},menu:function(o,n){return this.each(function(){if(n&&n.constructor==Array){new f.Menu(this,n,o)}else{if(this.nodeName.toUpperCase()=="UL"){f(this).menuBarFromUL(o)}else{f(this).menuFromElement(o,n)}}})}});var a=function(p,o){if(!p){return null}var q=p.firstChild;for(;q;q=q.nextSibling){if(q.nodeType==1&&q.nodeName.toUpperCase()==o){return q}}return null};var g=function(q,o){if(!q){return[]}var p=[],s=q.firstChild;for(;s;s=s.nextSibling){if(s.nodeType==1&&s.nodeName.toUpperCase()==o){p[p.length]=s}}return p}})(jQuery);(function(c){function b(){this.hasTextHighlighted=false;this._disabledInputs=[];this.regional=[];this.regional[""]={show24Hours:false,separator:":",ampmPrefix:" ",ampmNames:["AM","PM"],spinnerTexts:["Now","Previous field","Next field","Increment","Decrement"]};this._defaults={appendText:"",showSeconds:false,timeSteps:[1,1,1],initialField:0,useMouseWheel:true,defaultTime:null,minTime:null,maxTime:null,spinnerImage:"spinnerDefault.png",spinnerSize:[20,20,8],spinnerBigImage:"",spinnerBigSize:[40,40,16],spinnerIncDecOnly:false,spinnerRepeat:[500,250],beforeShow:null,beforeSetTime:null};c.extend(this._defaults,this.regional[""])}var e="timeEntry";var d;c.extend(b.prototype,{markerClassName:"hasTimeEntry",setDefaults:function(f){a(this._defaults,f||{});return this},_connectTimeEntry:function(i,n){var l=c(i);if(l.hasClass(this.markerClassName)){return}var h={};h.options=c.extend({},n);h._selectedHour=0;h._selectedMinute=0;h._selectedSecond=0;h._field=0;h.input=c(i);c.data(i,e,h);var f=this._get(h,"spinnerImage");var j=this._get(h,"spinnerText");var k=this._get(h,"spinnerSize");var g=this._get(h,"appendText");var m=(!f?null:c('<span class="timeEntry_control" style="display: inline-block; background: url(\''+f+"') 0 0 no-repeat; width: "+k[0]+"px; height: "+k[1]+"px;"+(c.browser.mozilla&&c.browser.version<"1.9"?" padding-left: "+k[0]+"px; padding-bottom: "+(k[1]-18)+"px;":"")+'"></span>'));l.wrap('<span class="timeEntry_wrap"></span>').after(g?'<span class="timeEntry_append">'+g+"</span>":"").after(m||"");l.addClass(this.markerClassName).bind("focus.timeEntry",this._doFocus).bind("blur.timeEntry",this._doBlur).bind("click.timeEntry",this._doClick).bind("mouseover.timeEntry",this._doMouseOver).bind("mouseout.timeEntry",this._doMouseOut).bind("keydown.timeEntry",this._doKeyDown).bind("keypress.timeEntry",this._doKeyPress);if(c.browser.mozilla){l.bind("input.timeEntry",function(o){c.timeentry._parseTime(h)})}if(c.browser.msie){l.bind("paste.timeEntry",function(o){setTimeout(function(){c.timeentry._parseTime(h)},1)})}if(this._get(h,"useMouseWheel")&&c.fn.mousewheel){l.mousewheel(this._doMouseWheel)}if(m){m.mousedown(this._handleSpinner).mouseup(this._endSpinner).mouseover(this._expandSpinner).mouseout(this._endSpinner).mousemove(this._describeSpinner)}},_enableTimeEntry:function(f){this._enableDisable(f,false)},_disableTimeEntry:function(f){this._enableDisable(f,true)},_enableDisable:function(f,g){var h=c.data(f,e);if(!h){return}f.disabled=g;if(f.nextSibling&&f.nextSibling.nodeName.toLowerCase()=="span"){c.timeEntry._changeSpinner(h,f.nextSibling,(g?5:-1))}c.timeEntry._disabledInputs=c.map(c.timeEntry._disabledInputs,function(i){return(i==f?null:i)});if(g){c.timeEntry._disabledInputs.push(f)}},_isDisabledTimeEntry:function(f){return c.inArray(f,this._disabledInputs)>-1},_changeTimeEntry:function(f,g){var i=c.data(f,e);if(i){var h=this._extractTime(i);a(i.options,g||{});if(h){this._setTime(i,new Date(0,0,0,h[0],h[1],h[2]))}}c.data(f,e,i)},_destroyTimeEntry:function(f){$input=c(f);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(g){return(g==f?null:g)});$input.parent().replaceWith($input);c.removeData(f,e)},_setTimeTimeEntry:function(f,h){var g=c.data(f,e);if(g){this._setTime(g,h?(typeof h=="object"?new Date(h.getTime()):h):null)}},_getTimeTimeEntry:function(f){var h=c.data(f,e);var g=(h?this._extractTime(h):null);return(!g?null:new Date(0,0,0,g[0],g[1],g[2]))},_doFocus:function(h){var f=(h.nodeName&&h.nodeName.toLowerCase()=="input"?h:this);if(c.timeEntry._lastInput==f||c.timeEntry._isDisabledTimeEntry(f)){c.timeEntry._focussed=false;return}var g=c.data(f,e);c.timeEntry._focussed=true;c.timeEntry._lastInput=f;c.timeEntry._blurredInput=null;var i=c.timeEntry._get(g,"beforeShow");a(g.options,(i?i.apply(f,[f]):{}));c.data(f,e,g);c.timeEntry._parseTime(g);setTimeout(function(){c.timeEntry._showField(g)},10)},_doBlur:function(f){c.timeEntry._blurredInput=c.timeEntry._lastInput;c.timeEntry._lastInput=null;c.timeEntryhasTextHighlighted=false},_doMouseOver:function(f){if(!c(".time_check").attr("checked")){return}if(f.target.selectionStart!=null){d=document.activeElement;c.timeEntry._doFocus(f.target)}},_doMouseOut:function(f){if(!c(".time_check").attr("checked")){return}if(f.target==d){return}if(f.target.selectionStart!=null){c(d).focus()}},_doClick:function(g){d=g.target;var n=g.target;var j=c.data(n,e);c.timeEntry._focussed=false;if(!c.timeEntry._focussed){var o=c.timeEntry._get(j,"separator").length+2;j._field=0;if(n.selectionStart!=null){for(var m=0;m<=Math.max(1,j._secondField,j._ampmField);m++){var h=(m!=j._ampmField?(m*o)+2:(j._ampmField*o)+c.timeEntry._get(j,"ampmPrefix").length+c.timeEntry._get(j,"ampmNames")[0].length);j._field=m;if(n.selectionStart<h){break}}}else{if(n.createTextRange){var f=c(g.srcElement);var k=n.createTextRange();var l=function(p){return{thin:2,medium:4,thick:6}[p]||p};var i=g.clientX+document.documentElement.scrollLeft-(f.offset().left+parseInt(l(f.css("border-left-width")),10))-k.offsetLeft;for(var m=0;m<=Math.max(1,j._secondField,j._ampmField);m++){var h=(m!=j._ampmField?(m*o)+2:(j._ampmField*o)+c.timeEntry._get(j,"ampmPrefix").length+c.timeEntry._get(j,"ampmNames")[0].length);k.collapse();k.moveEnd("character",h);j._field=m;if(i<k.boundingWidth){break}}}}}c.data(n,e,j);c.timeEntry._showField(j);c.timeEntry._focussed=false},_doKeyDown:function(f){if(f.keyCode>=48){return true}var g=c.data(f.target,e);switch(f.keyCode){case 9:return(f.shiftKey?c.timeEntry._changeField(g,-1,true):c.timeEntry._changeField(g,+1,true));case 35:g._field=Math.max(1,g._secondField,g._ampmField);c.timeEntry._adjustField(g,0);break;case 36:if(f.ctrlKey){c.timeEntry._setTime(g)}else{g._field=0;c.timeEntry._adjustField(g,0)}break;case 37:c.timeEntry._changeField(g,-1,false);break;case 38:c.timeEntry._adjustField(g,+1);break;case 39:c.timeEntry._changeField(g,+1,false);break;case 40:c.timeEntry._adjustField(g,-1);break}return false},_doKeyPress:function(g){var f=String.fromCharCode(g.charCode==undefined?g.keyCode:g.charCode);if(f<" "){return true}var h=c.data(g.target,e);c.timeEntry._handleKeyPress(h,f);return false},_doMouseWheel:function(f,h){if(c.timeEntry._isDisabledTimeEntry(f.target)){return}h=(c.browser.opera?-h/Math.abs(h):(c.browser.safari?h/Math.abs(h):h));var g=c.data(f.target,e);g.input.focus();if(!g.input.val()){c.timeEntry._parseTime(g)}c.timeEntry._adjustField(g,h);f.preventDefault()},_expandSpinner:function(i){var m=c.timeEntry._getSpinnerTarget(i);var k=c.data(c.timeEntry._getInput(m),e);var h=c.timeEntry._get(k,"spinnerBigImage");if(h){k._expanded=true;var l=c(m).offset();var j=null;c(m).parents().each(function(){var n=c(this);if(n.css("position")=="relative"||n.css("position")=="absolute"){j=n.offset()}return !j});var g=c.timeEntry._get(k,"spinnerSize");var f=c.timeEntry._get(k,"spinnerBigSize");c('<div class="timeEntry_expand" style="position: absolute; left: '+(l.left-(f[0]-g[0])/2-(j?j.left:0))+"px; top: "+(l.top-(f[1]-g[1])/2-(j?j.top:0))+"px; width: "+f[0]+"px; height: "+f[1]+"px; background: transparent url("+h+') 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(m)}},_getInput:function(f){return c(f).siblings("."+c.timeEntry.markerClassName)[0]},_describeSpinner:function(f){var h=c.timeEntry._getSpinnerTarget(f);var g=c.data(c.timeEntry._getInput(h),e);h.title=c.timeEntry._get(g,"spinnerTexts")[c.timeEntry._getSpinnerRegion(g,f)]},_handleSpinner:function(g){if((!c(".time_check").attr("checked"))||(!c.timeEntryhasTextHighlighted)){return}var k=c.timeEntry._getSpinnerTarget(g);var f=c.timeEntry._getInput(k);if(c.timeEntry._isDisabledTimeEntry(f)){return}if(f==c.timeEntry._blurredInput){c.timeEntry._lastInput=f;c.timeEntry._blurredInput=null}var i=c.data(f,e);c.timeEntry._doFocus(f);var j=c.timeEntry._getSpinnerRegion(i,g);c.timeEntry._changeSpinner(i,k,j);c.timeEntry._actionSpinner(i,j);c.timeEntry._timer=null;c.timeEntry._handlingSpinner=true;var h=c.timeEntry._get(i,"spinnerRepeat");if(j>=3&&h[0]){c.timeEntry._timer=setTimeout(function(){c.timeEntry._repeatSpinner(i,j)},h[0]);c(k).one("mouseout",c.timeEntry._releaseSpinner).one("mouseup",c.timeEntry._releaseSpinner)}},_actionSpinner:function(f,g){if(!f.input.val()){c.timeEntry._parseTime(f)}switch(g){case 0:this._setTime(f);break;case 1:this._changeField(f,-1,false);break;case 2:this._changeField(f,+1,false);break;case 3:this._adjustField(f,+1);break;case 4:this._adjustField(f,-1);break}},_repeatSpinner:function(f,g){if(!c.timeEntry._timer){return}c.timeEntry._lastInput=c.timeEntry._blurredInput;this._actionSpinner(f,g);this._timer=setTimeout(function(){c.timeEntry._repeatSpinner(f,g)},this._get(f,"spinnerRepeat")[1])},_releaseSpinner:function(f){clearTimeout(c.timeEntry._timer);c.timeEntry._timer=null},_endExpand:function(g){c.timeEntry._timer=null;var i=c.timeEntry._getSpinnerTarget(g);var f=c.timeEntry._getInput(i);var h=c.data(f,e);c(i).remove();h._expanded=false},_endSpinner:function(g){c.timeEntry._timer=null;var i=c.timeEntry._getSpinnerTarget(g);var f=c.timeEntry._getInput(i);var h=c.data(f,e);if(!c.timeEntry._isDisabledTimeEntry(f)){c.timeEntry._changeSpinner(h,i,-1)}if(c.timeEntry._handlingSpinner){c.timeEntry._lastInput=c.timeEntry._blurredInput}if(c.timeEntry._lastInput&&c.timeEntry._handlingSpinner){c.timeEntry._showField(h)}c.timeEntry._handlingSpinner=false},_getSpinnerTarget:function(f){return f.target||f.srcElement},_getSpinnerRegion:function(l,h){var q=this._getSpinnerTarget(h);var n=(c.browser.opera||c.browser.safari?c.timeEntry._findPos(q):c(q).offset());var i=(c.browser.safari?c.timeEntry._findScroll(q):[document.documentElement.scrollLeft||document.body.scrollLeft,document.documentElement.scrollTop||document.body.scrollTop]);var g=this._get(l,"spinnerIncDecOnly");var j=(g?99:h.clientX+i[0]-n.left-(c.browser.msie?2:0));var o=h.clientY+i[1]-n.top-(c.browser.msie?2:0);var m=this._get(l,(l._expanded?"spinnerBigSize":"spinnerSize"));var p=(g?99:m[0]-1-j);var f=m[1]-1-o;if(m[2]>0&&Math.abs(j-p)<=m[2]&&Math.abs(o-f)<=m[2]){return 0}var k=Math.min(j,o,p,f);return(k==j?1:(k==p?2:(k==o?3:4)))},_changeSpinner:function(f,h,g){c(h).css("background-position","-"+((g+1)*this._get(f,(f._expanded?"spinnerBigSize":"spinnerSize"))[0])+"px 0px")},_findPos:function(h){var g=curTop=0;if(h.offsetParent){g=h.offsetLeft;curTop=h.offsetTop;while(h=h.offsetParent){var f=g;g+=h.offsetLeft;if(g<0){g=f}curTop+=h.offsetTop}}return{left:g,top:curTop}},_findScroll:function(h){var g=false;c(h).parents().each(function(){g|=c(this).css("position")=="fixed"});if(g){return[0,0]}var i=h.scrollLeft;var f=h.scrollTop;while(h=h.parentNode){i+=h.scrollLeft||0;f+=h.scrollTop||0}return[i,f]},_get:function(g,f){return(g.options[f]!=null?g.options[f]:c.timeEntry._defaults[f])},_parseTime:function(i){var h=this._extractTime(i);var g=this._get(i,"showSeconds");if(h){i._selectedHour=h[0];i._selectedMinute=h[1];i._selectedSecond=h[2]}else{var f=this._constrainTime(i);i._selectedHour=f[0];i._selectedMinute=f[1];i._selectedSecond=(g?f[2]:0)}i._secondField=(g?2:-1);i._ampmField=(this._get(i,"show24Hours")?-1:(g?3:2));i._lastChr="";i._field=Math.max(0,Math.min(Math.max(1,i._secondField,i._ampmField),this._get(i,"initialField")));if(i.input.val()!=""){this._showTime(i)}},_extractTime:function(m){var p=m.input.val();var l=this._get(m,"separator");var g=p.split(l);if(l==""&&p!=""){g[0]=p.substring(0,2);g[1]=p.substring(2,4);g[2]=p.substring(4,6)}var f=this._get(m,"ampmNames");var o=this._get(m,"show24Hours");if(g.length>=2){var n=!o&&(p.indexOf(f[0])>-1);var k=!o&&(p.indexOf(f[1])>-1);var j=parseInt(g[0],10);j=(isNaN(j)?0:j);j=((n||k)&&j==12?0:j)+(k?12:0);var i=parseInt(g[1],10);i=(isNaN(i)?0:i);var h=(g.length>=3?parseInt(g[2],10):0);h=(isNaN(h)||!this._get(m,"showSeconds")?0:h);return this._constrainTime(m,[j,i,h])}return null},_constrainTime:function(m,g){var l=(g!=null);if(!l){var h=this._determineTime(this._get(m,"defaultTime"))||new Date();g=[h.getHours(),h.getMinutes(),h.getSeconds()]}var k=false;var f=this._get(m,"timeSteps");for(var j=0;j<f.length;j++){if(k){g[j]=0}else{if(f[j]>1){g[j]=Math.round(g[j]/f[j])*f[j];k=true}}}return g},_showTime:function(h){var f=this._get(h,"show24Hours");var i=this._get(h,"separator");var g=(this._formatNumber(f?h._selectedHour:((h._selectedHour+11)%12)+1)+i+this._formatNumber(h._selectedMinute)+(this._get(h,"showSeconds")?i+this._formatNumber(h._selectedSecond):"")+(f?"":this._get(h,"ampmPrefix")+this._get(h,"ampmNames")[(h._selectedHour<12?0:1)]));this._setValue(h,g);this._showField(h)},_showField:function(j){var i=j.input[0];if(j.input.is(":hidden")||c.timeEntry._lastInput!=i){return}var k=this._get(j,"separator");var f=k.length+2;var l=(j._field!=j._ampmField?(j._field*f):(j._ampmField*f)-k.length+this._get(j,"ampmPrefix").length);var g=l+(j._field!=j._ampmField?2:this._get(j,"ampmNames")[0].length);if(i.setSelectionRange){c.timeEntryhasTextHighlighted=true;i.setSelectionRange(l,g)}else{if(i.createTextRange){c.timeEntryhasTextHighlighted=true;var h=i.createTextRange();h.moveStart("character",l);h.moveEnd("character",g-j.input.val().length);h.select()}}if(!i.disabled){i.focus()}},_formatNumber:function(f){return(f<10?"0":"")+f},_setValue:function(g,f){if(f!=g.input.val()){g.input.val(f).trigger("change")}},_changeField:function(g,i,h){var f=(g.input.val()==""||g._field==(i==-1?0:Math.max(1,g._secondField,g._ampmField)));if(!f){g._field+=i}else{g._field=(i<0)?3:0}this._showField(g);g._lastChr="";c.data(g.input[0],e,g);return(f&&h)},_adjustField:function(g,h){if(g.input.val()==""){h=0}var f=this._get(g,"timeSteps");this._setTime(g,new Date(0,0,0,g._selectedHour+(g._field==0?h*f[0]:0)+(g._field==g._ampmField?h*12:0),g._selectedMinute+(g._field==1?h*f[1]:0),g._selectedSecond+(g._field==g._secondField?h*f[2]:0)))},_setTime:function(j,k){k=this._determineTime(k);var f=this._constrainTime(j,k?[k.getHours(),k.getMinutes(),k.getSeconds()]:null);k=new Date(0,0,0,f[0],f[1],f[2]);var k=this._normaliseTime(k);var g=this._normaliseTime(this._determineTime(this._get(j,"minTime")));var i=this._normaliseTime(this._determineTime(this._get(j,"maxTime")));k=(g&&k<g?g:(i&&k>i?i:k));var h=this._get(j,"beforeSetTime");if(h){k=h.apply(j.input[0],[this._getTimeTimeEntry(j.input[0]),k,g,i])}j._selectedHour=k.getHours();j._selectedMinute=k.getMinutes();j._selectedSecond=k.getSeconds();this._showTime(j);c.data(j.input[0],e,j)},_determineTime:function(h){var g=function(j){var i=new Date();i.setTime(i.getTime()+j*1000);return i};var f=function(o){var m=new Date();var i=m.getHours();var n=m.getMinutes();var j=m.getSeconds();var l=/([+-]?[0-9]+)\s*(s|S|m|M|h|H)?/g;var k=l.exec(o);while(k){switch(k[2]||"s"){case"s":case"S":j+=parseInt(k[1],10);break;case"m":case"M":n+=parseInt(k[1],10);break;case"h":case"H":i+=parseInt(k[1],10);break}k=l.exec(o)}m=new Date(0,0,10,i,n,j,0);if(/^!/.test(o)){if(m.getDate()>10){m=new Date(0,0,10,23,59,59)}else{if(m.getDate()<10){m=new Date(0,0,10,0,0,0)}}}return m};return(h?(typeof h=="string"?f(h):(typeof h=="number"?g(h):h)):null)},_normaliseTime:function(f){if(!f){return null}f.setFullYear(1900);f.setMonth(0);f.setDate(0);return f},_handleKeyPress:function(k,j){if(j==this._get(k,"separator")){this._changeField(k,+1,false)}else{if(j>="0"&&j<="9"){var o=parseInt(j,10);var n=parseInt(k._lastChr+j,10);var m=this._get(k,"show24Hours");var i=(k._field!=0?k._selectedHour:(m?(n<24?n:o):(n>=1&&n<=12?n:(o>0?o:k._selectedHour))%12+(k._selectedHour>=12?12:0)));var h=(k._field!=1?k._selectedMinute:(n<60?n:o));var g=(k._field!=k._secondField?k._selectedSecond:(n<60?n:o));var l=this._constrainTime(k,[i,h,g]);this._setTime(k,new Date(0,0,0,l[0],l[1],l[2]));k._lastChr=j}else{if(!this._get(k,"show24Hours")){var f=this._get(k,"ampmNames");if((j==f[0].substring(0,1).toLowerCase()&&k._selectedHour>=12)||(j==f[1].substring(0,1).toLowerCase()&&k._selectedHour<12)){var p=k._field;k._field=k._ampmField;this._adjustField(k,+1);k._field=p;this._showField(k)}}}}}});function a(h,g){c.extend(h,g);for(var f in g){if(g[f]==null){h[f]=null}}return h}c.fn.timeEntry=function(g){var f=Array.prototype.slice.call(arguments,1);if(typeof g=="string"&&(g=="isDisabled"||g=="getTime")){return c.timeEntry["_"+g+"TimeEntry"].apply(c.timeEntry,[this[0]].concat(f))}return this.each(function(){var i=this.nodeName.toLowerCase();if(i=="input"){if(typeof g=="string"){c.timeEntry["_"+g+"TimeEntry"].apply(c.timeEntry,[this].concat(f))}else{var h=(c.fn.metadata?c(this).metadata():{});c.timeEntry._connectTimeEntry(this,c.extend(h,g))}}})};c.timeEntry=new b()})(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(o){var n=this.get();var m=this;var l=false;if((o)&&(o.searchCriteria!=null)){l=true}if((n)&&(o.viewPath)&&(o.viewPath==n.viewPath)&&(!l)){var p=MFNamespace("MFWA.MFWA");p.refreshListing();return}b.save(function(){m._set(o)},function(){m._set(n)})}};c(g);return{view:g,selectedItem:d,currentView:f,searchCriteria:i,objectHistory:h}});MFNamespace("MFWA.Nulls",{Lookup:-1,Workflow:0,Class:-1,ClearFilter:-2});MFNamespace("MFWA.Consts",{ViewItem:{ItemType:{View:0,PropertyFolder:1,TraditionalFolder:2,ObjectVersion:3}}});MFNamespace("MFWA.Enumerations",{MFDataType:{ReadOnly:-10,Automatic:-11},MFFolderContentItemType:{ObjectFile:-1}});var profiling=false;MFNamespace("MFWA.Debug",function(a){var c;var b;return{init:function(){c=$('<div style="display:none;overflow:auto;position:absolute;bottom:30px;right:30px;width:40%;height:40%;z-index:3142;background:white;border:solid 2px;padding:4px;display:none"></div>');var d=$('<div style="display:none;font-size:4pt;position:absolute;bottom:10px;right:10px;z-index:3142;background:black;color:white;padding:1px;text-align:center;width:10px;">&pi;</div>').click(function(){c.toggle()});$("body").append(d);$("body").append(c);c.append('<span style="font-weight:bold">Debug log:</span>');b=$('<div style="font-family:monospace">');c.append(b);a.write("Debug initialized")},write:function(d){if(b){b.append(Date()+": ");b.append(d).append("<br>")}}}});MFNamespace("MFWA.Debug.Assert",{doesNotHaveValue:function(c,b,a){if(c[b]){this.promptAssert(a)}},hasValue:function(c,b,a){if(!c[b]){this.promptAssert(a)}},exists:function(b,a){this.isTrue(b,a)},doesNotExist:function(b,a){this.isFalse(b,a)},equals:function(c,b,a){if(c!=b){this.promptAssert(a)}},isTrue:function(a,b){if(!a){this.promptAssert(b)}},isFalse:function(a,b){if(a){this.promptAssert(b)}},fail:function(a){this.promptAssert(a)},promptAssert:function(a){if(!a){a="Assertion failure"}if(!confirm("Error: "+a+"\nContinue?")){throw a}}});MFNamespace("MFWA.Pooling",function(){var a={};return{get:function(d,b){if(!a[d]){a[d]=[]}if(a[d].length>0){return a[d].pop()}else{var c;var f=function(){a[d].push(c)};c=b({dispose:f});if(c.dispose){var e=c.dispose;c.dispose=function(){e.call(c);f()}}else{c.dispose=f}return c}},dispose:function(c,b){a[c].push(c)}}});MFNamespace("MFWA.Status",function(){var b;var a=true;return{init:function(){$("a").live("mouseover",function(){a=false}).live("mouseout",function(){a=true;if(b){window.status=b}})},setStatus:function(c){b=c;if(a){window.status=b}}}});MFNamespace("MFWA.MFWA",function(g){var d,b,i,h,c,e,f,a;return{setListing:function(j){d=j},setMenu:function(j){b=j},setTree:function(j){i=j},setSearch:function(j){h=j},setPropPane:function(j){c=j},setTaskPane:function(j){e=j},updateObject:function(k,l,j){d.updateObject(k,l,j)},addItem:function(j){d.addItem(j)},updateItem:function(j,k){d.updateItem(j,k)},updatePending:function(j,k){d.updatePending(j,k)},removeItem:function(j,k,l){d.removeItem(j,k,l);if(k){MFWA.PropertiesPane.clear();MFWA.TaskPane.clear();MFWA.Menu.UpdateMenuItemStates(null)}},reloadChildrenAfterDelete:function(j){d.reloadChildrenAfterDelete(j)},loadChildren:function(j){MFWA.ViewItem.createChildren(j);d.loadChildren(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(j){var h=MFNamespace("MFWA.Data.Ajax");var m=MFNamespace("MFWA.StringBuilder");var l=MFNamespace("MFWA.Debug");var o=MFNamespace("MFWA.Utils");var a=h.get;var k=null;var g=null;var r=null;var c={};var q={};var d={};var n=null;var f=null;var p={};var e={};var b={};function i(u,y,x,v,t){var s="./REST/valuelists";if(u==true){s+="bypropdefid"}s+="/"+y+"/items.aspx";var w=new Array();if(v){if(v.text){w.push("filter="+v.text)}if(v.item&&v.item.values.length>0){w.push("filterItem="+v.item.type+":"+v.item.values.join(","))}}if(t){w.push("selected="+t)}if(w.length>0){s=s+"?"+w.join("&")}return a(s,x)}return{getClassesByGroup:function(s,t){s=s*1;if(!d[s]){return a("./REST/objects/"+s+"/classes.aspx?byGroup=true",function(u){d[s]=u;t(u)})}else{t(d[s])}},getClass:function(t,u,s){if(!p[t]){return a("./REST/structure/classes/"+t+".aspx",function(v){p[t]=v;u(v)},s)}else{u(p[t])}},getClassInfo:function(t,u){if(!p[t]||!e[t]||!b[t]){return a("./REST/structure/classes/"+t+"/full.aspx",function(v){p[t]=v;e[t]=v.Templates;b[t]=v.AssociatedPropertyDefs;u(v)})}else{var s=p[t];s.Templates=e[t];s.AssociatedPropertyDefs=b[t];u(p[t])}},resolvePropertyDefs:function(x,y,t,z){var w={};var s=new Array();for(var v=0;v<x.length;v++){var u=x[v][y];if(k[u]){x[v][t]=k[u]}else{w[u]=x[v];s.push(u)}}if(s.length==0){z()}else{return a("./REST/structure/propertyDefs.aspx",function(B){for(var A=0;A<B.length;A++){var C=B[A];k[C.ID]=C;if(w[C.ID]){w[C.ID][t]=C}}z()})}},ensureObjectProperties:function(s,t){if(s.Properties){t(s)}else{return j.getProperties(s.ObjVer,function(u){t({ObjectVersion:s,Properties:u})})}},getLevelDefinition:function(s,t){return a("./REST/views/"+s+"/levelDefinition.aspx",function(u){t(u)})},getPropertyDefs:function(s){if(k){s(k)}else{return a("./REST/structure/propertyDefs.aspx",function(t){k=t;s(t)})}},hasValueListIcon:function(t,s,u){return a("./REST/objects/"+t+"/"+s+"/hasValueListIcon.aspx",function(v){u(v)})},getPropertyDefsByID:function(s){if(g){s(g)}else{j.getPropertyDefs(function(t){if(!g){g={};for(var u in t){g[t[u].ID]=t[u];c[t[u].ID]=t[u]}}s(g)})}},getPropertyDef:function(t,s){if(c[t]){s(c[t])}else{return a("./REST/structure/propertyDefs/"+t+".aspx",function(u){c[t]=u;s(u)})}},getValueList:function(s,t){if(q[s]){t(q[s])}else{return a("./REST/valueLists/"+s+".aspx",function(u){q[s]=u;t(u)})}},getObjectType:function(s,t){if(q[s]){t(q[s])}else{return a("./REST/objects/"+s+".aspx",function(u){q[s]=u;t(u)})}},getObjectsByType:function(s){if(r){s(r)}else{return a("./REST/objects.aspx",function(u){if(!r){r={};for(var t in u){r[u[t].ID]=u[t]}}s(r)})}},getValueListItems:function(u,v,t,s){return i(false,u,v,t,s)},getValueListItemsByPropDefID:function(s,v,u,t){return i(true,s,v,u,t)},getWorkflows:function(s){if(f){s(f)}else{return a("./REST/structure/workflows.aspx",function(t){f=t;s(t)})}},getWorkflowsForObject:function(s,t){return a("./REST/structure/workflows.aspx?object="+s.Type+","+s.ID+","+s.Version,t)},getSearchState:function(s){return a("./REST/views/searchstate.aspx",s)},getStatesForWorkflow:function(t,s,u){if(u){return a("./REST/structure/workflows/"+t+"/states/"+s+".aspx",u)}else{return a("./REST/structure/workflows/"+t+"/states.aspx",s)}},getNACLs:function(s){return a("./REST/structure/namedacls.aspx",s)},getObjectVersion:function(t,v,s,u){if(!s&&!u){u=v;s=t.Version;v=t.ID;t=t.Type}else{if(!u){u=s;s="latest"}}return a("./REST/objects/"+t+"/"+v+"/"+s+".aspx",u)},getObjectVersionOrHandleError:function(t,v,w){var u=t.Type;var x=t.ID;var s=t.Version;return a("./REST/objects/"+u+"/"+x+"/"+s+".aspx",v,w)},getProperties:function(u,w,s,v,t){if(!s&&!v&&!t){v=w;s=u.Version;w=u.ID;u=u.Type}else{if(!v&&!t){v=s;s="latest"}}return a("./REST/objects/"+u+"/"+w+"/"+s+"/properties.aspx",v,t)},getPropertiesForDisplay:function(t,v,s,u){if(!s&&!u){u=v;s=t.Version;v=t.ID;t=t.Type}else{if(!u){u=s;s="latest"}}return a("./REST/objects/"+t+"/"+v+"/"+s+"/displayproperties.aspx",u)},getPropertiesOfMultipleObjects:function(t,u){if(t&&t.length>0){return h.post("./REST/objects/getpropsofmultipleobjects.aspx",t,u)}else{var s=[];u(s)}},getVersionComments:function(t,v,s,u){if(!s&&!u){u=v;s=t.Version;v=t.ID;t=t.Type}else{if(!u){u=s;s="latest"}}return a("./REST/objects/"+t+"/"+v+"/"+s+"/comments.aspx",u)},getRelationship:function(t,v,s,u){return a("./REST/objects/"+t+"/"+v+"/"+s+"/relationshipsAsArray.aspx",u)},getRelationshipForPropertiespane:function(t,v,s,u){return a("./REST/objects/"+t+"/"+v+"/"+s+"/relationshipsForPropertiespane.aspx",u)},getNACL:function(t,v,s,u){return a("./REST/objects/"+t+"/"+v+"/"+s+"/nacl.aspx",u)},getWorkflowState:function(t,v,s,u){if(!s&&!u){u=v;s=t.Version;v=t.ID;t=t.Type}else{if(!u){u=s;s="latest"}}return a("./REST/objects/"+t+"/"+v+"/"+s+"/workflowstate.aspx",u)},getViewContents:function(t,u){var s=o.getSearchResultLimit();return a("./REST/views"+t+"/folders.aspx?limit="+s,u)},performSearch:function(t,x){var H={SearchInMetadata:"qm",SearchInFileContents:"qf",SearchInBoth:"qb"};var A={AnyWord:"n",Boolean:"b",AllWords:"a"};var z={isNot:"!=",isNotEmpty:"!=",">":">>=",greaterThan:">>=",isAfter:">>=","<":"<<=",lessThan:"<<=",isBefore:"<<=",greaterOrEqualThan:">=",">=":">=",lessOrEqualThan:"<=","<=":"<=",contains:"*=",startsWith:"^=",is:"=",isEmpty:"=",today:"=",withinTheLastWeek:"=",withinTheLastMonth:"=",withinTheLastYear:"="};var y=new m.StringBuilder();for(var F=0;F<t.array.length;F++){var u=t.array[F];if(u.SearchString!=""){y.append("&").append(F).append("_");y.append(H[u.SearchIn]);if(u.SearchType){y.append(A[u.SearchType])}else{y.append(A.AllWords)}y.append("=");var J=o.encodeURIPart(u.SearchString);y.append(J)}if(u.SearchObjectType!="All"){y.append("&").append(F).append("_o=");y.append(u.SearchObjectType)}var D=u.PropertyCriteria;for(var E=0;E<D.length;E++){var s=D[E];var v=new m.StringBuilder();if(s.Property!="empty"){var w=s.Property.substring(0,2);var C=s.Property.substring(3);if(w=="VL"){v.append("vl").append(C)}else{if(w=="PV"){if(s.DataType){v.append("p").append(s.DataType).append(C)}else{v.append("p").append(C)}}else{continue}}if(s.DataFunction){v.append("f").append(s.DataFunction)}v.append(z[s.Condition]);var I=o.encodeURIPart(s.TypedValue);v.append(I)}v=v.toString();if(v!=""){y.append("&").append(String(F)).append(String(E)).append("_").append(v)}}}y=y.toString();if(y.length>0){y=y.substring(1)}var B="";if(t.path){B=t.path}else{B="/_tempsearch"}if(y.length>0){y="&"+y}var G=o.getSearchResultLimit();return a("./REST/views"+B+"/search.aspx?limit="+G+y,x)},getUserID:function(s){if(n){s(n)}else{return a("./REST/session/userid.aspx",function(t){n=t;s(t)})}},canCompleteAssignment:function(u,s,t){return a("./REST/objects/"+u+"/"+s+"/canCompleteAssignment.aspx",t)},getComputerName:function(s){return a("./REST/session/computername.aspx",s)},canForceUndoCheckout:function(s){return a("./REST/session/canforceundocheckout.aspx",s)},getCurrentTimestamp:function(s){return a("./REST/structure/currenttimestamp.aspx",s)},getVaultGUID:function(s){return a("./REST/session/vaultguid.aspx",s)},getSitePath:function(s){return a("./REST/session/sitepath.aspx",s)},isLoggedInToVault:function(s,t){return a("./REST/session/"+s+"/vault.aspx",t)},Commands:{logout:function(s){return a("./REST/session.aspx?_method=DELETE",s)}}}});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(h){var g={SearchIn:$("#searchIn").val(),SearchObjectType:$("#searchObjectType").val(),LookWord:$('[name="searchTypeGroup"]:checked').val()};MFWA.Data.Operations.saveSearchState(g);return f.del("./REST/session.aspx",h)},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,k,g){if(i==true){return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/true/nacl.aspx",j,k,g)}else{return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/false/nacl.aspx",j,k,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)},AddToFavorites:function(h,i,g){return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/addtofavorites.aspx",false,i,g)},RemoveFromFavorites:function(h,i,g){return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/removefromfavorites.aspx",false,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)},notifyObjectAccess:function(h,i,g){return f.put("./REST/objects/"+h.Type+"/"+h.ID+"/"+h.Version+"/notifyObjectAccess.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)},saveSearchState:function(g){return f.put("./REST/views/savesearchstate.aspx",g)},setViewMode:function(g,h){return f.put("./REST/viewsettings/"+g+"/viewmode.aspx",h)}}});MFNamespace("MFWA.Handlers.PropertyHandlers",function(p){var h=MFNamespace("MFWA.Data.Cache");var b=MFNamespace("MFWA.Data.Operations");var l=MFNamespace("MFWA.Dialogs.DocumentCard");var d=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var k=MFNamespace("MFWA.Dialogs.Alerts");var c=MFNamespace("MFWA.MFWA");var o=MFNamespace("MFWA.Utils");var g=MFNamespace("MFWA.Dialogs.PermissionChangesPrompt");var j=MFNamespace("MFWA.Model");var a=MFNamespace("MFWA.Enumerations");var f=function(r,x){var t={};for(var q in r){var w=r[q];t[w.PropertyDef]=w}var v=[];for(var q in x.AssociatedPropertyDefs){var u=x.AssociatedPropertyDefs[q];if(!u.Required){continue}if(!d.shownInProperties(u.PropertyDef)||!d.usedInCreation(u.PropertyDef)){continue}if(t[u.PropertyDef].IsAutomatic){continue}var s=t[u.PropertyDef].TypedValue;if(!o.typedValueExists(s)){v.push(u)}}return v};var n=function(u){for(var t in u.Properties){if(u.Properties[t].PropertyDef==a.MFBuiltInPropertyDef.AssignedTo){for(var s in u.Properties){if(u.Properties[s].PropertyDef==a.MFBuiltInPropertyDef.CompletedBy){var w=u.Properties[t].TypedValue.Lookups;var v=u.Properties[s].TypedValue.Lookups;if(w&&v){for(var r=0;r<w.length;r++){for(var q=0;q<v.length;q++){if(w[r]&&v[q]){if(w[r].Item==v[q].Item){w.splice(r,1);r--}}}}}}}}}};var e=function(r,q,s){if(s&&r.VisibleAfterOperation){s(r)}else{if(s){s(null)}}q.close()};var m=function(u,v,q,s,r,t){if(r){if(u.ThisVersionLatestToThisUser){b.setProperties(u,s.Properties,function(w){b.setNACL(w.ObjectVersion.ObjVer,t,s.AccessControlList,function(x){e(x,q,v)})})}else{b.setNACL(u.ObjVer,t,s.AccessControlList,function(w){e(w,q,v)})}}else{b.setProperties(u,s.Properties,function(w){b.setNACL(w.ObjectVersion.ObjVer,false,s.AccessControlList,function(x){e(x,q,v)})})}};var i=function(r,s){var q="";h.getNACL(r.ObjVer.Type,r.ObjVer.ID,r.ObjVer.Version,function(t){q=t});return function(t){var u=t.window;var w=t.result;w.propertiesByID=[];for(var v in w.Properties){w.Properties[v]={PropertyDef:w.Properties[v].PropertyDef,TypedValue:w.Properties[v].TypedValue};w.propertiesByID[w.Properties[v].PropertyDef]=w.Properties[v]}if(r.ObjVer.Type==a.MFBuiltInObjectType.Assignment){n(w)}if(!j.view.get().objectHistory||(r.ThisVersionLatestToThisUser&&q.ID==w.AccessControlList.ID)){m(r,s,u,w,false,false)}else{g.prompt(function(x){if(!x){return true}else{var y=(x=="allversions")?true:false;m(r,s,u,w,true,y);return true}})}return false}};return{getMissingProperties:f,removeAssignedTo:n,getMissingProperty:function(q,s){var r=f(q,s);if(r.length>0){return r[0]}else{return null}},editObject:function(q,r){h.getObjectType(q.ObjVer.Type,function(s){l.ShowEditObjectWindow({objectVersion:q,objType:s},i(q,r))})}}});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($("#okButtonPressed").length>0){$("#okButtonPressed").val("false")}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,beforeClose:null,noJqPages:false,buttons:{ok:true,cancel:true},position:"center",gradient:false};var c=0;var i=null;var f=new Array();var g={};var e=function(k){return function(){var l=$(this);var m;if(k){m=k()}l.blur();return m}};var b=function(){if(f.length>0){return f.pop()}else{var o=new Array();var n=false;var u=$('<div class="window" title="No title"></div>');var s=$('<div class="window_buttons" />');var k=$('<button class="window_ok" >'+j.OK+"</button>");var p=$('<button class="window_cancel">'+j.Cancel+"</button>");s.append(k,p);var l=$('<div class="window_pages"></div>');u.append(l,s);u.hide();var t=function(w){for(var v=0;v<o.length;v++){o[v].resize({width:w.width-25,height:w.height-50})}};var r={};var q={id:h.unique("window"),noJqPages:false,show:function(z,x,y){o.push(x);y=$.extend({},d,y);u.dialog("option","minWidth",y.minwidth);u.dialog("option","minHeight",y.minheight);u.dialog("option","maxHeight",y.maxheight);u.dialog("option","maxWidth",y.maxwidth);var v=y.height||y.minheight||150;var w=y.width||y.minwidth||200;if(y.noheight==false){u.dialog("option","height",v);u.height(v-50)}else{u.dialog("option","height","auto")}if(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,beforeClose:y.beforeClose,cancelCleanup:y.cancelCleanup};if(y.buttons){k.toggle(!!y.buttons.ok);p.toggle(!!y.buttons.cancel)}if(y.gradient){u.dialog("option","dialogClass","dialog-gradient")}else{u.dialog("option","dialogClass","")}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&&!this.noJqPages){return}n=false;o=new Array();u.dialog("close");if(!this.noJqPages){l.empty()}},cancelButtonPressed:false,preventDoubleSubmit:false};u.dialog({modal:true,closeOnEscape:false,bgiframe:true,open:function(v,w){if($("#okButtonPressed").length>0){$("#okButtonPressed").val("false")}},resize:function(v,w){t(w.size)},resizeStop:function(v,w){u.dialog("option","width",w.size.width);u.dialog("option","height",w.size.height);u.width(w.size.width-30);u.height(w.size.height-50);t(w.size)},beforeclose:function(v,w){if($("#okButtonPressed").length>0&&$("#okButtonPressed").val()=="true"){return true}else{if(q.beforeClose){return q.beforeClose()}}},close:function(){c-=1;if(i){i(c)}f.push(q);if($("#okButtonPressed").length==0||$("#okButtonPressed").val()!="true"){if(r.cancelCleanup){var v=m(q);r.cancelCleanup(v)}}}});var m=function(v){return{close:function(){if(v){v.close()}},invalidate:function(){v=null},id:v.id}};q.ok=function(){if(q.preventDoubleSubmit==true){return}if($("#okButtonPressed").length==0){$("#listing").append("<input type='hidden' id='okButtonPressed'></input>")}$("#okButtonPressed").val("true");setTimeout(function(){q.preventDoubleSubmit=false},1000);if(!r.ok){q.close()}var v=m(q);if(r.ok(v)!==false){v.invalidate();q.close()}};q.beforeClose=function(){if(r.beforeClose){return r.beforeClose()}};q.cancel=function(){if(q.cancelButtonPressed==true){return}q.cancelButtonPressed=true;setTimeout(function(){q.cancelButtonPressed=false},500);if(!r.cancel){q.close()}var v=m(q);if(r.cancel(v)!==false){v.invalidate();q.close()}};k.click(e(q.ok));p.click(e(q.cancel));g[q.id]=q;return q}};return{init:function(k){i=k},show:function(n,l,m){var k=b();k.show(n,l,m);return k},close:function(k){g[k].close()},windowShown:function(){c+=1;if(i){i(c)}},windowHidden:function(){c-=1;if(c<0){a.fail("Negative amount of windows open.")}if(i){i(c)}}}});MFNamespace("MFWA.Dialogs.Prompt",function(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();if(s.length==0){MFWA.Dialogs.Alerts.ShowNotification(f.Alerts.CannotBeEmpty)}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(t){s=null;if(t){t()}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){if(q.ThisVersionLatestToThisUser==false){k.hide();m.html(f.OK);var r=q.Title;if(q.SingleFile&&q.Files[0].Extension){r+="."+q.Files[0].Extension}j.find("div.namePrompt").html(a.format(f.CheckOutPrompt.OlderVersionPromptText,a.escape(r)).replace(/\n\n/g," "))}else{k.show();m.html(f.CheckOutPrompt.ReadOnlyButton);j.find("div.namePrompt").html(a.format(f.CheckOutPrompt.PromptText,a.escape(q.Title)).replace(/\n\n/g," "))}}}};return{prompt:function(h,i){var g=d.get("CheckOutPrompt",b);g.initialize(h);g.show(i)}}});MFNamespace("MFWA.Dialogs.DiscardChangesPrompt",function(c){var d=MFNamespace("MFWA.Pooling");var g=MFNamespace("MFWA.I18n");var a=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.Window");var f=MFNamespace("MFWA.StringBuilder");var b=function(k){var o="empty";var j=$('<div class="discardchangesprompt"><div class="promptText namePrompt"></div><table class="buttons"><td><button class="discardchanges">'+g.DiscardChangesPrompt.DiscardChangesButton+'</button></td><td><button class="continueediting">'+g.DiscardChangesPrompt.ContinueEditingButton+"</button></td></tr></table></div>");var i=j.find("button.discardchanges");var m=j.find("button.continueediting");var n={window:j,discardchanges:i,continueediting:m};n.window.dialog({bgiframe:true,modal:true,title:g.DiscardChangesPrompt.Title,resizable:false,width:330});var h=null;var l=function(){if(!o(h)){h=null;return false}e.windowHidden();h=null;k.dispose();return true};n.window.bind("dialogbeforeclose",l);n.continueediting.click(function(){h="continueediting";n.window.dialog("close")});n.discardchanges.click(function(){h="discardchanges";n.window.dialog("close")});return{jq:n,show:function(p){o=p;h=null;n.window.dialog("open");e.windowShown()},initialize:function(q){var p=new f.StringBuilder(g.DiscardChangesPrompt.PromptText.length);p.append(g.DiscardChangesPrompt.PromptText);p.append("<br><br>");p.append(g.DiscardChangesPrompt.ConfirmationText);p.append("<br><br>");j.find("div.namePrompt").html(a.format(p.toString(),a.escape(q)).replace(/\n\n/g," "))}}};return{prompt:function(j,i){var h=d.get("DiscardChangesPrompt",b);h.initialize(j);h.show(i)}}});MFNamespace("MFWA.Dialogs.PermissionChangesPrompt",function(c){var d=MFNamespace("MFWA.Pooling");var f=MFNamespace("MFWA.I18n");var a=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.Window");var b=function(n){var k="empty";var j=$('<div class="PermissionChangesPrompt"><div class="promptText namePrompt"></div><table class="buttons"><tr><td><button class="allversions">'+f.PermissionChangesPrompt.AllVersionsButton+'</button></td><td><button class="currentversion">'+f.PermissionChangesPrompt.CurrentVersionButton+'</button></td><td><button class="cancel">'+f.Cancel+"</button></td></tr></table></div>");var l=j.find("button.allversions");var p=j.find("button.currentversion");var m=j.find("button.cancel");var i={window:j,allversions:l,currentversion:p,cancel:m};var g="M-Files";i.window.dialog({bgiframe:true,modal:true,title:g,resizable:false,width:420});var o=null;var h=function(){if(!k(o)){o=null;return false}e.windowHidden();o=null;n.dispose();return true};i.window.bind("dialogbeforeclose",h);i.cancel.click(function(){i.window.dialog("close")});i.allversions.click(function(){o="allversions";i.window.dialog("close")});i.currentversion.click(function(){o="currentversion";i.window.dialog("close")});return{jq:i,show:function(q){k=q;o=null;i.window.dialog("open");e.windowShown()},initialize:function(){j.find("div.namePrompt").html(a.escape(f.PermissionChangesPrompt.PromptText).replace(/\n\n/g," "))}}};return{prompt:function(h){var g=d.get("PermissionChangesPrompt",b);g.initialize();g.show(h)}}});MFNamespace("MFWA.Dialogs.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(F){var g=MFNamespace("MFWA.Utils"),y=MFNamespace("MFWA.Debug.Assert"),I=MFNamespace("MFWA.Nulls"),q=MFNamespace("MFWA.Debug"),z=MFNamespace("MFWA.Dialog.Alerts"),d=MFNamespace("MFWA.Model"),J=MFNamespace("MFWA.I18n"),v=MFNamespace("MFWA.I18n.DocumentCard"),G=MFNamespace("MFWA.Data.Cache"),C=MFNamespace("MFWA.Pooling"),f=MFNamespace("MFWA.Enumerations"),s=MFNamespace("MFWA.Window"),c=MFNamespace("MFWA.Dialogs.Templates"),h=MFNamespace("MFWA.Dialogs.DocumentCard.MoreProperties"),n=MFNamespace("MFWA.Dialogs.DocumentCard.Filters"),j=MFNamespace("MFWA.Dialogs.DiscardChangesPrompt"),H=MFNamespace("MFWA.Icons"),a=MFNamespace("MFWA.Handlers");viewItem=MFNamespace("MFWA.ViewItem");var E=null;var u=null;var p=false;var t=null;var B=null;var x=false;var l=function(){return C.get("DocumentCard",function(){G.getUserID(function(af){t=af.Value;G.getValueListItems(f.MFBuiltInValueList.Users,function(ag){for(var ah=0;ah<ag.length;++ah){if(af.Value==ag[ah].ID){B=ag[ah].Name;break}}})});p=false;u=null;E=null;var aa,ae=c.createDocumentCard(),Z,ab,K=0,R=0;var ac=function(ah,ai,af){y.doesNotHaveValue(aa.propertiesByID,ah.PropertyDef,"The property already exists in the datamodel.");var ag=F.PropertyDef.create(ah,ai);return U(ag,af)};var U=function(ag,af){y.doesNotHaveValue(aa.propertiesByID,ag.PropertyID,"The property already exists in the datamodel.");aa.properties.push(ag);aa.propertiesByID[ag.PropertyID]=ag;if(!af){ad(ag)}return ag};var ad=function(af){y.hasValue(aa.propertiesByID,af.PropertyID,"The property does not exist in the datamodel.");if(af.jq){if(F.Filters.isReadOnlyProperty(af.PropertyID)){ae.middleContent.append(af.jq);if(!Z){Z=af.jq}}else{if(Z){Z.before(af.jq)}else{ae.middleContent.append(af.jq)}}}};var S=function(ah,af){if(typeof(ah)=="object"){for(var ag=0;ag<aa.properties.length;ag++){if(aa.properties[ag]==ah){ah=ag}}}if(typeof(ah)=="number"){var ai=aa.properties[ah];if(ai.boundProperty){ai.boundProperty.Observers[ai.PropertyID]=null}aa.properties.splice(ah,1);aa.propertiesByID[ai.PropertyID]=null;if(ai.jq){ai.jq.remove()}return ai}else{return null}};var N=function(af,ag){if(!ag){return}if(ag.Deleted||ag.Hidden){return}G.getObjectType(af.PropertyDef.ValueList,function(ah){if(ah.RealObjectType){G.getProperties(af.PropertyDef.ValueList,ag.Item,"latest",function(ai){G.getPropertyDefsByID(function(ak){y.exists(af.control);var ao={};var am={};for(var ap=0;ap<ai.length;ap++){var aj=ai[ap];ao[aj.PropertyDef]=aj;var al=aa.propertiesByID[aj.PropertyDef];if(aj.TypedValue&&aj.TypedValue.HasValue){if(!am[ak[aj.PropertyDef].ValueList]){am[ak[aj.PropertyDef].ValueList]=[]}am[ak[aj.PropertyDef].ValueList].push(aj)}if(!al||!al.control){continue}if(F.Filters.isReadOnlyProperty(al.PropertyID)){continue}if(al.PropertyDef.DataType!=f.MFDataType.Lookup&&al.PropertyDef.DataType!=f.MFDataType.MultiSelectLookup){continue}if(af.boundProperty&&af.boundProperty==al){continue}var an=al.control.get();if(an!=null){continue}if(profiling||confirm(g.format(v.AutoFillConfirm,ag.DisplayValue,al.PropertyDef.Name,aj.TypedValue.DisplayValue))){al.control.set(aj.TypedValue,aj.ValueSource)}}if(af.boundProperty){var aq=function(ar){G.getValueList(af.boundProperty.PropertyDef.ValueList,function(av){var at=ar.control.get();if(at.Lookup||at.Lookups){return}var au;if(av.HasOwner&&av.Owner==af.boundProperty.PropertyDef.ValueList){au=ao[av.OwnerPropertyDef];if(au){ar.control.set(au.TypedValue,af.control.getSource())}}else{if(am[av.ID]&&am[av.ID].length==1){au=am[av.ID][0].TypedValue;var aw;if(au.DataType==f.MFDataType.MultiSelectLookup){aw=au.Lookups[0]}else{aw=au.Lookup}au={DisplayValue:aw.DisplayValue,DataType:ar.PropertyDef.DataType};if(au.DataType==f.MFDataType.MultiSelectLookup){au.Lookups=[aw]}else{au.Lookup=aw}ar.control.set(au,af.control.getSource())}}})}(af.boundProperty)}})},function(ai){MFWA.Dialogs.Alerts.PropertyValueNotFound(ag.DisplayValue,ai.Stack)})}else{if(!ah.HasOwner){return}G.getValueListItems(af.PropertyDef.ValueList,function(ai){for(var aj=0;aj<ai.length;++aj){if(ai[aj].ID==ag.Item){G.getValueListItems(af.boundProperty.PropertyDef.ValueList,function(al){for(var an=0;an<al.length;++an){if(al[an].ID==ai[aj].OwnerID){var ao=null;var am=null;var ak=null;if(af.boundProperty.PropertyDef.DataType==f.MFDataType.MultiSelectLookup){ak=f.MFDataType.MultiSelectLookup;am=[{Item:al[an].ID,DisplayValue:al[an].Name,Version:-1,Deleted:false,Hidden:false}]}else{ak=f.MFDataType.Lookup;ao={Item:al[an].ID,DisplayValue:al[an].Name,Version:-1,Deleted:false,Hidden:false}}af.boundProperty.control.set({DataType:ak,DisplayValue:al[an].Name,Lookup:ao,Lookups:am},af.control.getSource());break}}});break}}})}})};var V=function(af){aa.properties=[];aa.propertiesByID={};Z=null;if(!af){ae.middleContent.empty()}};var P=function(af){G.getPropertyDefsByID(function(ag){for(var ah in aa.properties){var ai=aa.properties[ah];ai.PropertyDef=ag[ai.PropertyID]}af()})};var T=function(an){var aw=aa.properties;var aj=[];for(var at=0;at<aw.length;at++){aw[at].Observers={};aw[at].boundProperty=null}for(var at=0;at<aw.length;at++){var ar=aw[at];var ak=ar.PropertyDef;if(!ar.jq){continue}if(!ak){continue}var au=ar.jq.children("td.property_name");var ax=ar.PropertyDef.Name;var ah=ar.jq.children("td.property_control");var ai=false;if(!ar.control||ar.control.type!=ak.DataType){ai=true;ah.empty();var al=function(az){var ay=0;az.control=F.Controls.getControl(ak,{change:function(aC,aB){for(var aA in az.Observers){az.Observers[aA](az,aC,aB)}if(az.PropertyDef.OwnerPropertyDef&&az.PropertyDef.OwnerPropertyDef.ID>0){var aD=aa.propertiesByID[az.PropertyDef.OwnerPropertyDef.ID];aD.control.filteredChanged(az.PropertyDef,aC)}},select:function(aC,aB,aA){if(aB&&aB.Lookups&&aB.Lookups.length>1){return}if(!!aA){M(aA,aC.DisplayValue)}if(az.PropertyDef.DataType==f.MFDataType.Lookup||az.PropertyDef.DataType==f.MFDataType.MultiSelectLookup){N(az,aC)}},getBoundPropertyValue:function(){var aA=az.boundProperty;if(!aA){return null}return{ID:aA.PropertyID,ValueList:aA.PropertyDef.ValueList,Value:aA.control.get()}}})}(ar);ah.append(ar.control.jq);if(ar.Required){ar.control.jq.append($('<div class="required">*</div>'))}var ap=false;if(aa.objectClass.AssociatedPropertyDefs){for(var ao=0;ao<aa.objectClass.AssociatedPropertyDefs.length;ao++){if(ar.PropertyID==aa.objectClass.AssociatedPropertyDefs[ao].PropertyDef){ap=true;break}}}if(!ap&&!ar.Required){var al=function(ay){ay.control.jq.append($('<div class="remove" style="background-image: url(\''+H.Commands.RemoveProperty+"');\"></div>").click(function(){S(ay);T()}))}(ar)}aj.push(ar)}if(!ai&&an){aj.push(ar)}if(!x&&ak.IsOwnerPropertyDef){var am=d.selectedItem.get();if(am&&am.objectVersion){if(ak.ValueList==am.objectVersion.ObjVer.Type){var af=parseInt(am.objectVersion.DisplayID);ar.TypedValue={DisplayValue:am.objectVersion.Title,HasValue:true,SerializedValue:af,DataType:f.MFDataType.Lookup,Lookup:{Deleted:false,DisplayValue:am.objectVersion.Title,Hidden:false,Item:af,Version:am.objectVersion.ObjVer.Version}};ar.control.set(ar.TypedValue,ar.ValueSource);ar.control.enabled(false);ar.control.hideControls(true)}}}if(ak.OwnerPropertyDef){var av=function(aB,ay){var az=aa.propertiesByID[ay.ID];var aA=function(aE,aD,aC){aB.control.filter(aE,aD,aC)};az.Observers[aB.PropertyID]=aA};var ag=ak.OwnerPropertyDef;if(ag.ID>0){var aq=aa.propertiesByID[ag.ID];if(aq){y.exists(aq.PropertyDef);ar.boundProperty=aq;av(ar,ar.PropertyDef.OwnerPropertyDef)}}else{if(ag.ID==-106){var al=function(ay){G.getValueList(ak.ValueList,function(az){if(!az.HasOwner){return}var aC=false;var aB=null;for(var aA=0;aA<aw.length;aA++){if((aw[aA].PropertyDef.DataType==f.MFDataType.Lookup||aw[aA].PropertyDef.DataType==f.MFDataType.MultiSelectLookup)&&(aw[aA].PropertyDef.ValueList==az.Owner)){aB=aw[aA]}if(aw[aA].ID==ay.propertyID){aC=true}if(aB&&aC){break}}if(aB){y.exists(aB.PropertyDef);ay.boundProperty=aB;av(ay,aB.PropertyDef)}})}(ar)}}}au.text(ax)}for(var at in aj){if((!aj[at].ValueSource)&&(aj[at].PropertyID==f.MFBuiltInPropertyDef.MonitoredBy)){aj[at].TypedValue={DisplayValue:B,HasValue:true,SerializedValue:t,DataType:10,Lookups:[{Deleted:false,DisplayValue:B,Hidden:false,Item:t,Version:-1}]}}aj[at].control.set(aj[at].TypedValue,aj[at].ValueSource)}};var L=function(){for(var ag=0;ag<aa.properties.length;ag++){var af=aa.properties[ag];if(af.propertySource=="template"&&af.ValueSource!="user"){S(ag)}}};var X=function(ag,af){$.getJSON("./REST/objects/"+ag+"/"+af+"/latest/full.aspx",function(al){var am=aa.propertiesByID;var ah={};for(var ak=0;ak<al.Properties.length;ak++){var an=al.Properties[ak];ah[an.PropertyDef]=an;if(!F.Filters.includedFromTemplate(an.PropertyDef)){continue}if(!am[an.PropertyDef]){var aj=ac(an,{valueSource:"template",propertySource:"template"})}else{var ai=am[an.PropertyDef];if(!!ai.control&&!!ai.control.isAutomaticProperty){continue}if(g.typedValueExists(an.TypedValue)&&ai.ValueSource!="user"){if(ai.control){ai.control.set(an.TypedValue,"template")}ai.TypedValue=an.TypedValue;ai.ValueSource="template"}}}aa.template={objectAndProperties:al,propertiesByID:ah};P(function(){T(true)})})};var M=function(aj,ag){if(!aj){return}if(aj.IsNamedACL){var ai=ae.permissions.find('option[value="'+aj.ID+'"]');if(ai.length>0){ai.attr("selected","true")}}else{var af=J.Custom;if(!!ag&&ag.length>0){var ah="("+ag+")";af+=ah}var ai=ae.permissions.find('option[value="'+af+'"]');if(ai.length==0){ae.permissions.append($('<option value="'+af+'" selected="true">'+af+"</option>"));aa.nacls.push(aj);aa.naclsByID[af]=aj}else{ai.attr("selected","true")}}};var O=function(ag,af,am){ae.moreProperties.attr("disabled",false);if(ag==I.Class){try{ae.classSelect.find("option[value="+aa.objectClassID+"]").attr("selected",true)}catch(an){}return}var aj=null;try{aj=ae.classSelect.find("option[value="+ag+"]");aj.attr("selected",true)}catch(an){}var ak=aj.data("item");if(ak){if(!x){M(ak.DefaultNamedACLForObject,ak.Name)}if(ak.Hidden===true||ak.Deleted===true){aa.objectClassID=ag;aa.objectClass=ak;ae.middleContent.empty();Z=null;if(af==false){for(var al=0;al<aa.properties.length;al++){if(n.requiredPropertyForHiddenOrDeletedClass(aa.properties[al].PropertyID)){aa.properties[al].Required=true}ad(aa.properties[al])}}else{var ai=aa.properties;aa.properties=[];aa.propertiesByID={};for(var al=0;al<ai.length;al++){var ah=ai[al];if(n.requiredPropertyForHiddenOrDeletedClass(ah.PropertyID)){ah.Required=true}if(ah.Required||g.typedValueExists(ah.TypedValue)){ac({PropertyDef:ah.PropertyID,Required:ah.Required},{PropertyDef:ah.PropertyDef,oldProperty:{TypedValue:ah.TypedValue,ValueSource:"user"},propertySource:"user"},false)}}}P(function(){T(true)});if(am){am()}return}}G.getClassInfo(ag,function(aA){aA=g.copy(aA);if(aa.options.objType.ID==f.MFBuiltInObjectType.DocumentCollection){aA.AssociatedPropertyDefs.push({PropertyDef:f.MFBuiltInPropertyDef.CollectionMemberDocuments,Required:false});aA.AssociatedPropertyDefs.push({PropertyDef:f.MFBuiltInPropertyDef.CollectionMemberCollections,Required:false})}aa.objectClassID=ag;aa.objectClass=aA;var ap=aa.properties;var ar=aa.propertiesByID;V(true);for(var au=0;au<ap.length;au++){var ax=ap[au];if(ax.control){ax.TypedValue=ax.control.get();q.write(ax.PropertyID);if(g.typedValueExists(ax.TypedValue)||!af){ax.ValueSource=ax.control.getSource()}else{ax.ValueSource=null}}}for(var au=0;au<aA.AssociatedPropertyDefs.length;au++){var aw=aA.AssociatedPropertyDefs[au];var az=ac(aw,{propertySource:"class",oldProperty:ar[aw.PropertyDef]},true)}for(var au in ap){var aq=ap[au];if(!(aa.objectClass.NamePropertyDef!=f.MFBuiltInPropertyDef.NameOrTitle&&aq.PropertyID==f.MFBuiltInPropertyDef.NameOrTitle)){if(g.typedValueExists(aq.TypedValue)||!af){if(aa.propertiesByID[aq.PropertyID]){var ao=aa.propertiesByID[aq.PropertyID];ao.TypedValue=aq.TypedValue;ao.ValueSource=aq.ValueSource}else{ac({PropertyDef:aq.PropertyID,Required:aq.Required},{PropertyDef:aq.PropertyDef,oldProperty:{TypedValue:aq.TypedValue,ValueSource:"user"},propertySource:"user"},true)}}}}ae.middleContent.empty();for(var au=0;au<aa.properties.length;au++){ad(aa.properties[au])}var at=null;if(ae.groups.template.css("display")!="none"){ae.templateSelect.empty();for(var au=0;au<aA.Templates.length;au++){var ay=aA.Templates[au];if(aa.options.objType.ID===ay.ObjVer.Type){var av=$('<option value="'+ay.ObjVer.Type+","+ay.ObjVer.ID+'" />');av.text(ay.Title);ae.templateSelect.append(av);if(!at){at={type:ay.ObjVer.Type,id:ay.ObjVer.ID}}}}if(!at){L();ae.templateSelect.attr("disabled",true);ae.templateRadio.attr("disabled",true);ae.templateCheck.attr("checked",false);ae.templateCheck.attr("disabled",true);if(ae.groups.sfd.css("display")!="none"){if(ae.templateRadio.is(":checked")||!(ae.mfdRadio.is(":checked")||ae.sfdRadio.is(":checked"))){ae.sfdRadio.click()}}}}P(function(){T(true);if(at){X(at.type,at.id);ae.templateRadio.attr("disabled",false);ae.templateSelect.attr("disabled",false);ae.templateCheck.attr("disabled",false);ae.templateCheck.attr("checked",true);ae.templateRadio.click()}});Q();if(am){am()}E=documentCard.getWindowResults();if((E!=null)&&(u==null)){u=E.Class.ID}W()})};var Q=function(){if(aa.workflows){ae.workflow.empty();var ah=$('<option value="'+I.Workflow+'">'+J.Empty+"</option>");ae.workflow.append(ah);var ag=I.WorkflowObjectClass;var aj=null;if(aa.objectClass){ag=aa.objectClass.ID;aj=aa.objectClass.Workflow}for(var af=0;af<aa.workflows.length;af++){var ak=aa.workflows[af];if(ak.item.ObjectClass==I.WorkflowObjectClass||ak.item.ObjectClass==ag){ae.workflow.append(ak.node);if(ak.item.ID==aj){ah=ak.node}}}if(ah){try{ah.attr("selected",true)}catch(ai){}}}};var Y=function(ag,af,ah){G.getPropertyDefsByID(function(am){V();aa.immutableProperties=[];var aj=null;for(var ai in ag){var ak=ag[ai];var al=am[ak.PropertyDef];if(af&&al.ID==f.MFBuiltInPropertyDef.VersionComment){continue}if(F.Filters.shownInProperties(al.ID)){ac(ak,{PropertyDef:al,Value:ak.TypedValue,valueSource:"old"},true)}else{aa.immutableProperties.push(ak)}if(al.ID==f.MFBuiltInPropertyDef.SingleFileObject){if(ak.TypedValue.Value){ae.sfdRadio.click()}else{ae.mfdRadio.click()}}if(al.ID==f.MFBuiltInPropertyDef.Class){aj=ak}}if(aj!==null){aa.objectClassID=aj.TypedValue.Lookup.Item*1;aa.objectClass={ID:aj.TypedValue.Lookup.Item*1,Name:aj.TypedValue.Lookup.DisplayValue,Hidden:aj.TypedValue.Lookup.Hidden,Deleted:aj.TypedValue.Lookup.Deleted}}if(ah){ah()}})};var W=function(){var af=d.selectedItem.get();if((!x)||(!af)||(!af.objectVersion)){return}var ag=af.objectVersion;if(!ag.ThisVersionLatestToThisUser){ae.top.find("*").attr("disabled",true);ae.moreProperties.attr("disabled",true);ae.middleContent.find("*").attr("disabled",true);ae.middleContent.find("*").unbind("click");ae.middleContent.find("*").unbind("dblclick");ae.middleContent.find("*").unbind("keydown");ae.middleContent.find("*").unbind("keypress");ae.middleContent.find("*").unbind("keyup");ae.middleContent.find("*").unbind("mousedown");ae.middleContent.find("*").unbind("mouseup")}};ae.classSelect.change(function(af){O(ae.classSelect.val(),true)});ae.templateSelect.change(function(ag){var af=ae.templateSelect.val().split(",");X(af[0],af[1])});ae.moreProperties.click(function(){h.getNewProperty(aa.objectClass.ObjType,aa.propertiesByID,function(af){if(af){if(af.OwnerPropertyDef!=null&&af.OwnerPropertyDef.ID>0){var ag=aa.propertiesByID[af.OwnerPropertyDef.ID];if(ag==null){G.getPropertyDef(af.OwnerPropertyDef.ID,function(ah){ac({PropertyDef:ah.ID,Required:false},{PropertyDef:ah});T(false,[ah.ID])})}}ac({PropertyDef:af.ID,Required:false},{PropertyDef:af});T(false,[af.ID])}return true})});documentCard={jq:ae,jqNode:ae.documentcard,setProperties:Y,setPermissions:M,resize:function(af){ae.middle.width(af.width-23);ae.middle.height(af.height-(K+R));ae.middle.children("table").width(af.width-23-20)},initialize:function(af,ah,ag,ai){y.hasValue(af,"objType","The object type has not been set");ae.moreProperties.attr("disabled",true);g_PendingLookupRequestCounter=0;aa={objectClass:null,objectClassID:null,properties:[],immutableProperties:[],propertiesByID:{},options:af,workflows:null,nacls:null};V();ab=false;if(af.checkIn===true){ae.checkInCheck.attr("checked",true)}else{ae.checkInCheck.attr("checked",false)}G.getWorkflows(function(al){aa.workflows=[];aa.workflowsByID={};for(var ak=0;ak<al.length;ak++){var am=al[ak];var aj={item:am,node:$('<option value="'+am.ID+'">'+g.escape(am.Name)+"</option>")};aa.workflows.push(aj);aa.workflowsByID[am.ID]=aj}Q();G.getNACLs(function(ao){aa.nacls=ao;aa.naclsByID=[];if(ai==true){ae.permissions.append($('<option value="empty" selected="selected"></option>'))}for(var an=0;an<ao.length;an++){ae.permissions.append($('<option value="'+ao[an].ID+'">'+g.escape(ao[an].Name)+"</option>"));aa.naclsByID[ao[an].ID+""]=ao[an]}if(af.objType.HasOwner&&ah){G.getObjectType(af.objType.Owner,function(ap){G.getPropertyDef(ap.OwnerPropertyDef,function(aq){ah({DataType:aq.DataType,PropertyDef:aq.ID,Required:true,TypedValue:{DataType:aq.DataType,HasValue:false}},function(){documentCard.loadClasses(af.objType.ID,ag)})})})}else{if(ah){ah(null,function(){documentCard.loadClasses(af.objType.ID,ag)})}else{this.loadClasses(af.objType.ID,ag)}}})})},preload:function(ah,af,ag){if(!ah.Properties){G.getProperties(ah.ObjVer,function(ai){Y(ai,af,ag)})}else{Y(ah.Properties,af,ag)}G.getNACL(ah.ObjVer.Type,ah.ObjVer.ID,ah.ObjVer.Version,function(ai){M(ai,"");if(E){E.AccessControlList=ai}})},loadClasses:function(ag,af){if(ag==f.MFBuiltInObjectType.DocumentCollection){ag=f.MFBuiltInObjectType.Document}G.getClassesByGroup(ag,function(aj){ae.classSelect.empty();var al=null;var am=null;var an=0;ae.classSelect.append($('<option value="'+I.Class+'">'+v.ChooseClass+"</option>"));for(var ai=0;ai<aj.length;ai++){if(aj[ai].Name==""){am=aj[ai].Classes;continue}var ao=$('<optgroup label="'+aj[ai].Name+'" />');ae.classSelect.append(ao);for(var ah=0;ah<aj[ai].Classes.length;ah++){if(!al){al=aj[ai].Classes[ah].ID}var ak=$('<option value="'+aj[ai].Classes[ah].ID+'">'+g.escape(aj[ai].Classes[ah].Name)+"</option>");ak.data("item",aj[ai].Classes[ah]);ao.append(ak);an++}}if(am){for(var ah=0;ah<am.length;ah++){if(!al){al=am[ah].ID}var ak=$('<option value="'+am[ah].ID+'">'+g.escape(am[ah].Name)+"</option>");ak.data("item",am[ah]);ae.classSelect.append(ak);an++}}ab=true;if(aa.objectClass&&(aa.objectClass.Hidden===true||aa.objectClass.Deleted===true)){var ak=$('<option value="'+aa.objectClass.ID+'">'+g.escape(aa.objectClass.Name)+"</option>");ak.data("item",aa.objectClass);ae.classSelect.append(ak)}if(an==1&&!aa.objectClass){aa.objectClassID=al}if(typeof(aa.objectClassID)=="number"){O(aa.objectClassID,false,af)}else{u=-999;E=documentCard.getWindowResults();if(af){af()}}})},loadClass:O,getWindowResults:function(){if(!(aa.properties&&aa.workflows)){return null}var ar={};if(aa.objectClass!=null){for(var ak in aa.immutableProperties){var ap=aa.immutableProperties[ak];ar[ap.PropertyDef]=ap}for(var ak in aa.properties){var ap=aa.properties[ak];if(!ap.jq){continue}if(aa.options.filter&&!aa.options.filter(ap.PropertyID)){continue}var ao=ap.control.get();var al=false;if(ap.control.isAutomaticProperty){al=ap.control.isAutomaticProperty()}var ah=ap.PropertyID;ar[ap.PropertyID]={PropertyDef:ah,IsAutomatic:al,TypedValue:ao}}ar[f.MFBuiltInPropertyDef.Class]={PropertyDef:f.MFBuiltInPropertyDef.Class,TypedValue:{DisplayValue:aa.objectClass.Name,Lookup:{Item:aa.objectClass.ID,DisplayValue:aa.objectClass.Name,Hidden:false,Version:-1,Deleted:false},DataType:f.MFDataType.Lookup}}}var ag=ae.top.find("input[@name='"+ae.radioGroupName+"']:checked:visible").val();var aj=null;var an=null;switch(ag){case"template":if(aa.template){an=aa.template.objectAndProperties;aj=aa.template.propertiesByID[f.MFBuiltInPropertyDef.SingleFileObject].TypedValue.Value}break;case"sfd":aj=true;break;case"mfd":aj=false;break;default:aj=null;break}q.write("SFD: "+aj);if(aj!==null){ar[f.MFBuiltInPropertyDef.SingleFileObject]={PropertyDef:f.MFBuiltInPropertyDef.SingleFileObject,TypedValue:{DisplayValue:aj?J.Yes:J.No,Value:aj,DataType:f.MFDataType.Boolean}}}var aq=aa.naclsByID[ae.permissions.val()];var am=null;if(ae.workflow.is(":visible")){am=aa.workflowsByID[ae.workflow.val()*1]}if(am){am=am.item;ar[f.MFBuiltInPropertyDef.Workflow]={PropertyDef:f.MFBuiltInPropertyDef.Workflow,Value:am.ID}}var ai=[];for(var af in ar){ai.push(ar[af])}return{Properties:ai,AccessControlList:aq,Workflow:am,Class:aa.objectClass,Template:an,CheckIn:ae.checkInCheck.is(":checked"),Open:ae.openCheck.is(":checked"),SelectedFileMode:ag}},hasMetaCardChanged:function(at){var aw=false;var av=documentCard.getWindowResults();if((at)&&((E!=null)&&(E.SelectedFileMode))){return true}if(av==null){return false}if(aa.objectClassID!=null){var ag=(E==null||E.AccessControlList==null)?-1:E.AccessControlList.ID;var an=(av==null||av.AccessControlList==null)?-1:av.AccessControlList.ID;var ak=(E==null||E.Workflow==null)?-1:E.Workflow.item;var au=(av==null||av.Workflow==null)?-1:av.Workflow.item;if(av.Class!=null&&u!=av.Class.ID){aw=true}else{if(ag!=an){aw=true}else{if(ak!=au){aw=true}else{if(E.Properties.length!=av.Properties.length){aw=true}else{if(E.CheckIn!=av.CheckIn){aw=true}else{if(E.Open!=av.Open){aw=true}else{if(E.SelectedFileMode!=av.SelectedFileMode){aw=true}else{if((!E.SelectedFileMode)&&(E.Template!=av.Template)){aw=true}else{if(E.Properties.length==av.Properties.length){for(var ar in E.Properties){if(E.Properties[ar].TypedValue==null&&av.Properties[ar].TypedValue==null){continue}else{if(E.Properties[ar].TypedValue==null&&av.Properties[ar].TypedValue!=null){aw=true;break}else{if(E.Properties[ar].TypedValue!=null&&av.Properties[ar].TypedValue==null){aw=true;break}else{if(E.Properties[ar].TypedValue.DisplayValue!=av.Properties[ar].TypedValue.DisplayValue){aw=true;break}}}}}}}}}}}}}}}else{var ag=(E==null||E.AccessControlList==null)?-1:E.AccessControlList.ID;var an=(av==null||av.AccessControlList==null)?-1:av.AccessControlList.ID;var ak=(E==null||E.Workflow==null)?-1:E.Workflow.item;var au=(av==null||av.Workflow==null)?-1:av.Workflow.item;var af=(E==null)?-1:E.Open;var ax=(av==null)?-1:av.Open;var ap=(av==null)?-1:av.CheckIn;var ah=(E==null)?-1:E.CheckIn;var aj=(E==null)?-1:E.SelectedFileMode;var aq=(av==null)?-1:av.SelectedFileMode;var am=(E==null)?-1:E.Template;var ai=(av==null)?-1:av.Template;var ao=(E==null||E.Properties==null)?-1:E.Properties;var al=(av==null||av.Properties==null)?-1:av.Properties;if(ag!=an){aw=true}else{if(ak!=au){aw=true}else{if(ah!=ap){aw=true}else{if(af!=ax){aw=true}else{if(aj!=aq){aw=true}else{if(am!=ai){aw=true}else{if(ao.length==al.length){for(var ar in ao){if(ao[ar].TypedValue.DisplayValue!=al[ar].TypedValue.DisplayValue){aw=true;break}}}}}}}}}}return aw},setVisibleItems:function(af){K=30;R=85;ae.groups.template.toggle(!!af.template);if(af.template){K+=25}if(af.template&&!af.singleFile){ae.templateCheckLabelGroup.show();ae.templateRadioLabelGroup.hide()}else{ae.templateCheckLabelGroup.hide();ae.templateRadioLabelGroup.show()}ae.groups.sfd.toggle(!!af.singleFile);ae.groups.mfd.toggle(!!af.singleFile);if(af.singleFile){K+=50}ae.groups.relationships.toggle(!!af.relationships);ae.groups.permissions.toggle(!!af.permissions);if(af.permissions){R+=25}ae.groups.workflow.toggle(!!af.workflow);if(af.workflow){R+=25}ae.groups.open.toggle(!!af.open);ae.groups.checkIn.toggle(!!af.checkIn);ae.groups.checkboxes.toggle(!!af.open||!!af.checkIn);if(af.open||af.checkIn){R+=25}}};return documentCard})};var r=function(K){return'<img style="vertical-align:middle;margin-right:5px" src="REST/objects/'+K+'/icon.ashx?size=16">'};var o=function(K){return'<img style="vertical-align:middle;margin-right:5px" src="'+viewItem.getObjectIcon(K)+'">'};var D=function(Q,P,N,L){var K=function(){var R=P.hasMetaCardChanged(false);if(R){M.noJqPages=true;j.prompt(Q,function(S){if(S=="discardchanges"){u=null;E=null;p=true;M.close(M.id);return true}else{return true}})}return !R};var O=false;var M=s.show(Q,P,{minwidth:450,minheight:500,resizable:true,gradient:true,ok:function(R){if(N){var U=P.getWindowResults();if(!U.Class){MFWA.Dialogs.Alerts.ShowError(J.DocumentCard.ClassSelectMessage);return false}var T=a.PropertyHandlers.getMissingProperty(U.Properties,U.Class);if(T){MFWA.Dialogs.Alerts.RequiredPropertyMissing(T.PropertyDef);return false}var S=P.hasMetaCardChanged(true);if(S){return N({window:R,result:U})}else{return true}}else{return true}},beforeClose:function(){if(p){p=false;return true}return K()},cancel:function(R){return true},cancelCleanup:function(R){if(L){return L(R)}else{return true}}});return M};var w=function(L,K){G.getUserID(function(M){G.getValueListItems(f.MFBuiltInValueList.Users,function(N){G.getCurrentTimestamp(function(R){var O="";for(var P=0;P<N.length;++P){if(M.Value==N[P].ID){O=N[P].Name;break}}var Q=new Date();var S=[{PropertyDef:f.MFBuiltInPropertyDef.Created,TypedValue:R},{PropertyDef:f.MFBuiltInPropertyDef.CreatedBy,TypedValue:{DataType:f.MFDataType.Text,HasValue:true,DisplayValue:O,SerializedValue:"",Value:O}},{PropertyDef:f.MFBuiltInPropertyDef.LastModified,TypedValue:R},{PropertyDef:f.MFBuiltInPropertyDef.LastModifiedBy,TypedValue:{DataType:f.MFDataType.Text,HasValue:true,DisplayValue:O,SerializedValue:"",Value:O}}];if(L){S.push({PropertyDef:f.MFBuiltInPropertyDef.NameOrTitle,TypedValue:{DataType:f.MFDataType.Text,HasValue:true,DisplayValue:L,SerializedValue:"",Value:L}})}K(S)})})})};var e=function(P,L,U,aa){x=false;if(!L){L={}}var M=L.filename;var V=L.properties;var Y=L.makingCopy;var W=L.creatingFromFile;var Z=L.workflow;var O=L.NACL;if(typeof(P)=="number"){G.getObjectType(P,function(ab){return e(ab,L,U,aa)})}else{var R=l();var N=false;var K=false;var X=(P.ID==f.MFBuiltInObjectType.Document);var Q=true;if(!W&&!Y){N=true;K=(P.ID==f.MFBuiltInObjectType.Document)}R.setVisibleItems({template:N,singleFile:K,permissions:true,workflow:true,open:X,checkIn:true});var S=true;if(P.ID==f.MFBuiltInObjectType.Document){S=false}else{if(Y){S=false}}var T=null;if(Y){T=function(){if(Z){R.jq.find("select.doccard_wf option[value="+Z+"]").attr("selected","true")}if(O){R.setPermissions(O,"")}}}R.initialize({objType:P,checkIn:S},function(ac,ab){w(M,function(ai){if(V){var ad={};for(var ae in ai){var ah=ai[ae];ad[ah.PropertyDef]=ah}for(var ag in V){var ah=V[ag];ad[ah.PropertyDef]=ah}ai=[];for(var af in ad){ai.push(ad[af])}}if(ac){ai.push(ac)}R.setProperties(ai,Q,ab)})},T,true);return D(r(P.ID)+g.escape(P.Name),R,U,aa)}};var i=function(M,L,K){e(M,null,L,K)};var m=function(O,L,N,K){var M={properties:L};e(O,M,N,K)};var b=function(P,L,M,O,K){var N={filename:L,creatingFromFile:true,properties:M};e(P,N,O,K)};var k=function(R,O,L,Q,K){var P={properties:O,NACL:L,makingCopy:true};for(var N in O){if(O[N].PropertyDef==f.MFBuiltInPropertyDef.Workflow){var M=O[N];P.workflow=O[N].TypedValue.Lookup.Item}}e(R,P,Q,K)};var A=function(M,L,K){x=true;if(!M.objType){G.getObjectType(M.ObjVer.Type,function(N){return A({objectVersion:M,objType:N},L,K)})}else{G.getUserID(function(O){var N=l();N.setVisibleItems({permissions:true,singleFile:(M.objType.ID==f.MFBuiltInObjectType.Document)});N.initialize({objType:M.objType},function(Q,P){N.preload(M.objectVersion,M.objectVersion.CheckedOutToUserID!=O.Value,P)});return D(o(M.objectVersion)+g.escape(M.objectVersion.Title),N,L,K)})}};return{ShowNewObjectWindow:i,ShowNewObjectWindowWithProperties:m,ShowNewObjectWindowFromFile:b,ShowNewObjectWindowFromAnotherObject:k,ShowEditObjectWindow:A}});MFNamespace("MFWA.Dialogs.DocumentCard.PropertyDef",function(a){var b=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");return{create:function(f,d){if(!d){d={}}var c={PropertyID:f.PropertyDef,PropertyDef:d.PropertyDef,Required:f.Required,TypedValue:f.TypedValue,ValueSource:d.valueSource,PropertySource:d.propertySource,Observers:{},jq:null};if(d.oldProperty){if(d.oldProperty.TypedValue&&d.oldProperty.ValueSource=="user"){c.TypedValue=d.oldProperty.TypedValue;c.ValueSource=d.oldProperty.ValueSource}}if(b.shownInProperties(c.PropertyID)){var e=$('<tr class="property" />').append($('<td class="property_name" />').append("Property "+f.PropertyDef)).append($('<td class="property_control"><input type="readonly" readonly="true" /></td>'));c.jq=e}return c}}});MFNamespace("MFWA.Dialogs.DocumentCard.Controls",function(d){var c=MFNamespace("MFWA.Utils");var h=MFNamespace("MFWA.Enumerations");var f=MFNamespace("MFWA.I18n");var b=MFNamespace("MFWA.Debug.Assert");var e=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var a=function(i){return{DisplayValue:"",Value:null,DataType:i}};var g={};g[h.MFDataType.Date]=function(p,n){var q=false;var i=null;var j=null;var o=$('<div class="date" />');var m=$('<input type="checkbox" class="date_check" />');var k=$('<input type="readonly" class="date" readonly="true" />');o.append(m,k);k.datepicker({dateFormat:f.DateTime.ShortDateFormat,changeMonth:true,changeYear:true,duration:"fast",gotoCurrent:true,buttonImage:"res/calendar.png",buttonText:"Choose",buttonImageOnly:true,showOn:"both",beforeShow:function(){if(!m.is(":checked")){m.attr("checked",true);i="user";r()}}});var r=function(s){if(typeof(s)!="undefined"){m.each(function(){this.checked=s})}if(o.children("input:checked").length>0){k.removeAttr("disabled");q=true}else{k.attr("disabled",true);q=false}};m.click(function(){i="user",r()});var l={jq:o,get:function(){if(q){var s=k.datepicker("getDate");return{DisplayValue:k.val(),Value:c.dateToStr(c.copyLocalToUTCDate(s)),DataType:h.MFDataType.Date}}else{return a(h.MFDataType.Date)}},getSource:function(){return i},set:function(s,t){q=(s!=null&&s.Value!=null);if(q){b.equals(s.DataType,h.MFDataType.Date);var u=c.strToDate(s.Value,true);k.datepicker("setDate",u);k.val($.datepicker.formatDate(f.DateTime.ShortDateFormat,u));i=t;r(true)}else{k.val($.datepicker.formatDate(f.DateTime.ShortDateFormat,new Date()));k.datepicker("setDate",new Date());i=null;r(false)}},filter:function(t,s){},enabled:function(s){if(s){o.removeAttr("disabled")}else{o.attr("disabled","disabled")}}};k.datepicker("option","onSelect",function(){i="user";q=true;k.blur();var s=l.get();if(j!=s&&n.change){n.change(l,s)}j=s;r(true)});return l};g[h.MFDataType.Time]=function(p,n){var q=false;var i=null;var j=null;var o=$('<div class="time" />');var m=$('<input type="checkbox" class="time_check" />');var k=$('<input type="text" class="time" />');o.append(m,k);k.timeEntry({spinnerImage:"Images/spinnerUpDownMotive.png",spinnerIncDecOnly:true,spinnerSize:[15,16,0],show24Hours:f.DateTime.Is24HourClock,separator:f.DateTime.TimeSeparator,ampmNames:[f.DateTime.AMDesignator,f.DateTime.PMDesignator],showSeconds:true,spinnerRepeat:[300,150],beforeShow:function(){if(!m.is(":checked")){m.attr("checked",true);i="user";r()}}});var r=function(t){if(typeof(t)!="undefined"){m.each(function(){this.checked=t})}if(o.children("input:checked").length>0){k.removeAttr("disabled");q=true}else{k.attr("disabled",true);var s=k.val();k.val("");k.val(s);q=false}};m.click(function(){i="user",r()});var l={jq:o,get:function(){if(q){var s=k.timeEntry("getTime");return{DisplayValue:k.val(),Value:c.dateToStr(c.copyLocalToUTCDate(s)),DataType:h.MFDataType.Time}}else{return a(h.MFDataType.Time)}},getSource:function(){return i},set:function(s,t){q=(s!=null&&s.Value!=null);if(q){b.equals(s.DataType,h.MFDataType.Time);var u=c.strToDate(s.Value,true);k.timeEntry("setTime",u);i=t;r(true)}else{k.timeEntry("setTime",new Date());i=null;r(false)}},filter:function(t,s){},enabled:function(s){if(s){o.removeAttr("disabled")}else{o.attr("disabled",true)}}};return l};g[h.MFDataType.Boolean]=function(m,k){var l=null;var i=null;var j=$('<select class="check"><option value="null" selected="selected">'+f.Empty+'</option><option value="true">'+f.Yes+'</option><option value="false">'+f.No+"</option></select>");var n={jq:$('<div class="common_control" />').append(j),get:function(){if(j.val()=="null"){return a(h.MFDataType.Boolean)}if(j.val()=="true"){return{DisplayValue:f.Yes,Value:true,DataType:h.MFDataType.Boolean}}else{return{DisplayValue:f.No,Value:false,DataType:h.MFDataType.Boolean}}},getSource:function(){return l},set:function(o,p){if(!o){o={DisplayValue:"",Value:null,DataType:h.MFDataType.Boolean}}b.equals(o.DataType,h.MFDataType.Boolean);if(o.Value===true){j.val("true");l=p}else{if(o.Value===false){j.val("false");l=p}else{j.val("null");l=null}}j.find("option[value="+j.val()+"]").attr("selected",true)},filter:function(p,o){},enabled:function(o){if(o){j.removeAttr("disabled")}else{j.attr("disabled","disabled")}}};j.change(function(){l="user";var o=n.get();if(i!=o&&k.change){k.change(n,o)}i=o});return n};g[h.MFDataType.MultiSelectLookup]=function(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(t){var k=MFNamespace("MFWA.Debug");var o=MFNamespace("MFWA.Utils");var a=MFNamespace("MFWA.Enumerations");var g=MFNamespace("MFWA.I18n");var p=MFNamespace("MFWA.I18n.DocumentCard");var s=MFNamespace("MFWA.Data.Cache");var f=MFNamespace("MFWA.Nulls");var b=MFNamespace("MFWA.Debug.Assert");var h=MFNamespace("MFWA.Dialogs.Prompt");var n=MFNamespace("MFWA.Data.Operations");var q=MFNamespace("MFWA.Icons");var l=MFNamespace("MFWA.Dialogs.Alerts");var m=MFNamespace("MFWA.StringBuilder");var k=MFNamespace("MFWA.Debug");var c=MFNamespace("MFWA.Model");var j=MFNamespace("MFWA.Dialogs.Confirm");var e=function(u){return function(w,v){if(u.change){u.change(w,v)}}};var r=function(u){return function(x,w,v){if(u.select){if(!w){if(x){w={DisplayValue:x.DisplayValue,Lookup:x,DataType:a.MFDataType.Lookup}}else{w={DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}}u.select(x,w,v)}}};var d=function(u){return function(v){if(u.remove){u.remove(v)}}};var i=function(x,L,A){if(!L){L={}}var F=null;var E=null;var y=null;var z={};var G=e(L);var J=r(L);var w=d(L);var M=L;var I={id:o.unique("mslu")};var u=function(N){if(!N){return null}if(N.Lookup){N=N.Lookup}if(N.Item){N=N.Item}if(typeof(N)=="number"){return N}else{return null}};I.jq=$('<div class="lookup" />');I.select=$('<select class="lookup" />').change(function(){F="user";var O=I.value;I.value=I.get();var N=u(I.value);if(u(O)!=N){if(N==f.ClearFilter){I.filterText("");I.set(O);return}G(I.value,F);if(I.value.Lookup){J(I.value.Lookup,null,I.valuesByID[N].defaultACL)}}});I.jq.append(I.select);var H=$('<div class="addItem" style="background-image: url(\''+q.Commands.AddValue+"');\"></div>");I.addItem=H;var K=$('<div class="filter" style="background-image: url(\''+q.Commands.SetFilter+"');\"></div>");I.filterItem=K;I.jq.append(H,K);if(L.remove){I.minusMark=$('<div class="mslu_minus" style="background-image: url(\''+q.Commands.AddRemove+"');\"></div>").click(function(){w(I)});I.jq.append(I.minusMark)}var B=function(){h.prompt(p.SetFilter,function(N){if(N){I.filterText(N)}return true})};K.click(B);var v=function(Q,P,N,O){n.addValueListItem(Q.ValueList,{Name:P,OwnerID:N.Value,HasOwner:!!N.Value},function(R){I.set({DataType:a.MFDataType.Lookup,DisplayValue:P,Lookup:{Item:R.ID,DisplayValue:P,Version:-1,Deleted:false,Hidden:false}},"user");I.refresh();O.close()})};H.click(function(){if(x.ValueList==a.MFBuiltInValueList.TraditionalFolders){l.ShowNotification(g.Alerts.TraditionalFolderAlert);return}s.getObjectType(x.ValueList,function(P){var Q={};if(P.RealObjectType){Q.NotAllowed=g.Alerts.CantAddNewObjectNotAllowed;Q.AccessDenied=g.Alerts.CantAddNewObjectAccessDenied;Q.Alert=g.Alerts.CantAddNewObject}else{Q.NotAllowed=g.Alerts.CantAddNewValueNotAllowed;Q.AccessDenied=g.Alerts.CantAddNewValueAccessDenied;Q.Alert=g.Alerts.CantAddNewValue}if(P.Name==""){l.ShowError(Q.AccessDenied);return}if(P.AllowAdding==false){l.ShowError(o.format(Q.NotAllowed,o.escape(P.Name)));return}var N={Value:null};if(P.HasOwner){if(!M.getBoundPropertyValue){l.ShowError("Internal error: lookup callbacks not set!");return}var O=c.selectedItem.get();if(O&&P.Owner!=O.objectVersion.ObjVer.Type){N=M.getBoundPropertyValue();if((!N)||(!N.Value.Lookups)){l.ShowError(Q.Alert);return}if(N.Value.Lookups){N.Value=u(N.Value.Lookups[0])}else{N.Value=u(N.Value.Lookup)}if(N.ValueList!=P.Owner){if(!P.RealObjectType){l.ShowError(Q.Alert);return}else{N.Value=null}}if(!N.Value&&!P.RealObjectType){l.SelectOwnerPropertyFirst(N.ID);return}}}if(!P.RealObjectType){h.prompt(p.AddNewValueToList,function(U,R){if(U){var V=false;for(var S in I.values){if(I.values[S].value.DisplayValue.toLowerCase()==U.toLowerCase()){V=true;break}}if(V==true){var T=new Object();T.message=o.format(g.NewItemDialog.PromptMessage,o.escape(U));T.title=g.NewItemDialog.Title;j.prompt(T,function(W){if(W==true){v(x,U,N,R)}else{R.close()}})}else{v(x,U,N,R)}}return false})}else{MFWA.Actions.newObject(x.ValueList,{callback:function(R){if(R){I.set({DataType:a.MFDataType.Lookup,DisplayValue:R.Title,Lookup:{Item:R.ObjVer.ID,DisplayValue:R.Title,Version:R.ObjVer.Version,Deleted:false,Hidden:false}},"user");I.refresh()}}})}})});I.get=function(){var O=I.select.val();if(O!=f.Lookup&&I.valuesByID){var P=I.select.val()*1;var N=I.valuesByID[P];return{DisplayValue:N.value.DisplayValue,Lookup:N.value,DataType:a.MFDataType.Lookup}}else{return{DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}};I.getSource=function(){return F};I.set=function(P,R){if(!P){P={DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}b.equals(P.DataType,a.MFDataType.Lookup);F=R;var N=null;if(P&&P.Lookup){if(I.values&&I.valuesByID[P.Lookup.Item]){try{$("#"+I.valuesByID[P.Lookup.Item].option).attr("selected",true)}catch(Q){}N=I.valuesByID[P.Lookup.Item].defaultACL}else{var O=$('<option value="'+P.Lookup.Item+'" selected>'+o.escape(P.Lookup.DisplayValue)+"</option>");I.select.append(O);I.valuesByID={};I.valuesByID[P.Lookup.Item]={value:P.Lookup};try{O[0].attr("selected",true)}catch(Q){}}}else{if(I.values){try{I.select.children()[0].attr("selected",true)}catch(Q){}}else{I.select.empty()}}if(u(I.value)!=u(P)){I.value=P;G(P,F);if(P.Lookup){J(P.Lookup,null,N)}}};var D=function(al,N){y=null;var V=I.select.outerWidth();var ae=false;I.values=new Array();I.valuesByID={};var O=new m.StringBuilder(3+al.length*8);O.append('<option value="').append(f.Lookup).append('"></option>');var ac=new Array();for(var af=0;af<al.length;af++){var Y=al[af];if(Y.HasParent==false){ac.push(Y)}else{var Z=ac.length;var ao=0;var aj=false;for(var W=0;W<Z;W++){if(Y.ParentID==ac[W].ID){aj=true;continue}else{if((aj==true)&&(ac[W].ParentID!=Y.ParentID)){ao=W;break}}}if(ao==0){ac.push(Y)}else{ac.splice(ao,0,Y)}}}al=ac;var ad=false;for(var af=0;af<al.length;af++){var Y=al[af];if(Y.ID<0&&!Y.IsClearItem){continue}var an={Item:Y.ID,DisplayValue:Y.Name,Hidden:false,Version:-1,Deleted:false};var ai=o.escape(an.DisplayValue);if(Y.IsClearItem){ai=Y.Name}var ag=function(ap,ar){if(al[ar].HasParent==true){ap="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ap;for(var aq=ar;aq>=0;aq--){if(al[ar].ParentID==al[aq].ID){ap=ag(ap,aq);break}}}return ap};var P=ag("",af);var Q=P.length/6;var T=ai;if(ai.length+Q>35){T=T.substr(0,33-Q)+"..."}var am=o.unique("option");var ah="";if(!$.browser.msie&&Y.Icon){ah='" indentation="'+P+'" title="REST/objects/'+Y.ValueListID+"/"+Y.ID+'/valueListIcon.aspx" style="';ad=true}else{ah='" style = "';T=P+T}O.append('<option id="').append(am).append('" value="').append(an.Item);if(u(I.value)==an.Item){ae=true;O.append(ah).append('" selected >')}else{if(Y.IsClearItem){O.append(ah).append('font-weight:bold;">')}else{O.append(ah).append('">')}}O.append(T).append("</option>");var R={value:an,option:am,defaultACL:Y.DefaultNamedACLForObject};I.values.push(R);I.valuesByID[an.Item]=R}I.select.html(O.toString());I.select.css("cursor","wait");var ab=I.value;if(!ae){if(N||!(I.value&&I.value.Lookup)){ab={DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup}}else{ab=I.value;var U=ab.Lookup.DisplayValue;var aa=$('<option value="'+ab.Lookup.Item+'" selected>'+o.escape(U)+"</option>");var R={value:ab.Lookup,option:aa};I.values.push(R);I.valuesByID[ab.Lookup.Item]=R;I.select.append(aa)}}if(navigator.appVersion.indexOf("MSIE")!=-1){I.select.width(V)}if(ad==true){I.select.attr("id",I.id);var ak="";if(I.value&&I.value.Lookup){ak=I.value.Lookup.DisplayValue}I.select.msDropDown({replaceDropDown:true,showIcon:false,currentItem:ak});ad=false;I.filterItem.css("position","relative");I.filterItem.css("margin-top","4px");var X=$("#"+I.id+"_msdd");var S="0px";if(($.client.os=="Linux")||($.client.os=="Windows"&&$.client.browser=="Safari")){S=(X.width()+37)}else{if($.client.browser=="Safari"){S=(X.width()+12)+"px"}else{S=(X.width()+17)+"px"}}I.filterItem.css("left",S);I.addItem.css("bottom","-8px");I.addItem.css("margin-top","4px");I.select.width(V);$(".lookup .ddTitle").css("padding","2px");if($.browser.safari){X.width(V-2)}else{if($.client.os=="Linux"){X.width(V)}}}if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}if(g_PendingLookupRequestCounter==0){$("#doccard, #doccard *").css("cursor","default")}};var C=function(O){if(z.text){var N={ID:f.ClearFilter,Name:p.ClearFilter+"'"+z.text+"'",IsClearItem:true};O.splice(0,0,N)}D(O)};I.filterText=function(N){z.text=N;if(y){y.cancel=true;if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}}++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard, #doccard *").css("cursor","wait")}y=s.getValueListItemsByPropDefID(x.ID,C,{item:z.item,text:z.text})};I.filter=function(R,P,O){var Q=Array();if(P.DataType==a.MFDataType.MultiSelectLookup){for(var N in P.Lookups){if(P.Lookups[N]!=null&&P.Lookups[N].Item!=f.Lookup){Q.push(P.Lookups[N].Item)}}}else{if(P.Lookup&&P.Lookup.Item!=f.Lookup){Q.push(P.Lookup.Item)}}if(y){y.cancel=true;if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}}z.item={type:R.PropertyDef.ValueList,values:Q};++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard, #doccard *").css("cursor","wait")}y=s.getValueListItemsByPropDefID(x.ID,function(S){D(S,O=="user")},{item:z.item,text:z.text})};I.refresh=function(){if(y){y.cancel=true;if(g_PendingLookupRequestCounter>0){--g_PendingLookupRequestCounter}}++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard, #doccard *").css("cursor","wait")}y=s.getValueListItemsByPropDefID(x.ID,D,{item:z.item,text:z.text})};I.filteredChanged=function(O,N){};I.canRemove=function(N){if(N){I.minusMark.show()}else{I.minusMark.hide()}};I.enabled=function(N){if(N){I.select.removeAttr("disabled")}else{I.select.attr("disabled","disabled")}};I.hideControls=function(N){if(N){if(I.minusMark){I.minusMark.hide()}I.addItem.hide();I.filterItem.hide()}else{if(I.minusMark){I.minusMark.show()}I.addItem.show();I.filterItem.show()}};if(A){I.filter(A.property,A.value,A.source)}else{++g_PendingLookupRequestCounter;if(g_PendingLookupRequestCounter==1){$("#doccard, #doccard *").css("cursor","wait")}y=s.getValueListItemsByPropDefID(x.ID,D)}return I};return{ssluConstructor:function(v,u){var w=i(v,u);return{jq:w.jq,get:function(){return w.get()},getSource:function(){return w.getSource()},set:function(y,x){w.set(y,x)},filter:function(z,y,x){w.filter(z,y,x)},filteredChanged:function(y,x){w.filteredChanged(y,x)},enabled:function(x){w.enabled(x)},hideControls:function(x){w.hideControls(x)}}},msluConstructor:function(G,B){var E=new Array();var u=null;var w=null;var C=e(B);var D=r(B);var v=B;var H=function(L){var K=false;for(var J=0;J<E.length;J++){if(E[J]==L){var M=E[J].get();if(M!=null&&M!=f.Lookup){K=true}E.splice(J,1);J--}}if(E.length==1){E[0].canRemove(false)}L.jq.remove();if(K){C(z.get(),z.getSource())}};var y=false;var I={remove:H,change:function(){u="user";if(!y){C(z.get(),z.getSource())}},select:function(L,K,J){if(!y){D(L,z.get(),J)}},getBoundPropertyValue:function(){if(v.getBoundPropertyValue){return v.getBoundPropertyValue()}return null}};var A=function(){var J=i(G,I,w);E.push(J);F.append(J.jq);E[0].canRemove(true)};var F=$('<div class="mslu" />');var x=$('<div class="mslu_plus" style="background-image: url(\''+q.Commands.AddRemove+"');\"></div>").click(function(){A()});F.append(x);A();E[0].canRemove(false);var z={jq:F,get:function(){var M={};for(var K=0;K<E.length;K++){var N=E[K].get();if(N.Lookup){M[N.Lookup.Item]=N}}var J={DisplayValue:new Array(),Lookups:new Array(),DataType:a.MFDataType.MultiSelectLookup};for(var L in M){J.DisplayValue.push(M[L].DisplayValue);J.Lookups.push(M[L].Lookup)}J.DisplayValue=J.DisplayValue.join("; ");if(J.Lookups.length==0){J.Lookups=null}return J},getSource:function(){return u},set:function(M,P){if(!M||!M.Lookups){M={DisplayValue:"",Lookups:new Array(),DataType:a.MFDataType.MultiSelectLookup}}b.equals(M.DataType,a.MFDataType.MultiSelectLookup);var J=z.get();while(M.Lookups.length>E.length){A()}while(M.Lookups.length<E.length&&E.length>1){H(E.pop())}y=true;if(M.Lookups.length==0){E[0].set({DisplayValue:"",Lookup:null,DataType:a.MFDataType.Lookup})}else{for(var L=0;L<M.Lookups.length;L++){E[L].set({DisplayValue:M.Lookups[L].DisplayValue,Lookup:M.Lookups[L],DataType:a.MFDataType.Lookup},P)}}y=false;u=P;var O=z.get();var K=false;if(!J||!J.Lookups){J=new Array()}else{J=J.Lookups}if(!O||!O.Lookups){O=new Array()}else{O=O.Lookups}if(O.length!=J.length){K=true}else{var N={};for(var L in O){N[O[L].Item]=true}var Q={};for(var L in J){Q[J[L].Item]=true}for(var L in Q){if(!N[L]){K=true}}}if(K){C(M,u);if(M.Lookups&&M.Lookups.length==1){D(M.Lookups[0],null,E[0].valuesByID[M.Lookups[0].Item].defaultACL)}}},filter:function(M,L,K){w={property:M,value:L,source:K};for(var J=0;J<E.length;J++){E[J].filter(M,L,K)}},filteredChanged:function(K,J){},enabled:function(K){for(var J in E){E[J].enabled(K)}}};return z}}});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.AllObjectTypes==false&&p!=u.ObjectType){continue}var t=$('<option value="'+u.ID+'">'+b.escape(u.Name)+"</option>");m[u.ID]=u;n.list.append(t)}})}};return k};return{getNewProperty:function(k,j,l){var i=e.get("MorePropertiesWindow",c);i.init(k,j,l);i.show()}}});MFNamespace("MFWA.Dialogs.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){n.noJqPages=true;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){o.noJqPages=true;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){n.noJqPages=true;var r=p.getUploadResults();return q(s,r)}},cancel:function(r){if($("#okButtonPressed").length>0){$("#okButtonPressed").val("false")}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($("#okButtonPressed").length>0){$("#okButtonPressed").val("false")}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 k=MFNamespace("MFWA.I18n");var c=MFNamespace("MFWA.Data.Cache");var f=MFNamespace("MFWA.Window");var g=MFNamespace("MFWA.Pooling");var i=MFNamespace("MFWA.Dialogs.Templates");var a=MFNamespace("MFWA.Enumerations");var h=MFNamespace("MFWA.Nulls");var j=MFNamespace("MFWA.Utils");var e=MFNamespace("MFWA.Dialogs.Alerts");var b=function(n,o){var l=$(".workflowDialog #workflow").val();var m=$(".workflowDialog select#state");m.empty();m.append('<option value="-1"></option>');if(o){$(".workflowDialog #workflow").attr("disabled","disabled");m.attr("disabled","disabled")}if(n){c.getStatesForWorkflow(l,n,function(p){for(var q=0;q<p.length;q++){if(p[q].ID==n){m.append('<option value="'+p[q].ID+'" selected>'+j.escape(p[q].Name)+"</option>")}else{if(p[q].Selectable==true){m.append('<option value="'+p[q].ID+'">'+j.escape(p[q].Name)+"</option>")}else{if($.browser.msie&&$.browser.version=="7.0"){m.append('<optgroup value="'+p[q].ID+'" class="disableOption" label="'+j.escape(p[q].Name)+'"></option>')}else{m.append('<option value="'+p[q].ID+'" disabled class="disableOption">'+j.escape(p[q].Name)+"</option>")}}}}})}else{c.getStatesForWorkflow(l,function(p){for(var q=0;q<p.length;q++){if(p[q].Selectable==true){m.append('<option value="'+p[q].ID+'">'+j.escape(p[q].Name)+"</option>")}else{if($.browser.msie&&$.browser.version=="7.0"){m.append('<optgroup value="'+p[q].ID+'" class="disableOption" label="'+j.escape(p[q].Name)+'"></option>')}else{m.append('<option value="'+p[q].ID+'" disabled class="disableOption">'+j.escape(p[q].Name)+"</option>")}}}})}if($.browser.msie&&$.browser.version=="6.0"){m.change(function(p){$(".workflowDialog select#state option:selected").each(function(){if($(".workflowDialog select#state option:selected").hasClass("disableOption")==true){e.ShowNotification(k.WorfFlowDialog.StateAccessDeniedMessage);if(n){m.val(n)}else{m.val("-1")}}})})}else{m.val(n)}};function d(l){return g.get("WorkflowDialog",function(){var n=i.createWorkflowDialog();var m={jq:n,jqNode:n.workflowDialog,resize:function(o){n.comment.height(o.height-180)},initialize:function(q,p){var s="";var o="";var r="";c.getPropertyDefsByID(function(t){s=j.escape(t[a.MFBuiltInPropertyDef.Workflow].Name);o=j.escape(t[a.MFBuiltInPropertyDef.State].Name);r=j.escape(t[a.MFBuiltInPropertyDef.VersionComment].Name);n.workflowHeader.append(s+k.Colon);n.stateHeader.append(o+k.Colon);n.commentHeader.append(r+k.Colon);c.getWorkflowsForObject(p,function(v){n.workflow.empty();n.workflow.append('<option value="-1"></option>');var w=null;if(q.Workflow.TypedValue.Lookup){w=q.Workflow.TypedValue.Lookup.Item}for(var u=0;u<v.length;u++){if(w==v[u].ID){n.workflow.append('<option value="'+v[u].ID+'" selected>'+j.escape(v[u].Name)+"</option>")}else{n.workflow.append('<option value="'+v[u].ID+'">'+j.escape(v[u].Name)+"</option>")}}var x=null;if(typeof(l)=="number"){x=l;b(x,true)}else{if(q.State.TypedValue.Lookup){x=q.State.TypedValue.Lookup.Item;b(x,false)}else{b(-1)}}})});return s},getWindowResults:function(){var o=$(".workflowDialog #workflow").val();var p=$(".workflowDialog #state").val();var q=$(".workflowDialog #comment").val();return{workflow:o,state:p,comment:q}}};return m})}return{show:function(o,m,l,n){c.getWorkflowState(o.ObjVer,function(p){var r=d(n);var q=r.initialize(p,o.ObjVer);return f.show(q+" - "+j.escape(o.Title),r,{minwidth:400,minheight:350,ok:function(s){if(m){var t=r.getWindowResults();return m(s,t)}else{return true}},cancel:function(s){if(l){return l(s)}else{return true}}})})},updateStates:function(l){b(l,false)}}});MFNamespace("MFWA.Dialogs.ChangePassword",function(){var g=MFNamespace("MFWA.I18n");var f=MFNamespace("MFWA.Data.Cache");var b=MFNamespace("MFWA.Window");var e=MFNamespace("MFWA.Pooling");var d=MFNamespace("MFWA.Dialogs.Templates");var c=MFNamespace("MFWA.Data.Operations");var h=MFNamespace("MFWA.Dialogs.Alerts");function a(){return e.get("ChangePassword",function(){var j=d.createChangePasswordDialog();var i={jq:j,jqNode:j.changePasswordDialog,resize:function(k){},getOld:function(){return j.oldPassword.val()},getNew1:function(){return j.newPassword.val()},getNew2:function(){return j.newPassword2.val()}};return i})}return{show:function(j){var i=a();return b.show(g.ChangePasswordDialog.Title,i,{width:300,height:180,ok:function(l){var k=i.getOld();var n=i.getNew1();var m=i.getNew2();if(k==""||n==""||m==""){h.ShowError(g.ChangePasswordDialog.EmptyPasswordError);return false}else{if(n!=m){h.ShowError(g.ChangePasswordDialog.NewPasswordsNotEqualError);return false}else{c.changePassword(k,n,function(){h.ShowNotification(g.ChangePasswordDialog.PasswordChanged);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(h){for(var i in a){if(i=="_namespace"){continue}var g=a[i];var f=$("#menu_"+i+" > div.menuItemText");var e=$("#contextmenu_"+i+" > div.menuItemText");if(g(h)){f.removeClass("dimmed");e.removeClass("dimmed")}else{f.addClass("dimmed");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+"')")}},setMenuForItems:function(h){var e;for(var g in h){var f=h[g];$("#"+f.row).contextMenu({menu:"menuSubOperations"},function(l){var m=$().listing.getListingItem(l);var n=m[0],j=m[1];var i=n.data("listing").opts;var k=n.listing("getSelected");if(k&&k.row==j.row){if(i.onrename){if(e){clearTimeout(e)}e=setTimeout(function(){e=null;i.onrename(j)},1000)}}else{if(e){clearTimeout(e)}i.onclick&&i.onclick(j)}});if(f.children&&f.children.length>0){this.setMenuForItems(f.children)}}}}});MFNamespace("MFWA.ViewItem",function(l){var r=MFNamespace("MFWA.Icons");var c=MFNamespace("MFWA.Debug.Assert");var b=MFNamespace("MFWA.Enumerations");var q=MFNamespace("MFWA.Utils");var n=MFNamespace("MFWA.Consts.ViewItem");var m=MFNamespace("MFWA.Debug");var t=MFNamespace("MFWA.Data.Cache");var o;var a;var g=function(v){if(!o){o={};o.T=b.MFDataType.Text;o.B=b.MFDataType.Boolean;o.M=b.MFDataType.MultiLineText;o.L=b.MFDataType.Lookup;o.S=b.MFDataType.MultiSelectLookup;o.D=b.MFDataType.Date;o.C=b.MFDataType.Time;o.I=b.MFDataType.Integer;o.O=b.MFDataType.Integer64;o.R=b.MFDataType.Floating;o.E=b.MFDataType.FILETIME;o.P=b.MFDataType.Timestamp;a={};for(var w in o){a[o[w]]=w}}return a[v]};var k={};k[false]="User";k[true]="Common";var d={};d[false]="";d[true]="Overlapping";var u=function(v){return{itemType:n.ItemType.ObjectVersion,objectType:v.ObjVer.Type,id:v.ObjVer.ID,version:v.ObjVer.Version,file:0}};var j=function(w){if(w.ObjVer.Type==b.MFBuiltInObjectType.Assignment){if(w.ObjectVersionFlags&b.MFObjectVersionFlag.Completed){var v=r.Listing.IconDoneAssignment;return v}else{var v=r.Listing.IconUndoneAssignment;return v}}else{if(w.SingleFile){extension=w.Files[0].Extension.toLowerCase();var v=r.Extensions[extension];if(!v||v===""){v=r.Listing.Default}return v}else{return"REST/objects/"+w.ObjVer.Type+"/icon.aspx"}}};var e=function(v){if(!v){return}if(v.ObjectVersion){if(v.ObjectVersion.ObjVer.Type==b.MFBuiltInObjectType.Assignment){if(v.ObjectVersion.HasRelationships){if(v.ObjectVersion.Files&&v.ObjectVersion.Files.length>0){return r.Expand_Collapse.FilesandRelatedObjectsCollapsed}else{return r.Expand_Collapse.RelatedObjectsCollapsed}}else{if(v.ObjectVersion.Files&&v.ObjectVersion.Files.length>0){return r.Expand_Collapse.FilesOnlyCollapsed}}}else{if(v.ObjectVersion.Files&&v.ObjectVersion.Files.length>0){return r.Expand_Collapse.FilesOnlyCollapsed}}}else{if(v.emptyRow){return r.Expand_Collapse.FilesOnlyCollapsed}}};var p=function(v){if(!v){return}if(v.ObjectVersion){if(v.ObjectVersion.ObjVer.Type==b.MFBuiltInObjectType.Assignment){if(v.ObjectVersion.HasRelationships){if(v.ObjectVersion.Files&&v.ObjectVersion.Files.length>0){return r.Expand_Collapse.FilesandRelatedObjectsExpanded}else{return r.Expand_Collapse.RelatedObjectsExpanded}}else{if(v.ObjectVersion.Files&&v.ObjectVersion.Files.length>0){return r.Expand_Collapse.FilesOnlyExpanded}}}else{if(v.ObjectVersion.Files&&v.ObjectVersion.Files.length>0){return r.Expand_Collapse.FilesOnlyExpanded}}}else{if(v.emptyRow){return r.Expand_Collapse.FilesOnlyExpanded}}};var f=function(y){if(!y.objectVersion){return}y.children=[];y.rootItem=y;if(y.objectVersion.ObjVer.Type==b.MFBuiltInObjectType.Assignment){var z=null;if(!y.objectVersion.SingleFile&&y.objectVersion.Files.length>0){z=true;y.expandableRow=true;y.expandIcon=p({ObjectVersion:y.objectVersion});y.collapseIcon=e({ObjectVersion:y.objectVersion});for(var x in y.objectVersion.Files){var w=l.ViewItem({FolderContentItemType:b.MFFolderContentItemType.ObjectFile,ObjectFile:y.objectVersion.Files[x]},y.path,y);w.rootItem=y;y.children.push(w)}}if(y.objectVersion.HasRelationships){i(y,z)}}else{if(!y.objectVersion.SingleFile&&y.objectVersion.Files.length>0){y.expandableRow=true;y.expandIcon=p({ObjectVersion:y.objectVersion});y.collapseIcon=e({ObjectVersion:y.objectVersion});for(var v in y.objectVersion.Files){var w=l.ViewItem({FolderContentItemType:b.MFFolderContentItemType.ObjectFile,ObjectFile:y.objectVersion.Files[v]},y.path,y);w.rootItem=y;y.children.push(w)}}}};var i=function(y,B){var A=null;var v=[];v.children=[];if(y.objectVersion.Relationships&&y.objectVersion.Relationships.length>0){y.expandableRow=true;y.expandIcon=p({ObjectVersion:y.objectVersion});y.collapseIcon=e({ObjectVersion:y.objectVersion});for(var w in y.objectVersion.Relationships){var x=y.objectVersion.Relationships[w];var z=l.ViewItem({FolderContentItemType:b.MFFolderContentItemType.ObjectVersion,ObjectVersion:x},y.path,y);z.rootItem=y;z.isRelatedObject=true;if(x.ObjVer.Type==b.MFBuiltInObjectType.Assignment&&y.objectVersion.ObjVer.Type==b.MFBuiltInObjectType.Assignment){z.expandableRow=false}if(B){if(x.ObjVer.Type!=A){if(v&&v.children&&v.children.length>0){y.children.push(v)}v=s(y,x);v.children=[];v.expandableRow=true;A=x.ObjVer.Type;z.parent=v;v.children.push(z)}else{z.parent=v;v.children.push(z)}}else{y.children.push(z)}}}if(B){y.children.push(v)}};var s=function(x,v){var w=null;w=l.ViewItem({emptyRow:true,name:"grouping"},x.path,x);w.childrenVisible=false;if(x.objectVersion.ObjVer.Type==b.MFBuiltInObjectType.Assignment&&v.ObjVer.Type==b.MFBuiltInObjectType.Assignment){w.icon=j(x.objectVersion)}else{w.icon="REST/objects/"+v.ObjVer.Type+"/icon.aspx"}w.name=v.ObjectNamePlural;return w};var h=function(y,z){var v=$("#"+z+"_plus");if(y.childrenVisible){v.css("background-image","url('"+y.expandIcon+"')")}else{v.css("background-image","url('"+y.collapseIcon+"')")}for(var x in y.children){var w=y.children[x];$("#"+w.row).toggle(y.childrenVisible);if(!y.childrenVisible){w.childrenVisible=false}h(w,w.row)}};return{getObjectIcon:j,createChildren:f,toggleChildren:h,ViewItem:function(G,z,E){var I=z;if(!I){I=""}if((I.length>1)&&(I[I.length-1]!="/")){I+="/"}var w;var B;var v;var C;var H=null;var F;if(G.View){var y=false;w=G.View.Name;itemType=n.ItemType.View;if(G.View.ViewLocation&&G.View.ViewLocation.Overlapping){y=true;itemType=n.ItemType.PropertyFolder;if(G.View.Name==""){w=G.View.ViewLocation.OverlappedFolder.DisplayValue}}I+="V"+G.View.ID;v={itemType:itemType,objectType:0,id:G.View.ID,version:0,file:0};var D=k[G.View.Common]+d[y]+"ViewFolder";B=r.Listing[D]}else{if(G.PropertyFolder){w=G.PropertyFolder.DisplayValue;I+=g(G.PropertyFolder.DataType);if(G.PropertyFolder.SerializedValue){I+=G.PropertyFolder.SerializedValue}B=r.Listing.PropertyFolder;v={itemType:n.ItemType.PropertyFolder,objectType:0,id:I,version:0,file:0}}else{if(G.ObjectVersion){w=G.ObjectVersion.Title;I+="O"+G.ObjectVersion.ObjVer.Type+"-"+G.ObjectVersion.ObjVer.ID+"-"+G.ObjectVersion.ObjVer.Version;H=G.ObjectVersion.HasRelationships||(!G.ObjectVersion.SingleFile&&G.ObjectVersion.Files&&G.ObjectVersion.Files.length>0);if(G.ObjectVersion.SingleFile){var x=G.ObjectVersion.Files[0].Extension;if(x&&x!=""){w+="."+x}}v=u(G.ObjectVersion);B=j(G.ObjectVersion)}else{if(G.ObjectFile){w=G.ObjectFile.Name;var x=G.ObjectFile.Extension;if(x){w+="."+x}B=r.Extensions[x.toLowerCase()];if(!B||B===""){B=r.Listing.Default}I+="F"+G.ObjectFile.ID;v={itemType:n.ItemType.ObjectVersion,objectType:E.objectVersion.ObjVer.Type,id:E.objectVersion.ObjVer.ID,version:E.objectVersion.ObjVer.Version,file:G.ObjectFile.ID};if(!B){B=r.Extensions.defaultExtension}}else{if(G.TraditionalFolder){w=G.TraditionalFolder.DisplayValue;I+="Y"+G.TraditionalFolder.Item;B=r.Listing.TraditionalFolder;v={itemType:n.ItemType.TraditionalFolder,objectType:0,id:G.TraditionalFolder.Item,version:0,file:0}}else{if(G.emptyRow){B:G.icon;C=G.emptyRow;v={id:-1}}else{c.fail("Unknown view type")}}}}}}var A={type:G.FolderContentItemType,view:G.View,propertyFolder:G.PropertyFolder,objectVersion:G.ObjectVersion,objectFile:G.ObjectFile,traditionalFolder:G.TraditionalFolder,name:w,icon:B,expandIcon:p(G),collapseIcon:e(G),path:I,children:[],ids:v,parent:E,pending:false,emptyRow:C,isRelatedObject:false,expandableRow:H,loadingChildren:false,rootItem:F,updateObject:function(K){this.name=K.Title;if(K.SingleFile&&K.Files[0].Extension){this.name+="."+K.Files[0].Extension}this.objectVersion=K;this.icon=j(K);this.ids=u(K);m.write("Resetting pending flag");this.pending=false;var J=false;if((K.ObjVer.Type==b.MFBuiltInObjectType.Assignment)||(!K.SingleFile&&K.Files.length>0)){J=true}if(J==true&&((K.HasRelationships)||(K.RelationShips&&K.RelationShips.length>0)||(K.Files&&K.Files.length>0))){this.expandableRow=true}else{this.expandableRow=false}},updatePending:function(J){this.pending=J},hideToggleIcon:function(){$("#"+this.row+"_plus").hide()}};return A}}});MFNamespace("MFWA.Listing.ViewMode",{List:1,Thumbnails:2});(function(i){var o=MFNamespace("MFWA.StringBuilder");var l=MFNamespace("MFWA.Debug");var e=MFNamespace("MFWA.Debug.Assert");var s=MFNamespace("MFWA.Utils");var k=MFNamespace("MFWA.I18n");var u=MFNamespace("MFWA.Icons");var g=MFNamespace("MFWA.Listing.ViewMode");var d=MFNamespace("MFWA.Enumerations");var c=MFNamespace("MFWA.Menu");var n=-1;var j=-1;var f={};var m={};var t=function(x){var w;var v;if(x.ondblclick&&x.onclick){addClickHandlers=function(z,y){z.append(" ondblclick=\"$().listing.handlers.OnDblClick('");z.append(y);z.append("')\" onclick=\"$().listing.handlers.OnClick('");z.append(y);z.append("')\"")};v=5}else{if(x.ondblclick){addClickHandlers=function(z,y){z.append(" ondblclick=\"$().listing.handlers.OnDblClick('");z.append(y);z.append("')\"")};v=3}else{if(x.onclick){addClickHandlers=function(z,y){z.append(" onclick=\"$().listing.handlers.OnClick('");z.append(y);z.append("')\"")};v=3}else{addClickHandlers=function(){}}}}return{handler:w,elements:v}};var q=function(x,z,C,y,v){if(!z){z=x.data("listing")}var B=s.unique("listing");var A=[z.id,B].join("_row_");y.row=A;if(!y.parent){y.children=[];y.childrenVisible=false}C.append("<").append(z.rowtag);C.append(' class="listing-item" id="').append(A).append('"');if(y.parent&&!y.parent.childrenVisible){C.append(' style="display:none;"')}addClickHandlers(C,A);C.append(">");C.append(x.listing(z.getItemFunc,y));C.append("</").append(z.rowtag).append(">");z.items.push(y);z.itemsByID[A]=y;var w=y.objectVersion;if(!w){w=y.ObjectVersion}if(w){if(!z.itemsByObjectVersionId[w.ObjVer.ID]){z.itemsByObjectVersionId[w.ObjVer.ID]=[]}z.itemsByObjectVersionId[w.ObjVer.ID].push(y)}};i.fn.listing=function(x){var v=[];for(var w=1;w<arguments.length;w++){v.push(arguments[w])}var y;this.each(function(){if(y!==undefined){return}if(typeof x=="string"){var z=x;y=r[z].apply(this,v)}else{e.exists(x,"columns");x=i.extend({},i.fn.listing.defaults,x);e.exists(x,"columns");h(this,x)}});return y};var b=function(y){var z=i().listing.getListingItem(y);var A=z[0],w=z[1];var v=A.data("listing").opts;var x=A.listing("getSelected");if(x&&x.row==w.row){if(v.onrename){if(p){clearTimeout(p)}p=setTimeout(function(){p=null;v.onrename(w)},1000)}}else{if(p){clearTimeout(p)}v.onclick&&v.onclick(w)}};var h=function(A,w){var B=i(A);var D={jq:null,value:null};B.empty();B.addClass("listing");var E=i('<tr class="header" style="height:0px;"></tr>');var y=i('<table class="listing-headers" style="position:absolute;" cellspacing="0" cellpadding="0"></table>');var F=i("<tr></tr>");var x=i('<div class="listing-container" style="position:relative;top:20px;overflow:auto"></div>');B.before(y.append(i("<thead></thead>").append(F)));B.before(x);x.append(B);var v=i('<div id="refreshListing" style="background-image: url(\''+u.Commands.Refresh+"')\"></div>");i("body").prepend(v);if(w.onrefresh){v.click(w.onrefresh)}var z=B.attr("id");if(!z||z==""){z=s.unique("listing");B.attr("id",z)}x.parent().bind("resize",function(){var I=i(this);x.width(I.width());x.height(I.height()-y.height())});x.parent().trigger("resize");x.parent().css("overflow","hidden");x.bind("scroll",function(){y.css("left",-x.scrollLeft())});var C=i("<div>");C.css({width:"90%",height:"90%","background-image":'url("Images/load.gif")',display:"none","background-position":"center","background-repeat":"no-repeat"});x.append(C);var H={node:B,opts:w,content:{},columns:[],header:E,fixedHeader:F,selected:null,items:[],itemsByID:{},itemsByObjectVersionId:{},id:z,getItemFunc:"_getItem_thumbnail",rowtag:"",loadLayer:C,scrollParent:x};m[z]=B;B.data("listing",H);B.listing("setListingMode",g.Thumbnails);B.listing("setColumns",w.columns,H.opts.columnchangedcb);B.listing("setData",w.data);var G=i("#searchBasic").offset().top+i("#searchBasic").height()+i(".listing-headers").height();G=G+6;v.css("top",G)};var a=function(x,w,v){x.sort(function(A,y){var z=w.comparer(A,y,w,v);if(v){return z}else{return -z}})};var r={setSorting:function(D,w){var x=i(this);var E=x.data("listing");E.opts.sortColumn=D;E.opts.sortAscending=w;i(".column-header-sortimage").attr("style","display: none;");i(".column-header-sortdir").attr("style","display: none;");var B="column-header-sortimage-"+E.opts.sortColumn;if(E.opts.sortAscending){i("#"+B).attr("src",u.Listing.ArrowUp)}else{i("#"+B).attr("src",u.Listing.ArrowDown)}i("#"+B).attr("style","display: block;");i("#columnSortInd"+E.opts.sortColumn).attr("style","display: block;");var A=E.opts.columns[E.opts.sortColumn].opts;var y=E.opts.sortColumn;if(A.currentWidth<16){i(i("#column_wrapper_"+y)[0].parentNode).css("width","13px");i("#column_wrapper_"+y).css("width","13px");if(E.opts.columns[y]){E.opts.columns[y].opts.currentWidth=13;x.listing("repositionColumns",E)}}var C="columnTitle"+E.opts.sortColumn;var z="columnSortInd"+E.opts.sortColumn;var F=i("#"+z).width();var v=i("#"+C).width();if((A.currentWidth-v)<25){F=A.currentWidth-18.5}else{F=v}i("#"+z).css("left",F+"px");i("#"+z).css("postition","absolute")},setColumns:function(x,B){var z=i(this);var A=z.data("listing");var v=[];A.fixedHeader.empty();A.header.empty();for(var w in x){var y=x[w];if(typeof(y)=="string"){y={path:y}}if(typeof y.title=="undefined"){y.title=y.path}if(y.title===""){y.title="&nbsp;"}y=i.extend({},i.fn.listing.column_defaults,y);var C=function(G,I){var N,M,J,P;var O="column-header-sortimage-"+I;var D='<div  id="columnTitle'+I+'" class="column-header-title">'+G.title+'</div><div id="columnSortInd'+I+'" class="column-header-sortdir"><img class="column-header-sortimage" id="'+O+'" src="'+u.Listing.ArrowUp+'" /></div>';N=i('<div id="column_wrapper_'+I+'" class="header ui-state-default">'+D+"</div>").bind("onselectstart",function(){return false}).hover(function(){i(this).addClass("ui-state-hover")},function(){i(this).removeClass("ui-state-hover")}).width(G.currentWidth-2).click(function(){if(A.suppressSort){return}if(A.opts.sortColumn==I){A.opts.sortAscending=!A.opts.sortAscending}else{A.opts.sortColumn=I;A.opts.sortAscending=true}z.listing("sort")});M=i('<th class="header"></th>').height(0);J=i('<th class="header"></th>').height(0);J.append(N);P=i('<div id="innerDiv'+I+'" style="border-left:1px solid white;border-right: 1px solid white; display:none;" ></div>').height(0);M.prepend(P);A.fixedHeader.append(J);A.header.append(M);M.data("listing",G);f[I]=i("#columnTitle"+I).width();var K=P.add(M.add(J)).width(G.currentWidth);l.write("Resizing will affect "+K.length+" elements");N.resizable({handles:"e",minWidth:G.minWidth,maxWidth:G.maxWidth,alsoResize:K,start:function(){A.suppressSort=true},resize:function(){i(".column-"+I).width(i("#innerDiv"+I).width()+"px")},stop:function(){setTimeout(function(){A.suppressSort=false},0);G.currentWidth=N[0].offsetWidth;G.onColumnResize();if(G.sorting){if(G.currentWidth<16){i(i("#column_wrapper_"+I)[0].parentNode).css("width","13px");i("#column_wrapper_"+I).css("width","13px");A.opts.columns[I].opts.currentWidth=13;z.listing("repositionColumns",A)}var V="columnTitle"+A.opts.sortColumn;var U="columnSortInd"+A.opts.sortColumn;var T=i("#"+U).width();var X=i("#"+V).width();if((G.currentWidth-X)<25){T=G.currentWidth-18.5}else{T=X}i("#"+U).css("left",T+"px");i("#"+U).css("postition","absolute")}var W=i(".listing-headers").width();i("#listingTable").width(W)}});var S=function(U,V){var T=i(this).children();T.css("background","url(images/ui-bg_flat_100_aaaab8_40x100.png) repeat-x scroll 50% 50% #F8ECE0");T.css("border-style","inset");i(this).find(".column-header-sortdir").css("background","url(images/ui-bg_flat_100_aaaab8_40x100.png) repeat-x scroll 50% 50% #F8ECE0");if(i.browser.msie){i(V.helper).css("padding-right","7px")}};var E=function(U,ab){if(i.browser.msie&&i.browser.version=="8.0"){i(ab.helper).css("-ms-filter","alpha (opacity=50)");i(ab.helper).css("filter","alpha (opacity=50)")}var W=ab.position.left;var ad=i(".listing-headers").position().left;if(ad<0){W-=ad}if(i(this).position().left>W){var T=i(this).position().left;for(var aa=I-1;aa>=0;aa--){var V=v[aa].opts.currentWidth;T-=V;if((T+(V/2))>(W)){var Y=i("#columnTitle"+aa).parent();var ac=i("#columnTitle"+(aa+1)).parent();Y.css("border-left-color","black");ac.css("border-left-color","#D3D3D3")}else{var Y=i("#columnTitle"+aa).parent();Y.css("border-left-color","#D3D3D3")}}}else{var X=(i(this).position().left+v[I].opts.currentWidth);var aa=I;for(aa=parseInt(aa)+1;aa<v.length;aa++){X+=(v[aa].opts.currentWidth);if((X-(v[aa].opts.currentWidth/2))<(W+v[I].opts.currentWidth)){var Y=i("#columnTitle"+aa).parent();var Z=i("#columnTitle"+(aa-1)).parent();Y.css("border-right-color","black");Z.css("border-right-color","#D3D3D3")}else{var Y=i("#columnTitle"+aa).parent();Y.css("border-right-color","#D3D3D3")}}}};var H=function(U,ad){var Z=[];for(var X=0;X<v.length;X++){Z.push((X+1)*2)}var Y=ad.position.left;var af=i(".listing-headers").position().left;if(af<0){Y-=af}if(i(this).position().left>Y){var T=i(this).position().left;for(var ac=I-1;ac>=0;ac--){var V=v[ac].opts.currentWidth;T-=V;if((T+(V/2))>(Y)){Z[I]=Z[ac]-1}}}else{var aa=(i(this).position().left+v[I].opts.currentWidth);var ac=I;for(ac=parseInt(ac)+1;ac<v.length;ac++){var V=v[ac].opts.currentWidth;aa+=V;if((aa-(V/2))<(Y+v[I].opts.currentWidth)){Z[I]=Z[ac]+1}}}B(Z);if(G.sorting){if(G.currentWidth<16){i(i("#column_wrapper_"+I)[0].parentNode).css("width","13px");i("#column_wrapper_"+I).css("width","13px");A.opts.columns[I].opts.currentWidth=13;z.listing("repositionColumns",A)}var ae="columnTitle"+A.opts.sortColumn;var ab="columnSortInd"+A.opts.sortColumn;var ag=i("#"+ab).width();var W=i("#"+ae).width();if((G.currentWidth-W)<25){ag=G.currentWidth-18.5}else{ag=W}i("#"+ab).css("left",ag+"px");i("#"+ab).css("postition","absolute")}};if(i.browser.msie&&i.browser.version=="8.0"){N.parent().draggable({axis:"x",containment:"window",zIndex:2000,helper:"clone",start:S,drag:E,stop:H})}else{N.parent().draggable({axis:"x",containment:"window",opacity:0.5,zIndex:2000,helper:"clone",start:S,drag:E,stop:H})}A.header.height(0);A.header.parent().height(0);v.push({node:M,opts:G});if(G.sorting){if(G.currentWidth<16){i(i("#column_wrapper_"+I)[0].parentNode).css("width","13px");i("#column_wrapper_"+I).css("width","13px");A.opts.columns[I].opts.currentWidth=13;z.listing("repositionColumns",A)}var Q="columnTitle"+A.opts.sortColumn;var L="columnSortInd"+A.opts.sortColumn;var R=i("#"+L).width();var F=i("#"+Q).width();if((G.currentWidth-F)<25){R=G.currentWidth-18.5}else{R=F}i("#"+L).css("left",R+"px");i("#"+L).css("postition","absolute")}}(y,w)}A.opts.columns=v;A.opts.columnchangedcb=B},setData:function(y){var B=new MFWA.Timer(function(I){l.write("SetData preparations @ jquery.listing: "+I)});var E=new MFWA.Timer(function(I){l.write("SetData string building @ jquery.listing: "+I)});var F=new MFWA.Timer(function(I){l.write("SetData finalizing @ jquery.listing: "+I)});B.start();var w=i(this);var H=w.data("listing");H.items=[];H.itemsByID={};var z=H.content;z.empty();H.opts.data=y;H.selected=null;if(!y){return}a(y,H.opts.columns[H.opts.sortColumn].opts,H.opts.sortAscending);var A=7;var C=t(H.opts);A+=C.elements;C=C.handler;var D=new o.StringBuilder(y.length*A);B.report();E.start();for(var x in y){var G=y[x];q(w,H,D,G,C)}E.report();F.start();w.listing("updatePending",false);z.html(D.toString());c.setMenuForItems(y);F.report();var v=i(".listing-headers").width();i("#listingTable").width(v)},repositionColumns:function(A){var z=A.header;if(z.length>0){var w=z.find("th");for(var y=0;y<w.length;y++){var x=z.find("th")[y];i(x).width(A.opts.columns[y].opts.currentWidth);var v=i(x).find("div")[0];i(v).width(A.opts.columns[y].opts.currentWidth);i(".column-"+y).width(A.opts.columns[y].opts.currentWidth+"px")}}},sort:function(w,x){var y=i(this);var E=y.data("listing");if(typeof w!="undefined"){E.opts.sortColumn=w}if(typeof x!="undefined"){E.opts.sortAscending=x}y.listing("setSorting",E.opts.sortColumn,E.opts.sortAscending);var z=E.opts.data;a(z,E.opts.columns[E.opts.sortColumn].opts,E.opts.sortAscending);var G=[];for(var A in z){G.push(i("#"+z[A].row))}G=i(G);G.appendTo(E.content);for(var A in E.opts.columns){if((E.opts.columns[A].opts.sorting)!==0&&(E.opts.sortColumn!==A)){E.opts.columns[A].opts.sorting=0;E.opts.columns[A].opts.onColumnSort()}}if(E.opts.sortAscending){E.opts.columns[E.opts.sortColumn].opts.sorting=1}else{E.opts.columns[E.opts.sortColumn].opts.sorting=2}E.opts.columns[E.opts.sortColumn].opts.onColumnSort();var C=E.opts.columns[E.opts.sortColumn].opts;if(C.currentWidth<16){i(i("#column_wrapper_"+E.opts.sortColumn)[0].parentNode).css("width","13px");i("#column_wrapper_"+E.opts.sortColumn).css("width","13px");E.opts.columns[E.opts.sortColumn].opts.currentWidth=13;y.listing("repositionColumns",E)}var D="columnTitle"+E.opts.sortColumn;var B="columnSortInd"+E.opts.sortColumn;var F=i("#"+B).width();var v=i("#"+D).width();if((C.currentWidth-v)<25){F=C.currentWidth-18.5}else{F=v}i("#"+B).css("left",F+"px");i("#"+B).css("postition","absolute")},select:function(z){var v=i(this);var y=v.data("listing");if(y.selected){y.selected.jq.removeClass("highlight")}var x=i("#"+z);var w=v.listing("getItemByID",z);if(i.browser.msie){i("html").focus()}else{i("#listing").append("<input type='text' id='tempText'></input>");i("#tempText").focus();i("#tempText").remove()}x.addClass("highlight");y.selected={jq:x,item:w}},unselect:function(){var v=i(this);var w=v.data("listing");if(w.selected){w.selected.jq.removeClass("highlight")}w.selected=null},updatePending:function(x){var v=i(this);var w=v.data("listing");w.loadLayer.toggle(x)},getSelected:function(){var v=i(this);var w=v.data("listing");if(w.selected){return w.selected.item}else{return null}},getItemByID:function(v){return i(this).data("listing").itemsByID[v]},_getItem_list:function(G){var w=i(this);var H=w.data("listing");var A=new Array(H.opts.columns.length);var C=0;if(H.opts.columns.length==0){return""}for(var z in H.opts.columns){var B=new o.StringBuilder(12);var x=H.opts.columns[z];var D=x.opts.func(G,x.opts);var v=null;if(D!=null&&typeof D=="object"&&D.id){v=D.id;D=D.text}var I=x.opts.cssClass;if(!I){I=""}B.append(z);B.append(" ");B.append(I);B.append('">');if(v){B.append('<div class="column-wrapper"><div id="');B.append(v);B.append('" class="listing-column column-')}else{B.append('<div class="column-wrapper"><div class="listing-column column-')}B.append(z);B.append(" ");B.append(I);B.append('" style="width:'+x.opts.currentWidth+'px">');if(D&&D.constructor==Date){var F=i.datepicker.formatDate(k.DateTime.ShortDateTimeFormat,D);B.append(F)}else{if(D){B.append(D)}}A[C]=B.toString();C++}var E=["<",' onselectstart="return false" onmousedown="return false" class="listing-column column-'].join("td");var y=["</div></div></",">"].join("td");return[E,A.join(y+E),y].join("")},_getItem_thumbnail:function(w){if(w.parent){return""}var x=new o.StringBuilder();if(w.objectVersion){if(w.objectVersion.ObjVer.Type==d.MFBuiltInObjectType.Document){if(w.objectVersion.SingleFile&&w.objectVersion.Files.length==1){x.append('<div class="imageframe">');x.append('<img class="thumbnail" src="./REST/objects/');x.append(w.objectVersion.ObjVer.Type);x.append("/");x.append(w.objectVersion.ObjVer.ID);x.append("/");x.append(w.objectVersion.ObjVer.Version);x.append("/files/");x.append(w.objectVersion.Files[0].ID);x.append("/");x.append(w.objectVersion.Files[0].Version);x.append("/");x.append("thumbnail.aspx")}else{x.append('<div class="iconframe">');x.append('<img class="thumbnail" src="');x.append(u.Listing.MultiFileDocument48)}}else{if(w.objectVersion.ObjVer.Type==d.MFBuiltInObjectType.Assignment){x.append('<div class="iconframe">');x.append('<img class="thumbnail" src="');if(w.objectVersion.ObjectVersionFlags&d.MFObjectVersionFlag.Completed){x.append(u.Listing.IconDoneAssignment48)}else{x.append(u.Listing.IconUndoneAssignment48)}}else{if(w.objectVersion.ObjVer.Type==d.MFBuiltInObjectType.DocumentCollection){x.append('<div class="iconframe">');x.append('<img class="thumbnail" src="');x.append(u.Listing.DocumentCollection48)}else{x.append('<div class="iconframe">');x.append('<img class="thumbnail" src="./REST/objects/');x.append(w.objectVersion.ObjVer.Type);x.append("/icon.aspx?size=48")}}}}if(w.objectFile){x.append('<div class="imageframe">');if(w.parent&&w.parent.objectVersion){x.append('<img class="thumbnail" src="./REST/objects/');x.append(w.parent.objectVersion.ObjVer.Type);x.append("/");x.append(w.parent.objectVersion.ObjVer.ID);x.append("/");x.append(w.parent.objectVersion.ObjVer.Version);x.append("/files/");x.append(w.objectFile.ID);x.append("/");x.append(w.objectFile.Version);x.append("/");x.append("thumbnail.aspx")}else{x.append('<img class="thumbnail" src="')}}else{if(w.view){x.append('<div class="iconframe">');x.append('<img class="thumbnail" src="');if(w.view.Common){if(w.view.ViewLocation&&w.view.ViewLocation.Overlapping){x.append(u.Listing.CommonOverlappingViewFolder48)}else{x.append(u.Listing.CommonViewFolder48)}}else{if(w.view.ViewLocation&&w.view.ViewLocation.Overlapping){x.append(u.Listing.UserOverlappingViewFolder48)}else{x.append(u.Listing.UserViewFolder48)}}}else{if(w.propertyFolder){x.append('<div class="iconframe">');x.append('<img class="thumbnail" src="');x.append(u.Listing.PropertyFolder48)}else{if(w.traditionalFolder){x.append('<div class="iconframe">');x.append('<img class="thumbnail" src="');x.append(u.Listing.TraditionalFolder48)}}}}x.append('">');if(w.pending){x.append('<img class="overlay" src="');if(i.browser.msie&&i.browser.version=="6.0"){x.append(u.Overlays.Pending48c8)}else{x.append(u.Overlays.Pending48c32)}x.append('">')}else{if(w.objectVersion||(w.parent&&w.parent.objectVersion)){var v=w.objectVersion||w.parent.objectVersion;if(!v.ThisVersionLatestToThisUser){x.append('<img class="overlay" src="');if(i.browser.msie&&i.browser.version=="6.0"){x.append(u.Overlays.PreviousVersion48c8)}else{x.append(u.Overlays.PreviousVersion48c32)}x.append('">')}else{if(v.ObjectCheckedOutToThisUser){x.append('<img class="overlay" src="');if(i.browser.msie&&i.browser.version=="6.0"){x.append(u.Overlays.CheckedOutCurrent48c8)}else{x.append(u.Overlays.CheckedOutCurrent48c32)}x.append('">')}else{if(v.ObjectCheckedOut){x.append('<img class="overlay" src="');if(i.browser.msie&&i.browser.version=="6.0"){x.append(u.Overlays.CheckedOutOther48c8)}else{x.append(u.Overlays.CheckedOutOther48c32)}x.append('">')}}}}}x.append("</div>");x.append('<div class="titleframe">');x.append(s.escape(w.name));x.append("</div>");return x.toString()},setItem:function(y,x){var v=i(this);var w=v.data("listing");var z=i("#"+y);z.empty();z.append(v.listing(w.getItemFunc,x))},addItemsAfter:function(z,v){var x=i(this);var y=x.data("listing");if(v.constructor!==Array){v=[];for(var w=1;w<arguments.length;w++){v.push(arguments[w])}}x.listing("_addItems",{items:v,afterItem:z})},addItem:function(w){var v=i(this);v.listing("_addItems",{items:[w]})},_addItems:function(w){var y=i(this);var z=y.data("listing");var v=w.items;if(v.length>1){a(v,z.opts.columns[z.opts.sortColumn].opts,z.opts.sortAscending)}var A=t(z.opts);var B=new o.StringBuilder(v.length*(7+A.elements));A=A.handler;for(var x=0;x<v.length;x++){q(y,z,B,v[x],A)}if(w.afterItem){i("#"+w.afterItem.row).after(B.toString())}else{if(w.beforeItem){i("#"+w.beforeItem.row).before(B.toString())}else{z.content.append(B.toString())}}c.setMenuForItems(v)},removeItem:function(y){var w=i(this);var x=w.data("listing");i("#"+y.row).remove();x.itemsByID[y.row]=null;for(var v=0;v<x.items.length;v++){if(x.items[v].row==y.row){x.items.splice(v,1);return}}},setRowCss:function(w){var z=i(this);var A=z.data("listing");var y="";for(var x in w){y=y+"#"+z.attr("id")+" "+x+" {\n";for(var v in w[x]){var B=w[x][v];if(typeof B==="number"&&v=="z-index"){B=B+"px"}y=y+v+":"+B+";\n"}y=y+"}\n"}l.write("Inserting style: "+y);y="<style>"+y+"</style>";if(A._currentCss){A._currentCss.remove()}var C=i(y);A._currentCss=C;i("head").append(C)},selectNext:function(){var x=i(this);var y=x.data("listing");var w=y.selected;if(w){var v=w.jq.next();while(v.length==1&&v.css("display")=="none"){v=v.next()}if(v.length==1){i().listing.handlers.OnClick(v.attr("id"))}}else{if(y.opts.data.length>0){i().listing.handlers.OnClick(y.opts.data[0].row)}}},selectPrev:function(){var w=i(this);var y=w.data("listing");var v=y.selected;if(v){var x=v.jq.prev();while(x.length==1&&x.css("display")=="none"){x=x.prev()}if(x.length==1){i().listing.handlers.OnClick(x.attr("id"))}}else{if(y.opts.data.length>0){i().listing.handlers.OnClick(y.opts.data[0].row)}}},setListingMode:function(A){var x=i(this);var y=x.data("listing");var B=x.data("listing.table.");x.empty();var z;var w;var v;if(A==g.Thumbnails){z=i("<div></div>");w=i('<div style="height:0px;overflow:hidden;"></div>');v=i("<div></div>");y.rowtag="div";y.getItemFunc="_getItem_thumbnail"}else{z=i("<table style='border-spacing:0;' cellspacing=0 cellpadding=0></table>");w=i('<thead style="height:0px;overflow:hidden;"></thead>');w.append(y.header);v=i("<tbody></tbody>");y.rowtag="tr";y.getItemFunc="_getItem_list"}z.append(w);z.append(v);x.append(z);y.content=v}};i.fn.listing.defaults={data:[],ondblclick:null,onclick:null,sortColumn:0,sortAscending:true};i.fn.listing.column_defaults={currentWidth:100,path:"",func:function(w,v){return s.extractPath(v.path,w)},comparer:function(w,v,x){var z=this.func(w,x);var y=this.func(v,x);if(z==y){return 0}if(z<y){return -1}else{return 1}}};i.fn.listing.getListing=function(v){return m[v]};i.fn.listing.getListingItem=function(x){var w=x.lastIndexOf("_");var v=x.substr(0,w-4);var y=i().listing.getListing(v);return[y,y.listing("getItemByID",x)]};var p;i.fn.listing.handlers={OnClick:function(y){var z=i().listing.getListingItem(y);var A=z[0],w=z[1];var v=A.data("listing").opts;var x=A.listing("getSelected");if(x&&x.row==w.row){if(v.onrename){if(p){clearTimeout(p)}p=setTimeout(function(){p=null;v.onrename(w)},1000)}}else{if(p){clearTimeout(p)}}v.onclick&&v.onclick(w)},OnDblClick:function(w){if(p){clearTimeout(p);p=null}var x=i().listing.getListingItem(w);var y=x[0],v=x[1];y.data("listing").opts.ondblclick(v)}}})(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(I,B){var S;var am={};var at=null;var ag=[];var w=[];var R=[];var aj=[];var ab=[];var M=true;var L="";var Z={};var v=null;var aa=[];t.getPropertyDefsByID(function(aA){aa=aA});var ax=function(aC){if(!aC){aC=c.view.get()}var aB=null;for(var aD in aC){if(aB!==null){assert.fail("There are two active views.")}aB=aD}if(aB===null){return}if(v){clearTimeout(v);v=null}I.listing("updatePending",true);I.listing("setData",null);c.selectedItem.set(null);var aA=i[aB];N[aA](aC[aB])};c.view.observe(k,ax);var N={};N[f.View]=function(aA){if(typeof aA=="undefined"){assert.fail("Refreshing view with no path");return}if(S){S.cancel=true}S=t.getViewContents(aA,x)};N[f.Search]=function(aA){t.performSearch(aA,function(aB){u(aB)})};N[f.History]=function(aA){p.getObjectHistory(aA,function(aB){u(aB)})};N[f.CollectionMembers]=function(aA){p.getCollectionMembers(aA,function(aB){u(aB)})};N[f.Relationships]=function(aA){p.getRelationships(aA,function(aB){u(aB)})};N[f.Subobjects]=function(aA){p.getSubobjects(aA,function(aB){u(aB)})};N[f.MFDContents]=function(aA){p.getMFDContents(aA,function(aB){u(aB)})};var y=function(aA){if(!am[aA.objectVersion.ObjVer.Type]){am[aA.objectVersion.ObjVer.Type]={}}am[aA.objectVersion.ObjVer.Type][aA.objectVersion.ObjVer.ID]=aA};var U=function(aC){if(aC.objectVersion){y(aC)}for(var aB in aC.children){var aA=aC.children[aB];U(aA)}};var au=function(aF){var aG=c.view.get();var aB="";if(aG&&aG.viewPath){aB=aG.viewPath}var aC=[];aC.ObjectVersion=aF;var aE=g.ViewItem(aC,aB);y(aE);I.listing("addItem",aE);for(var aA in aE.children){var aD=aE.children[aA];I.listing("addItem",aD)}};var ai=function(aA){I.listing("setItem",aA.row,aA)};var C=function(aI,aG,aA){if(aG){I.listing("removeItem",aI)}for(var aD in aI.children){var aF=aI.children[aD];C(aF,true,false)}if(aA){var aB=aI.objectVersion;if(!aB){aB=aI.ObjectVersion}if(aB){var aJ=I.data("listing");for(var aE=0;aE<aJ.itemsByObjectVersionId[aB.ObjVer.ID].length;aE++){var aH=aJ.itemsByObjectVersionId[aB.ObjVer.ID][aE];if(aH.parent&&aH.parent.children&&aH.parent.children.length>0){for(var aC=0;aC<aH.parent.children.length;aC++){if(aI.ids.id==aH.parent.children[aC].ids.id){aH.parent.children.splice(aC,1);if(aH.parent.children.length==0){if(aH.parent.emptyRow){C(aH.parent,true,false);aC--}else{aH.parent.hideToggleIcon()}}}}}C(aH,true,false);aJ.itemsByObjectVersionId[aB.ObjVer.ID].splice(aE,1);aE--}}}};var G=function(aB){if(aB.parent&&aB.parent.children&&aB.parent.children.length==1){var aA=aB;if(aB.parent.emptyRow){aA=aB.rootItem}else{aA=aB.parent}aA.childrenVisible=false;aA.children=[];MFWA.Listing.PlusClick(aA.row)}};var z=function(aC){I.listing("addItemsAfter",aC,aC.children);if(aC.objectVersion){U(aC)}for(var aB in aC.children){var aA=aC.children[aB];if(aA.children&&aA.children.length>0){z(aA)}}};var ae=function(aC,aD){aC.updatePending(aD);I.listing("setItem",aC.row,aC);for(var aB in aC.children){var aA=aC.children[aB];if(!aA.emptyRow&&aA.isRelatedObject==false){ae(aA,aD)}}};var H=function(aA){C(aA);ai(aA);z(aA);c.selectedItem.set(aA)};var af=function(aE,aH,aA){var aI;if(am[aE.Type]){aI=am[aE.Type][aE.ID]}if(!aI){return}var aG;if(aI.objectVersion){aG=aI.objectVersion}else{aG=aI.ObjectVersion}var aF=aG.ObjVer;if(aF.Version!=aE.Version){return}var aD=false;var aC=c.selectedItem.get();if(aC.objectVersion){var aB=aC.objectVersion;if(aF.Type==aB.ObjVer.Type&&aF.ID==aB.ObjVer.ID&&aF.Version==aB.ObjVer.Version){aD=true}}if(aI.children&&aI.children.length>0){C(aI,false,false)}aI.updateObject(aH);aI.icon=g.getObjectIcon(aI.objectVersion);ae(aI,false);ai(aI);if(aI.children&&aI.children.length>0){z(aI)}if(aD){c.selectedItem.set(aI)}else{c.selectedItem.set(null)}if((aH.ObjVer.Type==b.MFBuiltInObjectType.Assignment)||(!aH.SingleFile&&aH.Files.length>0)){MFWA.Listing.RefreshChildren(aI,aA)}ak(true)};var u=function(aA){if(S){S.cancel=true}x(aA)};var x=function(aL){var aE=aL.Path;var aB=aL.ViewSettingsID;var aC=[];var aH=null;am={};ag=[];w=[];R=[];aj=[];ab=[];var aM=new MFWA.Timer(function(aN){l.write("ParseViewContentsListing @ Listing, without setData: "+aN)});aM.start();if(aL.IsMFDContents){if(aL.Items.length>0){var aJ=aL.Items[0];var aK=g.ViewItem(aJ,aE);if(aJ.ObjectVersion){aH=aJ.ObjectVersion.ObjVer}}}else{for(var aG in aL.Items){var aJ=aL.Items[aG];var aK=g.ViewItem(aJ,aE);if(aK.view&&!MFWA.Dialogs.DocumentCard.Filters.visibleView(aK.view.ID)){continue}aC.push(aK);if(aJ.ObjectVersion){y(aK)}}}aM.report();if(!aL.ColumnInfos){aL.ColumnInfos=new Array()}if(aL.ColumnInfos.length==0){aL.ColumnInfos=V(aL,aE,aB);if(aE!="/"&&aL.IsGroupingEnabled==true){t.getLevelDefinition(aE,function(aO){if(aO.Value&&aO.Value.length>0){aL.ColumnInfos[1].LevelDefinition=aO.Value;$("#columnTitle1").html(aO.Value);var aN=$("#columnTitle1").width();$("#columnSortInd1").css("left",aN+"px").css("postition","absolute");p.setColumnInfos(aB,aL.ColumnInfos)}})}}else{var aD=null;for(var aK=0;aK<aL.ColumnInfos.length;aK++){var aA=aL.ColumnInfos[aK].PropertyID;if(aA>0&&!aa[aA]){aL.ColumnInfos.splice(aK,1);aK--;aD=true}}if(aD){p.setColumnInfos(aB,aL.ColumnInfos)}}ac(aL.ColumnInfos,aB);L=aB;Z=aL.ColumnInfos;I.listing("setListingMode",aL.ViewMode);n=aL.ViewMode;a.RefreshViewModeMenuItems();c.selectedItem.set(null);if(aH){MFWA.PropertiesPane.setProperties(aH)}if(aC){I.listing("setData",aC)}m.setStatus(aL.Items.length+" objects");if(aL.MoreResults){var aF=aL.Items.length;var aI=q.format(r.MoreResultsText,aF);e.queue(r.MoreResultsTitle,aI)}ak(true)};var V=function(aD,aF,aE){var aB=[];if(aF!="/"){aB.push({PropertyID:-17,MinColumnWidth:1,CurrentColumnWidth:40,MaxColumnWidth:12,Sorting:0})}aB.push({PropertyID:-1,MinColumnWidth:1,CurrentColumnWidth:250,MaxColumnWidth:1000,Sorting:((aF!="_history")?1:0)});if(aF=="_history"){aB.push({PropertyID:-8,MinColumnWidth:1,CurrentColumnWidth:70,MaxColumnWidth:1000,Sorting:2});aB.push({PropertyID:24,MinColumnWidth:1,CurrentColumnWidth:130,MaxColumnWidth:1000,Sorting:0});aB.push({PropertyID:23,MinColumnWidth:1,CurrentColumnWidth:55,MaxColumnWidth:1000,Sorting:0});aB.push({PropertyID:39,MinColumnWidth:1,CurrentColumnWidth:100,MaxColumnWidth:1000,Sorting:0});aB.push({PropertyID:29,MinColumnWidth:1,CurrentColumnWidth:100,MaxColumnWidth:1000,Sorting:0});p.setColumnInfos(aE,aB)}else{var aA=false;for(var aC=0;aC<aD.Items.length;aC++){if((aD.Items[aC].FolderContentItemType!=1)&&(aD.Items[aC].FolderContentItemType!=2)&&(aD.Items[aC].FolderContentItemType!=3)){aA=true;break}}if(aA){aB.push({PropertyID:-3,MinColumnWidth:1,CurrentColumnWidth:80,MaxColumnWidth:1000,Sorting:0});aB.push({PropertyID:-14,MinColumnWidth:1,CurrentColumnWidth:150,MaxColumnWidth:1000,Sorting:0})}else{aB.push({PropertyID:-2,MinColumnWidth:1,CurrentColumnWidth:150,MaxColumnWidth:1000,Sorting:0})}}return aB};var ac=function(aA,aF){var aC=[];var aG=0;var aE=true;for(var aD in aA){var aB=aA[aD].PropertyID;var aH=function(aI){aC.push({title:ah(aA[aD]),minWidth:aI.MinColumnWidth,currentWidth:aI.CurrentColumnWidth,maxWidth:aI.MaxColumnWidth,func:Q(aB),sorting:aI.Sorting,comparer:F(aB),onColumnResize:function(){aI.CurrentColumnWidth=this.currentWidth;p.setColumnInfos(aF,aA)},onColumnSort:function(){aI.Sorting=this.sorting;p.setColumnInfos(aF,aA)}})}(aA[aD]);if(aA[aD].Sorting!=0){aG=aD;aE=(aA[aD].Sorting==1)}}I.listing("setColumns",aC,function(aI){for(var aJ=0;aJ<Z.length;aJ++){Z[aJ].tempPos=aI[aJ]}Z.sort(function(aL,aK){return aL.tempPos-aK.tempPos});for(var aJ=0;aJ<Z.length;aJ++){delete Z[aJ].tempPos}p.setColumnInfos(aF,Z);ac(Z,aF);I.listing("setData",I.data("listing").opts.data)});I.listing("setSorting",aG,aE)};var ah=function W(aA){propertyId=aA.PropertyID;switch(propertyId){case -1:if(aA.LevelDefinition&&aA.LevelDefinition.length>0){return aA.LevelDefinition}else{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 23:return r.Columns.User;case 24:return r.Columns.StatusTime;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(propertyId>=0){var aC=q.unique("headercell");var aB=null;t.getPropertyDefsByID(function(aD){var aE=" ";if(aD[propertyId]){aE=aD[propertyId].Name}if(!aE){aE=""}if(aB===null){aB=q.escape(aE)}else{$("#"+aC).text(aE)}});if(aB===null){aB='<span id="'+aC+'">...</span>'}return aB}else{return""}}};var Q=function al(aF){switch(aF){case -1:return function aG(aQ){var aS=new o.StringBuilder(15);if(aQ.parent){aS.append('<div class="nameIndent">')}if(aQ.expandableRow){aS.append('<div class="nameExpand" id="');aS.append(aQ.row);aS.append('_plus" onclick="MFWA.Listing.PlusClick(\'');aS.append(aQ.row);aS.append("')\" style=\"background-repeat: no-repeat;background-image: url('");if(aQ.childrenVisible){aS.append(aQ.expandIcon)}else{aS.append(aQ.collapseIcon)}aS.append("');\"></div>")}aS.append('<img style="display:block" src="');aS.append(aQ.icon);aS.append('" class="nameIcon">');if(!aQ.emptyRow){if(aQ.pending){aS.append('<img class="history-overlay overlay" src="');if($.browser.msie&&$.browser.version=="6.0"){aS.append(s.Overlays.PendingGIF)}else{aS.append(s.Overlays.Pending)}aS.append('">')}else{if(aQ.objectVersion||(aQ.parent&&aQ.parent.objectVersion)){var aP=aQ.objectVersion||aQ.parent.objectVersion;if(!aP.ThisVersionLatestToThisUser){aS.append('<img class="history-overlay overlay" src="');if($.browser.msie&&$.browser.version=="6.0"){aS.append(s.Overlays.PreviousVersionGIF)}else{aS.append(s.Overlays.PreviousVersion)}aS.append('">')}else{if(aP.ObjectCheckedOutToThisUser){aS.append('<img class="history-overlay overlay" src="');if($.browser.msie&&$.browser.version=="6.0"){aS.append(s.Overlays.CheckedOutCurrentGIF)}else{aS.append(s.Overlays.CheckedOutCurrent)}aS.append('">')}else{if(aP.ObjectCheckedOut){aS.append('<img class="history-overlay overlay" src="');if($.browser.msie&&$.browser.version=="6.0"){aS.append(s.Overlays.CheckedOutOtherGIF)}else{aS.append(s.Overlays.CheckedOutOther)}aS.append('">')}}}}}}var aO;if((aQ.objectVersion&&aQ.objectVersion.SingleFile)||aQ.objectFile){var aP=(aQ.objectVersion||aQ.parent.objectVersion);var aR=(aQ.objectFile||aQ.objectVersion.Files[0]);var aN=(aP.ThisVersionLatestToThisUser?"latest":aP.ObjVer.Version);aO="REST/objects/"+aP.ObjVer.Type+"/"+aP.ObjVer.ID+"/"+aN+"/files/"+aR.ID+"/download.aspx"}if(aO){aS.append('<a href="').append(aO).append('" onclick="return false" class="nameText">')}else{aS.append('<div class="nameText">')}aS.append(q.escape(aQ.name));if(aO){aS.append("</a>")}else{aS.append("</div>")}if(aQ.parent){aS.append("</div>")}return aS.toString()};case -17:return function aL(aO){if(aO.objectVersion){var aQ=aO.objectVersion.HasRelationshipsFrom;var aP=aO.objectVersion.HasRelationshipsTo;var aN;if(aQ&&aP){aN=s.Listing.RelationshipsFromAndTo}else{if(aQ){aN=s.Listing.RelationshipsFrom}else{if(aP){aN=s.Listing.RelationshipsTo}else{return""}}}return['<img src="','">'].join(aN)}else{return""}};case -8:return function aJ(aN){if(aN.objectVersion){return aN.objectVersion.ObjVer.Version}else{return""}};case -2:case -21:return function aB(aO){if(aO.objectVersion){var aP=q.unique("listingcell");var aN=null;t.getObjectType(aO.objectVersion.ObjVer.Type,function(aQ){var aR=aQ.Name;if(!aR){aR=""}if(aN===null){aN=q.escape(aR)}else{$("#"+aP).text(aR)}});if(aN===null){aN={id:aP}}return aN}else{if(aO.objectFile){return r.ListingItemTypes.File}else{if(aO.propertyFolder){return r.ListingItemTypes.PropertyFolder}else{if(aO.view){return r.ListingItemTypes.View}else{if(aO.traditionalFolder){return r.ListingItemTypes.TraditionalFolder}else{return""}}}}}};case -3:return function aE(aN){if(aN.objectVersion){if(aN.objectVersion.SingleFile){return""+q.formatSize(aN.objectVersion.Files[0].Size)}else{return""}}else{if(aN.objectFile){return""+q.formatSize(aN.objectFile.Size)}else{return""}}};case -5:return function aM(aN){if(aN.objectVersion&&aN.objectVersion.ObjectCheckedOut){return aN.objectVersion.CheckedOutTo}else{return""}};case -14:return function aD(aN){if(aN.objectVersion){return aN.objectVersion.LastModifiedDisplayValue}else{if(aN.objectFile){return aN.objectFile.LastModifiedDisplayValue}else{return""}}};case -6:return function aK(aN){if(aN.objectVersion&&aN.objectVersion.ObjectCheckedOut){return aN.objectVersion.CheckedOutAtDisplayValue}else{return""}};case -13:return function aI(aN){if(aN.objectVersion){return aN.objectVersion.CreatedDisplayValue}else{return""}};case -7:return function aC(aN){if(aN.objectVersion){return aN.objectVersion.DisplayID}else{return""}};case -19:return function aH(aO){if(aO.objectVersion){var aP=q.unique("listingcell");var aN=null;t.getObjectType(aO.objectVersion.ObjVer.Type,function(aQ){var aR=aQ.Name;if(!aR){aR=""}if(aN===null){aN=q.escape(aR)}else{$("#"+aP).text(aR)}});if(aN===null){aN='<span id="'+aP+'"></span>'}return aN}else{return""}};case -9:case -10:case -11:case -4:case -12:case -15:case -16:case -18:case -20:default:if(aF>=0){return function aA(aS){if(aS.objectVersion){var aP=aS.objectVersion.ObjVer;if(!ag[aP.Type]){ag[aP.Type]=[]}if(!ag[aP.Type][aP.ID]){ag[aP.Type][aP.ID]=[]}if(!ag[aP.Type][aP.ID][aP.Version]){ag[aP.Type][aP.ID][aP.Version]=1;w.push(aP)}else{if(!ab[aP.Type]){ab[aP.Type]=[]}if(!ab[aP.Type][aP.ID]){ab[aP.Type][aP.ID]=[]}var aR=ab[aP.Type][aP.ID][aP.Version];if(aR){for(var aQ=0;aQ<aR.length;aQ++){if(aR[aQ].PropertyDef==aF){var aU=q.unique("listingcell");var aT=null;if(aR[aQ].TypedValue.Lookups&&aR[aQ].TypedValue.DataType==MFWA.Enumerations.MFDataType.MultiSelectLookup){aT=aR[aQ].TypedValue.Lookups[0]}else{if(aR[aQ].TypedValue.DataType==MFWA.Enumerations.MFDataType.Lookup){aT=aR[aQ].TypedValue.Lookup}}if(aT&&aT.Hidden==false){var aO=aR[aQ].PropertyDef;t.getPropertyDef(aO,function(aV){t.hasValueListIcon(aV.ValueList,aT.Item,function(aW){var aY=$("#"+aU);if(aW.Value==true){var aX='<img class="nameIcon" style="display: block;" src="REST/objects/'+aV.ValueList+"/"+aT.Item+'/valueListIcon.aspx" >';aX+='<div class="nameText">'+aR[aQ].TypedValue.DisplayValue+"</div>";aY.parent().html(aX)}})})}var aN='<div class="nameText" >'+aR[aQ].TypedValue.DisplayValue+"</div>";return'<div id="'+aU+'">'+aN+"</div>"}}return""}}var aU=q.unique("listingcell");R.push({objver:aP,propertyID:aF,htmlID:aU});ak(true);var aN='<img class="nameIcon" id="img_'+aU+'" style="display: none;">';aN+='<div class="nameText" id="'+aU+'">...</div>';return aN}return""}}else{return function(aN){return""}}}};var F=function F(aA){switch(aA){case -1:return av(function(aB){if(aB.propertyFolder){if(aB.propertyFolder.IsNumberSorting){return parseInt(aB.propertyFolder.SortingKey)}else{return aB.propertyFolder.SortingKey}}return""},function(aB){return aB.name});case -17:return av(function(aC){if(!aC.objectVersion){return 0}var aB=aC.objectVersion;if(aB.HasRelationshipsTo&&aB.HasRelationshipsFrom){return 3}if(aB.HasRelationshipsFrom){return 2}if(aB.HasRelationshipsTo){return 1}return 0});case -8:return av(function(aB){if(aB.objectVersion){return aB.objectVersion.ObjVer.Version}return 0});case -3:return av(function(aB){if(aB.objectVersion){if(aB.objectVersion.SingleFile){return aB.objectVersion.Files[0].Size}else{return 0}}else{if(aB.objectFile){return aB.objectFile.Size}else{return 0}}});case -7:return av(function(aC){if(aC.objectVersion){var aB=parseInt(aC.objectVersion.DisplayID);if(aB!=NaN){return aB}else{return aC.objectVersion.DisplayID}}else{return 0}});case -13:return av(function(aB){if(aB.objectVersion){return aB.objectVersion.CreatedUtc}else{return""}});case -14:return av(function(aB){if(aB.objectVersion){return aB.objectVersion.LastModifiedUtc}else{if(aB.objectFile){return aB.objectFile.LastModified}else{return""}}});case -6:case -5:case -10:return av(function(aB){return Q(aA)(aB)});case -19:case -2:case -21:return av(function(aB){return Q(aA)(aB)});case -4:case -9:case -11:case -12:case -15:case -16:case -18:case -20:return av(function(aB){return 0});default:return av(function(aF){if(aA>=0){if(aF.objectVersion){var aB=aF.objectVersion.ObjVer;if(ab[aB.Type]&&ab[aB.Type][aB.ID]){var aE=ab[aB.Type][aB.ID][aB.Version];if(aE){for(var aD=0;aD<aE.length;aD++){var aC=aE[aD];if(aC.PropertyDef==aA){var aG=aC.TypedValue;if(aG.SortingKey){return aG.SortingKey}return aG.DisplayValue}}}}}}return""})}};var ak=function ak(aC){if((aC&&(w.length>0||R.length>0))||w.length>100){var aB=w;w=[];var aA=R;R=[];t.getPropertiesOfMultipleObjects(aB,function(aK){if(aB.length!=aK.length){assert.fail("Inconsistent number of properties.")}for(var aF in aB){var aJ=aB[aF];if(!ab[aJ.Type]){ab[aJ.Type]=[]}if(!ab[aJ.Type][aJ.ID]){ab[aJ.Type][aJ.ID]=[]}ab[aJ.Type][aJ.ID][aJ.Version]=aK[aF]}for(var aF in aj){aA.push(aj[aF])}aj=[];for(var aF in aA){var aG=aA[aF].objver;var aH=ab[aG.Type][aG.ID][aG.Version];if(aH){var aL=false;for(var aD=0;aD<aH.length;aD++){if(aH[aD].PropertyDef==aA[aF].propertyID){$("#"+aA[aF].htmlID).text(aH[aD].TypedValue.DisplayValue);var aE=null;if(aH[aD].TypedValue.Lookups&&aH[aD].TypedValue.DataType==MFWA.Enumerations.MFDataType.MultiSelectLookup){aE=aH[aD].TypedValue.Lookups[0]}else{if(aH[aD].TypedValue.DataType==MFWA.Enumerations.MFDataType.Lookup){aE=aH[aD].TypedValue.Lookup}}if(aE&&aE.Hidden==false){var aI=aH[aD].PropertyDef;t.getPropertyDef(aI,function(aN){var aM=$("#img_"+aA[aF].htmlID);aM.attr("src","REST/objects/"+aN.ValueList+"/"+aE.Item+"/valueListIcon.aspx");t.hasValueListIcon(aN.ValueList,aE.Item,function(aO){if(aO.Value==true){aM.show();aM.css("display","block")}else{aM.remove()}})})}aL=true;break}}if(aL==false){$("#"+aA[aF].htmlID).text("")}}else{aj.push(aA[aF])}}})}};var ad=function(aB){if(aB.objectVersion){var aA=false;t.getProperties(aB.objectVersion.ObjVer,function(aD){for(var aC=0;aC<aD.length;aC++){if((aD[aC].PropertyDef==37)&&(aD[aC].TypedValue.SerializedValue)){aA=true}}if(aA){MFWA.Actions.objectOperations("MakeFileFromTemplate",aB)}else{if(aB.objectVersion.SingleFile){MFWA.Actions.objectOperations("OpenFile",aB)}else{MFWA.Actions.objectOperations("Properties",aB)}}})}else{if(aB.objectFile){MFWA.Actions.objectOperations("OpenFile",aB)}else{if(aB.emptyRow){MFWA.Listing.PlusClick(aB.row)}else{c.view.set({viewPath:aB.path})}}}};c.selectedItem.observe(k,function(aA){if(aA){I.listing("select",aA.row)}else{I.listing("unselect")}});var aw=40;var ar=38;var aq=37;var ap=39;var az=13;$(document).keydown(function(aC){if(!M||$.Menu.isActive()){return}if(aC.target.tagName=="SELECT"||aC.target.tagName=="INPUT"){return}var aB=null;if(aC.which==aw){aB=function(){I.listing("selectNext")}}else{if(aC.which==ar){aB=function(){I.listing("selectPrev")}}else{if(aC.which==az){var aA=I.listing("getSelected");if(aA){aB=function(){ad(aA)}}}else{return true}}}if(aB){if(v){clearTimeout(v)}v=setTimeout(aB,25)}return true});var D=function(aB){n=aB;var aA=I.data("listing");I.listing("setListingMode",n);I.listing("setData",aA.opts.data);p.setViewMode(L,aB);if(aB==d.List){I.listing("repositionColumns",aA)}E();ak(true)};var ay=function(){return n};var P=function(){return Z};var O=function(aA){Z.push({MinColumnWidth:1,CurrentColumnWidth:150,MaxColumnWidth:1000,Sorting:0,PropertyID:aA});p.setColumnInfos(L,Z);ac(Z,L);I.listing("setData",I.data("listing").opts.data);E();ak(true)};var T=function(aC){if(aC!=-1){var aA=[];var aD=false;for(var aB=0;aB<Z.length;aB++){if(Z[aB].PropertyID!=aC){aA.push(Z[aB])}}Z=aA;p.setColumnInfos(L,Z);ac(Z,L);I.listing("setData",I.data("listing").opts.data);E()}};function E(){var aA=c.selectedItem.get();if(aA!=null){I.listing("select",aA.row)}}var an=function(aC,aA,aG,aF,aE){if((!aC.parent&&!aA.parent)||(aC.parent==aA.parent)){return aE(aC,aA,aG)}var aD=aC;var aB=aA;if(aD.parent){aD=aD.parent}if(aB.parent){aB=aB.parent}if(aD==aB){if(aC.parent){return aF?1:-1}else{return aF?-1:1}}return aE(aD,aB,aG)};var av=function(){var aA=[];for(var aB=0;aB<arguments.length;aB++){aA.push(arguments[aB])}if(aA.length==0){aA=[function(aD,aC){return aC.func(aD,aC)}]}aA.unshift(Y);aA.push(A);aA.push(K);aA.push(J);aA.push(ao);return function(aD,aC,aF,aE){return an(aD,aC,aF,aE,function(aK,aI,aL){for(var aH=0;aH<aA.length;aH++){keyFunction=aA[aH];var aJ=keyFunction(aK,aL);var aG=keyFunction(aI,aL);if(typeof aJ=="string"){aJ=aJ.toLowerCase()}if(typeof aG=="string"){aG=aG.toLowerCase()}if(aJ<aG){return -1}if(aJ>aG){return 1}}return 0})}};var Y=function(aA){return aA.ids.itemType};var A=function(aA){return aA.ids.objectType};var K=function(aA){return aA.ids.id};var J=function(aA){return aA.ids.version};var ao=function(aA){return aA.ids.file};var X=[];X.push({title:"",cssClass:"",minWidth:50,currentWidth:100,maxWidth:200,sorting:0,func:function(aA){return""},comparer:av(function(aA){return 0}),onColumnResize:function(){},onColumnSort:function(){}});I.listing({columns:X,ondblclick:ad,onclick:function(aA){c.selectedItem.set(aA)},onrefresh:function(){ax()}});return{setViewMode:D,getViewMode:ay,getCurrentColumns:P,addColumnToListing:O,hideColumnFromListing:T,setFolderListing:u,refresh:ax,addItem:au,updateItem:ai,removeItem:C,reloadChildrenAfterDelete:G,updateObject:af,loadChildren:H,updatePending:ae,enableKeys:function(aA){M=aA}}},PlusClick:function(w){var v=$().listing.getListingItem(w)[1];if(v.loadingChildren){return}v.childrenVisible=!v.childrenVisible;if(!v.childrenVisible||v.emptyRow||(v.children&&v.children.length>0)){g.toggleChildren(v,w)}else{v.loadingChildren=true;var u=$("#"+w+"_plus");u.css("background-image","url("+s.Expand_Collapse.Throbber+")");t.getRelationshipForPropertiespane(v.objectVersion.ObjVer.Type,v.objectVersion.ObjVer.ID,v.objectVersion.ObjVer.Version,function(x){v.objectVersion.Relationships=x;v.objectVersion.HasRelationships=(x.length>0);if((v.objectVersion.RelationShips&&v.objectVersion.RelationShips.length>0)||(v.objectVersion.Files&&v.objectVersion.Files.length>0)){v.expandableRow=true}else{v.expandableRow=false}MFWA.MFWA.loadChildren(v);g.toggleChildren(v,w);v.loadingChildren=false})}},RefreshChildren:function(w,v){var u=w.rootItem;if(w.parent&&w.parent.emptyRow&&w.parent.children&&w.parent.children.length==0){u=w.parent.rootItem}if(!u){u=w}if(v&&u){MFWA.MFWA.removeItem(u,false,false);u.children=[];if(u.childrenVisible){u.childrenVisible=false;MFWA.Listing.PlusClick(u.row)}}}}});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,SortingKey:(w.propertyFolder&&w.propertyFolder.SortingKey!="")?w.propertyFolder.SortingKey:c.escape(w.name),IsNumberSorting:w.propertyFolder?w.propertyFolder.IsNumberSorting:false},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.attributes.IsNumberSorting){if(parseInt(C.attributes.SortingKey)<parseInt(B.attributes.SortingKey)){return -1}else{if(parseInt(C.attributes.SortingKey)>parseInt(B.attributes.SortingKey)){return 1}else{return 0}}}else{if(C.attributes.SortingKey<B.attributes.SortingKey){return -1}else{if(C.attributes.SortingKey>B.attributes.SortingKey){return 1}else{return 0}}}})}return x},error:function(s,q){var r=g.createErrorHandler();r(s.xhttp)},onchange:function(s,q){$("#searchString").val("");if(!p){o=s;if(!s){return}var t=$(s).attr("viewPath");var r=e.view.get();if(r&&r.viewPath==t){var u=MFNamespace("MFWA.MFWA");u.refreshListing();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}})}}});MFNamespace("MFWA.Actions",function(l){var e=MFNamespace("MFWA.MFWA");var m=MFNamespace("MFWA.Data.Cache");var t=MFNamespace("MFWA.Data.Operations");var c=MFNamespace("MFWA.Model");var k=MFNamespace("MFWA.Enumerations");var x=MFNamespace("MFWA.Debug");var L=MFNamespace("MFWA.I18n");var K=MFNamespace("MFWA.Utils");var F=MFNamespace("MFWA.Dialogs.Alerts");var q=MFNamespace("MFWA.Dialogs.CheckOutPrompt");var y=MFNamespace("MFWA.Dialogs.Upload");var z=MFNamespace("MFWA.Dialogs.DocumentCard");var I=MFNamespace("MFWA.Dialogs.Comments");var p=MFNamespace("MFWA.Dialogs.Workflow");var a=MFNamespace("MFWA.Dialogs.ChangePassword");var C=MFNamespace("MFWA.Dialogs.UndoCheckout");var B=MFNamespace("MFWA.Dialogs.ForceUndoCheckout");var E=MFNamespace("MFWA.Dialogs.Confirm");var H=MFNamespace("MFWA.Dialogs.Upload");var D=MFNamespace("MFWA.Dialogs.Error");var G=MFNamespace("MFWA.Dialogs.Prompt");var v=MFNamespace("MFWA.Structs");var b=MFNamespace("MFWA.Handlers");var s=MFNamespace("MFWA.Filters");var w=MFNamespace("MFWA.Listing");var J=MFNamespace("MFWA.Menu");var o={CheckOut:true,CheckIn:true,UndoCheckout:true,Rename:true,Delete:true,MarkComplete:true,ConvertToSFD:true,ConvertToMFD:true,AddFile:true};var n=false;var r=function(M){return function(N){if(N.Status==403){window.location="login.aspx"}else{F.ShowError(N)}if(M){e.updatePending(M,false)}}};var f=function(M){return function(O){if(O){var N=M;if(M.objectFile){N=M.parent}if(O.ObjectVersion){O=O.ObjectVersion}if(c.view.get().objectHistory){e.refreshListing()}else{e.updateObject(N.objectVersion.ObjVer,O,n)}}else{e.removeItem(M,true,true)}}};var j=function(M){return function(){F.ShowNotification(L.FavoriteDialog.ObjectAffectedMessage)}};var h=function(M){return function(){F.ShowNotification(L.FavoriteDialog.ObjectNotAffectedMessage)}};var g=function(N,M,O){return function(P){if(P==true){M.RemoveFromFavorites(N.ObjVer,function(){O.refreshListing();F.ShowNotification(L.FavoriteDialog.ObjectAffectedMessage)})}}};var d=function(P,N,O,Q,M){return function(R){if(R==true){if(N){if(Q.getAppletInitialized()){MFWA.Java.deleteFile(O,N,f(P),r(P))}else{M.deleteFile(O.ObjVer,N,f(P),r(P))}}else{m.getObjectType(O.ObjVer.Type,function(T){if(T.HasSubTypes==true){var S=new Object();S.message=L.DeleteDialog.MessageSubObjects;S.title=L.DeleteDialog.Title;E.prompt(S,function(U){if(U==true){if(Q.getAppletInitialized()){MFWA.Java.deleteObject(O,f(P),r(P))}else{M.deleteObject(O.ObjVer,f(P),r(P))}}else{Q.updatePending(P,false)}})}else{if(Q.getAppletInitialized()){MFWA.Java.deleteObject(O,f(P),r(P))}else{M.deleteObject(O.ObjVer,f(P),r(P))}}})}}else{Q.updatePending(P,false)}}};var A=function(M,O,N){return function(U){var R=M.ObjVer;var T=v.createNewLookup(M.Title,R.ID,-1);var P=v.createNewTypedValue(10,M.Title,T);var S=U.DefaultPropertyDef;var Q=v.createNewPropertyValue(S,P);if(N.properties==null){N.properties=new Array()}N.properties.push(Q);m.getObjectType(O,i(N))}};var i=function(M){return function(N){z.ShowNewObjectWindowWithProperties(N,M.properties,u(M,N),M.cancelCallback)}};var u=function(N,O){var M=new Array();return function(W){if(N.validate){N.validate(W)}var T=W.window;var U=W.result;var Q=b.PropertyHandlers.getMissingProperty(U.Properties,U.Class);if(Q){F.RequiredPropertyMissing(Q.PropertyDef);return false}var Z={};var R=[];if(O.ID==k.MFBuiltInObjectType.Assignment){MFWA.Handlers.PropertyHandlers.removeAssignedTo(U)}for(var V in U.Properties){var P=U.Properties[V];P={PropertyDef:P.PropertyDef,TypedValue:P.TypedValue};Z[P.PropertyDef]=P;if(z.Filters.usedInCreation(P.PropertyDef)){R.push(P)}}var S=function(ab,ad,aa,ac){if(ab.addToList!==false){e.addItem(ac)}if(ad){ad.close()}if(ab.closeDocumentCard!==false){aa.close()}if(ab.allowOpenFile!==false&&ac.SingleFile&&!U.CheckIn&&U.Open){MFWA.Java.openFile(ac,ac.Files[0])}if(ab.callback){ab.callback(ac)}};var X=function(ag,af){var aa=[];if(N.objectFiles){aa=N.objectFiles}for(var ad in af){aa.push({Title:af[ad].title,Extension:af[ad].extension,UploadID:af[ad].uploadID,Size:af[ad].size})}M=new Array();for(var ad in aa){M.push({title:aa[ad].Title,extension:aa[ad].Extension,uploadID:aa[ad].UploadID,size:aa[ad].Size})}var ae=null;if(U.Template&&U.Template.ObjectVersion){ae=U.Template.ObjectVersion.ObjVer}else{if(N.templateForFiles){ae=N.templateForFiles}}var ac=null;if(U.AccessControlList&&U.AccessControlList.AccessControlList){ac=U.AccessControlList.AccessControlList}var ab=null;if(typeof O=="number"){ab=O}else{ab=O.ID}t.createObject({objType:ab,checkIn:U.CheckIn},{PropertyValues:R,Workflow:U.Workflow,TemplateForFiles:ae,Files:aa,ACL:ac},function(ah){S(N,ag,T,ah)},r())};if(U.Template||N.files===false){X(null,[])}else{var Y=Z[k.MFBuiltInPropertyDef.SingleFileObject];if(Y){Y=Y.TypedValue.Value}if(Y){if(M.length==1){X(null,M)}else{y.singleFile(X)}}else{if(O.ID==k.MFBuiltInObjectType.Document){if(M.length>0){X(null,M)}else{y.multipleFiles(X)}}else{X(null,[])}}}return false}};return{newObject:function(Q,N){if(!N){N={}}var P=c.selectedItem.get();if(Q==k.MFBuiltInObjectType.Assignment&&P&&P.objectVersion){var O=P.objectVersion.ObjVer;if(O.Type!=k.MFBuiltInObjectType.Assignment){var M=O.Type;m.getObjectType(M,A(P.objectVersion,Q,N))}else{m.getObjectType(Q,i(N))}}else{m.getObjectType(Q,i(N))}m.getObjectType(Q,function(){})},newDragDocument:function(Q,O,N,P,M){m.getObjectType(0,function(S){var R;z.ShowNewObjectWindowFromFile(0,Q,N,u({validate:function(T){R=K.copy(T);T.result.CheckIn=false},callback:function(T){P({args:R,objectVersion:T})},files:false,addToList:false,closeDocumentCard:false,objectFiles:O,allowOpenFile:false},S),M)})},uploadDocument:function(M){m.getObjectType(M);y.show(function(N,O){var P=m.getObjectType(M);z.showNewObjectWindow(P,function(Q,R){F.ShowNotification("Creating object with "+O.length+" files and "+R.length+" properties!")})})},goTo:function(M){$("#searchString").val("");c.view.set({viewPath:M})},changeState:function(O){var N=c.selectedItem.get();var M=N.objectVersion;t.notifyObjectAccess(M.ObjVer);p.show(M,function(P,Q){t.setWorkflowState(M.ObjVer,Q,function(R){P.close();f(N)(R)},r(N));return false},null,O)},objectOperations:function(O,Z){if(!Z){Z=c.selectedItem.get()}if(Z){var N=c.selectedItem.get();var V=N.objectVersion;var S=N.objectFile;if(!V&&N.objectFile&&N.parent&&N.parent.objectVersion){V=N.parent.objectVersion}if(!V){return}if(o[O]){if(N.pending){x.write("Canceling '"+O+"' because of a pending update.");return}if(s[O]&&!s[O](N)){x.write("Canceling '"+O+"' because the command is not valid in the item's current state.");return}e.updatePending(N,true)}switch(O){case"CheckOut":n=true;if(e.getAppletInitialized()){MFWA.Java.checkOut(V,f(N),r(N))}else{t.checkOut(V.ObjVer,f(N),r(N))}break;case"CheckIn":n=true;if(e.getAppletInitialized()){MFWA.Java.checkIn(V,f(N),r(N))}else{t.checkIn(V.ObjVer,f(N),r(N))}break;case"UndoCheckout":n=true;var M={message:K.format(L.UndoCheckoutDialog.Message,V.Title,V.CheckedOutTo,V.CheckedOutFrom)};C.prompt(M,function(aa){if(aa==true){m.getObjectVersion(V.ObjVer.Type,V.ObjVer.ID,"latest",function(ab){m.canForceUndoCheckout(function(ac){m.getUserID(function(ad){if(ab.ObjectCheckedOutToThisUser==true){if(e.getAppletInitialized()){MFWA.Java.undoCheckout(V,f(N),r(N))}else{t.undoCheckout(V.ObjVer,f(N),r(N))}}else{if(ac.Value==true||ab.CheckedOutToUserID==ad.Value){var ae={message:K.format(L.ForceUndoCheckoutDialog.Message,K.escape(V.Title),K.escape(V.CheckedOutTo),K.escape(V.CheckedOutFrom))};B.prompt(ae,function(af){if(af==true){if(e.getAppletInitialized()){MFWA.Java.forceUndoCheckout(V,f(N),r(N))}else{t.forceUndoCheckout(V.ObjVer,f(N),r(N))}}else{e.updatePending(N,false)}})}else{F.ShowError(L.Alerts.CannotUndoCheckout);e.updatePending(N,false)}}})})})}else{e.updatePending(N,false)}});break;case"Comments":t.notifyObjectAccess(V.ObjVer);I.show(V,function(aa,ab){if(ab==""&&V.ObjectCheckedOut==false){aa.close()}else{t.setVersionComment(V.ObjVer,ab,function(ac){aa.close();e.updateObject(V.ObjVer,ac.ObjectVersion,false)},r(N))}return false});break;case"CheckInWithComments":I.show(V,function(aa,ab){if(ab!=""){t.setVersionComment(V.ObjVer,ab,function(){aa.close();if(e.getAppletInitialized()){MFWA.Java.checkIn(V,f(N),r(N))}else{t.checkIn(V.ObjVer,f(N),r(N))}},r(N))}else{aa.close();if(e.getAppletInitialized()){MFWA.Java.checkIn(V,f(N),r(N))}else{t.checkIn(V.ObjVer,f(N),r(N))}}return false});break;case"Workflow":case"ChangeState":l.changeState(null);break;case"Properties":t.notifyObjectAccess(V.ObjVer);N.childrenVisible=true;n=true;b.PropertyHandlers.editObject(V,f(N),r(N));break;case"AddToFavorites":t.AddToFavorites(V.ObjVer,j(V),h(V));break;case"RemoveFromFavorites":var M=new Object();M.message=L.FavoriteDialog.RemoveFromFavoriteMessage;M.title=L.FavoriteDialog.Title;E.prompt(M,g(V,t,e));break;case"Delete":n=true;var M=new Object();if(S){M.message=L.DeleteDialog.MessageItem}else{M.message=L.DeleteDialog.MessageObject}M.title=L.DeleteDialog.Title;E.prompt(M,d(N,S,V,e,t));break;case"MarkComplete":n=true;t.markComplete(V.ObjVer,f(N),r(N));break;case"ConvertToSFD":n=true;if(e.getAppletInitialized()){MFWA.Java.setSingleFileObject(V,true,f(N),r(N))}else{t.setSingleFileObject(V.ObjVer,true,f(N),r(N))}break;case"ConvertToMFD":n=true;if(e.getAppletInitialized()){MFWA.Java.setSingleFileObject(V,false,f(N),r(N))}else{t.setSingleFileObject(V.ObjVer,false,f(N),r(N))}break;case"History":t.notifyObjectAccess(V.ObjVer);c.view.set({objectHistory:V.ObjVer});break;case"Rename":n=true;var M={title:L.Commands.Rename,value:""};if(S||V.SingleFile==true){if(V.SingleFile==true){S=V.Files[0]}M.value=S.Name;if(S.Extension!=""){M.value+="."+S.Extension}}else{M.value=V.Title}G.prompt(M,function(ab,aa){if(ab!==null&&ab!==undefined&&ab!==""){if(S){if(e.getAppletInitialized()){MFWA.Java.renameFile(V,S,ab,f(N),r(N))}else{t.renameFile(V.ObjVer,S,ab,f(N),r(N))}}else{if(e.getAppletInitialized()){MFWA.Java.renameObject(V,ab,f(N),r(N))}else{t.renameObject(V.ObjVer,ab,f(N),r(N))}}return true}return false},function(){e.updatePending(N,false)});break;case"OpenFile":t.notifyObjectAccess(V.ObjVer);var Y=S;if(V.SingleFile==true){Y=V.Files[0]}if(!e.getAppletInitialized()){var R=V.ObjVer;window.location="REST/objects/"+R.Type+"/"+R.ID+"/"+R.Version+"/files/"+Y.ID+"/download.aspx"}else{var U=false;if(V.ObjectCheckedOut==true&&V.ThisVersionLatestToThisUser==true){U=true}var T=e.getSessionInfo();if(!T.LicenseAllowsModifications){U=true}if(U){if(V.SingleFile==true){MFWA.Java.openFile(V,V.Files[0])}else{if(S){MFWA.Java.openFile(V,S)}}}else{q.prompt(V,function(aa){if(aa==null){return true}if(aa=="checkout"){t.checkOut(V.ObjVer,function(af){e.updateObject(V.ObjVer,af,n);var ab=af.Files;var ae;var ag;var ac=0;for(ac=0;ac<ab.length;ac++){ag=ab[ac];if(ag.ID===Y.ID){ae=ag;break}}if(ae){MFWA.Java.openFile(af,ae)}else{var ad={context:L.CheckOutPrompt.NotFoundErrroMessage};D.show(ad)}},r(N))}else{MFWA.Java.openFile(V,Y)}return true})}}break;case"DownloadFile":var Y=S;if(V.SingleFile==true){Y=V.Files[0]}var R=V.ObjVer;window.location="REST/objects/"+R.Type+"/"+R.ID+"/"+R.Version+"/files/"+Y.ID+"/download.aspx";break;case"AddFile":n=true;H.addFile(V.ObjVer,function(aa,ab){N.childrenVisible=true;f(N)(ab);return true},function(aa){e.updatePending(N,false);return true});break;case"ReplaceFile":var Q={};if(N.objectFile){Q.ID=S.ID;Q.Version=S.Version}else{Q.ID=N.objectVersion.Files[0].ID;Q.Version=N.objectVersion.Files[0].Version}H.replaceFile(V.ObjVer,Q.ID,function(aa,ab){MFWA.Java.removeTemporaryFile(ab,function(){},r(N));return true},function(aa){e.updatePending(N,false);return true});break;case"GetAssignmentsForObject":var X={SearchIn:"SearchInMetadata",SearchString:"",SearchWithinThisFolder:false,CurrentFolder:null,SearchType:null,SearchObjectType:"10",PropertyCriteria:new Array()};var W={Property:"VL_"+V.ObjVer.Type,Condition:"is",TypedValue:V.ObjVer.ID+"",DataFunction:null,DataType:null};X.PropertyCriteria.push(W);var P={path:"",array:[]};P.array.push(X);c.view.set({searchCriteria:P});break;case"CollectionMembers":c.view.set({collectionMembers:V.ObjVer});break;case"Relationships":c.view.set({relationships:V.ObjVer});break;case"Subobjects":t.notifyObjectAccess(V.ObjVer);c.view.set({subobjects:V.ObjVer});break;case"MakeFileFromTemplate":m.getProperties(V.ObjVer.Type,V.ObjVer.ID,V.ObjVer.Version,function(ab){ab[0].TypedValue.DisplayValue="";ab[0].TypedValue.SerializedValue="";ab[0].TypedValue.Value="";for(var aa=0;aa<ab.length;aa++){if(ab[aa].PropertyDef==37){ab.splice(aa,1)}}var ac={templateForFiles:V.ObjVer,files:false};z.ShowNewObjectWindowWithProperties(V.ObjVer.Type,ab,u(ac,V.ObjVer.Type),null)});break;case"MakeCopy":m.getProperties(V.ObjVer.Type,V.ObjVer.ID,V.ObjVer.Version,function(aa){m.getNACL(V.ObjVer.Type,V.ObjVer.ID,V.ObjVer.Version,function(ab){var ac={templateForFiles:V.ObjVer,files:false};z.ShowNewObjectWindowFromAnotherObject(V.ObjVer.Type,aa,ab,u(ac,V.ObjVer.Type),null,r(N))})});break;case"GetHyperlink":m.getVaultGUID(function(aa){m.getSitePath(function(ac){var ae=aa.Value.replace("{","").replace("}","");var ad="";ad=ac.Value+"openfile.aspx?vault="+ae+"&objtype="+V.ObjVer.Type+"&docid="+V.ObjVer.ID;if(S){ad+="&fileid="+S.ID}else{if(V.SingleFile==true){ad+="&fileid="+V.Files[0].ID}}var ab={title:L.Prompt.Title,message:L.Prompt.GetHyperlink,ok:true,cancel:false,value:ad};G.prompt(ab,function(af){return true})})});break;default:F.ShowError("Unknown command: "+O);break}}},settings:function(N){var M="menu_"+N;switch(N){case"ViewList":e.setListingMode(w.ViewMode.List);J.RefreshViewModeMenuItems();break;case"ViewThumbnails":e.setListingMode(w.ViewMode.Thumbnails);J.RefreshViewModeMenuItems();break;case"LogOut":t.logout(function(O){if(O.Value==true){window.location="login.aspx?logout=true"}});break;case"ChangePassword":a.show(function(O){O.close()});break;default:F.ShowError("Unknown command: "+N);break}},columnsettings:function(O){var M=e.getCurrentColumns();var P=false;for(var N=0;N<M.length;N++){if(M[N].PropertyID==O){P=true;break}}if(P){e.hideColumnFromListing(O)}else{e.addColumnToListing(O)}},updateColumnSettingsMenu:function(){J.RefreshColumnSettingMenuItems()},browseRelationships:function(N){var M=c.selectedItem.get().objectVersion;m.getObjectType(M.ObjVer.Type,function(P){var O=P.objectTypeTargetsForBrowsing;var Q="/V13";var S;for(var R=0;R<O.length;R++){if(O[R].TargetObjectType==N){S=O[R].ViewCollection}}if(S){Q+="/V"+S;m.getViewContents(Q,function(T){if(T.Items.length>0){Q+="/V"+T.Items[0].View.ID;m.getViewContents(Q,function(U){if(U.Items.length>0){var V=M.ObjVer.ID%1000;var W=(M.ObjVer.ID-V)/1000;if(U.Items[W]){Q+="/I"+W+"/L"+M.ObjVer.ID;c.view.set({viewPath:Q})}}})}})}})},showRelatedObject:function(M,P){var N={SearchIn:"SearchInMetadata",SearchString:P,SearchWithinThisFolder:false,CurrentFolder:null,SearchType:null,SearchObjectType:M,PropertyCriteria:new Array()};var O={path:"",array:[]};O.array.push(N);MFWA.Model.view.set({searchCriteria:O})}}});MFNamespace("MFWA.Filters",function(c){var b=MFNamespace("MFWA.Data.Cache");var d=MFNamespace("MFWA.Model");var f=function(g){return function(h){if(!h||!h.objectVersion){return false}else{return g(h.objectVersion)}}};var a=function(g){return function(h){if(!h){return false}else{if(h.objectVersion){return g()}else{return false}}}};var e=function(g){return function(h){if(!h){return false}else{if(h.objectVersion){return g(h.objectVersion,false)}else{if(h.objectFile&&h.parent&&h.parent.objectVersion){return g(h.parent.objectVersion,true)}else{return false}}}}};return{CheckOut:f(function(g){if(!g||g.ObjectCheckedOut==true||g.ThisVersionLatestToThisUser==false||g.Deleted==true){return false}return true}),CheckIn:f(function(g){if(!g||g.ObjectCheckedOutToThisUser==false||g.ThisVersionLatestToThisUser==false){return false}return true}),CheckInWithComments:f(function(g){if(!g||g.ObjectCheckedOutToThisUser==false||g.ThisVersionLatestToThisUser==false){return false}return true}),UndoCheckout:f(function(g){if(!g||g.ObjectCheckedOut==false||g.ThisVersionLatestToThisUser==false){return false}return true}),Properties:f(function(g){return true}),History:f(function(g){var h=d.view.get();if(h&&h.objectHistory){return false}else{if(!g){return false}}return true}),Relationships:f(function(g){if(!g){return false}return true}),Comments:f(function(g){if(!g||g.ThisVersionLatestToThisUser==false){return false}return true}),Workflow:f(function(g){if(!g||g.ThisVersionLatestToThisUser==false){return false}return true}),Rename:e(function(h,g){if(!h||h.Deleted==true){return false}else{if(h.ThisVersionLatestToThisUser==false){return false}else{if(g){if(h.ObjectCheckedOutToThisUser==true){return true}else{return false}}else{if(h.ObjectCheckedOut==false||h.ObjectCheckedOutToThisUser==true){return true}else{return false}}}}}),Delete:e(function(h,g){var i=d.view.get();if(i&&i.viewPath=="/V15"){return false}else{if(i&&i.objectHistory){return false}else{if(!h||h.Deleted==true){return false}else{if(g){if(h.ObjectCheckedOutToThisUser==true){return true}else{return false}}else{if(h.ObjectCheckedOut==false||h.ObjectCheckedOutToThisUser==true){return true}else{return false}}}}}}),ConvertToSFD:f(function(g){if(!g||g.SingleFile==true||g.ObjectCheckedOutToThisUser==false||g.Files.length!=1){return false}else{if(g.ThisVersionLatestToThisUser==false){return false}}return true}),ConvertToMFD:f(function(g){if(!g||g.SingleFile==false||g.ObjectCheckedOutToThisUser==false){return false}else{if(g.ThisVersionLatestToThisUser==false){return false}}return true}),ReplaceFile:e(function(h,g){if(!h||h.Deleted==true){return false}else{if(h.ThisVersionLatestToThisUser==false){return false}else{if(g){if(h.ObjectCheckedOutToThisUser==true){return true}else{return false}}else{if((h.SingleFile==true)&&(h.ObjectCheckedOutToThisUser==true)){return true}else{return false}}}}}),OpenFile:e(function(h,g){if(!h){return false}else{if(g){return true}else{if(h.SingleFile==true){return true}else{return false}}}}),RemoveFromFavorites:a(function(){var g=d.view.get();if(g&&g.viewPath=="/V15"){return true}else{return false}}),AddToFavorites:a(function(){var g=d.view.get();if(g&&g.viewPath!="/V15"){return true}else{return false}})}});MFNamespace("MFWA.TaskPane",function(q){var c=MFNamespace("MFWA.MFWA");var p=MFNamespace("MFWA.Data.Cache");var u=MFNamespace("MFWA.Data.Operations");var v=MFNamespace("MFWA.Dialogs.Upload");var n=MFNamespace("MFWA.Dialogs.DocumentCard");var s=MFNamespace("MFWA.Dialogs.Alerts");var k=MFNamespace("MFWA.Dialogs.DocumentCard.Filters");var o=MFNamespace("MFWA.Handlers.PropertyHandlers");var a=MFNamespace("MFWA.Enumerations");var h=MFNamespace("MFWA.Model");var f=MFNamespace("MFWA.StringBuilder");var l=MFNamespace("MFWA.Actions");var w=MFNamespace("MFWA.Icons");var r=false;var j={};var t=function(z){var y=z.metadata();if(y.action){z.click(function(){if(r){return}var A=l[y.action];A.apply(l,y.params||[]);r=true;setTimeout(function(){r=false},50)})}};var e=function(y){y.find(".taskpaneButton").each(function(){t($(this))})};var d=function(y){return function(z){if(z.CanHaveFiles){if(y.objectVersion.SingleFile==true){$("#taskpaneAddFile").hide();$("#taskpaneOpenFile").show();$("#taskpaneDownloadFile").show();if(y.objectVersion.ThisVersionLatestToThisUser==true){$("#taskpaneGetHyperlink").show()}else{$("#taskpaneGetHyperlink").hide()}}else{if(y.objectVersion.SingleFile==false){$("#taskpaneDownloadFile").hide();$("#taskpaneGetHyperlink").hide();$("#taskpaneOpenFile").hide();if(y.objectVersion.ThisVersionLatestToThisUser==true&&y.objectVersion.ObjectCheckedOutToThisUser==true){$("#taskpaneAddFile").show()}else{$("#taskpaneAddFile").hide()}}}}else{$("#taskpaneAddFile").hide();$("#taskpaneDownloadFile").hide();$("#taskpaneGetHyperlink").hide();$("#taskpaneOpenFile").hide()}if(!c.getAppletInitialized()){$("#taskpaneDownloadFile").hide()}}};var g={taskpaneCheckOut:function(y){return y.ThisVersionLatestToThisUser&&!y.ObjectCheckedOut&&!y.Deleted},taskpaneCheckIn:function(y){return y.ThisVersionLatestToThisUser&&y.ObjectCheckedOutToThisUser},taskpaneUndoCheckout:function(y){return y.ThisVersionLatestToThisUser&&y.ObjectCheckedOut},taskpaneCollectionMembers:function(y){return y.ObjVer.Type==9},taskpaneReplaceFile:false,taskpaneProperties:true,taskpaneHistory:true,taskpaneRelationships:true,taskpaneSubobjects:false,taskpaneWorkflow:true,taskpaneStates:true,taskpaneMakeCopy:true,taskpaneGetHyperlink:false,taskpaneViewAndModify:true,taskpaneThumbnailArea:true};var x={taskpaneCheckOut:false,taskpaneCheckIn:false,taskpaneUndoCheckout:false,taskpaneMarkComplete:false,taskpaneCollectionMembers:false,taskpaneHistory:false,taskpaneRelationships:false,taskpaneCollectionMembers:false,taskpaneSubobjects:false,taskpaneWorkflow:false,taskpaneStates:false,taskpaneMakeCopy:false,taskpaneGetHyperlink:function(y){return y.ThisVersionLatestToThisUser},taskpaneBrowse:false,taskpaneProperties:true,taskpaneThumbnailArea:true};MFWA.Model.selectedItem.observe(this,function(y){if(y&&y.objectVersion){for(var B in g){var A=g[B];if(typeof A=="function"){A=A(y.objectVersion)}$("#"+B).toggle(A)}if((y.objectVersion.SingleFile)&&(y.objectVersion.ObjectCheckedOutToThisUser)&&(y.objectVersion.ThisVersionLatestToThisUser==true)){$("#taskpaneReplaceFile").show()}if(MFWA.Model.view.get().objectHistory){$("#taskpaneHistory").hide();if(y.objectVersion.ThisVersionLatestToThisUser==false){$("#taskpaneWorkflow").hide();$("#taskpaneMakeCopy").hide()}}if(y.objectVersion.ObjVer.Type==a.MFBuiltInObjectType.Assignment){p.canCompleteAssignment(y.objectVersion.ObjVer.ID,y.objectVersion.ObjVer.Version,function(C){if(C.Value==true&&y.objectVersion.ThisVersionLatestToThisUser==true&&y.objectVersion.Deleted==false){$("#taskpaneMarkComplete").show()}else{$("#taskpaneMarkComplete").hide()}})}else{$("#taskpaneMarkComplete").hide()}p.getObjectType(y.objectVersion.ObjVer.Type,d(y));p.getObjectType(y.objectVersion.ObjVer.Type,function(F){var C=F.objectTypeTargetsForBrowsing;if(C.length>0){$("#taskpaneBrowse .taskpaneButton").hide();for(var D=0;D<C.length;D++){var E="taskpaneBrowseObjectType_"+C[D].TargetObjectType;$("#"+E).show()}$("#taskpaneBrowse").show()}else{$("#taskpaneBrowse").hide()}});p.getObjectsByType(function(C){p.getObjectType(y.objectVersion.ObjVer.Type,function(D){var F=false;for(var E in C){if(C[E].HasOwner&&C[E].Owner==D.ID){F=true;break}}if(F==true){$("#taskpaneSubobjects").show()}else{$("#taskpaneSubobjects").hide()}})})}else{if(y&&y.objectFile){for(var B in x){var A=x[B];if(typeof A=="function"){A=A(y.objectFile)}$("#"+B).toggle(A)}if(y.parent&&y.parent.objectVersion){var z=y.parent.objectVersion;if(z.ObjectCheckedOutToThisUser==true&&z.ThisVersionLatestToThisUser==true){$("#taskpaneAddFile").show();$("#taskpaneDownloadFile").show();$("#taskpaneOpenFile").show();$("#taskpaneGetHyperlink").show();$("#taskpaneReplaceFile").show()}else{if(z.ThisVersionLatestToThisUser==true){$("#taskpaneAddFile").hide();$("#taskpaneDownloadFile").show();$("#taskpaneOpenFile").show();$("#taskpaneGetHyperlink").show();$("#taskpaneReplaceFile").hide()}else{$("#taskpaneAddFile").hide();$("#taskpaneDownloadFile").show();$("#taskpaneOpenFile").show();$("#taskpaneGetHyperlink").hide();$("#taskpaneReplaceFile").hide()}}$("#taskpaneViewAndModify").show()}else{$("#taskpaneViewAndModify").hide();$("#taskpaneStates").hide()}}else{$("#taskpaneViewAndModify").hide();$("#taskpaneBrowse").hide();$("#taskpaneStates").hide()}}m(y);b(y)});var b=function(C){var B=$("#taskpaneThumbnail");if(!C){B.hide();return}var y=null;if(C.objectFile&&C.parent&&C.parent.objectVersion){var A=C.parent.objectVersion.ObjVer;var z=C.objectFile;y="REST/objects/"+A.Type+"/"+A.ID+"/"+A.Version+"/files/"+z.ID+"/"+z.Version+"/preview.aspx?size=150&force=true"}else{if(C.objectVersion){var A=C.objectVersion.ObjVer;y="REST/objects/"+A.Type+"/"+A.ID+"/"+A.Version+"/preview.aspx?size=150&force=true"}}if(y){B.attr("src",y);B.show()}else{B.hide()}};function i(y){p.hasValueListIcon(a.MFBuiltInValueList.States,y,function(z){if(z.Value==true){$("#states_"+y).show()}else{$("#states_"+y).css("background-image","url('"+w.Listing.WorkflowStates+"')");$("#states_"+y).show()}})}var m=function(y){$("#taskpaneStates .taskpaneButton").remove();$("#taskpaneStates").hide();if(!y||!y.objectVersion||!y.objectVersion.ThisVersionLatestToThisUser){return}p.getWorkflowState(y.objectVersion.ObjVer,function(A){var z=(A.Workflow.TypedValue.Lookup!=null)?A.Workflow.TypedValue.Lookup.Item:0;if(z>0){var B=(A.State.TypedValue.Lookup!=null)?A.State.TypedValue.Lookup.Item:0;p.getStatesForWorkflow(z,B,function(C){if(C&&C.length>0){var E=new f.StringBuilder("");var G=false;$("#taskpaneStates .taskpaneButton").remove();$("#taskpaneStates").hide();for(var D in C){if((!C[D])||(C[D].ID==B)||(!C[D].Selectable)){continue}var F="{action:'changeState',params:["+C[D].ID+"]}";E.append('<div class="taskpaneButton hidden '+F+' ">');i(C[D].ID);E.append('<div id="states_'+C[D].ID+'" class="taskpaneItemIcon 8bit" style="display:none;background-image: url(REST/objects/'+a.MFBuiltInValueList.States+"/"+C[D].ID+'/valueListIcon.aspx)"></div>');E.append('<div class="taskpaneItemText">');E.append(C[D].Name);E.append("</div></div>");if(!G){G=true}}if(G){$("#taskpaneStates").append(E.toString());$("#taskpaneStates").show();e($("#taskpaneStates"))}}})}})};return{create:function(y){y.find(".taskpaneArea").each(function(){e($(this))})},clear:function(){$("#taskpaneViewAndModify").hide();$("#taskpaneStates").hide();$("#taskpaneBrowse").hide();$("#taskpaneThumbnailArea").hide()}}});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(){var v=$("#searchIn").msDropDown().data("dd");v.set("selectedIndex",0);$(".ddChild").hide();$("#searchObjectType").val("-1");$('#searchIn option[value="SearchInBoth"]').attr("selected","selected");$("#searchWithinThisFolder").removeAttr("checked");$("#searchString").attr("value","");$("#searchAllWordsButton").click();$('#searchObjectType option[value="All"]').attr("selected","selected");for(var 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')");var u=$("#searchAdvanced").offset().top+$("#searchAdvanced").height()+$(".listing-headers").height();u=u+6;$("#refreshListing").css("top",u)}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')");var u=$("#searchBasic").offset().top+$("#searchBasic").height()+$(".listing-headers").height();u=u+6;$("#refreshListing").css("top",u)}},PerformSearch:function(){var E={};var z=false;var w=$("#searchString").val();$("#searchIn option").each(function(){if($(this).text()==$("#searchString").val()){z=true}});if($("#searchString").val()!=""&&$("#searchIn")[0].length<=3){$("#searchIn").prepend("<option value='clearHistory' class=disableOption>"+a.Filters.ClearHistory+"</option>");$("#searchIn").prepend("<option disabled class=disableOption> -- </option>");$("#searchIn").prepend("<option>"+$("#searchString").val()+"</option>")}else{if($("#searchString").val()!=""&&(!z)){$("#searchIn").prepend("<option>"+$("#searchString").val()+"</option>")}}$("#searchIn").msDropDown();$(".ddChild").hide();$("#searchString").val(w);if($("#searchObjectType").val()=="-1"){E={SearchIn:$("#searchIn").val(),SearchString:$("#searchString").val(),SearchWithinThisFolder:$("#searchWithinThisFolder").attr("checked"),CurrentFolder:null,SearchType:null,SearchObjectType:"All",PropertyCriteria:new Array()}}else{E={SearchIn:$("#searchIn").val(),SearchString:$("#searchString").val(),SearchWithinThisFolder:$("#searchWithinThisFolder").attr("checked"),CurrentFolder:null,SearchType:null,SearchObjectType:$("#searchObjectType").val(),PropertyCriteria:new Array()}}var G=true;if($("#searchAdvanced").css("display")=="none"){G=false}if(G){E.SearchType=$('[name="searchTypeGroup"]:checked').val();for(var y=1;y<=2;y++){var D=$("#searchPropertyCriterion"+y+" .searchExpression").val();var v=$("#searchPropertyCriterion"+y+" .searchConditionType").val();if(v=="isEmpty"||v=="isNotEmpty"){var C={Property:D,Condition:v,TypedValue:"$0",DataFunction:null,DataType:null};E.PropertyCriteria.push(C)}else{if($("#searchPropertyCriterion"+y+" .hasDatepicker").length==1){var H=$("#searchPropertyCriterion"+y+" .hasDatepicker").datepicker("getDate");var u="d";var B="d";switch(v){case"today":H=new Date();break;case"withinTheLastWeek":case"withinTheLastMonth":case"withinTheLastYear":var F=365;if(v=="withinTheLastMonth"){F=30}else{if(v=="withinTheLastWeek"){F=7}}var I={Property:D,Condition:"lessOrEqualThan",TypedValue:q.getUTCTime(new Date()).getTime(),DataFunction:"d",DataType:"d"};E.PropertyCriteria.push(I);u="m";v="lessOrEqualThan";H=F;B="i";break;case"isAfter":case"isBefore":case"is":default:break}var C={Property:D,Condition:v,TypedValue:null,DataFunction:u,DataType:B};if(u=="m"){C.TypedValue=H}else{C.TypedValue=q.getUTCTime(H).getTime()}E.PropertyCriteria.push(C)}else{var C={Property:D,Condition:v,TypedValue:$("#searchPropertyCriterion"+y+" .searchTypedValue").val(),DataFunction:null,DataType:null};E.PropertyCriteria.push(C)}}}}var x;if(E.SearchWithinThisFolder==false||!d.view.get()||!d.view.get().searchCriteria){x={path:"",array:[]}}else{x=d.view.get().searchCriteria}if(E.SearchWithinThisFolder){var A=d.view.get();if(typeof A.viewPath!="undefined"){x.path=A.viewPath}else{if(A.searchCriteria){x.path=A.searchCriteria.path}else{c.fail("Cannot search within this view")}}}x.array.push(E);d.view.set({searchCriteria:x})},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)}})}}}},SetSearchControlsWithSavedSettings:function(){t.getSearchState(function(u){$("#searchIn").val(u.SearchIn);$("#searchIn").msDropDown();$(".ddChild").hide();$("#searchObjectType").val(u.SearchObjectType);$("#search"+u.LookWord+"Button").attr("checked",true)})},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(n){var t=MFNamespace("MFWA.Data.Cache");var r=MFNamespace("MFWA.Utils");var k=MFNamespace("MFWA.I18n");var s=MFNamespace("MFWA.Enumerations.MFBuiltInPropertyDef");var b=MFNamespace("MFWA.Enumerations");var d=MFNamespace("MFWA.PropertiesPane.Column");var q=MFNamespace("MFWA.StringBuilder");var m=MFNamespace("MFWA.ViewItem");var a=new Array();var f='<div class="propertiesPaneColumn"><table></table></div>';var c=[];function j(v,w){for(var u=0;u<v.length;u++){if(v[u].PropertyDef==w){return v[u]}}return null}function l(w,u){for(var v=0;v<w.length;v++){if(w[v].ID==u){return w[v]}}return null}function o(v){if(v[0].Rows.length>0){var w=$("#propertiesPane").height()-$("#propertiesPaneInfo").height()-parseInt($("#propertiesPaneMargin").css("margin-top"));var u=v[0].Rows[v[0].Rows.length-1].Height;while(v[0].pushRight(u,v[0].Height,w)!=false){u=v[0].Rows[v[0].Rows.length-1].Height}}}function p(w){a=new Array();var u=$("#propertiesPaneProperties").width();var y=$("#propertiesPaneTitle").outerWidth(true);var x=Math.floor(u/y);a.push(d.createColumn(w));for(var v=1;v<x;v++){a.push(d.createColumn());a[v-1].Right=a[v];a[v].Left=a[v-1]}return a}function h(x,y,u){var v=new q.StringBuilder();var w=false;t.getPropertyDef(u,function(B){if(x.Relationships&&x.Relationships.length>0){for(var A in x.Relationships){if(x.Relationships[A].ObjVer.Type==B.ValueList&&x.Relationships[A].ObjVer.ID==y.Item){w=true;break}}}var z=r.escape(y.DisplayValue);if(!z){z=""}v.append("<div>");v.append("<div style='float:left'>");if(y.Hidden==false){e(B.ValueList,y.Item);v.append("<img id='imgValueList_"+B.ValueList+"_"+y.Item+"' style='display:none;margin-right:2px;margin-top:-2px;float:left' src='");v.append("REST/objects/"+B.ValueList+"/"+y.Item+"/valueListIcon.aspx");v.append("'</img>")}v.append("<div style='float:left'");if(w){v.append(" class='propertiesPaneButton'");v.append(' onclick=\'MFNamespace("MFWA.Actions").showRelatedObject(');v.append(B.ValueList);v.append(",");v.append(y.Item);v.append(")'>")}else{v.append(">")}v.append(z);v.append("</div>");v.append("</div>");v.append("</div>")});return v.toString()}function e(u,v){t.hasValueListIcon(u,v,function(w){if(w.Value==true){$("#imgValueList_"+u+"_"+v).show();c.push("imgValueList_"+u+"_"+v)}})}function g(y,u,z,x,w,v){t.getUserID(function(ab){var ac=ab.Value;var I='<tr><td class="propertiesPaneNameOrTitle">'+r.escape(y.Title)+"</td></tr>";var G=j(u,s.Class).TypedValue.DisplayValue;I+='<tr><td><div style="float:left"><img style="float:left" src="'+m.getObjectIcon(y)+'"></img><div style="float:left;padding-left:3px;padding-top:2px">'+r.escape(G);I+=" "+r.format(k.PropertiesPane.IDAndVersion,y.DisplayID,y.ObjVer.Version)+"</div></div></td></tr>";var Q=r.escape(j(u,s.Created).TypedValue.DisplayValue);Q+=k.Comma;Q+=r.escape(j(u,s.CreatedBy).TypedValue.DisplayValue);var E='<tr><td class="dataname">'+r.escape(l(z,s.Created).Name)+k.Colon+"</td>";E+="<td>"+Q+"</td></tr>";var N=r.escape(j(u,s.LastModified).TypedValue.DisplayValue);N+=k.Comma;N+=r.escape(j(u,s.LastModifiedBy).TypedValue.DisplayValue);E+='<tr><td class="dataname">'+k.PropertiesPane.LastModified+"</td>";E+="<td>"+N+"</td></tr>";if(y.ObjectCheckedOut){E+='<tr><td class="dataname">'+k.PropertiesPane.Status+"</td>";E+="<td>"+k.PropertiesPane.CheckedOut+k.Comma+r.escape(y.CheckedOutTo);E+=" ["+r.escape(y.CheckedOutFrom)+"]</td></tr>";E+='<tr><td class="dataname">&nbsp;</td>';E+="<td>"+y.CheckedOutAtDisplayValue;E+="</td></tr>"}if(y.Deleted){var aa=r.escape(j(u,s.Deleted).TypedValue.DisplayValue);aa+=k.Comma;aa+=r.escape(j(u,s.DeletedBy).TypedValue.DisplayValue);E+='<tr><td class="dataname">'+r.escape(l(z,s.Deleted).Name)+k.Colon+"</td>";E+="<td>"+aa+"</td></tr>"}$("#propertiesPaneTitle").empty();$("#propertiesPaneTitle").append("<table>"+I+"</table>");$("#propertiesPaneTimestamps").empty();$("#propertiesPaneTimestamps").append("<table>"+E+"</table>");$("#propertiesPaneProperties").empty();$("#propertiesPaneProperties").append(f);var C=0;if(v&&v.NamePropertyDefID){C=v.NamePropertyDefID}for(var Y=0;Y<u.length;Y++){if(u[Y].PropertyDef!=C&&MFWA.Dialogs.DocumentCard.Filters.showInPropertiesPane(u[Y].PropertyDef)){var O='<tr><td class="dataname">'+r.escape(l(z,u[Y].PropertyDef).Name)+":</td>";var L="";if(u[Y].TypedValue.DataType==MFWA.Enumerations.MFDataType.MultiSelectLookup){if(u[Y].TypedValue.Lookups){for(var X=0;X<u[Y].TypedValue.Lookups.length;X++){if(u[Y].TypedValue.Lookups[X].Item==ac&&(u[Y].PropertyDef==s.AssignedTo||u[Y].PropertyDef==s.CompletedBy)){L+='<div style="font-weight: bold;">';var F=r.escape(u[Y].TypedValue.Lookups[X].DisplayValue);if(!F){F=""}L+=F;L+="</div>"}else{L+=h(y,u[Y].TypedValue.Lookups[X],u[Y].PropertyDef)}}}}else{if(u[Y].TypedValue.DataType==MFWA.Enumerations.MFDataType.Lookup){if(u[Y].TypedValue.Lookup){L+=h(y,u[Y].TypedValue.Lookup,u[Y].PropertyDef)}}else{if(u[Y].TypedValue.DataType==b.MFDataType.Text&&u[Y].ContentType==2){var T=r.escape(u[Y].TypedValue.DisplayValue);if(T){L='<a href="'+T+'" target="_blank">'+T+"</a>"}}else{if(u[Y].TypedValue.DataType==b.MFDataType.Text&&u[Y].ContentType==1){var D=r.escape(u[Y].TypedValue.DisplayValue);if(D){L='<a href="mailto:'+D+'"">'+D+"</a>"}}else{var F=r.escape(u[Y].TypedValue.DisplayValue);if(F){L=F.replace(/\r/g,"");L=L.replace(/\n/g,"<br>")}}}}}O+="<td>"+L+"</td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(O)}}if(x.length>0){var P='<tr><td class="dataname">'+r.escape(l(z,s.VersionComment).Name)+k.Colon+"</td><td>";P+=r.escape(x[0].LastModifiedBy.TypedValue.DisplayValue)+":<br>";var S=r.escape(x[0].Comment.TypedValue.DisplayValue);if(S){var W=S.replace(/\r/g,"");W=W.replace(/\n/g,"<br>");P+=W}if(x.length>1){P+="<br>";P+='<div class="morecomments" onclick=\'MFNamespace("MFWA.Actions").objectOperations("Comments")\'>';P+=k.PropertiesPane.MoreComments+"</div>"}P+="</td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(P)}var H=j(u,s.Workflow);if(H){var U='<tr><td class="dataname">'+k.PropertiesPane.WorkFlow+"</td><td";if(y.ThisVersionLatestToThisUser==true){U+=" class=\"propertiesPaneButton\" onclick=\"MFNamespace('MFWA.Actions').objectOperations('Workflow')\""}var Z=-1;var R="";Z=(H.TypedValue.Lookup!=null)?H.TypedValue.Lookup.Item:-1;if(Z>0){i("workflowImage_",b.MFBuiltInValueList.Workflows,Z);R=(H.TypedValue.Lookup!=null)?'<img id="workflowImage_'+Z+'" src="REST/objects/'+b.MFBuiltInValueList.Workflows+"/"+Z+'/valueListIcon.aspx" style="margin-right: 2px; margin-top: -2px; float: left;display:none;" ></img>':""}U+='><div style="float:left"><div style="float:left">'+R+H.TypedValue.DisplayValue+"</div></div></td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(U);var K='<tr><td class="dataname">'+k.PropertiesPane.State+"</td>";var B=j(u,s.State);var V="";R="";if(B.TypedValue.DisplayValue!=""){V=r.escape(B.TypedValue.DisplayValue);var M=-1;M=(B.TypedValue.Lookup!=null)?B.TypedValue.Lookup.Item:-1;if(M>0){i("stateImage_",b.MFBuiltInValueList.States,M);R=(B.TypedValue.Lookup!=null)?'<img id="stateImage_'+M+'" src="REST/objects/'+b.MFBuiltInValueList.States+"/"+M+'/valueListIcon.aspx" style="margin-right: 2px; margin-top: -2px; float: left;display:none;" ></img>':""}}else{V="-"}K+="<td";if(y.ThisVersionLatestToThisUser==true){K+=" class=\"propertiesPaneButton\" onclick=\"MFNamespace('MFWA.Actions').objectOperations('Workflow')\""}K+='><div style="float:left"><div style="float:left">'+R+V+"</div></div><td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(K)}if(y.HasAssignments){var ad='<tr><td class="dataname"></td>';ad+='<td id="propertiesPaneAssignments" onclick="MFWA.Actions.objectOperations(\'GetAssignmentsForObject\');">';ad+=r.escape(w)+"</td></tr>";$("#propertiesPaneProperties > div.propertiesPaneColumn > table").append(ad)}var A=p($("#propertiesPaneProperties > div.propertiesPaneColumn tr"));o(A);$("#propertiesPaneProperties").empty();for(var Y=0;Y<A.length;Y++){$("#propertiesPaneProperties").append('<div class="propertiesPaneColumn"></div>');var J="";for(var X=0;X<A[Y].Rows.length;X++){J+=A[Y].Rows[X].HTML}$("#propertiesPaneProperties > div.propertiesPaneColumn:eq("+Y+")").append("<table>"+J+"</table>")}})}function i(u,v,w){t.hasValueListIcon(v,w,function(x){if(x.Value==true){$("#"+u+w).show();c.push(u+w)}})}return{propPaneResized:function(){var E=a.length;if(E>0&&a[0].Rows.length>0){var u=$("#propertiesPane").height()-$("#propertiesPaneInfo").height()-parseInt($("#propertiesPaneMargin").css("margin-top"));var w=$("#propertiesPaneProperties").width();var v=$("#propertiesPaneTitle").outerWidth(true);var F=Math.floor(w/v);if(F==0){F=1}if(F<E){while(F<E){var y=a[E-2];var G=a[E-1];y.Rows.push.apply(y.Rows,G.Rows);y.Height+=G.Height;a.pop();y.Right=null;E=a.length}}else{if(F>E){while(F>E){var z=MFNamespace("MFWA.PropertiesPane.Column");a.push(z.createColumn());var C=a.length-1;a[C-1].Right=a[C];a[C].Left=a[C-1];E=a.length}}}for(var B=a.length;B>1;B--){var y=a[B-2];var G=a[B-1];y.Rows.push.apply(y.Rows,G.Rows);y.Height+=G.Height;G.Rows.splice(0,G.Rows.length);G.Height=0}o(a);$("#propertiesPaneProperties").empty();for(var B=0;B<a.length;B++){$("#propertiesPaneProperties").append('<div class="propertiesPaneColumn"></div>');var D="";for(var A=0;A<a[B].Rows.length;A++){D+=a[B].Rows[A].HTML}$("#propertiesPaneProperties .propertiesPaneColumn:eq("+B+")").append("<table>"+D+"</table>")}for(var x in c){$("#"+c[x]).show()}}},clear:function(){$("#propertiesPaneTitle").empty();$("#propertiesPaneTimestamps").empty();$("#propertiesPaneProperties").empty();a=new Array()},setProperties:function(u){var v=function(){n.clear()};t.getObjectVersionOrHandleError(u,function(w){t.getPropertiesForDisplay(u,function(x){t.getPropertyDefs(function(y){t.getVersionComments(u,function(z){t.getObjectType(10,function(A){var B=j(x,s.Class).TypedValue.Lookup.Item;t.getClass(B,function(C){MFWA.Data.Cache.getRelationship(w.ObjVer.Type,w.ObjVer.ID,w.ObjVer.Version,function(D){w.Relationships=D;g(w,x,y,z,A.NamePlural,C)})},function(){MFWA.Data.Cache.getRelationship(w.ObjVer.Type,w.ObjVer.ID,w.ObjVer.Version,function(C){w.Relationships=C;g(w,x,y,z,A.NamePlural)})})})})})})},v)}}});MFNamespace("MFWA.Structs",function(a){var b=MFNamespace("MFWA.Enumerations");return{createNewTypedValue:function(c,f,e){if(c==b.MFDataType.MultiSelectLookup&&e.constructor!==Array){e=[e]}var d=new Object();d.DataType=c;d.DisplayValue=f;if(c==b.MFDataType.MultiSelectLookup){d.Lookups=e}else{if(c==b.MFDataType.Lookup){d.Lookup=e}else{d.Value=e}}if(e!=null){d.HasValue=true}else{d.HasValue=false}return d},createNewLookup:function(f,d,c){var e=new Object();e.Deleted=false;e.DisplayValue=f;e.Hidden=false;e.Item=d;e.Version=c;return e},createNewPropertyValue:function(c,e){var d=new Object();d.PropertyDef=c;d.Value=e;d.TypedValue=e;return d}}});if(jQuery){(function(){$.extend($.fn,{contextMenu:function(a,b){if(a.menu==undefined){return false}if(a.inSpeed==undefined){a.inSpeed=150}if(a.outSpeed==undefined){a.outSpeed=75}if(a.inSpeed==0){a.inSpeed=-1}if(a.outSpeed==0){a.outSpeed=-1}$(this).each(function(){var c=$(this);var d=$(c).offset();$("#"+a.menu).addClass("contextMenu");$(this).mousedown(function(g){var f=g;f.stopPropagation();$(this).mouseup(function(o){o.stopPropagation();var t=$(this);$(this).unbind("mouseup");$.Menu.closeAll();if(f.button==2){$(".contextMenu").hide();var i=$("#"+a.menu);if($(c).hasClass("disabled")){return false}var q={},w,v;var k,r,m,p,l,j;m=$(".contextMenu").width();j=$(".contextMenu").height();r=o.pageX;l=o.pageY;if(self.innerHeight){isPosition=true;k=self.innerWidth;p=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){isPosition=true;k=document.documentElement.clientWidth;p=document.documentElement.clientHeight}else{if(document.body){isPosition=true;k=document.body.clientWidth;p=document.body.clientHeight}}}if(isPosition==true){var n=k-r;var z=p-l;w=(n<m)?(r-m):r;v=(z<j)?(l-j):l}$(i).css({top:v,left:w}).fadeIn(a.inSpeed);b(o.currentTarget.id);$(document).keypress(function(x){switch(x.keyCode){case 38:if($(i).find("LI.hover").size()==0){$(i).find("LI:last").addClass("hover")}else{$(i).find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover");if($(i).find("LI.hover").size()==0){$(i).find("LI:last").addClass("hover")}}break;case 40:if($(i).find("LI.hover").size()==0){$(i).find("LI:first").addClass("hover")}else{$(i).find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover");if($(i).find("LI.hover").size()==0){$(i).find("LI:first").addClass("hover")}}break;case 13:$(i).find("LI.hover A").trigger("click");break;case 27:$(document).trigger("click");break}});var s=$("#"+a.menu).find("LI");var u=s.length;for(var h=0;h<u;h++){$(s[h]).unbind("click");$(s[h]).click(function(){if($($(this).find("div")[2]).hasClass("dimmed")){return false}else{if(b){var e=this.id;if(e==""){$(".contextMenu").show();return false}else{$(".contextMenu").hide();var x=MFNamespace("MFWA.Actions");x.objectOperations(e,null)}}}})}setTimeout(function(){$(document).mouseup(function(e){if(e.button!=2){$(i).fadeOut(a.outSpeed)}return false})},0)}})});if($.browser.mozilla){$("#"+a.menu).each(function(){$(this).css({MozUserSelect:"none"})})}else{if($.browser.msie){$("#"+a.menu).each(function(){$(this).bind("selectstart.disableTextSelect",function(){return false})})}else{$("#"+a.menu).each(function(){$(this).bind("mousedown.disableTextSelect",function(){return false})})}}$(c).add($("UL.contextMenu")).bind("contextmenu",function(){return false})});return $(this)},disableContextMenuItems:function(a){if(a==undefined){$(this).find("LI").addClass("disabled");return($(this))}$(this).each(function(){if(a!=undefined){var c=a.split(",");for(var b=0;b<c.length;b++){$(this).find('A[href="'+c[b]+'"]').parent().addClass("disabled")}}});return($(this))},enableContextMenuItems:function(a){if(a==undefined){$(this).find("LI.disabled").removeClass("disabled");return($(this))}$(this).each(function(){if(a!=undefined){var c=a.split(",");for(var b=0;b<c.length;b++){$(this).find('A[href="'+c[b]+'"]').parent().removeClass("disabled")}}});return($(this))},disableContextMenu:function(){$(this).each(function(){$(this).addClass("disabled")});return($(this))},enableContextMenu:function(){$(this).each(function(){$(this).removeClass("disabled")});return($(this))},destroyContextMenu:function(){$(this).each(function(){$(this).unbind("mousedown").unbind("mouseup")});return($(this))}})})(jQuery)}(function($){var msOldDiv="";var dd=function(element,options){var confirmDialog=MFNamespace("MFWA.Dialogs.Confirm");var i18ns=MFNamespace("MFWA.I18n.Search");var sElement=element;var $this=this;var options=$.extend({height:120,visibleRows:7,rowHeight:23,showIcon:true,zIndex:9999,mainCSS:"dd",useSprite:false,onInit:"",style:"",replaceDropDown:false,currentItem:""},options);this.ddProp=new Object();var selectedValue="";var actionSettings={};actionSettings.insideWindow=true;actionSettings.keyboardAction=false;actionSettings.currentKey=null;var ddList=false;var config={postElementHolder:"_msddHolder",postID:"_msdd",postTitleID:"_title",postTitleTextID:"_titletext",postChildID:"_child",postAID:"_msa",postOPTAID:"_msopta",postInputID:"_msinput",postArrowID:"_arrow",postInputhidden:"_inp"};var styles={dd:options.mainCSS,ddTitle:"ddTitle",arrow:"arrow",ddChild:"ddChild",ddTitleText:"ddTitleText",disabled:0.3,ddOutOfVision:"ddOutOfVision"};var attributes={actions:"focus,blur,change,click,dblclick,mousedown,mouseup,mouseover,mousemove,mouseout,keypress,keydown,keyup",prop:"size,multiple,disabled,tabindex"};this.onActions=new Object();var elementid=$(sElement).attr("id");var inlineCSS=$(sElement).attr("style");options.style+=(inlineCSS==undefined)?"":inlineCSS;var allOptions=$(sElement).children();ddList=($(sElement).attr("size")>0||$(sElement).attr("multiple")==true)?true:false;if(ddList){options.visibleRows=$(sElement).attr("size")}if(options.replaceDropDown==false){$(".ddTitle").css("color","#ffffff")}var a_array={};var inputControl="";var currentImage="";var getPostID=function(id){return elementid+config[id]};var getOptionsProperties=function(option){var currentOption=option;var styles=$(currentOption).attr("style");return styles};var matchIndex=function(index){var selectedIndex=$("#"+elementid+" option:selected");if(selectedIndex.length>1){for(var i=0;i<selectedIndex.length;i++){if(index==selectedIndex[i].index){return true}}}else{if(selectedIndex.length==1){if(selectedIndex[0].index==index){return true}}}return false};var createA=function(currentOptOption,current,currentopt,tp){var aTag="";var aidoptfix=(tp=="opt")?getPostID("postOPTAID"):getPostID("postAID");var aid=(tp=="opt")?aidoptfix+"_"+(current)+"_"+(currentopt):aidoptfix+"_"+(current);var arrow="";var clsName="";if(options.useSprite!=false){clsName=" "+options.useSprite+" "+currentOptOption.className}else{var indentation="";if(options.replaceDropDown==true){indentation=$(currentOptOption).attr("indentation");if(!indentation){indentation=""}}arrow=$(currentOptOption).attr("title");arrow=(arrow.length==0)?"":indentation+'<img id="dropDownImg" src="'+arrow+'" align="absmiddle" /> '}var sText=$(currentOptOption).text();var sValue=$(currentOptOption).val();var sEnabledClass=($(currentOptOption).attr("disabled")==true)?"disabled":"enabled";a_array[aid]={html:arrow,value:sValue,text:sText,index:currentOptOption.index,id:aid};var innerStyle=getOptionsProperties(currentOptOption);if(matchIndex(currentOptOption.index)==true){aTag+='<a style="height:15px;" href="javascript:void(0);" class="selected '+sEnabledClass+clsName+'"'}else{aTag+='<a style="height:15px;" href="javascript:void(0);" class="'+sEnabledClass+clsName+'"'}if(innerStyle!==false&&innerStyle!==undefined){aTag+=" style='"+innerStyle+"'"}aTag+=' id="'+aid+'">';aTag+=arrow+'<span class="'+styles.ddTitleText+'">'+sText+"</span></a>";return aTag};var createATags=function(){var childnodes=allOptions;if(childnodes.length==0){return""}var aTag="";var aidfix=getPostID("postAID");var aidoptfix=getPostID("postOPTAID");childnodes.each(function(current){var currentOption=childnodes[current];if(currentOption.nodeName=="OPTGROUP"){aTag+="<div class='opta'>";aTag+="<span style='font-weight:bold;font-style:italic; clear:both;'>"+$(currentOption).attr("label")+"</span>";var optChild=$(currentOption).children();optChild.each(function(currentopt){var currentOptOption=optChild[currentopt];aTag+=createA(currentOptOption,current,currentopt,"opt")});aTag+="</div>"}else{aTag+=createA(currentOption,current,"","")}});return aTag};var createChildDiv=function(){var id=getPostID("postID");var childid=getPostID("postChildID");var sStyle=options.style;sDiv="";sDiv+='<div id="'+childid+'" class="'+styles.ddChild+'"';if(!ddList){sDiv+=(sStyle!="")?' style="'+sStyle+'"':""}else{sDiv+=(sStyle!="")?' style="border-top:1px solid #c3c3c3;display:block;position:relative;'+sStyle+'"':""}sDiv+=">";return sDiv};var createTitleDiv=function(){var titleid=getPostID("postTitleID");var arrowid=getPostID("postArrowID");var titletextid=getPostID("postTitleTextID");var inputhidden=getPostID("postInputhidden");var sText="";var arrow="";if(document.getElementById(elementid).options.length>0){sText=$("#"+elementid+" option:selected").text();arrow=$("#"+elementid+" option:selected").attr("title")}arrow=(arrow.length==0||arrow==undefined||options.showIcon==false||options.useSprite!=false)?"":'<img id="dropDownImg" src="'+arrow+'" align="absmiddle" /> ';var sDiv='<div id="'+titleid+'" class="'+styles.ddTitle+'"';sDiv+=">";inputControl='<input id="searchString" style="width: 280px; border:0px;" type="text"  />';if(options.replaceDropDown==true){inputControl=""}sDiv+='<span id="'+arrowid+'" class="'+styles.arrow+'"></span><span class="'+styles.ddTitleText+'" id="'+titletextid+'">'+arrow+inputControl+"</span></span></div>";return sDiv};var applyEventsOnA=function(){var childid=getPostID("postChildID");$("#"+childid+" a.enabled").bind("click",function(event){event.preventDefault();var selectedA=$(this).attr("id");var sValue="";if(selectedA!=undefined){sValue=a_array[selectedA].value}if(options.replaceDropDown){manageSelection(this);setInsideWindow(false);var sText=(options.showIcon==false)?$(this).text():$(this).html();sText=sText.replace(/^\s+/,"");setTitleText(sText);setValue();$this.close()}else{if(sValue=="clearHistory"){var opts=new Object();opts.message=i18ns.Filters.AlertMsg;opts.title=i18ns.Filters.AlertTile;confirmDialog.prompt(opts,function(confirmationResult){if(confirmationResult){$("#searchIn option").each(function(){if($(this).val()=="SearchInBoth"){$("#searchString").val("");$("#searchIn").msDropDown();$(".ddChild").hide();return false}$(this).remove()})}})}else{if((sValue=="SearchInBoth")||(sValue=="SearchInMetadata")||(sValue=="SearchInFileContents")){manageSelection(this);if(!ddList){$("#"+childid).unbind("mouseover");setInsideWindow(false);if(sValue=="SearchInBoth"){$("#dropDownImg").attr("src","Images/metacard.png")}else{if(sValue=="SearchInMetadata"){$("#dropDownImg").attr("src","Images/metaalone.png")}else{$("#dropDownImg").attr("src","Images/filealone.png")}}$this.close()}setValue()}else{$("#searchString").val(sValue);$(".ddChild").hide();return}}}})};var createDropDown=function(){var changeInsertionPoint=false;var id=getPostID("postID");var titleid=getPostID("postTitleID");var titletextid=getPostID("postTitleTextID");var childid=getPostID("postChildID");var arrowid=getPostID("postArrowID");var iWidth=$("#"+elementid).width();iWidth=iWidth+2;var sStyle=options.style;if($("#"+id).length>0){$("#"+id).remove();changeInsertionPoint=true}var sDiv='<div id="'+id+'" class="'+styles.dd+'"';sDiv+=(sStyle!="")?' style="'+sStyle+'"':"";sDiv+=">";sDiv+=createTitleDiv();sDiv+="<div style='position:relative'>"+createChildDiv();sDiv+=createATags();sDiv+="</div></div>";sDiv+="</div>";if(changeInsertionPoint==true){var sid=getPostID("postElementHolder");$("#"+sid).after(sDiv)}else{$("#"+elementid).after(sDiv)}if(ddList){var titleid=getPostID("postTitleID");$("#"+titleid).hide()}if(iWidth<10){iWidth=348}$("#"+id).css("width",iWidth+"px");$("#"+childid).css("width",(iWidth-2)+"px");if(options.replaceDropDown==true&&options.currentItem.length>0){setTitleText(options.currentItem)}if(allOptions.length>options.visibleRows){var margin=parseInt($("#"+childid+" a:first").css("padding-bottom"))+parseInt($("#"+childid+" a:first").css("padding-top"));var iHeight=((options.rowHeight)*options.visibleRows)-margin;$("#"+childid).css("height",iHeight+"px")}else{if(ddList){var iHeight=$("#"+elementid).height();$("#"+childid).css("height",iHeight+"px")}}if(changeInsertionPoint==false){setOutOfVision();addRefreshMethods(elementid)}if($("#"+elementid).attr("disabled")==true){$("#"+id).css("opacity",styles.disabled)}applyEvents();$("#"+titleid).bind("mouseover",function(event){hightlightArrow(1)});$("#"+titleid).bind("mouseout",function(event){hightlightArrow(0)});applyEventsOnA();$("#"+childid+" a.disabled").css("opacity",styles.disabled);if(ddList){$("#"+childid).bind("mouseover",function(event){if(!actionSettings.keyboardAction){actionSettings.keyboardAction=true;$(document).bind("keydown",function(event){var keyCode=event.keyCode;actionSettings.currentKey=keyCode;if(keyCode==39||keyCode==40){event.preventDefault();event.stopPropagation();next();setValue()}if(keyCode==37||keyCode==38){event.preventDefault();event.stopPropagation();previous();setValue()}})}})}$("#"+childid).bind("mouseout",function(event){setInsideWindow(false);$(document).unbind("keydown");actionSettings.keyboardAction=false;actionSettings.currentKey=null});$("#"+titleid).bind("click",function(event){setInsideWindow(false);if($("#"+childid+":visible").length==1){$("#"+childid).unbind("mouseover")}else{$("#"+childid).bind("mouseover",function(event){setInsideWindow(true)});$this.open()}});$("#"+titleid).bind("mouseout",function(evt){setInsideWindow(false)});if(options.showIcon&&options.useSprite!=false){setTitleImageSprite()}};var getByIndex=function(index){for(var i in a_array){if(a_array[i].index==index){return a_array[i]}}return -1};var manageSelection=function(obj){var childid=getPostID("postChildID");if(!ddList){$("#"+childid+" a.selected").removeClass("selected")}var selectedA=$("#"+childid+" a.selected").attr("id");if(selectedA!=undefined){var oldIndex=(actionSettings.oldIndex==undefined||actionSettings.oldIndex==null)?a_array[selectedA].index:actionSettings.oldIndex}if(obj&&!ddList){$(obj).addClass("selected")}if(ddList){var keyCode=actionSettings.currentKey;if($("#"+elementid).attr("multiple")==true){if(keyCode==17){actionSettings.oldIndex=a_array[$(obj).attr("id")].index;$(obj).toggleClass("selected")}else{if(keyCode==16){$("#"+childid+" a.selected").removeClass("selected");$(obj).addClass("selected");var currentSelected=$(obj).attr("id");var currentIndex=a_array[currentSelected].index;for(var i=Math.min(oldIndex,currentIndex);i<=Math.max(oldIndex,currentIndex);i++){$("#"+getByIndex(i).id).addClass("selected")}}else{$("#"+childid+" a.selected").removeClass("selected");$(obj).addClass("selected");actionSettings.oldIndex=a_array[$(obj).attr("id")].index}}}else{$("#"+childid+" a.selected").removeClass("selected");$(obj).addClass("selected");actionSettings.oldIndex=a_array[$(obj).attr("id")].index}}};var addRefreshMethods=function(id){var objid=id;document.getElementById(objid).refresh=function(e){$("#"+objid).msDropDown(options)}};var setInsideWindow=function(val){actionSettings.insideWindow=val};var getInsideWindow=function(){return actionSettings.insideWindow};var applyEvents=function(){var mainid=getPostID("postID");var actions_array=attributes.actions.split(",");for(var iCount=0;iCount<actions_array.length;iCount++){var action=actions_array[iCount];var actionFound=has_handler(action);if(actionFound==true){switch(action){case"focus":$("#"+mainid).bind("mouseenter",function(event){document.getElementById(elementid).focus()});break;case"click":$("#"+mainid).bind("click",function(event){$("#"+elementid).trigger("click")});break;case"dblclick":$("#"+mainid).bind("dblclick",function(event){$("#"+elementid).trigger("dblclick")});break;case"mousedown":$("#"+mainid).bind("mousedown",function(event){$("#"+elementid).trigger("mousedown")});break;case"mouseup":$("#"+mainid).bind("mouseup",function(event){$("#"+elementid).trigger("mouseup")});break;case"mouseover":$("#"+mainid).bind("mouseover",function(event){$("#"+elementid).trigger("mouseover")});break;case"mousemove":$("#"+mainid).bind("mousemove",function(event){$("#"+elementid).trigger("mousemove")});break;case"mouseout":$("#"+mainid).bind("mouseout",function(event){$("#"+elementid).trigger("mouseout")});break}}}};var setOutOfVision=function(){var sId=getPostID("postElementHolder");$("#"+elementid).after("<div class='"+styles.ddOutOfVision+"' style='height:0px;overflow:hidden;position:absolute;' id='"+sId+"'></div>");$("#"+elementid).appendTo($("#"+sId))};var setTitleText=function(sText){if(sText!=""){currentImage=sText}if(currentImage==""){currentImage='<img id="dropDownImg" src="'+$("#dropDownImg").attr("src")+'" align="absmiddle" />'}sText=currentImage;var textIntext="";var titletextid=getPostID("postTitleTextID");if(!options.replaceDropDown){textIntext=$("#searchString").val()}$("#"+titletextid).html(sText+inputControl);if(!options.replaceDropDown){$("#searchString").val(textIntext)}};var next=function(){var titletextid=getPostID("postTitleTextID");var childid=getPostID("postChildID");var allAs=$("#"+childid+" a.enabled");for(var current=0;current<allAs.length;current++){var currentA=allAs[current];var id=$(currentA).attr("id");if($(currentA).hasClass("selected")&&current<allAs.length-1){$("#"+childid+" a.selected").removeClass("selected");$(allAs[current+1]).addClass("selected");var selectedA=$("#"+childid+" a.selected").attr("id");if(!ddList){var sText=(options.showIcon==false)?a_array[selectedA].text:a_array[selectedA].html;setTitleText(sText)}if(parseInt(($("#"+selectedA).position().top+$("#"+selectedA).height()))>=parseInt($("#"+childid).height())){$("#"+childid).scrollTop(($("#"+childid).scrollTop())+$("#"+selectedA).height()+$("#"+selectedA).height())}break}}};var previous=function(){var titletextid=getPostID("postTitleTextID");var childid=getPostID("postChildID");var allAs=$("#"+childid+" a.enabled");for(var current=0;current<allAs.length;current++){var currentA=allAs[current];var id=$(currentA).attr("id");if($(currentA).hasClass("selected")&&current!=0){$("#"+childid+" a.selected").removeClass("selected");$(allAs[current-1]).addClass("selected");var selectedA=$("#"+childid+" a.selected").attr("id");if(!ddList){var sText=(options.showIcon==false)?a_array[selectedA].text:a_array[selectedA].html;setTitleText(sText)}if(parseInt(($("#"+selectedA).position().top+$("#"+selectedA).height()))<=0){$("#"+childid).scrollTop(($("#"+childid).scrollTop()-$("#"+childid).height())-$("#"+selectedA).height())}break}}};var setTitleImageSprite=function(){if(options.useSprite!=false){var titletextid=getPostID("postTitleTextID");var sClassName=document.getElementById(elementid).options[document.getElementById(elementid).selectedIndex].className;if(sClassName.length>0){var childid=getPostID("postChildID");var id=$("#"+childid+" a."+sClassName).attr("id");var backgroundImg=$("#"+id).css("background-image");var backgroundPosition=$("#"+id).css("background-position");var paddingLeft=$("#"+id).css("padding-left");if(backgroundImg!=undefined){$("#"+titletextid).find("."+styles.ddTitleText).attr("style","background:"+backgroundImg)}if(backgroundPosition!=undefined){$("#"+titletextid).find("."+styles.ddTitleText).css("background-position",backgroundPosition)}if(paddingLeft!=undefined){$("#"+titletextid).find("."+styles.ddTitleText).css("padding-left",paddingLeft)}$("#"+titletextid).find("."+styles.ddTitleText).css("background-repeat","no-repeat");$("#"+titletextid).find("."+styles.ddTitleText).css("padding-bottom","2px")}}};var setValue=function(){var childid=getPostID("postChildID");var allSelected=$("#"+childid+" a.selected");if(allSelected.length==1){var sText=$("#"+childid+" a.selected").text();var selectedA=$("#"+childid+" a.selected").attr("id");if(selectedA!=undefined){var sValue=a_array[selectedA].value;if(sValue=="clearHistory"){return}document.getElementById(elementid).selectedIndex=a_array[selectedA].index}if(options.showIcon&&options.useSprite!=false){setTitleImageSprite()}}else{if(allSelected.length>1){var alls=$("#"+elementid+" > option:selected").removeAttr("selected");for(var i=0;i<allSelected.length;i++){var selectedA=$(allSelected[i]).attr("id");var index=a_array[selectedA].index;document.getElementById(elementid).options[index].selected="selected"}}}var sIndex=document.getElementById(elementid).selectedIndex;$this.ddProp.selectedIndex=sIndex};var has_handler=function(name){if($("#"+elementid).attr("on"+name)!=undefined){return true}var evs=$("#"+elementid).data("events");if(evs&&evs[name]){return true}return false};var checkMethodAndApply=function(){var childid=getPostID("postChildID");if(has_handler("change")==true){var currentSelectedValue=a_array[$("#"+childid+" a.selected").attr("id")].text;if(selectedValue!=currentSelectedValue){$("#"+elementid).trigger("change")}}if(has_handler("mouseup")==true){$("#"+elementid).trigger("mouseup")}if(has_handler("blur")==true){$(document).bind("mouseup",function(evt){$("#"+elementid).focus();$("#"+elementid)[0].blur();setValue();$(document).unbind("mouseup")})}};var hightlightArrow=function(ison){var arrowid=getPostID("postArrowID");if(ison==1){$("#"+arrowid).css({backgroundPosition:"0 100%"})}else{$("#"+arrowid).css({backgroundPosition:"0 0"})}};var setOriginalProperties=function(){for(var i in document.getElementById(elementid)){if(typeof(document.getElementById(elementid)[i])!="function"&&document.getElementById(elementid)[i]!==undefined&&document.getElementById(elementid)[i]!==null){$this.set(i,document.getElementById(elementid)[i],true)}}};var setValueByIndex=function(prop,val){if(getByIndex(val)!=-1){document.getElementById(elementid)[prop]=val;var childid=getPostID("postChildID");$("#"+childid+" a.selected").removeClass("selected");$("#"+getByIndex(val).id).addClass("selected");var sText=getByIndex(document.getElementById(elementid).selectedIndex).html;if(options.replaceDropDown==true){setTitleText(sText)}else{if(val==0){$("#dropDownImg").attr("src","Images/metacard.png")}else{if(val==1){$("#dropDownImg").attr("src","Images/metaalone.png")}else{if(val==2){$("#dropDownImg").attr("src","Images/filealone.png")}}}}}};var addRemoveFromIndex=function(i,action){if(action=="d"){for(var key in a_array){if(a_array[key].index==i){delete a_array[key];break}}}var count=0;for(var key in a_array){a_array[key].index=count;count++}};this.open=function(){if(($this.get("disabled",true)==true)||($this.get("options",true).length==0)){return}var childid=getPostID("postChildID");if(msOldDiv!=""&&childid!=msOldDiv){$("#"+msOldDiv).slideUp("fast");$("#"+msOldDiv).css({zIndex:"0"})}if($("#"+childid).css("display")=="none"){$(document).bind("keydown",function(event){var keyCode=event.keyCode;if(keyCode==39||keyCode==40){event.preventDefault();event.stopPropagation();next()}if(keyCode==37||keyCode==38){event.preventDefault();event.stopPropagation();previous()}if(keyCode==27||keyCode==13){$this.close();if(keyCode==13){var selectedA=$("#"+childid+" a.enabled").attr("id");var sValue="";if(selectedA!=undefined){sValue=a_array[selectedA].value}if((sValue=="SearchInBoth")||(sValue=="SearchInMetadata")||(sValue=="SearchInFileContents")){setValue()}}}if($("#"+elementid).attr("onkeydown")!=undefined){document.getElementById(elementid).onkeydown()}});$(document).bind("keyup",function(event){if($("#"+elementid).attr("onkeyup")!=undefined){document.getElementById(elementid).onkeyup()}});$(document).bind("mouseup",function(evt){if(getInsideWindow()==false){$this.close()}});$("#"+childid).css({zIndex:options.zIndex});$("#"+childid).slideDown("fast",function(){if($this.onActions.onOpen!=null){eval($this.onActions.onOpen)($this)}});if(childid!=msOldDiv){msOldDiv=childid}}};this.close=function(){var childid=getPostID("postChildID");$(document).unbind("keydown");$(document).unbind("keyup");$(document).unbind("mouseup");$("#"+childid).slideUp("fast",function(event){checkMethodAndApply();$("#"+childid).css({zIndex:"0"});if($this.onActions.onClose!=null){eval($this.onActions.onClose)($this)}})};this.selectedIndex=function(i){$this.set("selectedIndex",i)};this.set=function(prop,val,isLocal){if(prop==undefined||val==undefined){throw {message:"set to what?"}}$this.ddProp[prop]=val;if(isLocal!=true){switch(prop){case"selectedIndex":setValueByIndex(prop,val);break;case"disabled":$this.disabled(val,true);break;case"multiple":document.getElementById(elementid)[prop]=val;ddList=($(sElement).attr("size")>0||$(sElement).attr("multiple")==true)?true:false;if(ddList){var iHeight=$("#"+elementid).height();var childid=getPostID("postChildID");$("#"+childid).css("height",iHeight+"px");var titleid=getPostID("postTitleID");$("#"+titleid).hide();var childid=getPostID("postChildID");$("#"+childid).css({display:"block",position:"relative"});applyEventsOnA()}break;case"size":document.getElementById(elementid)[prop]=val;if(val==0){document.getElementById(elementid).multiple=false}ddList=($(sElement).attr("size")>0||$(sElement).attr("multiple")==true)?true:false;if(val==0){var titleid=getPostID("postTitleID");$("#"+titleid).show();var childid=getPostID("postChildID");$("#"+childid).css({display:"none",position:"absolute"});var sText="";if(document.getElementById(elementid).selectedIndex>=0){var aObj=getByIndex(document.getElementById(elementid).selectedIndex);sText=aObj.html;manageSelection($("#"+aObj.id))}setTitleText(sText)}else{var titleid=getPostID("postTitleID");$("#"+titleid).hide();var childid=getPostID("postChildID");$("#"+childid).css({display:"block",position:"relative"})}break;default:try{document.getElementById(elementid)[prop]=val}catch(e){}break}}};this.get=function(prop,forceRefresh){if(prop==undefined&&forceRefresh==undefined){return $this.ddProp}if(prop!=undefined&&forceRefresh==undefined){return($this.ddProp[prop]!=undefined)?$this.ddProp[prop]:null}if(prop!=undefined&&forceRefresh!=undefined){return document.getElementById(elementid)[prop]}};this.visible=function(val){var id=getPostID("postID");if(val==true){$("#"+id).show()}else{if(val==false){$("#"+id).hide()}else{return $("#"+id).css("display")}}};this.add=function(opt,index){var objOpt=opt;var sText=objOpt.text;var sValue=(objOpt.value==undefined||objOpt.value==null)?sText:objOpt.value;var img=(objOpt.title==undefined||objOpt.title==null)?"":objOpt.title;var i=(index==undefined||index==null)?document.getElementById(elementid).options.length:index;document.getElementById(elementid).options[i]=new Option(sText,sValue);if(img!=""){document.getElementById(elementid).options[i].title=img}var ifA=getByIndex(i);if(ifA!=-1){var aTag=createA(document.getElementById(elementid).options[i],i,"","");$("#"+ifA.id).html(aTag)}else{var aTag=createA(document.getElementById(elementid).options[i],i,"","");var childid=getPostID("postChildID");$("#"+childid).append(aTag);applyEventsOnA()}};this.remove=function(i){document.getElementById(elementid).remove(i);if((getByIndex(i))!=-1){$("#"+getByIndex(i).id).remove();addRemoveFromIndex(i,"d")}if(document.getElementById(elementid).length==0){setTitleText("")}else{var sText=getByIndex(document.getElementById(elementid).selectedIndex).html;setTitleText(sText)}$this.set("selectedIndex",document.getElementById(elementid).selectedIndex)};this.disabled=function(dis,isLocal){document.getElementById(elementid).disabled=dis;var id=getPostID("postID");if(dis==true){$("#"+id).css("opacity",styles.disabled);$this.close()}else{if(dis==false){$("#"+id).css("opacity",1)}}if(isLocal!=true){$this.set("disabled",dis)}};this.form=function(){return(document.getElementById(elementid).form==undefined)?null:document.getElementById(elementid).form};this.item=function(){if(arguments.length==1){return document.getElementById(elementid).item(arguments[0])}else{if(arguments.length==2){return document.getElementById(elementid).item(arguments[0],arguments[1])}else{throw {message:"An index is required!"}}}};this.namedItem=function(nm){return document.getElementById(elementid).namedItem(nm)};this.multiple=function(is){if(is==undefined){return $this.get("multiple")}else{$this.set("multiple",is)}};this.size=function(sz){if(sz==undefined){return $this.get("size")}else{$this.set("size",sz)}};this.addMyEvent=function(nm,fn){$this.onActions[nm]=fn};this.fireEvent=function(nm){eval($this.onActions[nm])($this)};var updateCommonVars=function(){$this.set("version",$.msDropDown.version);$this.set("author",$.msDropDown.author)};var init=function(){createDropDown();setOriginalProperties();updateCommonVars();if(options.onInit!=""){eval(options.onInit)($this)}};init()};$.msDropDown={version:2.3,author:"Marghoob Suleman",create:function(id,opt){return $(id).msDropDown(opt).data("dd")}};$.fn.extend({msDropDown:function(options){return this.each(function(){var mydropdown=new dd(this,options);$(this).data("dd",mydropdown)})}})})(jQuery);function commitFlashObject(b,a){_output="";_paramoutput="";_src="";_ver="";for(_cO in b){_output+=_cO+'="'+b[_cO]+'" ';_paramoutput+="<param name="+_cO+' value="'+b[_cO]+'">';if(_cO=="movie"){_src='src="'+b[_cO]+'"'}if(_cO=="version"){_ver=b[_cO]}}if(_ver==""){_ver="8,0,0,0"}ihtm="<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+_ver+" "+_output+">\n";ihtm+=_paramoutput+"\n";ihtm+="<embed "+_src+" pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash type=application/x-shockwave-flash "+_output+">\n";ihtm+="</embed>\n";ihtm+="</object>\n";document.getElementById(a).innerHTML=ihtm}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%"})}}});
