function initForms(){FormValidation.addFormValidation();var B=$$("rm-fSetHeader","div","rm-pageWrapper");for(var C=(B.length-1);C>=0;C--){if(!$hc(B[C],"rm-disabledSection")){enableCollapse(B[C],"rm-formContent",{no_effects:true})}}Tooltips.init(Tooltips.generalTipClass,{parent_id:"rm-pageWrapper"});var A=document.getElementsByTagName("FORM");for(var C=0;C<A.length;C++){initShowhideText(A[C],"en")}}function buildActionMenu(B,H,M,A,F){Event.stop(B);if(!F){F={}}var J=(F.is_split||false);var L=H.offsetWidth;if(H.button_inited){return }var D,E,C,G;if(typeof drawShim=="function"){if(!hasAncestorShim(M)){G=drawShim(M,"rm-actionShim");G.style.zIndex="4"}}if($hc(M,"rm-globalAM")){C=$("rm-mainActionMenu");if(C==null){C=$CE(M.tagName,"rm-mainActionMenu",M.className,document.body);C.style.position="absolute";C.style.zIndex="10000"}D=(function(){var V=($D.getX(H))+(F.xoffset||0);var T=($D.getY(H))+(F.yoffset||16);if(C==null){C=$("rm-mainActionMenu")}C.innerHTML=M.innerHTML;function Q(Y,Z){for(var X=0;X<Z.length;X++){$E.removeListener(Z[S],"click",Q)}C.style.display="none"}var O=C.getElementsByTagName("a");for(var S=0;S<O.length;S++){$E.on(O[S],"click",Q,O)}var R=$D.getDocumentScrollLeft();var U=$D.getViewportWidth();var W=R+U;C.style.visibility="hidden";C.style.display="block";var P=C.offsetWidth;C.style.visibility="visible";C.style.display="none";if(F.side=="left"){if((V+P)>W){V=W-5-P}}else{if((V-P+L)>R){V=V-P+L}else{V=R+5}}C.style.left=V+"px";C.style.top=T+"px";if(G!=null){G.style.display="block";G.style.left=V+"px";G.style.top=T+"px"}C.style.display="block"});E=(function(){if(C==null){C=$("rm-mainActionMenu")}if(G!=null){G.style.display="none"}C.style.display="none"})}else{D=(function(){if(G!=null){G.style.display="block"}});E=(function(){if(G!=null){G.style.display="none"}})}var N=$$(A,"span",$(M.parentNode));for(var I=(N.length-1);I>=0;I--){enableCollapse(N[I],M.className,{no_effects:true,f_action:"rm-collapsed",blurable:true,split_button:J,collapse_timeout:(F.timeout||500),preExpand:D,preCollapse:E,postExpand:F.postExpand,override_id:C,exclude_class:F.exclude_class,sec_triggers:F.sec_triggers});if(!$E.isIE){var K=$E.getListeners(N[I],"click");if(K!=null&&K.length>0){K[0].fn(B)}}}H.button_inited=true;H.onclick=null}var Tooltips={toolTips:[],shown:null,generalTipClass:"rm-formTip",infoTipClass:"rm-info",alertTipClass:"rm-alert",successTipClass:"rm-success",targetClass:null,m_overLock:false,m_outTimeout:1000,m_outTimeoutObj:null,tipClasses:null,count:0,init:function(E,D){if(!D){D={}}var B=(D.nodeType||"*");var A=$$(E,B,D.parent_id);Tooltips.tipClasses=[Tooltips.alertTipClass,Tooltips.infoTipClass,Tooltips.errorTipClass,Tooltips.successTipClass];Tooltips.targetClass=E;for(var C=(A.length-1);C>=0;C--){if(!A[C].parentNode.tipInitialized){Tooltips.toolTips[Tooltips.toolTips.length]=[A[C].parentNode,A[C]];Tooltips.watchTip(A[C].parentNode,A[C],D)}}},watchTip:function(A,E,D){$E.on(A,"mouseover",Tooltips.tipAction,[E,A,D]);$E.on(A,"mouseout",Tooltips.tipAction,[E,A,D]);var C=A.getElementsByTagName("input");for(var B=(C.length-1);B>=0;B--){$E.on(C[B],"blur",Tooltips.tipAction,[E,A,D]);$E.on(C[B],"focus",Tooltips.tipAction,[E,A,D])}A.tipInitialized=true},tipAction:function(C,A){var D=A[0];var B=A[1];switch(C.type){case"focus":Tooltips.m_overLock=true;break;case"blur":Tooltips.m_overLock=false;Tooltips.m_outTimeoutObj=setTimeout("Tooltips.hideTip(Tooltips.shown)",Tooltips.m_outTimeout);return ;case"mouseover":if(Tooltips.m_overLock){return }break;case"mouseout":if(!Tooltips.m_overLock&&Tooltips.shown){Tooltips.m_outTimeoutObj=setTimeout("Tooltips.hideTip(Tooltips.shown)",Tooltips.m_outTimeout)}return }if(Tooltips.m_outTimeoutObj){clearTimeout(Tooltips.m_outTimeoutObj)}Tooltips.showTip(D,B,A[2])},showTip:function(E,B,D){if(E){if(Tooltips.shown!=E){Tooltips.hideTip();Tooltips.count++;Tooltips.shown=E;window.status=E;var A=false;for(var C=(Tooltips.tipClasses.length-1);C>=0;C--){if($hc(B,Tooltips.tipClasses[C])){A=true;$ac(E,Tooltips.tipclasses[C])}}if(!A){$ac(E,Tooltips.infoTipClass)}if(B){if(D.setPosition){D.setPosition(E,B)}else{E.style.top=($D.getY(B)-10)+"px"}}E.style.display="block"}}},hideTip:function(A){if(!A){A=Tooltips.shown}if(A){if(Tooltips.m_outTimeoutObj){clearTimeout(Tooltips.m_outTimeoutObj)}A.style.display="none";A.className=Tooltips.generalTipClass;Tooltips.shown=null}}};var CAL_MONTH="rm-month";var CAL_YEAR="rm-year";var CAL_DAY="rm-day";var CAL_MINUTE="Minute";var CAL_HOUR="Hour";var CAL_AMPM="AmPm";var CAL_ID="calendar_object";var CAL_COMPACT="Date";var DATE_DELIM="/";function initCalendar(E,A){if(!E){return }if(typeof E=="object"){E=[E]}if(typeof E=="string"){E=[$(E)]}if(!E.length){return }var B=$CE("div",null,null,document.body);$D.generateId(B);var G=new YAHOO.widget.Calendar(CAL_ID,B.id,{close:true});var F,D;B.style.position="absolute";G.hide();G.changePageEvent.subscribe(H,G,true);function H(){var I=$$("calheader","div",B)[0];if(D!=null){D.unreg()}D=new $DD(B);D.setHandleElId(I)}B.updateDrag=H;for(var C=(E.length-1);C>=0;C--){attachCalendar(G,E[C],B,A)}return G}function attachCalendar(M,U,H,L){var N=U.parentNode;var F=[N.getAttribute("esd"),N.getAttribute("lsd")];var C=[N.getAttribute("eed"),N.getAttribute("led")];if(!F[0]&&!F[1]){F=null}if(!C[0]&&!C[1]){C=null}var B=F?F:C;if(!B){B=["",""]}var V=null,E=null;if(B[0].length>0){V=B[0].split(DATE_DELIM)}if(B[1].length>0){E=B[1].split(DATE_DELIM)}var J=$$(CAL_COMPACT,null,N)[0];var I=$$(CAL_MONTH,null,N)[0];var O=$$(CAL_DAY,null,N)[0];var S=$$(CAL_YEAR,null,N)[0];var P=$$(CAL_HOUR,null,N);var T=$$(CAL_MINUTE,null,N);var W=$$(CAL_AMPM,null,N);P=P.length?P[0]:null;T=T.length?T[0]:null;W=W.length?W[0]:null;var K=J?[J]:[I,O,S,P,T];for(var Q=(K.length-1);Q>=0;Q--){if(K[Q]){$E.on(K[Q],"keydown",$rf.numericOnly)}}if(V||E){for(var Q=(K.length-1);Q>=0;Q--){$E.on(K[Q],"blur",function(Y){var a=null,Z=null;if(E){a=D({day:E[1],month:E[0],year:E[2]})}if(V){Z=D({day:V[1],month:V[0],year:V[2]})}if(a||Z){var X=D(A());if(!X){return }if(Z&&YAHOO.widget.DateMath.before(X,Z)){R({day:V[1],month:V[0],year:V[2]})}else{if(a&&YAHOO.widget.DateMath.after(X,a)){R({day:E[1],month:E[0],year:E[2]})}}}})}}function G(Z,Y,a){var b=Y[0],X=b[0];R({month:X[1],day:X[2],year:X[0]});M.hide()}function D(Y){if(!Y){return null}var X=new Date();if(Y.day){X.setDate(Y.day)}if(Y.month){X.setMonth(Y.month-1)}if(Y.year){X.setYear(Y.year)}return X}function R(X){if(J&&X.month&&X.day&&X.year){J.value=X.month+DATE_DELIM+X.day+DATE_DELIM+X.year}else{if(X.month&&I){$rf.setFieldValue(I,X.month)}if(X.day&&O){$rf.setFieldValue(O,X.day)}if(X.year&&S){$rf.setFieldValue(S,X.year)}if(X.hour&&P){$rf.setFieldValue(P,X.hour)}if(X.minute&&T){$rf.setFieldValue(T,X.minute)}if(X.ampm&&W){$rf.setFieldValue(W,X.ampm)}}}function A(){var Y={};if(J){var X=J.value.split(DATE_DELIM);Y.month=X[0];Y.day=X[1];Y.year=X[2]}else{if(I){Y.month=parseInt($rf.getFieldValue(I))+1}if(O){Y.day=$rf.getFieldValue(O)}if(S){Y.year=$rf.getFieldValue(S)}if(P){Y.hour=$rf.getFieldValue(P)}if(T){Y.minute=$rf.getFieldValue(T)}if(W){Y.ampm=$rf.getFieldValue(W)}}return Y}$E.on(U,"click",function(b){M.selectEvent.unsubscribeAll();var X=new Date(),a=null;var Y=A();if(Y.month&&Y.year&&Y.year>0){X=Y.month+DATE_DELIM+Y.year;if(Y.day){a=Y.month+DATE_DELIM+Y.day+DATE_DELIM+Y.year}}M.cfg.setProperty("pagedate",X);if(a){M.cfg.setProperty("selected",a)}if(typeof L=="object"){for(var Z=(L.length-1);Z>=0;Z--){if(L[Z].type!=null&&L[Z].values!=null){M.cfg.setProperty(L[Z].type,L[Z].values)}}}if(B[0]!=""){M.cfg.setProperty("mindate",B[0])}if(B[1]!=""){M.cfg.setProperty("maxdate",B[1])}M.render();M.selectEvent.subscribe(G,M,true);H.style.top=(parseInt($D.getY(U))+20)+"px";H.style.left=(parseInt($D.getX(U)))+"px";H.updateDrag();M.show()})}var CALENDAR_SPAN_CLASS="calGroup";var changeDaySelect=function(D,A){var C=Ramius.nodeUtils.getParentNodeByClassName(A,CALENDAR_SPAN_CLASS);var F=$$(CAL_DAY,"select",C)[0];if(F!=null&&A!=null){if(F.tagName=="SELECT"&&A.tagName=="SELECT"){if(A.value!=null&&A.value>-1&&A.value<12){var B=0;var E=parseInt(A.value);if(E>6){E++}if(E==1){B=29}else{if(E%2==0&&E<6){B=31}else{if(E%2==1&&E<6){B=30}else{if(E%2==0&&E>=6){B=31}else{if(E%2==1&&E>=6){B=30}}}}}for(i=F.length-1;i>29;i--){F.remove(i)}i=0;for(i=30;i<=B;i++){var G=document.createElement("OPTION");G.text=i;G.value=i;F.options.add(G)}}}}return };var ADD_ICON_URL="/_inc/images/icons/actions/add_16x16.png";var REMOVE_ICON_URL="/_inc/images/icons/actions/remove_16x16.png";var DISABLED_REMOVE_ICON_URL="/_inc/images/icons/actions/remove_disabled_16x16.png";var DRAG_ICON="/images/m_input_grip.gif";var FIELD_DELIM="|";var aSimpleCls="rm-multiSimpleAdd",rSimpleCls="rm-multiSimpleRemove";var SIMPLE_SET=0;var COMPLEX_SET=1;function convertMultiInputSets(A,C){var D=$$(A);for(var B=(D.length-1);B>=0;B--){createMultiInputSet(D[B],C)}}function createMultiInputSet(C,Y){if(!Y){Y={}}var H=(Y.maximum||5);var a=(Y.minimum||1);var Q=0;var S=(Y.add_title||"Add Entry");var V=(Y.add_alt||S);var O=(Y.remove_title||"Remove Entry");var b=(Y.remove_alt||O);var K=(Y.input_field_cls||"rm-regInput");var F=(Y.sortable||false);var E=(Y.ignore_field||"rm-multiIgnore");var c=(Y.base_element||"rm-multibase");var W=$$(c,"",C)[0];if(W==null||!W.length<=0){return }var N=Ramius.nodeUtils.noClass(C.childNodes,E);N=Ramius.nodeUtils.noClass(N,c);var e=$hc(C,"convertedSet");var R=Y.edit_cls||"rm-edit_line";var L=Y.added_cls||"rm-addedField";var J=Y.converted_cls||"rm-baseClone";var I=Y.addFunction;for(var U=0;U<N.length;U++){G(N[U])}if(e){M();T()}else{var Z=W;for(var U=0;Q<a;U++){Z=M(Z)}}function T(){var g=$$("rm-primary","input",C);for(var f=(g.length-1);f>=0;f--){$E.removeListener(g[f],"click");$E.on(g[f],"click",X,g)}X(null,g)}function X(j,h){var h=$$("rm-primary","input",C);for(var f=(h.length-1);f>=0;f--){var g=null;if(h[f].parentNode!=W){g=$$("rm-removeButton","img",h[f].parentNode.parentNode)[0]}if(!g){continue}if(h[f].checked){$E.removeListener(g.parentNode,"click");g.src=DISABLED_REMOVE_ICON_URL}else{$E.on(g.parentNode,"click",D);g.src=REMOVE_ICON_URL;$ac(g,"rm-enabled")}}}function M(f){if((!e&&Q>=H)||!W){return }Q++;var g=W.cloneNode(true);$rc(g,c);if(e){$ac(g,R)}var h=(f)?Ramius.nodeUtils.getNextSiblingTag(f):null;if(!h){C.appendChild(g)}else{C.insertBefore(g,h)}A(g);d(g);return g}function G(f,g){if((!f||Q>=H)&&!e){return }Q++;var h=(g)?Ramius.nodeUtils.getNextSiblingTag(g):null;if(!h){C.appendChild(f)}else{C.insertBefore(f,h)}f.noAdd=true;A(f);d(f);return f}function A(g){var m,h,f="rm-multiComplexRemove",l="rm-multiComplexAdd";var k=g.tagName.toUpperCase()=="TR"?"TD":"SPAN";if(!Y.mode||Y.mode==SIMPLE_SET){m=$fc(g,rSimpleCls);h=$fc(g,aSimpleCls);if(!$hc(g,R)&&((Q>a&&!h)||(e))){h=$CE(k,"",rSimpleCls,g,{title:O,innerHTML:'<span class="forIE6"></span><img class="rm-removeButton" src="'+REMOVE_ICON_URL+'" alt="'+b+'" />'})}else{if(k=="TD"){$CE(k,"",rSimpleCls,g)}}if(!m&&!e){m=$CE(k,"",aSimpleCls,g,{title:S,innerHTML:'<img class="addButton" src="'+ADD_ICON_URL+'" alt="'+V+'" />'})}if(e&&!g.noAdd&&I){var j=$CE(k,"",aSimpleCls,g,{title:S,innerHTML:'<span id="__tmp_add" class="'+BUTTON_CLS+' rm-standard"><span class="rm-first-child"><div class="rm-button">Add</div></span></span>'});$E.on("__tmp_add","click",I,{obj:g,func:P,type:k})}if(m){$E.on(m,"click",B)}}else{if(Y.mode==COMPLEX_SET){if(Q>a){h=$fc(g,f);if(!h){h=$CE("div","",f,g,{innerHTML:(Y.complexRemoveText||"Remove")})}}m=$$(l,"",C)[0];if(!m&&!e){m=$CE("li",null,l,null,{innerHTML:"Add More..."})}if(m){C.appendChild(m);if(Q==1){$E.on(m,"click",B)}}}}if(h){$E.on(h,"click",D)}}function d(g){if(!g){return }if(F){var f=$CE("img","","input_grip",null,{src:DRAG_ICON});g.insertBefore(f,g.firstChild);$rdd(g,{src_opacity:25,col:g.parentNode,row:gen_frwap_cls,el_handle:"input_grip",row_ajax_:function(l,m){},lock_x:true,pre_drop_cls:"pre-minput_sort",post_drop_cls:"post-minput_sort"})}if(e&&!$hc(g,R)){$ac(g,"rm-addedField");var h=g.getElementsByTagName("input");var k=null;for(var j=0;j<h.length;j++){if(h[j].type.toLowerCase()=="text"){k=h[j];break}}if(k){k.readOnly="readonly"}}}function B(){M(this.parentNode)}function D(){if(this&&this.parentNode&&this.parentNode.parentNode){this.parentNode.parentNode.removeChild(this.parentNode);Q--}}function P(l,f,m){var g=[];g[g.length]=$$(aSimpleCls,m,f);g[g.length]=$$(rSimpleCls,m,f);for(var k=(g.length-1);k>=0;k--){for(var h=(g[k].length-1);h>=0;h--){if(g[k][h]&&g[k][h].parentNode){g[k][h].parentNode.removeChild(g[k][h])}}}$rc(f,R);$ac(f,J);G(f);M();T()}}function swapProvField(G,D){var H=$$("state_province_text",null,G.parentNode.parentNode)[0];var C=$$("province_list",null,G.parentNode.parentNode)[0];var B=$$("state_list",null,G.parentNode.parentNode)[0];var E=$$("state_province_label",null,G.parentNode.parentNode)[0];var F=$$("province_label",null,G.parentNode.parentNode)[0];var A=$$("state_label",null,G.parentNode.parentNode)[0];B.name="";B.selectedIndex=0;A.style.display="none";B.style.display="none";C.name="";C.selectedIndex=0;C.style.display="none";F.style.display="none";H.style.display="none";E.style.display="none";H.value="";H.text="";H.name="";switch(G.value){case ("CA"):C.name=D;C.style.display="block";F.style.display="block";break;case ("US"):B.name=D;B.style.display="block";A.style.display="block";break;default:E.style.display="block";H.style.display="block";H.name=D;break}}function checkEndDate(B){var A=$$("endDateSelect",null,B.parentNode)[0];if(B.value=="present"){A.style.visibility="hidden";A.selectedIndex=0}else{A.style.visibility=""}}function updateBaseUrl(F,G,E,A,D,C){if(!D){D={}}if(!D.desc_field){D.desc_field=$$("rm-description",null,G.parentNode)[0]}if(D.desc_field&&G){var H=A;if(G.value.length){var B=$(D.dest_field);if(C){H=convToSubdomainCharset(G.value.toLowerCase())}else{H=convToSixentCharset(G.value.toLowerCase())}if(B&&H!=B.value){B.value=H}else{if(!B&&H!=G.value){G.value=H}}}if(!C){D.desc_field=$rh(D.desc_field,E+H)}else{D.desc_field=$rh(D.desc_field,"http://<strong>"+H+"</strong>."+E)}}}function convToSixentCharset(A){return convToCharset(A,"sixent")}function convToSubdomainCharset(A){return convToCharset(A,"subdomain")}function convToCharset(F,G){var E="",H=null,C=Ramius.SIXENT_CHARSET;if(G=="subdomain"){C=Ramius.SUBDOMAIN_CHARSET}for(var D=0;D<F.length;D++){var I=F.charCodeAt(D),A=null;if((I>=192&&I<=198)||(I>=224&&I<=230)){A="a"}else{if(I==199||I==231){A="c"}else{if((I>=200&&I<=203)||(I>=232&&I<=235)){A="e"}else{if(I>=226&&I<=239){A="i"}else{if(I>=204&&I<=207){A="l"}else{if(I==209||I==241){A="n"}else{if((I>=210&&I<=214)||(I>=242&&I<=246)||(I==248)){A="o"}else{if(I==223){A="s"}else{if((I>=217&&I<=220)||(I>=249&&I<=252)){A="u"}else{if((I>=221&&I<=222)||(I>=253&&I<=255)){A="y"}else{if(I==32){A="-"}else{if(I==95&&G=="subdomain"){A="-"}}}}}}}}}}}}var B=H=="-"&&(A=="-"||F.charAt(D)=="-");B=B||(H=="_"&&(A=="_"||F.charAt(D)=="_"));if(!B){H=(A!=null)?A:F.charAt(D);if(!((H=="-"||H=="_")&&E.length<1)){E=E+H}}}return E.stripInvalidChars(C)}function cleanAlias(A){if(A){A=A.replace(/^[\s-_]+/,"");A=A.replace(/[\s-_]+$/,"")}return A}function sizeIframe(C){var G=10;var F="rm-fileIFrame";var D="rm-iframeWrap";var E=C.contentDocument||C.contentWindow;if(E.document){E=E.document}var B=$(D);if(B&&B.offsetHeight>0){var A=B.offsetHeight+G;C.style.height=A+"px"}}function setAutoHeight(E,D,B){var G=E.style.height;if(!G){G=E.clientHeight||E.offsetHeight}var A=document.createElement("div");var C=E.cloneNode(true);C.removeAttribute("name");C.removeAttribute("id");$ac(C,"rm-clone-obj");C.style.overflow="visible";C.disabled=true;C.tabIndex=-1;C.style.height=is_IE()?"1000px":"5px";A.className="rm-autoHeightWrap";A.appendChild(C);E.parentNode.insertBefore(A,E);E.autoHeightMin=D||G;E.autoHeightMax=B;E.autoHeightDiv=C;E.resizeInput=function(I){var K=I.target||I.srcElement;var J=K.value;K.autoHeightDiv.value=J;var H=K.autoHeightDiv.scrollHeight;if(H<K.autoHeightMin){H=K.autoHeightMin}if(K.autoHeightMax!=null&&H>K.autoHeightMax){H=K.autoHeightMax}K.style.height=H+"px"};$E.on(E,"keyup",E.resizeInput);var F=new Object();F.target=E;E.resizeInput(F)}function toggleWrap(C){var D,A,B;if(C){D=C.value;A=C.cloneNode(false);if(A.getAttribute("wrap")=="off"){A.removeAttribute("wrap")}else{A.setAttribute("wrap","off")}C.parentNode.replaceChild(A,C);A.value=D}}function updateInputFields(D,E){var A=$$("rm-i18n-text","li",D);for(var B=0;B<A.length;B++){var C=$(A[B]);if(C.lang&&C.lang==E){C.style.display="block"}else{C.style.display="none"}}}function showhideText(B){var A=B.selectedIndex;var D=B.options[A];var C=D.value;updatePicklists(B.form,C);updateInputFields(B.form,C)}function initShowhideText(A,C){var B=$(A);updatePicklists(B,C);updateInputFields(B,C)}function updatePicklists(A,D){var H=$$("rm-lang-picker","li",A);for(var E=0;E<H.length;E++){var C=H[E];C.style.display="block";var J=$$("rm-active-lang","select",C);for(var I=0;I<J.length;I++){var G=J[I];for(var F=0;F<G.options.length;F++){var B=(G.options[F].value==D);G.options[F].selected=B}}}}function initSelectList(L,M,E,H){var B=false;var D=(navigator&&navigator.appName)?navigator.appName.toLowerCase():null;if(D&&D.indexOf("opera")>=0){B=true}var A=E+"_0";var K=$(A);K.options.length=0;for(var F=0;F<L.subs.length;F++){var C=L.subs[F].option;var J=L.subs[F].idx;C.idx=J;var G=K.options.length;var I=C.selected?C.selected:C.defaultSelected;if(B){C.selected=I;C.defaultSelected=I}K.options[G]=C;if(!B){K.options[G].selected=I;K.options[G].defaultSelected=I}}alterOptions(E,H,M)}function alterOptions(D,A,B){for(i=0;i<(A-1);i++){var C=$(D+"_"+i);var E=$(D+"_"+(i+1));populateSubList(C,E,B)}}function populateSubList(K,C,M){var A=false;var E=(navigator&&navigator.appName)?navigator.appName.toLowerCase():null;if(E&&E.indexOf("opera")>=0){A=true}for(var I=0;I<K.options.length;I++){var D=K.options[I];if(D.selected){var L=D.idx;if($E.isIE){C.options.length=0}else{for(var G=(C.options.length-1);G>=0;G--){C.options[G].parentNode.removeChild(C.options[G])}}var F=M[L].subs;if(F!=null){new_length=F.length;for(var H=0;H<F.length;H++){var B=F[H].option;if(F[H].idx){var L=F[H].idx;B.idx=L}var J=B.selected!=null?B.selected:B.defaultSelected;if(A){B.selected=J;B.defaultSelected=J}C.options[H]=B;if(!A){C.options[H].selected=J;C.options[H].defaultSelected=J}}}}}}function validateUserName(A,D,H,J){var F="validate_";var E="/support/verification/username.jsp";var B=(A.srcElement||A.target);var I=Ramius.nodeUtils.getParentNodeByClassName(B,BUTTON_CLS);var C=F+I.id;var G=$(D).value;if(!H){H=$(C)}if(!H){H=$CE("span",C,"",I.parentNode)}E=E+"?username="+escape(G);if(J!=null){E+="&group_id="+J}if(Ramius.ajax.updater(H,E)==null){$rh(C,"Error connecting to Validation module")}var K=$fs($(D),"rm-submitError");if(K&&K.id!=H&&"text"!=K.type){K.style.display="none"}}var ModalManager={modals:[],getModal:function(){var B=-1;if(ModalManager.modals.length==0){ModalManager.modals[0]=new ModalManager.modalBuilder()}for(var A=0;A<ModalManager.modals.length;A++){if(!ModalManager.modals[A].isShown()){B=A;break}}if(B==-1){B=ModalManager.modals.length;ModalManager.modals[B]=new ModalManager.modalBuilder()}return ModalManager.modals[B]},getLastShown:function(){var A=ModalManager.modals,C=-1;for(var B=A.length-1;B>=0;B--){if(A[B].isShown()){C=B;break}}if(C==-1){C=0}return A[C]},commonStart:null,commonEnd:null,modalBuilder:function(){var overlay_id="rm-overlay";var overlay_el=$(overlay_id);var overlay_css="";var modal_wrap_id="rm-modalWrap";var default_modal_width="453";var modal_wrap_cls="rm-modalWrap";var modal_wrap=$(modal_wrap_id);var inner_modal_wrap_cls="rm-modal";var top_cls="rm-t";var bottom_cls="rm-b";var modal_bar_cls="rm-modalBar";var modal_id="rm-modalContent";var modal_cls="rm-modalContent";var modal_content_in_cls="rm-modalContentIn";var modal_bar,modal;var modal_onshow=null;var modal_instance=this;var modal_bar_html='<a href="javascript:void(0);" class="rm-closeModal">X</a>';var isLoaded=false;var shown=false;var modal_content=null;var pre_shown=false;var secondary_modal=false;var shim=null;var esc_listeners=null;var maximized=false;var restore_height=-1;var restore_width=-1;var modal_dd=null;var screen_scalable=false;var scale_x_offset=0;var scale_y_offset=0;var scale_x_min=450;var scale_x_max=1000;var scale_action=null;var scale_body_class="rm-bodyContentModal";if(overlay_el){overlay_id=overlay_id+new Date().getTime();overlay_el=null;overlay_css="rm-overlay";secondary_modal=true}if(modal_wrap){modal_wrap_id=modal_wrap_id+new Date().getTime();modal_id=modal_id+new Date().getTime();modal=modal_wrap=null}this.isShown=function(){return modal_instance.shown};this.getNode=function(){return modal_content};this.watchEscKey=function(event){var escKey=27;var keydowned=event.keyCode||event.which;if(keydowned==escKey){if(modal_bar.firstChild!=null&&typeof modal_bar.firstChild.onclick=="function"){modal_bar.firstChild.onclick(event)}else{if(modal_instance.shown){modal_instance.hide()}}}};var startShow=function(){modal_instance.verifyModal();if(typeof ModalManager.commonStart=="function"){ModalManager.commonStart()}var full_height=$D.getDocumentHeight();var full_width=$D.getDocumentWidth();overlay_el.style.height=full_height+"px";overlay_el.style.minWidth="1000px";overlay_el.style.display="block";overlay_el.style.opacity=0;overlay_el.style.filter="alpha(opacity=1)";if(!secondary_modal){var fadeAnim=new $A(overlay_el,{opacity:{from:0,to:0.6}},0.1);fadeAnim.animate()}else{if(!secondary_modal){overlay_el.style.opacity=0.6;overlay_el.style.filter="alpha(opacity=60)"}}modal_instance.pre_shown=true;modal_instance.lastRmModalInstance=rmModal;rmModal=modal_instance};this.registerEscape=function(){modal_instance.esc_listeners=$E.getListeners(document,"keydown");if(modal_instance.esc_listeners!=null){for(var i=0;i<modal_instance.esc_listeners.length;++i){var listener=modal_instance.esc_listeners[i];$E.removeListener(document,"keydown",listener.fn)}}$E.on(document,"keydown",modal_instance.watchEscKey)};this.setWidth=function(width){if(!width||width<=0){modal_wrap.style.width=default_modal_width+"px"}else{modal_wrap.style.width=width+"px"}};this.setHeight=function(height){if(!height||height<=0){modal_wrap.style.height=null}else{modal_wrap.style.height=height+"px"}};this.center=function(options){if(!options){options={}}modal_wrap.style.visibility="hidden";modal_content.style.display="block";modal_wrap.style.height="auto";var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var xpos=options.xpos?options.xpos:($D.getViewportWidth()/2)-(modal_wrap.offsetWidth/2)+scrollX;var viewable_height=$D.getViewportHeight();var modal_height=(modal_wrap.offsetHeight||modal_wrap.clientHeight);var ypos=options.ypos;if(ypos==null&&modal_height<viewable_height){ypos=((viewable_height/2)-(modal_height/2))+scrollY}else{if(ypos==null){ypos=scrollY}}if(ypos<0){ypos=0}if(xpos<0){xpos=0}if(options.xoffset){xpos+=options.xoffset}if(options.yoffset){ypos+=options.yoffset}if(!options.ypos&&modal_height<viewable_height&&(ypos-80)>scrollY){ypos-=60}if(ypos==0){ypos+=20}modal_wrap.style.top=ypos+"px";modal_wrap.style.left=xpos+"px";if(options.hide){modal_content.style.display="none"}else{modal_wrap.style.visibility="visible"}};this.findFocus=function(){var f_prio=["input","select","textarea","button","a"];var hasFocus=false;for(var i=0;i<f_prio.length;i++){var el_grp=modal_content.getElementsByTagName(f_prio[i]);for(var j=0;j<el_grp.length;j++){var cur=el_grp[j];if(cur&&(cur.disabled=="undefined"||!cur.disabled)&&(cur.readOnly=="undefined"||!cur.readOnly)&&(!cur.type||(cur.type.toLowerCase()!="hidden"&&cur.type.toLowerCase()!="checkbox"))){try{cur.focus();hasFocus=true}catch(ex){continue}break}}if(hasFocus){break}}};this.show=function(text,loadFunc,options){if($E.isIE&&!modal_instance.isLoaded){$E.onDOMReady(function(){modal_instance._show(text,loadFunc,options)})}else{modal_instance._show(text,loadFunc,options)}};this._show=function(text,loadFunc,options){this.verifyModal();if(!modal_instance.pre_shown){startShow()}this.setWidth(-1);if(typeof text=="object"){modal_content.innerHTML="";modal_content.appendChild(text)}else{modal_content.innerHTML=text}if(!options){options={}}if(typeof options.beforeModalShow=="function"){options.beforeModalShow(modal_instance)}var scripts=modal_content.getElementsByTagName("SCRIPT");for(var i=0;i<scripts.length;i++){if(scripts[i].innerHTML.indexOf("getRmModal().setWidth")>=0){(function(script){return window.eval(script.innerHTML)})(scripts[i]);scripts[i].parentNode.removeChild(scripts[i])}}modal_wrap.style.top="1px";modal_wrap.style.left="1px";modal_wrap.style.display="block";options.hide=true;var boxHeight=-1;boxHeight=parseInt(modal_content.offsetHeight);this.center(options);modal_content.style.display="none";var a=new $A(modal,{height:{from:1,to:boxHeight}},0.5,YAHOO.util.Easing.backOut);a.onComplete.subscribe(function(){modal_wrap.style.visibility="visible";modal_content.style.display="block";modal.style.height="auto";modal_content.style.zoom=1;Tooltips.init(Tooltips.generalTipClass,{parent_id:"rm-modalContent",setPosition:function(tip,r_to){tip.style.top=(($D.getY(r_to)-getRmModal().getY())-10)+"px";tip.style.left=(getRmModal().getWidth()-4)+"px"}});$rn.evalScripts(modal_content);if(!options.no_focus){modal_instance.findFocus()}modal_instance.registerEscape();if(typeof loadFunc=="function"){loadFunc(modal)}if(typeof modal_onshow=="function"){modal_onshow()}});a.animate();var lm=ModalManager.getLastShown();if(modal_instance!=lm){var oZ=parseInt($D.getStyle(lm.getOverlay(),"z-index"));if(isNaN(oZ)){oZ=parseInt(lm.getOverlay().style.zIndex)}modal_wrap.style.zIndex=oZ+3;overlay_el.style.zIndex=oZ+2;overlay_el.style.filter="alpha(opacity=1)";overlay_el.style.opacity="0.01"}if(!shim&&typeof drawShim!="undefined"&&typeof drawShim=="function"){shim=drawShim(overlay_el);shim.style.top=0;shim.style.left=0;shim.style.zIndex=parseInt($D.getStyle(overlay_el,"z-index"))-1;shim.style.width="100%"}if(shim){shim.style.display="block"}modal_instance.shown=true};this.setX=function(xpos){if(xpos>=0){modal_instance.getModal().style.left=xpos+"px"}};this.setY=function(ypos){if(ypos>=0){modal_instance.getModal().style.top=ypos+"px"}};this.getX=function(){return parseInt($D.getStyle(modal_instance.getModal(),"left"))};this.getWidth=function(){return parseInt(modal_instance.getModal().offsetWidth)};this.getHeight=function(){return parseInt(modal_instance.getModal().clientHeight||modal_instance.getModal().offsetHeight)};this.getY=function(){return parseInt($D.getStyle(modal_instance.getModal(),"top"))};this.getContent=function(){return modal_content};this.setContent=function(content,exec,validation){modal_wrap.style.visibility="hidden";modal_content.innerHTML="";if(typeof content=="string"){modal_content.innerHTML=content}else{if(typeof content=="object"){modal_content.appendChild(content)}else{modal_content=content}}if(validation){FormValidation.addFormValidation(modal_content)}this.setWidth(-1);var options={};options.hide=true;var boxHeight=-1;boxHeight=parseInt(modal_content.offsetHeight);if(exec){$rn.evalScripts(modal_content)}this.center();modal_content.style.display="block";modal_wrap.style.visibility="visible";Tooltips.init(Tooltips.generalTipClass,{parent_id:"rm-modalContent",setPosition:function(tip,r_to){tip.style.top=(($D.getY(r_to)-getRmModal().getY())-10)+"px";tip.style.left=(getRmModal().getWidth()-4)+"px"}});modal_instance.registerEscape()};this.hide=function(cascade){if(typeof ModalManager.commonEnd=="function"){ModalManager.commonEnd()}modal_wrap.style.display="none";modal_wrap.style.visibility="hidden";if(shim){shim.style.display="none"}var forms=modal_content.getElementsByTagName("form");if(forms!=null&&forms.length>0){for(var i=0;i<forms.length;i++){if(forms[i]!=null&&typeof forms[i].close=="function"){forms[i].close()}}}if(!secondary_modal){modal.style.height="auto";var fadeAnim=new $A(overlay_el,{opacity:{from:0.7,to:0}},0.2);fadeAnim.onComplete.subscribe(function(){overlay_el.style.display="none"});fadeAnim.animate()}else{overlay_el.style.display="none"}modal_instance.resetModal();modal_instance.shown=false;modal_instance.pre_shown=false;if(modal_instance.esc_listeners!=null){for(var i=0;i<modal_instance.esc_listeners.length;++i){var listener=modal_instance.esc_listeners[i];$E.on(document,"keydown",listener.fn)}}$E.removeListener(document,"keydown",modal_instance.watchEscKey);if(rmModal===this.lastRmModalInstance&&ModalManager.hideEmbeds!=null){var he=ModalManager.hideEmbeds;for(var i=0;i<he.length;i++){$rn.toggleEmbeds(he[i],false)}}if(this.lastRmModalInstance!=null){rmModal=this.lastRmModalInstance}if(this.newCloseAction){this.resetCloseAction();this.newCloseAction=false}$rc(document.documentElement,scale_body_class);if(cascade&&this.lastRmModalInstance!=null){rmModal.hide()}};this.addEvent=function(rowId,url){modal_instance.verifyModal();$E.on($(rowId),"click",function(e){var exception_cls="rm-exception";var thisEl=this;var target_el=(e.srcElement||e.target);var exceptionEl=$hc(target_el,exception_cls)?target_el:null;if(!exceptionEl){exceptionEl=$rn.getParentNodeByClassName(target_el,exception_cls)}if(!exceptionEl){this.getModalInput(url)}})};this.getModalInput=function(url,func){if($E.isIE&&!modal_instance.isLoaded){$E.onDOMReady(function(){modal_instance._getModalInput(url,func)})}else{modal_instance._getModalInput(url,func)}};this._getModalInput=function(url,func){modal_instance.verifyModal();var modal_el=$fc(modal_wrap,modal_cls);Ramius.ajax.request(url,{beforeStart:function(){startShow()},onComplete:function(respObject){modal_instance._show(respObject.responseText,func,{execJS:true})},onFailure:function(respObject){modal_instance.hide()}})};this.getOverlay=function(){return overlay_el};this.getModal=function(){return modal_wrap};this.addModalClass=function(cls){if(cls&&cls.length){$ac(modal_wrap,cls)}};this.getMaximized=function(){return maximized};this.maximize=function(max_el){var content_div=$("rm-item");if(maximized){modal_instance.restore(max_el);restore_width=restore_height=-1;return }modal_instance.fullScreen(max_el)};this.fullScreen=function(max_el){var content_div=$("rm-item");restore_height=modal_instance.getHeight();restore_width=modal_instance.getWidth();modal_instance.setX(0);modal_instance.setY(document.documentElement.scrollTop||document.body.scrollTop);var w=parseInt($D.getViewportWidth());modal_instance.setWidth(parseInt($D.getViewportWidth()));modal_instance.setHeight(parseInt($D.getViewportHeight()));if(content_div!=null){content_div.style.maxHeight=content_div.style.height=(parseInt($D.getViewportHeight())-55)+"px"}maximized=true;modal_bar.style.cursor="default";if(max_el!=null){$ac(max_el,"rm-restore")}$rc(document.documentElement,scale_body_class);$ac(document.documentElement,scale_body_class);if(modal_dd!=null){modal_dd.lock()}if(typeof modal_instance.scale_action=="function"){modal_instance.scale_action()}$E.removeListener(window,"resize",modal_instance.screenResize);$E.on(window,"resize",modal_instance.screenResize)};this.screenResize=function(){if(maximized){modal_instance.fullScreen()}else{if(screen_scalable){modal_instance.restore()}}};this.restore=function(rest_el){if(screen_scalable){var content_div=$("rm-item");var w=parseInt($D.getViewportWidth());var h=parseInt($D.getViewportHeight());var x_off=modal_instance.getScaleOffsetX()*2;var y_off=modal_instance.getScaleOffsetY()*2;if(x_off>0){w-=x_off}if(y_off>0){h-=y_off}if(scale_x_min>w){w=scale_x_min}if(w>scale_x_max){w=scale_x_max}$rc(document.documentElement,scale_body_class);$ac(document.documentElement,scale_body_class);modal_instance.setHeight(h);modal_instance.setWidth(w);if(content_div!=null){content_div.style.maxHeight=content_div.style.height=(h-55)+"px"}if(modal_dd!=null){modal_dd.lock()}$E.removeListener(window,"resize",modal_instance.screenResize);$E.on(window,"resize",modal_instance.screenResize)}else{if(restore_height>0&&restore_width>0){modal_instance.setHeight(restore_height);modal_instance.setWidth(restore_width);$rc(document.documentElement,scale_body_class);if(modal_dd!=null){modal_dd.unlock()}$E.removeListener(window,"resize",modal_instance.screenResize)}}$E.onDOMReady(modal_instance.center);maximized=false;modal_bar.style.cursor=screen_scalable?"default":"move";if(rest_el!=null){$rc(rest_el,"rm-restore")}if(typeof modal_instance.scale_action=="function"){modal_instance.scale_action()}};this.initScreenScalable=function(x_offset,y_offset,x_min,x_max){modal_instance.setScreenScalable(true);modal_instance.setScaleOffsetX(x_offset);modal_instance.setScaleOffsetY(y_offset);modal_instance.setScaleMinX(x_min);modal_instance.setScaleMaxX(x_max);modal_instance.restore()};this.setScreenScalable=function(scalable){screen_scalable=scalable};this.getScaleOffsetX=function(){return scale_x_offset>0?scale_x_offset:0};this.getScaleOffsetY=function(){return scale_y_offset>0?scale_y_offset:0};this.setScaleOffsetX=function(offset){scale_x_offset=offset};this.setScaleOffsetY=function(offset){scale_y_offset=offset};this.setScaleMinX=function(min){scale_x_min=min};this.setScaleMaxX=function(max){scale_x_max=max};this.resetModal=function(){modal_instance.resetModalClass();modal_instance.resetModalBar();maximized=false;screen_scalable=false;modal_bar.style.cursor="move";if(modal_dd!=null){modal_dd.unlock()}$E.removeListener(window,"resize",modal_instance.screenResize)};this.resetModalClass=function(cls){modal_wrap.className="rm-modalWrap"};this.setModalBarContent=function(html){modal_bar.innerHTML=html};this.resetModalBar=function(){modal_bar.innerHTML=modal_bar_html;modal_instance.resetCloseAction()};this.setModalCloseAction=function(func){if(typeof func=="function"){modal_bar.firstChild.onclick=func;this.newCloseAction=true}};this.setModalScaleAction=function(func){if(typeof func=="function"){modal_instance.scale_action=func}};this.setModalShowAction=function(func){if(typeof func=="function"){modal_onshow=func}};this.resetCloseAction=function(){if(modal_bar){modal_bar.firstChild.onclick=function(){modal_instance.hide();return false}}};this.verifyModal=function(){if(!modal_instance.isLoaded){if(!overlay_el){overlay_el=$CE("div",overlay_id,overlay_css,document.body)}if(!modal_wrap){modal_wrap=$CE("div",modal_wrap_id,modal_wrap_cls,document.body);var modal_inner_wrap=$CE("div",null,inner_modal_wrap_cls,modal_wrap);var modal_t=$CE("div",null,top_cls,modal_inner_wrap)}if(!modal_bar){modal_bar=$CE("div",null,modal_bar_cls,modal_inner_wrap,{innerHTML:modal_bar_html});modal_instance.resetCloseAction()}if(!modal){modal=$CE("div",modal_id,modal_cls,modal_inner_wrap);modal.style.zoom=1}if(!modal_content){modal_content=$CE("div",null,modal_content_in_cls,modal)}modal_instance.isLoaded=true;$D.generateId(modal_bar);modal_dd=new $DD(modal_wrap);modal_dd.setHandleElId(modal_bar.id);modal_dd.startDrag=function(){var obj_x=$D.getX(modal_instance.getModal());var cLeft=obj_x;var cRight=($D.getViewportWidth()-(obj_x+modal_instance.getWidth()+1));modal_dd.resetConstraints(true);modal_dd.setXConstraint(cLeft,cRight)};var modal_b=$CE("div",null,bottom_cls,modal_wrap);var modal_b_inner=$CE("div",null,null,modal_b)}};this.reload=function(url,exec,validate,onReload){Ramius.ajax.request(url,{method:"GET",onComplete:function(response){last_resp=response.responseText;if(typeof onReload=="function"){onReload(response)}getRmModal().setContent(last_resp,exec,validate)},onError:function(response){last_resp=response.responseText;if(typeof onReload=="function"){onReload(response)}getRmModal().setContent(last_resp,exec,validate)},onFailure:function(){}})};this.openUrl=function(url,m,exec,settings){if($E.isIE&&!modal_instance.isLoaded){$E.onDOMReady(function(){modal_instance._openUrl(url,m,exec,settings)})}else{modal_instance._openUrl(url,m,exec,settings)}};this._openUrl=function(url,m,exec,settings){if(!m){m="GET"}if(!settings){settings={}}var sFunc=(settings.no_val)?null:FormValidation.addFormValidation;Ramius.ajax.request(url,{method:m,beforeStart:function(){startShow()},onComplete:function(resp){var onshow=function(m_obj){if(typeof sFunc=="function"){sFunc(m_obj)}if(typeof settings.onComplete=="function"){settings.onComplete(resp)}};modal_instance._show(resp.responseText,onshow,{execJS:exec,no_focus:settings.no_focus})},onFailure:function(){modal_instance.hide()}})}}};var rmModal=getRmModal();function getRmModal(){if(rmModal==null){rmModal=ModalManager.getModal()}return rmModal}var REQUIRED_CLS="rm-isRequired",ERROR_CLS="rm-submitError";var FORM_ERROR_LIST="rm-form_error_list";var FORM_ERROR_WRAPPER="rm-form_error";var EMAILCLS="rm-email",URLCLS="rm-website",DAYCLS="rm-day",YEARCLS="rm-year";var SEC_VALIDATE="rm-optionalValidation";var SIMPLE_WHITESPACE="rm-simpleWhiteSpace";var FormValidation={validationSet:[],err_modal:null,getVsetVal:function(F,E){var C="",D=FormValidation.validationSet;if(!F||!F.length){return C}for(var A=(D.length-1);A>=0;A--){var B=D[A];if(B&&B.length){if(D[A][0]==F){C=D[A][E];break}}}return C},getErrorMessageByFieldName:function(A){return FormValidation.getVsetVal(A,2)},getLabelByFieldName:function(A){return FormValidation.getVsetVal(A,1)},getFunctionByFieldName:function(A){return FormValidation.getVsetVal(A,3)},getMinLengthByFieldName:function(A){return FormValidation.getVsetVal(A,4)},getMaxLengthByFieldName:function(A){return FormValidation.getVsetVal(A,5)},addFormValidation:function(D){var C=(D||document);var A=C.getElementsByTagName("form");for(var B=(A.length-1);B>=0;B--){$E.on(A[B],"submit",FormValidation.submitValidation)}},getLabelByFor:function(C,D){if(D!=null&&C!=null&&C.id!=null&&C.id.length>0){var E=D.getElementsByTagName("label");for(var B=0;B<E.length;B++){var A=(E[B].getAttribute("for")||E[B].getAttribute("htmlFor"));if(A!=null&&A.length>0&&A==C.id){return E[B]}}}return null},submitValidation:function(Q,S,B){var Y=false,I=[];var T=null;if(B==null){B={}}if(Q!=null){T=(this&&this.tagName&&this.tagName.toUpperCase()=="FORM")?this:(Q.srcElement||Q.target)}else{T=$(S)}T=T&&T.form?T.form:T;var M=null;if(!ncsv){M=$$(REQUIRED_CLS,null,T);M=$rf.uniqueMergeArray(M,$$(EMAILCLS,"input",T));M=$rf.uniqueMergeArray(M,$$(URLCLS,"input",T));M=$rf.uniqueMergeArray(M,$$(DAYCLS,"*",T));M=$rf.uniqueMergeArray(M,$$(YEARCLS,"*",T));M=$rf.uniqueMergeArray(M,$$(SEC_VALIDATE,"*",T));for(var P=(M.length-1);P>=0;P--){if($hc(M[P],"rm-clone-obj")){continue}if(M[P].form!=null&&M[P].form!==T){continue}var G=M[P],A=false,E=false,N=false;var D=G.type?G.type.toLowerCase():"";var C=FormValidation.getErrorMessageByFieldName(G.name);switch(D){case"checkbox":if(!$rf.getFieldValue(G)){A=true}break;case"radio":break;case"text":case"password":default:var K=$rf.getFieldValue(G,true);if($hc(G,SIMPLE_WHITESPACE)){K=Ramius.textUtils.simpleWhiteSpace(K)}if((!K||K.length==0||K=="")&&$hc(G,REQUIRED_CLS)){E=true;A=true}if(K&&K.length){var U=FormValidation.getMinLengthByFieldName(G.name);if(K.length<U){C=DEFAULT_MSG_SUFFIXES.minLength.replace("{0}",U);E=true;A=true}var R=FormValidation.getMaxLengthByFieldName(G.name);if(R>0&&K.length>R){C=DEFAULT_MSG_SUFFIXES.maxLength.replace("{0}",R);E=true;A=true}}if(!A&&K&&K.length){if($hc(G,DAYCLS)){try{var H=Ramius.nodeUtils.getParentNodeByClassName(G,"calGroup");var X=$rf.getFieldValue($$("rm-month",null,H)[0],true);if(!$rf.validateDay(X,K)){if(!C.length){C=DEFAULT_MSG_SUFFIXES.url;E=true}A=true}}catch(W){}}else{if(($hc(G,EMAILCLS)&&!$rf.validateEmail(K))||($hc(G,"rm-websiteFull")&&!$rf.validateFullUrl(K))||($hc(G,"rm-websiteUnc")&&!$rf.validateUncUrl(K))||($hc(G,URLCLS)&&!$rf.validateUrl(K))||($hc(G,YEARCLS)&&!$rf.validateYear(K))){if(!C.length){C=DEFAULT_MSG_SUFFIXES.url;E=true}A=true}}}}if(!A&&G.name){var F=FormValidation.getFunctionByFieldName(G.name);if(F&&typeof F=="function"){var J=F(G,$rf.getFieldValue(G,true));if(J&&J.has_error){if(J.err_msg){C=J.err_msg}N=J.noLabel;A=true}}}if(A){$ac(G,ERROR_CLS);Y=true;var V=N?"":FormValidation.getLabelByFieldName(G.name);if(V==""&&E&&!N&&G.parentNode!=null){var O=G.parentNode.getElementsByTagName("label")[0];if(O==null){O=FormValidation.getLabelByFor(G,T)}if(O!=null){var L=O.getElementsByTagName("abbr");V=(O.innerText||O.textContent);if(L!=null){V=V.replace(" *","")}}}I[I.length]=[V,G,C]}else{$rc(G,ERROR_CLS)}}if(Y){FormValidation.showErrorModal(I);if(Q!=null){Event.stop(Q)}if(typeof B.onError=="function"){B.onError(T,I)}return false}}FormValidation.formModified=false;disableForm(T);if(typeof B.onSuccess=="function"){B.onSuccess(T)}return true},clearValidationSet:function(A){var F=FormValidation.validationSet;var E=[];var B=0;for(var C=0;C<F.length;C++){var D=F[C];if(D[5]!=A){E[B++]=D}}FormValidation.validationSet=E},addValidationSet:function(B,D,A,F,C,E){FormValidation.validationSet[FormValidation.validationSet.length]=[D,A,F,C,E,B]},showErrorModal:function(N,O){var C,B;var J=ModalManager.getLastShown();var M=null;M=ModalManager.getModal();if(FormValidation.err_modal!=null&&FormValidation.err_modal.shown){return }FormValidation.err_modal=M;if(!O){O={}}var E=$$(FORM_ERROR_LIST,null,FORM_ERROR_WRAPPER)[0];E=E.cloneNode(false);for(var G=(N.length-1);G>=0;G--){var D=Ramius.textUtils.trim(N[G][0]);if(!N[G][2].length){N[G][2]=DEFAULT_MSG_SUFFIXES.base}var L=!D||!D.length?""+N[G][2]:'"'+D+'" '+N[G][2];if(L!=B){if(N[G][1]&&!N[G][1].id){$D.generateId(N[G][1])}var H=$CE("a",null,"",$CE("li",null,null,E),{href:"#",innerHTML:L});H.onclick=function(){return false};$E.on(H,"click",function(P,Q){if(Q){Q.focus();M.hide()}return false},N[G][1])}B=L}var K=$(FORM_ERROR_WRAPPER).cloneNode(true);var F=$$(FORM_ERROR_LIST,null,K)[0];K.insertBefore(E,F);K.removeChild(F);$ac(K,"rm-errorModal");F=null;K.id="";if(O.no_description){var I=$$("rm-error_description","p",K)[0];if(I){I.parentNode.removeChild(I)}}var A=$$(BUTTON_CLS,BUTTON_EL,K)[0];$E.removeListener(A);$E.on(A,"click",function(Q,P){P.hide()},M);K.style.display="block";if(J&&M&&M!=J){M.show(K,null,{xpos:(J.getX()+20),ypos:(J.getY()+40)})}else{M.show(K)}},formModified:false,EXIT_MSG:"You have made unsaved changes to the page. Are you sure you wish to leave?",warnOnUnload:function(B,G){if(!G){G={}}if(!B||!B.length){B=document.getElementsByTagName("FORM")}if(!B){return }if(typeof B!="array"){B=[B]}for(var F=(B.length-1);F>=0;F--){var E=B[F].elements;for(var D=(E.length-1);D>=0;D--){var C=E[D].tagName&&E[D].tagName.toLowerCase();if(C.length&&C!=BUTTON_TAG&&C!="fieldset"){$E.on(E[D],"blur",A,E[D].value)}}}function A(I,J){var H=(I.target||I.srcElements);if(J!=H.value){FormValidation.formModified=true}}$E.on(window,"beforeunload",FormValidation.formUnload)},formUnload:function(A){if(FormValidation.formModified){if(confirm(FormValidation.EXIT_MSG)){Event.stop(A);window.status=""}}},onFormChange:function(B,C){var A=$(B).elements;FormValidation.onFormElementsChange(A,C)},onFormElementsChange:function(C,D){if(!C||!C.length){return }for(var B=(C.length-1);B>=0;B--){var A=(C[B].tagName)?C[B].tagName.toLowerCase():"";if(A.length&&A!=BUTTON_TAG&&A!="fieldset"){FormValidation.watchFormElementChange(C[B],D)}}},watchFormElementChange:function(B,D){if(!B.tagName&&!B.type){return }var C="blur";switch(B.tagName.toLowerCase()){case"input":switch(B.type.toLowerCase()){case"password":case"text":C="keyup";break;case"radio":case"checkbox":C="click";break}break;case"select":C="change";break}$E.on(B,C,A,$rf.getFieldValue(B));function A(F,G){var E=(F.target||F.srcElements);if(G!=$rf.getFieldValue(E)){if(D&&typeof D=="function"){D(E)}}}}};var newCaptcha=function(A){$((A||"rm-captchaImage")).src="/captcha?type=image&ts="+new Date().getTime()};var TabLayout={enableTabbedLayout:function(G,D){if(!D){D={}}var M=D.content_cls||"rm-tabbedContent";var L=D.tab_content_type||"div";var H=D.tab_cls||"rm-tab";var J=D.tab_el_type||"li";var F=D.selected_cls||"rm-current";var N=this;var B=null;var A=D.start_tab||0;var K=$$(H,J,G);var C=D.tabChangeValidation;var O=(D.click_to_close==true);var E=D.onTabChange;var I=D.start_el;this.initGroup=function(){for(var P=0;P<K.length;P++){N.registerUpdateTab(K[P],K)}};this.getCurrentTab=function(){return B};this.getCurrentContent=function(){var P=$$(M,L,B);return P&&P.length>0?P[0]:null};this.setCurrentTab=function(P){B=P;if(typeof E=="function"){E(B,K,N)}};this.getTabValidation=function(S,R){if(C&&C.length){var P=N.getCurrentTabPosition();for(var Q=0;Q<C.length;Q++){if(C[Q].tab==P){return C[Q].func}}}};this.registerUpdateTab=function(Q,P){if(Q!=null&&Q.getElementsByTagName("a")!=null&&Q.getElementsByTagName("a").length>0){var R=Q.getElementsByTagName("a")[0];$E.on(R,"click",function(S){N.updateTab(Q,P)});R.onclick=function(){return false}}};this.updateTab=function(P,U){var X=true;var W=N.getTabValidation(N.getCurrentTab(),U);if(W&&typeof W=="function"){X=W()}if(X&&P!=null&&P.getElementsByTagName("a")!=null&&P.getElementsByTagName("a").length>0){var Q=P.getElementsByTagName("a")[0];var Y=Q.href;var V=Y.substr(Y.indexOf("#")+1,Y.length);var R=$$(M,L);for(var T=0;T<U.length;T++){$rc(U[T],F)}if(O&&B===P){for(var S=0;S<R.length;S++){R[S].style.display="none"}N.setCurrentTab(null);return }$ac(P,F);for(var S=0;S<R.length;S++){if(R[S].id!=V){R[S].style.display="none"}else{R[S].style.display="block"}}N.setCurrentTab(P)}};this.getCurrentTabPosition=function(){var Q=-1;for(var P=0;P<K.length;P++){if(K[P]==B){Q=P;break}}return Q};this.showNextTab=function(){var P=N.getCurrentTabPosition()+1;if(!K[P]){P=0}N.updateTab(K[P],K)};this.showPreviousTab=function(){var P=N.getCurrentTabPosition()-1;if(!K[P]){P=0}N.updateTab(K[P],K)};this.showTabContainingElement=function(R){if(R==null){return }var P=$rn.getParentNodeByClassName(R,M);if(P!=null){var T=null;for(var Q=0;Q<K.length;Q++){var U=K[Q].getElementsByTagName("a")[0];var S=U.href;if(S.indexOf(P.id)>=0){T=K[Q];break}}if(T!=null){this.updateTab(T,K)}}};this.initGroup();if(I!=null){this.showTabContainingElement(I)}else{if(A>=0){this.updateTab(K[A],K)}}}};function disableForm(C){var B=$(C);if(B&&B.tagName&&B.tagName.toLowerCase()=="form"){var D=$$(SUBMIT_CLS,BUTTON_TAG,B);for(var A=(D.length-1);A>=0;A--){var E=D[A];if(E){E.disabled=true;if(!$hc(E,BUTTON_CLS)){E=$rn.getParentNodeByClassName(E,BUTTON_CLS);$ac(E,BUTTON_DISABLED)}}}}}function enableForm(C){var B=$(C);if(B&&B.tagName&&B.tagName.toLowerCase()=="form"){var D=$$(SUBMIT_CLS,BUTTON_TAG,B);for(var A=(D.length-1);A>=0;A--){var E=D[A];if(E){E.disabled=false;if(!$hc(E,BUTTON_DISABLED)){E=$rn.getParentNodeByClassName(E,BUTTON_DISABLED);$rc(E,BUTTON_DISABLED)}}}}}function submitAJAX(D,I,J,K,L){var H=$(I);if(!J){J=false}if(L==null){L={}}if(H&&!H.ajaxFormSubmitted){var C=H.method;if(!C){C="POST"}var E=H.action;if(!E){return false}if(typeof tinymce!="undefined"){var B=$$("wysiwygField","textarea",I);for(var F=0;F<B.length;F++){var G=tinymce.EditorManager.get(B[F].id);B[F].value=G.getContent()}}if(D!=null){Event.stop(D)}var A=FormValidation.submitValidation(null,I,L);if(A){if(typeof tinymce!="undefined"){var B=$$("wysiwygField","textarea",I);for(var F=0;F<B.length;F++){G.initialized=false;B[F].style.display="none"}}H.ajaxFormSubmitted=true;Ramius.ajax.request(E,{upload:K,form:H,method:C,onUpload:function(M){enableForm(H);if(J&&J.onUpload){J.onUpload(M,J.params)}H.ajaxFormSubmitted=false},onComplete:function(M){enableForm(H);if(J&&J.onComplete){J.onComplete(M,J.params)}H.ajaxFormSubmitted=false},onError:function(N){enableForm(M);if(J&&J.onError){J.onError(N,J.params)}var M=$(I);if(M){M.ajaxFormSubmitted=false}},onFailure:function(M){H.ajaxFormSubmitted=false;enableForm(H);getRmModal().hide()}})}}}function simpleAJAX(B,D,A,C){Ramius.ajax.request(B,{method:"GET",onComplete:function(E){last_resp=E.responseText;var F=$(D);if(F!=null){F.innerHTML=last_resp;$rn.evalScripts(F);if(C!=null){C()}}},onFailure:function(E){last_resp=response.responseText;var F=$(A);if(F!=null){F.innerHTML=last_resp;$rn.evalScripts(F)}}})}function simpleAJAXPost(F,A,E,G,D,B){var C={onError:function(H,I){last_resp=H.responseText;loadResponse(G,last_resp)},onComplete:function(H,I){last_resp=H.responseText;loadResponse(E,last_resp);if(D){D()}}};submitAJAX(F,A,C,false,B)}function loadResponse(A,B){var C=$(A);if(C!=null){C.innerHTML=B;$rn.evalScripts(C)}}function modalPost(E,A,F,C,B){var D={onError:function(G,H){last_resp=G.responseText;getRmModal().setContent(last_resp,true)},onUpload:function(G,H){last_resp=G.responseText;getRmModal().setContent(last_resp,true)},onComplete:function(G,I){last_resp=G.responseText;var H=$(F);if(H!=null){H.innerHTML=last_resp;$rn.evalScripts(H)}getRmModal().hide()}};submitAJAX(E,A,D,C,B)}var SearchableList={initListByClassName:function(F,E,C,D){if(!D){D={}}var G=$(F);var A=$(E);var B=$$(C,D.item_type,D.itemset_parent);if(F&&B.length){return new SearchableList.createFilteredSearch(G,A,B,D)}return null},createFilteredSearch:function(B,F,E,C){var I=SearchableList.getFilterableList(E,C.filterFunction);var G=$(C.resetButton);var A=$(C.customButton);if(G){$E.on(G,"click",SearchableList.resetList,{"infield":B,"infield_2":F,"items":E,"showFunction":C.showFunction,"emptyLabel":C.no_result})}if(A){$E.on(A,"click",SearchableList.resetList,{"infield":B,"infield_2":F,"items":E,"showFunction":C.customShow,"emptyLabel":C.no_result,"itemType":C.item_type})}if(C.customActions){var H=C.customActions;for(var D=H.length-1;D>=0;D--){$E.on(H[D].target,(H[D].event||"click"),H[D].actionFunction,{"items":E,"infield":B,"infield_2":F,"showFunction":C.showFunction})}}$E.on(B,"keydown",function(K){var J=K.keyCode||K.which;if(J==13){Event.stop(K);return false}});if(F){$E.on(F,"change",SearchableList.keyWatch,{"filterList":I,"items":E,"infield":B,"infield_2":F,"hideFunction":C.hideFunction,"showFunction":C.showFunction,"emptyLabel":C.no_result,"itemType":C.item_type})}$E.on(B,"keyup",SearchableList.keyWatch,{"filterList":I,"items":E,"infield":B,"infield_2":F,"hideFunction":C.hideFunction,"showFunction":C.showFunction,"emptyLabel":C.no_result,"itemType":C.item_type});return{"filterList":I,"items":E,"infield":B,"infield_2":F,"hideFunction":C.hideFunction,"showFunction":C.showFunction,"emptyLabel":C.no_result,"itemType":C.item_type}},keyWatch:function(B,D){var I=Ramius.textUtils.trim(D.infield.value.toLowerCase());var H=D.infield_2.value.toLowerCase();if(I=="filter..."){I=""}var G=D.filterList,F=D.items;if(!I.length&&!H.length){SearchableList.resetList(B,D);return }var A=false;var C=(F&&F[0])?$(F[0].className+"_temp"):null;if(C){C.parentNode.removeChild(C)}for(var E=0;E<G.length;E++){var K=F[E];if($("rm-filterableList")!=null){if($hc(K,"rm-selected")&&$hc($("rm-filterableList"),"rm-filterUnselected")){continue}if(!$hc(K,"rm-selected")&&$hc($("rm-filterableList"),"rm-filterSelected")){continue}}var J=G[E]?" "+G[E].toLowerCase():null;if(J){if(I.length>0&&J.indexOf(" "+I)<0){SearchableList.hideItem(F[E],D.hideFunction)}else{if(H.length>0&&J.indexOf(H)<0){SearchableList.hideItem(F[E],D.hideFunction)}else{SearchableList.showItem(F[E],D.showFunction);A=true}}}}if(!A){if(!C&&F[0]){$CE(D.itemType,F[0].className+"_temp",null,F[0].parentNode,{innerHTML:D.emptyLabel})}}},hideItem:function(A,B){if(B&&typeof B=="function"){B(A)}else{A.parentNode.style.display="none"}},showItem:function(B,A){if(A&&typeof A=="function"){A(B)}else{B.parentNode.style.display="block"}var C=(B)?$(B.className+"_temp"):null;if(C){C.parentNode.removeChild(C)}},resetList:function(C,E){var D=E.infield;var A=E.items;if(D&&A){for(var B=(A.length-1);B>=0;B--){SearchableList.showItem(A[B],E.showFunction)}}},getFilterableList:function(D,C){var A=[],E=D.length;for(var B=0;B<E;B++){if(C&&typeof C=="function"){A[B]=C(D[B])}else{A[B]=D[B].innerHTML?D[B].innerHTML:""}}return A}};var MicroTip={tip:null,timeoutShow:null,timeoutTime:300,addTip:function(C,B,A){if(typeof C=="string"){C=$(C)}if(!C||!B||!B.length){return }$E.on(C,"mouseover",MicroTip.showTip,{element:C,text:B,clone_id:A});$E.on(C,"mouseout",MicroTip.hideTip,{element:C})},showTip:function(D,E){if(!E||!E.element||!E.text){return }if(!MicroTip.tip){MicroTip.tip=$CE("div","rm-microTip",null,document.body)}if(!MicroTip.tip){return }var C=E.clone_id?$(E.text).innerHTML:E.text;if(E.clone_id){MicroTip.tip.className=$(E.text).className}MicroTip.tip=$rh(MicroTip.tip,C);var B=$E.getPageX(D),A=$E.getPageY(D);MicroTip.timeoutShow=setTimeout(function(){MicroTip.followCursor(null,{xpos:B,ypos:A});MicroTip.tip.style.display="block";MicroTip.timeoutShow=null;$E.on(E.element,"mousemove",MicroTip.followCursor,E)},MicroTip.timeoutTime)},hideTip:function(A,B){if(MicroTip.tip==null||!B||!B.element){return }MicroTip.tip.style.display="none";MicroTip.tip.className="";if(MicroTip.timeoutShow){window.clearTimeout(MicroTip.timeoutShow)}$E.removeListener(B.element,MicroTip.followCursor)},followCursor:function(C,D){if(MicroTip.tip){var A,E,B=$D.getViewportWidth();if(!C&&D.xpos&&D.ypos){A=D.xpos+10;E=D.ypos+10}else{A=($E.getPageX(C)+10);E=($E.getPageY(C)+10)}if((A+MicroTip.tip.offsetWidth)>B){A=(B-MicroTip.tip.offsetWidth)}MicroTip.tip.style.top=E+"px";MicroTip.tip.style.left=A+"px"}}};var KeyNav={active:false,elementClass:null,focusElement:null,lastElement:null,lastHighlight:null,shiftDown:false,p_id:null,el_type:null,actionData:{},hlClass:"rm-highlightElement",skipHidden:null,upKey:38,downKey:40,defaultIdx:0,enterKey:13,tabKey:9,leftKey:37,rightKey:39,lockout:false,shiftKey:16,escKey:27,deleteKey:46,spaceKey:32,offsetHeight:53,lastKey:null,isOpera:false,initKeyNavigation:function(B,E,C){if(!B){return }if(!C){C={}}KeyNav.p_id=C.parentId;KeyNav.skipHidden=C.skipHidden;KeyNav.el_type=C.elementType;KeyNav.elementClass=B;for(var A=0;E&&A<E.length;A++){var D=E[A];if(D.key){KeyNav.actionData["k"+D.key]=D}}if(C.highlightClass){KeyNav.hlClass=C.highlightClass}$E.on(document,"keydown",KeyNav.watchKeyNavigation);var F=(navigator&&navigator.appName)?navigator.appName.toLowerCase():null;if(F&&F.indexOf("opera")>=0){KeyNav.isOpera=true}KeyNav.active=true},pause:function(){KeyNav.active=false},resume:function(){KeyNav.active=true},watchKeyNavigation:function(E){if(!KeyNav.active||!KeyNav.elementClass){return }var B=E.keyCode||E.which;function D(I){var H=I.keyCode||I.which;if(H==KeyNav.shiftKey&&KeyNav.shiftDown){KeyNav.shiftDown=false;$E.removeListener(document,"keyup",D)}}if(B==KeyNav.shiftKey){KeyNav.shiftDown=true;$E.on(document,"keyup",D);return }switch(B){case KeyNav.tabKey:case KeyNav.upKey:case KeyNav.downKey:case KeyNav.leftKey:case KeyNav.rightKey:if(KeyNav.isOpera&&(B==KeyNav.upKey||B==KeyNav.downKey||B==KeyNav.tabKey)){return }Event.stop(E);if(KeyNav.tabKey==B){if(KeyNav.shiftDown){KeyNav.previousElement()}else{KeyNav.nextElement()}}else{if(B==KeyNav.upKey||B==KeyNav.leftKey){KeyNav.previousElement()}else{if(B==KeyNav.downKey||B==KeyNav.rightKey){KeyNav.nextElement()}}}if(KeyNav.focusElement){var F=(document.documentElement.scrollTop||document.body.scrollTop)+KeyNav.offsetHeight;var C=$D.getViewportHeight()+(F-KeyNav.offsetHeight);var G=$D.getY(KeyNav.focusElement);var A=KeyNav.focusElement.offsetHeight;if((G+A)>C){window.scroll(0,(G+A)-(KeyNav.offsetHeight*2))}else{if(G<F){window.scroll(0,G-KeyNav.offsetHeight)}}}break;case KeyNav.enterKey:case KeyNav.spaceKey:case KeyNav.deleteKey:case KeyNav.copyKey:if(KeyNav.isOpera&&B==KeyNav.spaceKey){return }if(KeyNav.focusElement||KeyNav.lastElement){Event.stop(E)}if(window.ajaxInProgress){return }if(!KeyNav.focusElement&&KeyNav.lastElement){KeyNav.focusElement=KeyNav.lastElement}KeyNav.actionElement(E,B);break;case KeyNav.escKey:if(!KeyNav.focusElement&&KeyNav.lastElement){KeyNav.focusElement=KeyNav.lastElement}KeyNav.reset();default:break}},nextElement:function(){var B=KeyNav.getElements();if(KeyNav.lastElement&&!KeyNav.focusElement){KeyNav.focusElement=KeyNav.lastElement}var A=KeyNav.currentIndex(KeyNav.focusElement,B);if(A<0){A=KeyNav.currentIndex(KeyNav.lastHighlight,B)}if(A<0){A=KeyNav.defaultIdx}else{if(A==B.length-1){A=0}else{A++}}KeyNav.setHighlight(B,A);KeyNav.lockout=false},previousElement:function(){var B=KeyNav.getElements();if(KeyNav.lastElement&&!KeyNav.focusElement){KeyNav.focusElement=KeyNav.lastElement}var A=KeyNav.currentIndex(KeyNav.focusElement,B);if(A<0){A=KeyNav.currentIndex(KeyNav.lastHighlight,B)}if(A<0){A=KeyNav.defaultIdx}else{if(A==0){A=B.length-1}else{A--}}KeyNav.setHighlight(B,A);KeyNav.lockout=false},setHighlightByElement:function(A){if(KeyNav.focusElement){$rc(KeyNav.focusElement,KeyNav.hlClass)}KeyNav.lastHighlight=KeyNav.focusElement;KeyNav.focusElement=A;$ac(KeyNav.focusElement,KeyNav.hlClass)},setHighlight:function(B,A){if(B&&B.length){if(KeyNav.focusElement){$rc(KeyNav.focusElement,KeyNav.hlClass)}KeyNav.lastHighlight=KeyNav.focusElement;KeyNav.focusElement=B[A];$ac(KeyNav.focusElement,KeyNav.hlClass)}},getElements:function(){var C=$rn.getElementsByClasses(KeyNav.elementClass,KeyNav.el_type,KeyNav.p_id);var D=[];for(var B=0;B<C.length;B++){var A=$rn.getParentNodeByClassName(C[B],KeyNav.skipHidden);if(!$rn.isHidden(C[B])&&!$rn.isHidden(A)){D[D.length]=C[B]}}return D},actionElement:function(event,key){if(!KeyNav.focusElement||!KeyNav.focusElement.parentNode||KeyNav.lockout&&key==KeyNav.lastKey){return }if(!key&&event){key=event.keyCode||event.which}var action=(KeyNav.actionData)?KeyNav.actionData["k"+key]:null;if(action&&action.actionClass&&action.action&&KeyNav.focusElement){var action_els=$$(action.actionClass,action.actionElType,KeyNav.focusElement);if(!action_els||!action_els.length){action_els=$$(action.altActionClass,action.actionElType,KeyNav.focusElement);if(!action_els||!action_els.length){return }}for(var a_inc=(action_els.length-1);a_inc>=0;a_inc--){var action_el=action_els[a_inc];var l=$E.getListeners(action_el,action.action);if(l){for(var i=0;i<l.length;l++){if(l[i].fn){l[i].fn(event)}}}else{if(action.action=="click"&&action_el.onclick){if(action_el.type&&action_el.type.toLowerCase()=="checkbox"){if(action_el.disabled==true){return }action_el.checked=action_el.checked?false:true}if(typeof action_el.onclick=="string"){eval(action_el.onclick)}else{if(typeof action_el.onclick=="function"){action_el.onclick(event)}}}}}KeyNav.lastElement=KeyNav.focusElement;KeyNav.focusElement=null;if(action.lockout){KeyNav.lockout=true;KeyNav.lastKey=key}else{KeyNav.lockout=false;KeyNav.lastKey=-1}}},currentIndex:function(D,C){var A=-1;if(!C||!D||!C.length){return A}for(var B=(C.length-1);B>=0;B--){if(C[B]==D){A=B;break}}return A},reset:function(){if(KeyNav.focusElement){$rc(KeyNav.focusElement,KeyNav.hlClass);KeyNav.focusElement=null;KeyNav.lastElement=null;KeyNav.lastHighlight=null}}};function genHiddenValue(F,C,B){var E=$(C);var H=E.getElementsByTagName(BUTTON_TAG)[0];var G=F.srcElement||F.target;if(H&&G!=H){H.click();return }if(F&&H&&H.form&&H.name){if(!B){B={}}var A=B.tag||"input";var D=B.type||"hidden";$CE(A,null,null,H.form,{name:H.name,value:(H.value||""),"type":D})}}var cleanupMCE=function(B){if(typeof tinymce!="undefined"){var A=$$("wysiwygField","textarea",B);for(var D=0;D<A.length;D++){var C=tinymce.EditorManager.get(A[D].id);if(C!=null){C.initialized=false;C.remove()}}}};function folderTreeFocus(A,B,G){var H=$(B);var C=parseInt($rf.getFieldValue(H));var I=H.selectedIndex;var E=H.options[I];if(E.disabled){E.selected=false;var F;for(var D=0;D<H.options.length;D++){if(H.options[D].value==G||(G==-1&&!H.options[D].disabled)){H.options[D].selected=true;return false}}}else{return true}return false}var TagInput={init:function(G,A,I){G.tag=new TagField(G,I);G.tag.cloud_el=$$("rm-suggestTagsDropWrap","div",G)[0];G.tag.input_el=$$("rm-mainInput","input",G)[0];G.tag.hidden_el=$$("rm-tagHiddenInput","input",G)[0];G.tag.suggestUrl=A;G.tag.suggest=G.tag.options.suggest;var H=$$("rm-tagDeleteBtn","a",G);var C=$$("rm-showTagCloud","a",G)[0];var E=$$("rm-hideTagCloud","a",G)[0];var F=$$("rm-tagSuggestResults","div",G)[0];$E.on(C,"click",function(){G.tag.cloudVisible(true)});$E.on(E,"click",function(){G.tag.cloudVisible(false)});$E.on(G.tag.input_el.parentNode.parentNode,"click",function(){G.tag.enableInput()});for(var D=0;D<H.length;D++){$E.on(H[D],"click",G.tag.removeTag)}var B=A.indexOf("?")>=0?"&":"?";if(G.tag.suggest&&A&&A.length>0){Ramius.suggest.tagSuggest(G,F,A+B+"json=1")}},selectTag:function(A){var C=A.childNodes[0].innerHTML;var B=$rn.getParentNodeByClassName(A,"rm-tagInputWrap");if($hc(A,"rm-tagSelected")){TagInput.removeTag(B,C)}else{B.tag.addTag(C)}B.tag.enableInput()},highlightCloud:function(E,D,A){var B=$$("rm-tag","li",E.cloud_el);for(var C=0;C<B.length;C++){if(D==null||D.toLowerCase()==B[C].childNodes[0].innerHTML.toLowerCase()){$rc(B[C],"rm-tagSelected");if(A){$ac(B[C],"rm-tagSelected")}if(D!=null){break}}}},cloudFilter:function(D,A,C){var H=D.srcElement||D.target;var G=$rn.getParentNodeByClassName(H,"rm-tagInputWrap");var F=G.tag.cloud_el.childNodes[0];var E=G.tag.suggestUrl.indexOf("?")>=0?"&":"?";var B=G.tag.hidden_el.value?E+"tags="+escape(G.tag.hidden_el.value):"";if(A){B+=B.length>0?"&":E;B+="location="+A}if(C){B+=B.length>0?"&":E;B+="sort="+C}Ramius.ajax.updater(F,G.tag.suggestUrl+B,{evalScripts:true})},copyInput:function(B,A){var H=$(B);var F=$(A);if(H&&F&&H.tag&&F.tag){F.tag.enableInput(false);var E=$$("rm-tagDelete","li",H);var D=$$("rm-tagDelete","li",F);for(var C=0;C<D.length;C++){D[C].parentNode.removeChild(D[C])}TagInput.highlightCloud(F.tag,null,false);for(var C=0;C<E.length;C++){var G=E[C].childNodes[0].innerHTML;F.tag.addTag(G)}}},removeTag:function(E,D){var A=$$("rm-tagText","span",E.tag.input_el.parentNode.parentNode);for(var B=0;B<A.length;B++){var C=null;if(A[B].innerText){C=A[B].innerText}else{C=A[B].textContent}if(C.toLowerCase()==D.toLowerCase()){A[B].parentNode.parentNode.removeChild(A[B].parentNode);break}}E.tag.updateField();if(E.tag.suggest){TagInput.highlightCloud(E,D,false)}}};function TagField(B,A){this.options=!A?{}:A;this.target=B;this.expired=true;this.suggest=true;this.suggestLoaded=false;this.cloud_el;this.input_el;this.hidden_el;this.suggestUrl;this.cloudVisible=function(C){if(this.suggest&&C!=$hc(this.target,"rm-tagInputFull")){var F=this.cloud_el.childNodes[0];this.cloudAnimate(C);if(!this.suggestLoaded&&C){var E=this.suggestUrl.indexOf("?")>=0?"&":"?";var D=this.hidden_el.value?E+"tags="+escape(this.hidden_el.value):"";var G=new Function("try{var tag_el = $('"+this.target.id+"');tag_el.tag.cloudAnimate(true);tag_el.tag.suggestLoaded = true;}catch(e){}");Ramius.ajax.updater(F,this.suggestUrl+D,{evalScripts:true,onComplete:G})}}};this.cloudAnimate=function(G){var C=this.cloud_el;var I=this.cloud_el.childNodes[0];var H=(I.clientHeight||I.offsetHeight)+8;var F=this.cloud_el.clientHeight||this.cloud_el.offsetHeight;var D=!G?0:H;$rc(this.target,"rm-tagInputFull");if(G){$ac(this.target,"rm-tagInputFull")}var E=new YAHOO.util.Anim(this.cloud_el,{height:{from:F,to:D}},0.2,YAHOO.util.Easing.easeOut);if(G){E.onComplete.subscribe(function(){C.style.height="auto"})}E.animate()};this.updateField=function(){var C=$$("rm-tagText","span",this.input_el.parentNode.parentNode);var E="";for(var D=0;D<C.length;D++){if(E.length>0){E+=","}if(C[D].innerText){E+=C[D].innerText}else{E+=C[D].textContent}}this.hidden_el.value=E};this.removeTag=function(C){var F=C.srcElement||C.target;var E=$rn.getParentNodeByClassName(F,"rm-tagInputWrap");var D=F.parentNode.childNodes[0].innerHTML;F.parentNode.parentNode.removeChild(F.parentNode);E.tag.updateField();if(E.tag.suggest){TagInput.highlightCloud(E,D,false)}};this.addTag=function(J){if(!J){return }J=Ramius.textUtils.trim(J);var H=this.hidden_el.value.match(new RegExp("^(.*,)?[\\s]*"+Ramius.textUtils.escapeRegEx(J)+"[\\s]*(,.*)?$","gi"));if(H){var F=$$("rm-tagText","span",this.input_el.parentNode.parentNode);for(var G=0;G<F.length;G++){var I=null;if(F[G].innerText){I=F[G].innerText}else{I=F[G].textContent}if(I.toLowerCase()==J.toLowerCase()){F[G].parentNode.parentNode.removeChild(F[G].parentNode);break}}}if(J.length>0){var D=document.createElement("li");D.className="rm-tag rm-tagDelete";var C=document.createElement("span");var E=document.createElement("a");C.className="rm-tagText";C.innerHTML=J;D.appendChild(C);D.appendChild(E);this.input_el.parentNode.parentNode.insertBefore(D,this.input_el.parentNode);$E.on(E,"click",this.removeTag);if(this.suggest){TagInput.highlightCloud(this,J,true)}this.updateField()}};this.submitTag=function(){this.addTag(this.input_el.value);this.input_el.value=""};this.keyWatch=function(E,D){var C=E.keyCode||E.which;if(C==13||C==9||C==44||C==59){Event.stop(E);D.addTag(D.input_el.value);D.input_el.value=""}else{if(C==27){D.input_el.value=""}}if(D.options.maxLength&&D.input_el.value.length>=D.options.maxLength){if(C!=37&&C!=39&&C!=8&&C!=46&&C!=16){Event.stop(E)}}};this.enableInput=function(C){C=C==null?true:C;if(this.input_el.parentNode.style.display!="block"){this.input_el.parentNode.style.display="block";$E.on(this.input_el,"keypress",this.keyWatch,this);try{$$("rm-tagDesc","li",this.target)[0].style.display="none"}catch(D){}}if(C){this.input_el.focus()}}}function tinyURL(A){var B={upload:false,form:A.form,parameters:"shorten_key="+A.name,method:"POST",onComplete:function(C,D){A.value=(C.responseText);A.checklength()}};Ramius.ajax.request("/support/shorten.jsp",B)}$E.on(window,"load",initForms);var SUBMIT_CLS="rm-button";var BUTTON_CLS="rm-sixentButton";var BUTTON_EL="span";var BUTTON_TAG="button";var BUTTON_DISABLED="rm-disabled";var ACTIVE_CLS="active";var HOVER_CLS="hover";var ACTION_MENU_CLS="rm-actionMenu";var ACTION_PAGE_CLS="rm-actionPage";var ACTION_CLS="rm-action";var SPLIT_DRP_CLS="rm-splitDropBtn";var SPLIT_MENU_CLS="rm-splitMenu";var SPLIT_PAGE_CLS="rm-splitPage";var ncsv=false