function treeOpen(b){var a=new Array();a[0]="nav-plus-line-middle.gif";a[1]="nav-plus-line-last.gif";var d=parseParentTree(b.id)+":tree";var e=d+":contests_:0:node:text";var c=document.getElementById(e);c.focus()}function closeDialogOnSuccess(d,a,b,c){if(!b.validationFailed){c.hide()}}function toggleElement(a){var b=document.getElementById(a);if(b==null){}else{if(b.style.display==""){b.style.display="block"}else{b.style.display=(b.style.display!="none")?"none":"block";if(b.style.display=="block"){b.style.overflow="visible"}}}return false}function toggleInlineElement(a){var b=document.getElementById(a);if(b==null){}else{if(b.style.display==""){b.style.display="inline"}else{b.style.display=(b.style.display!="none")?"none":"inline";if(b.style.display=="inline"){b.style.overflow="visible"}}}return false}function openElement(a){var b=document.getElementById(a);if(b!=null){b.style.display="block";b.style.overflow="visible"}return false}function closeElement(a){var b=document.getElementById(a);if(b!=null){b.style.display="none"}return false}function getElementsByClassName(h,g){if(!g){g=document.getElementsByTagName("body")[0]}var b=[];var f=new RegExp("\\b"+h+"\\b");var e=g.getElementsByTagName("*");for(var d=0,c=e.length;d<c;d++){if(f.test(e[d].className)){b.push(e[d])}}return b}function parseParentTree(b){var a=b.lastIndexOf(":");return b.substring(0,a)}function toggleClass(b,e){var d=document.getElementById(b);if(d==null){return false}var c=d.className.indexOf(e);if(c==-1){d.setAttribute("class",d.className+" "+e)}else{var a=d.className.substring(0,c-1)+d.className.substring(c+e.length,d.className.length);d.setAttribute("class",a)}return false}function toggleRelativeElement(d,e,f){if(f==undefined||f==null){f="block"}var b=(d.id!=undefined)?d.id:d.source;var a=parseParentTree(b);var c=null;if(a==""){c=document.getElementById(e)}else{c=document.getElementById(a+":"+e)}if(c==null){}else{if(c.style.display==""){c.style.display=f}else{c.style.display=(c.style.display!="none")?"none":f;if(c.style.display=="block"){c.style.overflow="visible"}}}return false}function isCheckBoxChecked(){}function showFullLength(b,f,a){var d=document.getElementById(b.id+"Detail");d.style.display="block";if(!f){f=window.event}if(f.pageX&&f.pageY){posX=f.pageX;posY=f.pageY}else{if(f.clientX&&f.clientY){posX=f.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posY=f.clientY+document.body.scrollTop+document.documentElement.scrollTop}}if(a!=null){var c=document.getElementById(a);if(c!=null){posX-=c.style.width;posY-=c.style.height}}d.style.top=posY+"px";d.style.left=posX+"px"}function hideFullLength(a,c){var b=document.getElementById(a.id+"Detail");b.style.display="none"}function bulkCreation(h,a,c){var j=document.getElementById(h.id);var f=parseParentTree(parseParentTree(h.id))+":"+a;var b=j.value;var e=document.getElementById(f);var d;var g="";if(b==1){g=c}else{for(d=1;d<=b;++d){if(d==10){g+=c+"0"}else{g+=c+d+" "}g+="\n <br/>"}}if(e!=null){e.innerHTML=g}else{alert(g)}}function styleUp(b,c){var a=document.getElementById(b);if(a!=null){a.style.marginRight=c}}function email(a,b){document.write('<a href="mailto:'+a+"@"+b+'">'+a+"@"+b+"</a>")}function rot13(a){return a.replace(/[a-zA-Z]/g,function(b){return String.fromCharCode((b<="Z"?90:122)>=(b=b.charCodeAt(0)+13)?b:b-26)})}function recommendNames(g){var f=new Array();f=g.id.split(":");var h=f[0];for(var c=1;c<f.length-2;c++){h=h+":"+f[c]}var d=document.getElementById(h+":firstNameDuplDecoration:firstNameDupl");var b=document.getElementById(h+":lastNameDuplDecoration:lastNameDupl");var a=document.getElementById(h+":badgeNameDecoration:badgeName");var e=document.getElementById(h+":certificateNameDecoration:certificateName");if((d.value.length>=1)&&(b.value.length>=1)){if(a.value.length<1){if(d.value.length+b.value.length+1<=100){a.value=d.value.concat(" ").concat(b.value)}else{a.value=b.value}}if(e.value.length<1){if(d.value.length+b.value.length+1<=100){e.value=d.value.concat(" ").concat(b.value)}else{e.value=b.value}}}return true}function quickFilter(c,b){var a=document.getElementById(c);if(a==null){return false}a.value=b;a.onchange();if(isIE()){a.fireEvent("onchange")}return true}function submitWithParameter(a,b){if(a.form.action==null){return}else{if(a.form.action.indexOf("?")==-1){a.form.action+="?"}}a.form.action+=b}function submitFormWithParameter(c,b){var a=document.getElementById(c);if(a==null){return false}if(a.action==null){return}else{if(a.action.indexOf("?")==-1){a.action+="?"}}a.action+=b}function submitFormWithParameters(d){var b=document.getElementById(d);if(b==null){return false}if(b.action==null){return}else{if(b.action.indexOf("?")==-1){b.action+="?"}}var a=window.location.href;if(a.indexOf("?")>-1){var c=a.substr(a.indexOf("?")+1);b.action+=c}}function openRichTree(c,e){var b=parseParentTree(c.id);var a=null;if(b==""){a=document.getElementById(e)}else{a=document.getElementById(b+":"+e)}for(var d=0;d<a.component.childs.size();d++){nodeAction(a.component.childs[d],"expand")}}function closeRichTree(c,e){var b=parseParentTree(c.id);var a=null;if(b==""){a=document.getElementById(e)}else{a=document.getElementById(b+":"+e)}for(var d=0;d<a.component.childs.size();d++){nodeAction(a.component.childs[d],"collapse")}}function nodeAction(a,c){if(c=="expand"){a.expand();for(var b=0;b<a.childs.size();b++){nodeAction(a.childs[b],c)}}else{if(c=="collapse"){a.collapse();for(var b=0;b<a.childs.size();b++){nodeAction(a.childs[b],c)}}}}function getSelectedOption(c){var a=document.getElementById(c);var b=a.options.selectedIndex;return a.options[b].text}function getCSSRule(d,f){d=d.toLowerCase();if(document.styleSheets){for(var b=0;b<document.styleSheets.length;b++){var e=document.styleSheets[b];var c=0;var a=false;do{if(e.cssRules){a=e.cssRules[c]}else{a=e.rules[c]}if(a){if(a.selectorText.toLowerCase()==d){if(f=="delete"){if(e.cssRules){e.deleteRule(c)}else{e.removeRule(c)}return true}else{return a}}}c++}while(a)}}return false}function killCSSRule(a){return getCSSRule(a,"delete")}function addCSSRule(a){if(document.styleSheets){if(!getCSSRule(a)){if(document.styleSheets[0].addRule){document.styleSheets[0].addRule(a,null,0)}else{document.styleSheets[0].insertRule(a+" { }",0)}}}return getCSSRule(a)}function toggleTooltip(){var a=getCSSRule("span.tooltip");a.style.display=(a.style.display=="block")?"none":"block"}function filterKeepFocus(d){var c=$((d.target?d.target:d.srcElement).id);if(c.createTextRange){var a=c.createTextRange();a.collapse(false);a.select()}else{if(c.setSelectionRange){c.focus();var b=c.value.length;c.setSelectionRange(b,b)}}c.selectionStart=c.selectionEnd=c.value.length}function checkRow(b){var a=document.getElementById(b);a.checked="true";a.className="disabled";a.setAttribute("onclick","return false;");a.setAttribute("onkeypress","return false;")}function toggleDeletionLinks(a,c){var e=false;if(a==null){return null}else{if(a.checked==undefined&&a.firstChild!=undefined&&a.firstChild.firstChild!=undefined){e=a.firstChild.firstChild.checked}else{e=a.checked}}var d=getElementsByClassName(c,null);for(var b=0;b<d.length;b++){d[b].style.display=(e)?"inline":"none"}}function getElementsByClassName(h,g){if(!g){g=document.getElementsByTagName("body")[0]}var b=[];var f=new RegExp("\\b"+h+"\\b");var e=g.getElementsByTagName("*");for(var d=0,c=e.length;d<c;d++){if(f.test(e[d].className)){b.push(e[d])}}return b}function displayHTML(a,e,d){var c=window.open("","HTML preview","width=500,height=500");if(window.focus){c.focus();c.screenX=window.screenX+200;c.screenY=window.screenY+200}c.document.write("<html><head><title>"+e+"</title>");c.document.title=e;c.document.write("</head><body>");c.document.write("<div style='height:85%'>");var f;if(a.id!=null&&a.id.length>4){f=trimAbsolueId(a,"Html")}else{c.document.close();return}f=f+d;var b=document.getElementById(f);if(b==null){c.document.write("Error: element "+f+" not found")}else{c.document.write(b.value)}c.document.write("</div>");c.document.write("<div style='text-align:center; border-top: 1px solid #ccc; padding: 0.3em;'>");c.document.write("<div style='display:inline'>");c.document.write("<input type='button' value='Close Window' onClick='window.close()'>");c.document.write("</div>");c.document.write("</div>");c.document.write("<\/script>");c.document.write("</body>");c.document.close();c.focus()}function pushURL(c,b){var a=window.location.href;if(a.indexOf("?")!=-1){a=a.split("?")[0]}if(b!=null&&b!=""){a=a+"?"+b}window.history.pushState(null,c,a)}function pushRESTfulURL(c,b){var a=window.location.href;if(a.indexOf("/")!=-1){a=a.substring(0,a.lastIndexOf("/"))}if(b!=null){a=a+"/"+encodeURI(b.replace(/ /g,"-").toLowerCase())}window.history.pushState(a,c,a)}function pushRESTfulURLTree(e){var a=window.location.href;if(a.indexOf("/")!=-1){a=a.substring(0,a.lastIndexOf("/"))}if(e!=null){var d="";var c=e[0].className.split(" ");for(var b=0;b<c.length;++b){if(stringStartsWith(c[b],"Topic-")){d=c[b].split("Topic-")[1];break}}a=a+"/"+encodeURI(d)}window.history.pushState(a,e[0].textContent,a)}function stringStartsWith(a,b){return a.slice(0,b.length)==b}function backButtonChangedURL(d,c){if(d==null){return}var a=window.location.href;if(a.indexOf("/")!=-1){var b=a.substring(a.lastIndexOf("/")+1,a.length);c([{name:"newTitleTopic",value:b}])}}function trimAbsolueId(a,b){var d=a.id;var c=b.length;if(d.length>c){return d.substring(0,d.length-c)}else{return"Error trimming absoluteId"}}function openMenu(b){var a=document.getElementById(b);if(a!=null&&a.style.display!="block"){a.style.display="block";a.setAttribute("aria-hidden","false");a.previousSibling.setAttribute("aria-expanded","true");a.previousSibling.className+=" ui-state-active";a.previousSibling.firstChild.className="ui-icon ui-icon-triangle-1-s"}}function setFocus(b){var a=document.getElementById(b);if(a&&a.focus){a.focus();moveCaretToEnd(a)}}function delayAnchor(a){var b=a.getAttribute("href");setTimeout(function(){window.location=b},1000)}function setScreenSize(a){document.getElementById(a).value=screenSize()}function addSizeToGETParam(a){var b=a.getAttribute("href");window.location=b+"?s="+screenSize()}function screenSize(){return window.innerWidth!=null?window.innerWidth:document.body!=null?document.body.clientWidth:null}function moveCaretToEnd(b){if(typeof b.selectionStart=="number"){b.selectionStart=b.selectionEnd=b.value.length}else{if(typeof b.createTextRange!="undefined"){b.focus();var a=b.createTextRange();a.collapse(false);a.select()}}}var icpcDelayWithId=(function(b){var a=0;return function(d,c){clearTimeout(a);a=setTimeout(d,c)}})();var icpcDelay=(function(){var a=0;return function(c,b){clearTimeout(a);a=setTimeout(c,b)}})();var Util={toggleTableFilter:function(a){a=a.replace(/:/g,"\\:");if($("#"+a).hasClass("hideFilter")){$("#"+a).removeClass("hideFilter")}else{$("#"+a).addClass("hideFilter")}}};function printPreview(c){var b=document.getElementsByTagName("link");if(b!=null&&b!=undefined){for(i=0;i<b.length;i++){var d=b[i].getAttribute("href");if(d.indexOf(c)!=-1){var a=b[i].getAttribute("media");if("print"==a){b[i].setAttribute("media","")}else{b[i].setAttribute("media","print")}}}}};