(function($){var Judy=function($){var self=this,_name="Judy",_nonObj=["window","document","document.documentElement","element","image","textNode","attributeNode","otherNode","event","date","regexp","jquery"],_uaIe=0,_dateFrmt,_dateTz,_nonInputFlds=["textarea","select"],_dataName,_dialEvts=["beforeClose","create","open","focus","dragStart","drag","dragStop","resizeStart","resize","resizeStop","close"],_dialOpts=["appendTo","autoOpen","buttons","closeOnEscape","closeText","dialogClass","draggable","height","hide","maxHeight","maxWidth","minHeight","minWidth","modal","position","resizable","show","title","width"],_dialMthds=["close","destroy","isOpen","moveToTop","open","option","widget"],_dialogs=[],_acInit,_acLstnrs={},_acFltrs=[{"!url":/\/inspect\/ajax/},{"!url":/\/log_filter\/ajax/}],_checklist="checkboxes",_radio="radios",_jqOvrly,_ovrlyRsz,_errorHandler=function(error,variable,options){var u=options,o={},t; if(typeof window.inspect==="function"&&inspect.tcepsnI){if(typeof inspect.errorHandler==="function"){if(u){if((t=typeof u)==="string"){o.message=u; o.wrappers=1; }else{if(t==="object"){o=u; o.wrappers=!u.wrappers?1:(u.wrappers+1); }}}o.category="Judy"; inspect.errorHandler(error,variable,o); }else{inspect.console("Please update Inspect."); }}},_elm=function(list,u,cntxt,mthd,noError){var li=!list?0:undefined,t,s=u,jq,le,i,f; if(u){if((t=typeof u)==="object"){if(u===window||u===document||u.getAttributeNode){return !list?u:[u]; }if(typeof u.jquery==="string"){if(u.length){if(!cntxt){return u.get(li); }if((jq=$(u,cntxt)).length){return jq.get(li); }}s=u.selector; }else{if(self.isArray(u)&&(le=u.length)){for(i=0; i-1?t:""; },_disable=function(nbl,slctr,cntxt,ttl){var a=_elm(true,slctr,cntxt,!nbl?"disable":"enable"),le,i,r; if(a){le=a.length; for(i=0; i-1?"selected":false)){++set; if(!multi){return 1; }}}return set; },_valChecklist=function(r,val){var par,rOpts,nOpts,rOpt,nVals,i,v=[],set=0; if((par=self.ancestor(r,"div.form-checkboxes",3))){nOpts=(rOpts=$("input[type='checkbox']",par).get()).length; if(val===undefined){for(i=0; i-1?"checked":false)){++set; }}return set; }return undefined; },_filter=function(o,fltr){var le=fltr.length,i,k,x,not,v; for(i=0; i=96&&cK<=105){k+=(cK-48); }else{if((cK>=65&&cK<=90)||(cK>=48&&cK<=57)){k+=cK; }else{throw new Error("unsupported char["+ky+"] in keystrokes["+keystrokes+"]"); }}}}if(k&&k%1000>0){return"_"+k; }throw new Error("keystrokes["+keystrokes+"] "+(!k?"evaluates to nothing":"all modifiers, no plain keys")); },_keystrokes=function(e){var k=0,kC; if(e.ctrlKey||e.metaKey){k+=100000; }if(e.altKey){k+=10000; }if(e.shiftKey){k+=1000; }if((kC=e.keyCode)){switch(kC){case 61:k+=107; break; case 189:k+=109; break; default:if(kC>=96&&kC<=105){k+=(kC-48); }else{k+=kC; }}}return k; },_bindKeys=function(et,as){var jq=$(as[0]),jqMthd=typeof jq.on==="function"?"on":"bind",nAs=as.length,qualifiers="",nQs,iQ,q,nm,kms={},km,rs=jq.get(),nRs=jq.length,r,hndlr,dat,pdef=false,i,jq1,d,e,j,le,kyHndlrs,f; if(nAs<3){throw new Error("requires at least 3 args"); }if(!nRs){throw new Error("No element like selector["+as[0]+"], type["+self.typeOf(as[0])+"]"); }for(i=1; i<5; i++){switch(typeof as[i]){case"string":qualifiers=as[1]; break; case"function":hndlr=as[i]; break; case"object":dat=as[i]; break; case"boolean":pdef=as[i]; break; }}if(!hndlr){throw new Error("No handler function arg found"); }nQs=(qualifiers=qualifiers.split(" ")).length; for(iQ=0; iQ-1){nm=q.replace(/^[^\.]+\.(.+)$/,"$1"); q=q.replace(/^([^\.]+)\..+$/,"$1"); }km=_keyMask(q.replace(/[_\+]\+/,"_plus").replace(/\+/g,"_")); if(iQ&&kms[km]&&kms.hasOwnProperty(km)){continue; }kms[km]={handler:hndlr,data:dat,namespace:nm,type:q,preventDefault:pdef}; }for(i=0; i0)?"-":"+")+((zu=((zu?z:z*-1)/60))<10?"0":"")+Math.floor(zu)):"+00"); },_dateFrmt=function(dt,d,t,m,UTC,iso){var u,f=UTC?"getUTC":"get"; return(d?(dt[f+"FullYear"]()+"-"+((u=dt[f+"Month"]()+1)<10?("0"+u):u)+"-"+((u=dt[f+"Date"]())<10?("0"+u):u)):"")+(d&&t?(iso?"T":" "):"")+(t?((((u=dt[f+"Hours"]())<10?("0"+u):u)+":"+((u=dt[f+"Minutes"]())<10?("0"+u):u)+":"+((u=dt[f+"Seconds"]())<10?("0"+u):u))+(m?((iso?".":" ")+((u=dt[f+"Milliseconds"]())<10?("00"+u):(u<100?("0"+u):u))):"")):"")+(!iso?"":(UTC?"Z":(_dateTz(dt,1)+":00"))); },_dimInner=function(d,slctr,ignorePadding){var u=slctr,r,dE=document.documentElement,jq,v,p; if(u===window){return dE["client"+d]; }if(u===dE||u===document.body){return dE["scroll"+d]; }if((r=_elm(0,u,0,"inner"+d))){v=r["client"+d]; if(!ignorePadding){if((p=(jq=$(r)).css("padding-"+(d==="Width"?"left":"top"))).indexOf("px")>-1){v-=parseFloat(p); }if((p=jq.css("padding-"+(d==="Width"?"right":"bottom"))).indexOf("px")>-1){v-=parseFloat(p); }v=Math.round(v); }return v; }return undefined; },_dimOuter=function(d,slctr,includeMargin,set,max){var u=slctr,r,dE=document.documentElement,jq,v; if(u===window){return dE["inner"+d]||dE["client"+d]; }if(u===dE||u===document.body){return dE["scroll"+d]; }if((r=_elm(0,u,0,"outer"+d))){v=(jq=$(r))["outer"+d](includeMargin); if(!set||set===v){return v; }v=_dimInner(d,u)+(set-v); if(!max||max===2){jq.css(d.toLowerCase(),v+"px"); }if(max){jq.css("max-"+d.toLowerCase(),v+"px"); }return set; }return undefined; },_ovrlyRsz=function(){var w=window,d=document.documentElement,dW,dD; _jqOvrly.css({width:((dD=self.innerWidth(d))>(dW=self.innerWidth(w))?dD:dW)+"px",height:((dD=self.innerHeight(d))>(dW=self.innerHeight(w))?dD:dW)+"px"}); }; this.yduj=true; this.yduJ=true; this.version=2.1; this.browserIE=_uaIe=(function(){var u; if((u=window.navigator)&&(u=u.userAgent)){if(/; MSIE \d{1,2}\.\d/.test(u)){return(u=parseFloat(u.replace(/^.+; MSIE (\d{1,2}\.\d).+/,"$1")))?u:0; }if(/; Trident\/\d+\.\d+;/.test(u)&&/; rv:\d+\.\d+[;\)]/.test(u)){return(u=parseFloat(u.replace(/^.+; rv:(\d+\.\d+)[;\)].+$/,"$1")))?u:0; }}return 0; }()); this.setup=function(){self.setup=function(){}; _dataName="judy_"+self.randName(); }; this.typeOf=function(u){var t=typeof u; if(!arguments.length){return"Judy"; }switch(t){case"boolean":case"string":return t; case"number":return isFinite(u)?t:(isNaN(u)?"NaN":"infinite"); case"object":if(u===null){return"null"; }try{if(u.typeOf&&typeof u.typeOf==="function"){return u.typeOf(); }else{if(typeof u.length==="number"&&!(u.propertyIsEnumerable("length"))&&typeof u.splice==="function"){return"array"; }else{if(u===window){return"window"; }else{if(u===document){return"document"; }else{if(u===document.documentElement){return"document.documentElement"; }else{if(u.getAttributeNode){return u.tagName.toLowerCase==="img"?"image":"element"; }else{if(u.nodeType){switch(u.nodeType){case 3:return"textNode"; case 2:return"attributeNode"; }return"otherNode"; }else{if(typeof u.stopPropagation==="function"||(u.cancelBubble!==undefined&&typeof u.cancelBubble!=="function"&&typeof u.boundElements==="object")){return"event"; }else{if(typeof u.getUTCMilliseconds==="function"){return"date"; }else{if(typeof u.exec==="function"&&typeof u.test==="function"){return"regexp"; }else{if(u.hspace&&typeof u.hspace!=="function"){return"image"; }else{if(u.jquery&&typeof u.jquery==="string"&&!u.hasOwnProperty("jquery")){return"jquery"; }}}}}}}}}}}}}catch(er){}return t; case"function":return(u.constructor===RegExp||(typeof u.exec==="function"&&typeof u.test==="function"))?"regexp":t; }return t; }; this.isContainer=function(u,orArray){var t; return u&&typeof u==="object"&&((t=self.typeOf(u))==="object"||(orArray&&t==="array")||(t!=="array"&&self.arrayIndexOf(_nonObj,t)===-1))?(!orArray||t!=="array"?"object":t):false; }; this.isArray=function(u){return(u&&typeof u==="object"&&typeof u.length==="number"&&!(u.propertyIsEnumerable("length"))&&typeof u.splice==="function"); }; this.isNumber=function(u){return typeof u==="number"&&isFinite(u); }; this.isInt=function(u,nonNegative){return typeof u==="number"&&isFinite(u)&&(u%1===0)&&(!nonNegative||u>-1); }; this.containerCopy=function(oa,shallow){var t,c={},p,v; if(!oa||!(t=self.isContainer(oa,true))){return oa; }if(t==="array"){if(shallow){return oa.concat(); }c=[]; }for(p in oa){if(oa.hasOwnProperty(p)){c[p]=((v=oa[p])&&typeof v==="object")?(v===oa?c:(!shallow?self.containerCopy(v,false):v)):v; }}return c; }; this.objectGet=function(o,anyNumberOfKeys){var a=arguments,le=a.length,u=o,p,i; try{if(!u||typeof u!=="object"){throw new Error("arg o isnt object"); }if(le<2){throw new Error("no key arg"); }for(i=1; i1&&(!u||typeof u!=="object")){return undefined; }if((!(p=a[i])&&p!==0)||!(p=""+p)){throw new Error("arg #"+i+"["+p+"] type["+self.typeOf(p)+"] isnt integer or non-empty string"); }if(u.hasOwnProperty(p)){u=u[p]; }else{return undefined; }}return u; }catch(er){_errorHandler(er,null,_name+".objectGet()"); }return undefined; }; this.objectKeys=function(o){var a,k; if(!o||typeof o!=="object"){return null; }if(typeof Object.keys==="function"){return Object.keys(o); }a=[]; for(k in o){if(o.hasOwnProperty(k)){a.push(k); }}return a; }; this.objectKeyOf=function(o,v){var k; if(v!==undefined&&o||typeof o==="object"){for(k in o){if(o.hasOwnProperty(k)&&o[k]===v){return k; }}}return undefined; }; this.objectSort=function(o){var a=[],oByVal={},os={},k,v,cNum=String.fromCharCode(127),le,i=0; if(!o||typeof o!=="object"){return o; }for(k in o){if(o.hasOwnProperty(k)){++i; oByVal[(typeof(v=o[k])!=="number"?"":cNum)+v]=k; a.push(v); }}if(!i){return o; }le=i; a.sort(); for(i=0; i=le){oa.push(v1); }else{if((v=oa[p])===undefined){oa[p]=v1; }else{if(v1!==null){if(!(t=self.isContainer(v,true))||self.isContainer(v1,true)!==t){oa[p]=v1; }else{self.merge(v,v1,t,d+1); }}}}}}}}return true; }}throw new TypeError("Type mismatch, first is array, second is type["+self.typeOf(oa1)+"]"); }throw new TypeError("First arg is type["+self.typeOf(oa)+"], second is type["+self.typeOf(oa1)+"]"); }throw new Error("Cant recurse > 10, circular ref?"); }catch(er){_errorHandler(er,null,_name+".merge()"); }return false; }; this.ancestor=function(selector,parentSelector,max){var u,r=_elm(0,selector,null,"ancestor"),tt=parentSelector,lim=max&&max>0?(max+1):101,id,aCls,tn,cls,le,i; if(!r||r===window||r===document.documentElement){return undefined; }if(!tt||!(tt=$.trim(""+tt))){return r.parentNode; }if(tt.indexOf("#")>-1){u=tt.replace(/^([^\#]+)?\#([^\.]+)(\..+)?$/,"$2,$1$3").split(","); id=u[0]; tt=u[1]||""; }if(tt.indexOf(".")>-1){aCls=tt.split("."); tt=aCls[0]; aCls.splice(0,1); le=aCls.length; }tt=tt.toLowerCase(); while((--lim)&&(r=r.parentNode)){if(r.nodeType!==1||tn==="body"){return undefined; }tn=r.tagName.toLowerCase(); if((tt&&tn!==tt)||(id&&r.id!==id)){continue; }if(le){if(!(cls=r.className).length){continue; }cls=" "+cls+" "; u=0; for(i=0; i7&&o.hasOwnProperty(k)&&k.indexOf("jQuery")===0){if(!(o=o[k])||!o.events||!o.hasOwnProperty("events")){return null; }}}}}if(!o){return null; }if(!type){return o.events; }o=o.events; for(k in o){if(k===type&&o.hasOwnProperty(k)){return o[k]; }}return null; }; this.isField=function(elm,button){return typeof elm==="object"&&elm.tagName?(_fieldType(elm,button)?true:false):undefined; }; this.fieldType=function(selector,context,button){var r=_elm(0,selector,context,"fieldType"); return r?_fieldType(r,button):undefined; }; this.fieldValue=function(selector,context,val,type){var r=_elm(0,selector,context,"fieldValue"),t; if(r&&(t=type||_fieldType(r,true))){switch(t){case"select":return _valSelect(r,val); case"checkbox":return _valCheckbox(r,val); case"checkboxes":case"checklist":return _valChecklist(r,val); case"radio":case"radios":return _valRadio(r,context,val); case"image":t="src"; default:t=""; }if(val===undefined){return !t?r.value:r.getAttribute(t); }if(!t){r.value=""+val; }else{r.setAttribute(t,""+val); }return true; }return undefined; }; this.disable=function(selector,context,hoverTitle){_disable(0,selector,context,hoverTitle); }; this.enable=function(selector,context,hoverTitle){_disable(1,selector,context,hoverTitle); }; this.scrollTrap=function(selector,context,eventName){var a=_elm(true,selector,context,"scrollTrap"),nm=eventName||(_name+".scrollTrap"); if(a){$(a).each(function(){var preventZone=100,halfZone,s=this.scrollTop,$self=$(this),$chlds,le,$chld,h; if(!$self.hasClass("scroll-trapped")){if((le=($chlds=$self.children()).get().length)===1){$chld=$($chlds.get(0)); }else{if(le){$chld=$chlds.wrapAll("
").parent(); }else{return; }}$self.addClass("scroll-trapped"); if((h=this.clientHeight)<1.5*preventZone){preventZone=Math.floor(h/1.5); }halfZone=Math.floor(preventZone/2); $chld.css({"margin-top":preventZone+"px","margin-bottom":preventZone+"px"}); this.scrollTop=s+preventZone; $self.bind("scroll."+nm,function(){var that=this,s=that.scrollTop,h; if(s(h=that.scrollHeight-that.clientHeight)-halfZone){that.scrollTop=h-halfZone; setTimeout(function(){that.scrollTop=h-preventZone; },100); }}}); }}); }}; this.scrollTo=function(selector,context,offset,pad){var u,par,r,to=offset,p=pad||0,num,$par,chld,prvntZn=0,max=-1; if((par=_elm(0,selector,context,"scrollTo"))){if(!to||typeof to==="number"||!(r=_elm(0,to,par,"",true))){num=true; to=!to||!isFinite(to)||to<0?0:to; }if(($par=$(par)).hasClass("scroll-trapped")&&(chld=$par.children().get(0))){prvntZn=parseInt($(chld).css("margin-top").replace(/px/,""),10); max=par.scrollHeight-par.clientHeight-Math.floor(prvntZn*0.75); }if(num){to+=prvntZn; }else{par.scrollTop=prvntZn; to=(r.offsetTop-par.offsetTop); }if(p&&prvntZn&&p<0&&(p*-1)>(u=Math.floor(prvntZn/4))){p=-u; }to+=p; if(max>0&&to>max){to=max; }par.scrollTop=to; }}; this.focus=function(selector,context,delay){var d=delay||0,to; if(selector){to=setTimeout(function(){var r; if((r=_elm(0,selector,context,"",true))){try{r.focus(); }catch(er){}}},d>=0?d:20); }}; this.innerWidth=function(selector,ignorePadding){return _dimInner("Width",selector,ignorePadding); }; this.innerHeight=function(selector,ignorePadding){return _dimInner("Height",selector,ignorePadding); }; this.outerWidth=function(selector,includeMargin,set,max){return _dimOuter("Width",selector,includeMargin,set,max); }; this.outerHeight=function(selector,includeMargin,set,max){return _dimOuter("Height",selector,includeMargin,set,max); }; this.stripTags=function(u){return $.trim((""+u).replace(/<[^<>]+>/g," ").replace(/[ ]+/g," ")); }; this.toLeading=function(u,length){var le=length||1; return(new Array(le).join("0")+u).substr(-le,le); }; this.toUpperCaseFirst=function(u){var s=""+u,le=s.length; return !le?"":(s.charAt(0).toUpperCase()+(le<2?"":s.substr(1))); }; this.isLeapYear=function(u){var y; switch(self.typeOf(u)){case"date":y=u.getFullYear(); break; case"number":y=u; break; case"string":y=parseInt(u,10); break; default:return null; }if(isFinite(y)&&u>-1&&u%1===0){return(!(y%4)&&(y%100))||!(y%400); }return null; }; this.dateISO=function(date,UTC){var d=date||new Date(); return UTC&&Date.prototype.toISOString?d.toISOString():_dateFrmt(d,1,1,1,UTC,1); }; this.dateTime=function(date,UTC){var d=date||new Date(); return UTC&&Date.prototype.toISOString?d.toISOString().replace(/T/," ").replace(/\.\d{3}Z$/,""):_dateFrmt(d,1,1,0,UTC); }; this.dateToFormat=function(date,sFormat){var u=date,fmt=sFormat||"YYYY-MM-DD",le,y,m,d,s,a,b; if(u&&typeof u==="object"&&u.getFullYear){y=u.getFullYear(); m=self.toLeading(u.getMonth()+1,2); d=self.toLeading(u.getDate(),2); if((a=(s=fmt.substr(0,10)).replace(/[MDY]/g,"")).length<2){return""; }b=a.charAt(1); a=a.charAt(0); switch(s.replace(/[^MDY]/g,"")){case"YYYYMMDD":s=y+a+m+b+d; break; case"MMDDYYYY":s=m+a+d+b+y; break; case"DDMMYYYY":s=d+a+m+b+y; break; default:return""; }if((le=fmt.length)>11){s+=" "+self.toLeading(u.getHours(),2); if(le>14){s+=":"+self.toLeading(u.getMinutes(),2); if(le>17){s+=":"+self.toLeading(u.getSeconds(),2); if(le>20){s+=" "+self.toLeading(u.getMilliseconds(),3); }}}}return s; }else{try{throw new Error("date["+u+"] type["+self.typeOf(u)+"] is not a non-empty Date"); }catch(er){_errorHandler(er,null,_name+".dateToFormat()"); }return""; }}; this.dateFromFormat=function(sDate,sFormat){var s=sDate,dt=new Date(),fmt=sFormat||"YYYY-MM-DD",y,m,d; if(s&&typeof s==="string"){if(/^YYYY.MM.DD$/.test(fmt)){y=s.substr(0,4); m=s.substr(5,2); d=s.substr(8,2); }else{if(/^MM.DD.YYYY$/.test(fmt)){y=s.substr(6,4); m=s.substr(0,2); d=s.substr(3,2); }else{if(/^DD.MM.YYYY$/.test(fmt)){y=s.substr(6,4); m=s.substr(3,2); d=s.substr(0,2); }else{return null; }}}y=parseInt(y,10); d=parseInt(d,10); switch((m=parseInt(m,10))){case 1:case 3:case 5:case 7:case 8:case 10:case 12:if(d>31){return null; }break; case 4:case 6:case 9:case 11:if(d>30){return null; }break; case 2:if(d>29||(d===29&&!self.isLeapYear(y))){return null; }break; default:return null; }dt.setFullYear(y,m-1,d); dt.setHours(0,0,0); dt.setMilliseconds(0); return dt; }else{try{throw new Error("date["+s+"] type["+self.typeOf(s)+"] is not non-empty string"); }catch(er){_errorHandler(er,null,_name+".dateFromFormat()"); }return null; }}; this.timeFormat=function(date,sTime){var d=date,t=sTime?$.trim(sTime):0,h=0,i=0,s=0,le,v; if(d&&typeof d==="object"&&d.getFullYear){if(t){if(/^\d+$/.test(t)){h=t.substr(0,2); if((le=t.length)>3){i=t.substr(2,2); if(le>5){s=t.substr(4,2); }}}else{if((le=(t=t.split(/[^\d]/)).length)){h=t[0]; if(le>1){i=t[1]; if(le>2){s=t[2]; }}}}if(h){h=isFinite(v=parseInt(h,10))&&v<25?v:0; if(i){i=isFinite(v=parseInt(i,10))&&v<60?v:0; }if(s){s=isFinite(v=parseInt(s,10))&&v<60?v:0; }if(h===24){if(!i&&!s){h=23; i=s=59; }else{h=0; }}}d.setHours(h,i,s); }else{h=d.getHours(); i=d.getMinutes(); s=d.getSeconds(); }return""+(h<10?"0":"")+h+":"+(i<10?"0":"")+i+":"+(s<10?"0":"")+s; }else{try{throw new Error("date["+d+"] type["+self.typeOf(d)+"] is not a non-empty Date"); }catch(er){_errorHandler(er,null,_name+".timeFormat()"); }return"00:00:00"; }}; this.numberToFormat=function(num,oFormat){var n=num||0,s,sgn="",o,isInt,kSep,scale,u,le,d,i; if(!n){return"0"; }if(n<0){n*=-1; sgn="-"; }isInt=!(u=(o=oFormat||{}).type)||u==="integer"; kSep=(u=o.thousand_separator)||u===""?u:" "; if((d=n%1)){n=Math.round(n); }s=""+n; if(kSep&&(le=s.length)>3){n=s; s=n.substr(0,i=le%3); while(i-1){d=s.substr(p).replace(/\D/g,""); s=s.substr(0,p); }n=parseInt(s.replace(/\D/g,""),10); if(d){n+=parseInt(d,10)/Math.pow(10,d.length); }return sgn*(!isInt?n:Math.round(n)); }return 0; }; this.rand=function(min,max){var m=min||0; return m+Math.floor((Math.random()*(((max||9000000000000000)-m)+1))+1)-1; }; this.randName=function(length){var al=length||20,l,s=String.fromCharCode(Math.floor(Math.random()*26)+97); while((l=s.length)al?s.substr(0,al):s; }; this.overlay=function(show,opaque,hoverTitle){var hide=!show||typeof show==="object",ttl=hoverTitle||"",clsO="module-judy-overlay-opaque",clsT="module-judy-overlay-hovertitled"; if(!_jqOvrly){if(hide){return; }$(document.body).append('
'); _jqOvrly=$("div#module_judy_overlay"); _ovrlyRsz(); $(window).resize(function(){_ovrlyRsz(); }); }else{if(hide){_jqOvrly.hide(); return; }else{_jqOvrly[opaque?"addClass":"removeClass"](clsO)[ttl?"addClass":"removeClass"](clsT).get(0).setAttribute("title",ttl); }}_jqOvrly.show(); }; this.dialog=function(selector,option,value){var sl=selector,u=option,t,s,o,v=value,keys,a,tg="",id="",cls="module-judy-dialog",cls1="",elm,jq,dialExists,fxd,title,doOpen,autoOpenLater,to; if($.ui&&typeof $.ui.dialog==="function"){if(u){if((t=typeof u)==="string"){if(u!=="option"){s=u; }else{if(v&&typeof v==="object"){o=self.containerCopy(v); }}}else{if(t==="object"){o=self.containerCopy(u); }}}if(sl){if(typeof sl==="string"){if(sl.indexOf("#")===-1&&sl.indexOf(".")===-1){if((elm=document.getElementById(id=sl))&&self.arrayIndexOf(_dialogs,id)>-1){dialExists=true; }}else{if((elm=$(sl).get(0))){if((id=elm.id)){if(self.arrayIndexOf(_dialogs,id)>-1){dialExists=true; }}else{id=elm.id=self.randName(); }}else{a=sl.replace(/^([a-z\d_\-]+)?(\#[a-z\d_\-]+)?(\.[a-z\d_\-]+)?$/,"$1,$2,$3").split(","); tg=a[0]; id=a[1]?a[1].substr(1):self.randName(); if(a[2]){cls1=" "+a[2].split(/\./).join(" "); }}}}else{if(typeof sl==="object"&&sl.getAttributeNode){if((id=elm.id)){if(self.arrayIndexOf(_dialogs,id)>-1){dialExists=true; }}else{id=elm.id=self.randName(); }}}}else{id=self.randName(); }if(dialExists){doOpen=false; jq=$(elm); if(o){delete o.fixed; if((keys=self.objectKeys(o)).length===1){v=o[s=keys[0]]; }}if(s){if(s==="content"){if(jq.dialog("isOpen")){doOpen=true; }jq.html(v); if(doOpen){if(doOpen){to=setTimeout(function(){jq.dialog("open"); },100); }}return id; }if(s==="getContent"){return jq.html(); }if(s==="title"){$(".ui-dialog-title",$(elm.parentNode)).html(v); return id; }else{if(self.arrayIndexOf(_dialOpts,s)>-1||self.arrayIndexOf(_dialEvts,s)>-1){jq.dialog("option",s,v); }}if(self.arrayIndexOf(_dialMthds,s)>-1){return jq.dialog(s); }jq.dialog(s,v); return id; }else{if(o){if(jq.dialog("isOpen")){doOpen=true; jq.dialog("close"); }if(o.close&&o.hasOwnProperty("close")&&typeof o.close!=="function"){doOpen=false; delete o.close; }if(o.content!==undefined&&o.hasOwnProperty("content")){jq.html(v); delete o.content; }if(o.open&&o.hasOwnProperty("open")){doOpen=true; delete o.open; }jq.dialog(o); if(doOpen){to=setTimeout(function(){jq.dialog("open"); },100); }}}return id; }doOpen=true; if(!o){o={}; if(s){o[s]=v; }}if(!elm){$(document.body).append("<"+(tg||"div")+' id="'+id+'" class="'+cls+cls1+(!o.contentClass?"":(" "+o.contentClass))+'">"); elm=document.getElementById(id); }jq=$(elm); if(o.open&&o.hasOwnProperty("open")){delete o.open; }if(!o.autoOpen&&o.hasOwnProperty("autoOpen")){doOpen=false; }else{autoOpenLater=true; o.autoOpen=false; }if((u=self.objectGet(o,"content"))){jq.html(u); delete o.content; }if(o.fixed&&o.hasOwnProperty("fixed")){fxd=true; delete o.fixed; }if(o.title&&o.hasOwnProperty("title")){title=o.title; delete o.title; }jq.dialog(o); u=$(elm.parentNode); if(fxd){u.css("position","fixed"); }if(title!==undefined){$(".ui-dialog-title",u).html(title); }u.addClass(cls+"-container"); _dialogs.push(id); if(doOpen){to=setTimeout(function(){jq.dialog("open"); if(autoOpenLater){jq.dialog("autoOpen",true); }},100); }return id; }try{throw new Error("jQuery UI Dialog not included"); }catch(er){_errorHandler(er,null,_name+".dialog()"); }return false; }; this.timer=function(o,func,args,delay){return new self.Timer(o,func,args,delay); }; this.Timer=function(o,func,args,delay){var a=args||[],fired=false,f=o?function(){fired=true; try{func.apply(o,a); }catch(er){}}:function(){fired=true; try{func(); }catch(er){}},t=window.setTimeout(f,delay||0); this.fired=function(){return fired; }; this.cancel=function(){window.clearTimeout(t); }; }; }; (Drupal.Judy=window.Judy=window.judy=new Judy($)).setup(); })(jQuery);