/* YUI Compressor 2.2.5.  See the non-gz version */
String.prototype.quotemeta=function(){return this.replace(/(\W)/g,"\\$1")};if(!strings){var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){var s=scripts[i];if(s.src&&s.src.match(/locstrings\.(.*?)\.js$/)){var stringsurl=s.src.replace(strings_regex,"locstrings.en.js");document.write('<script type="text/javascript" src="'+stringsurl+'"><\/script>')}}}function fixup(){var B=$("language_submit");if(B){B.hide()}block_leave_without_save();if(window.extra_onload){extra_onload()}if($("st-instrument")!=null){setup_auto_tab()}var A=$("guest-signin-link");if(null!=A){A.href+=(A.href.indexOf("?")>=0?"&":"?")+"js=1"}}function install_logmsg(){var A;window.logmsg=function(D){if(!A){document.body.appendChild(A=Builder.node("div",{style:"position:fixed;top:0;left:0;z-index:110"},[Builder.node("textarea",{style:"width:60em;height:10em"}),Builder.node("a",{style:"background-color:white;color:black;font-size:200%;border:1px solid black",onclick:"clearlogbox();return false"},"x")]))}A.firstChild.value=D+"\n"+A.firstChild.value};window.clearlogbox=function(){document.body.removeChild(A);A=null};var B={};var C={};window.startclock=function(D){B[D]=new Date()};window.stopclock=function(F){var E=new Date();var D=E.getTime()-B[F].getTime();C[F]=D+(C[F]||0);logmsg("elapsed "+F+": "+(D/1000)+" ("+(C[F]/1000)+")")}}var form_data_clean=true;function mark_dirty(){form_data_clean=false}function block_leave_without_save(){var F=false;for(var E=0;E<document.forms.length;E++){var D=document.forms[E];if(!Element.hasClassName(D,"block-leave-without-save")){continue}F=true;for(var G=0;G<D.elements.length;G++){var C=D.elements[G];switch(C.type){case"radio":case"checkbox":add_elem_handler(C,"onclick",mark_dirty);break;case"text":case"textarea":case"password":case"file":case"select-one":case"select-multiple":add_elem_handler(C,"onchange",mark_dirty);break}}}if(F){for(var A=0;A<document.links.length;A++){var B=document.links[A];if(/^javascript:/.test(B.href)){continue}if(B.target!=null&&B.target!=""&&B.target!="_self"){continue}add_elem_handler(B,"onclick",check_data_dirty)}}}function check_data_dirty(){return form_data_clean||confirm("You have unsaved data.  Are you sure you want to discard?")}function add_elem_handler(D,A,B){var C=D[A];if(typeof (C)=="function"){D[A]=function(){var F=C.call(D);var E=B.call(D);if(typeof (F)=="boolean"&&typeof (E)=="boolean"){return F&&E}else{return E}}}else{D[A]=B}}function link_append(E,A,F){var G=A.split(".");var D=document.forms[G[0]];if(D){var C=D.elements[G[1]];if(C){if(C.value!=null&&C.value!=""){var B=$H();B[F==null?G[1]:F]=C.value;E.href+=(E.href.indexOf("?")>=0?"&":"?")+B.toQueryString()}}}return true}function show_all_help(){var C=$$(".help-topic");for(var A=0;A<C.length;A++){$(C[A]).show(C[A])}var B=$("show-all-link-holder");B.hide(B)}function set_js(A){if(A.js){A.js.value=1}}function signin_validate(A){set_js(A);return true}function register_validate(A){set_js(A);return true}window.save_clicked=false;function start_save(){window.save_clicked=true}function instedit_validate(A){if(!window.save_clicked){return false}window.save_clicked=false;var B=[];if(!/\S/.test(A.instructor.value)){B.push(loc("Please enter an instructor name"))}if(!/\S/.test(A.course.value)){B.push(loc("Please enter the name of the course"))}if(!/\S/.test(A.semester.value)){B.push(loc("Please enter the semester the instrument will be administered"))}if(!/\S/.test(A.description.value)){B.push(loc("Please enter a description of your instrument"))}if(B.length>0){alert(B.join("\n"));return false}return true}function insteditdates_validate(A){if(!window.save_clicked){return false}window.save_clicked=false;var B=[];if(B.length>0){alert(B.join("\n"));return false}return true}function analysis_add_validate(B){for(var A=0;A<B.elements.length;A++){var C=B.elements[A];if(C.type=="checkbox"&&C.name=="add_select"&&C.checked){return true}}alert(loc("Please select one of the instruments or click Cancel"));return false}function loc(A){if(strings==null||strings[A]==null){return A}return strings[A]}var base_url=null;function uri_for(A){if(base_url==null){var B=$("flag");var C=""+B.src;base_url=C.substring(0,C.indexOf("/images/flags"))}return base_url+A}function helplink_html(A){return'<a href="'+uri_for("/help/"+A)+'" target="_blank" class="helplink" title="'+loc("Click for help")+'" onclick="return pophelp(this)" onmouseover="showhelp(\''+A+'\', this)" onmouseout="hidehelp()">?</a>'}function pophelp(A){try{window.open(A.href,"_blank","width=650,height=500,menubar=no,scrollbars=yes,resizable=yes");return false}catch(B){}return true}var helpajax=null;var ajaxcount=0;function showhelp(B,C,E){hidehelp();var A=uri_for("/inlinehelp/"+B);C.parentNode.insertBefore(Builder.node("div",{id:"inline-help",className:E?"inline-instructions":"inline-help"}),C.nextSibling);var D=++ajaxcount;helpajax=new Ajax.Request(uri_for("/inlinehelp/"+B),{method:"get",onSuccess:function(F){if(D==ajaxcount&&helpajax&&!helpajax.cancelled){$("inline-help").innerHTML=F.responseText}}});helpajax.cancelled=false}function hidehelp(){if(helpajax!=null){helpajax.cancelled=true}var A=$("inline-help");if(A){Element.remove(A)}}function do_confirm(A,B){if(confirm(B)){A.href=append_to_query(A.href,"confirm=1")}else{A.href=append_to_query(A.href,"confirm=0")}return true}function append_to_query(A,B){var C=A.split("#");var D=C[0].split("?");if(D.length>1){C[0]+="&"+B}else{C[0]+="?"+B}return C.join("#")}var next_element={};function auto_tab(){var A=next_element[this.name];if(A!=null){A.focus()}}function setup_auto_tab(){for(var B=0;B<document.forms.length;B++){var D=document.forms[B].elements;for(var A=D.length-2;A>=0;A--){var C=D[A];if(C.type=="radio"||C.type=="checkbox"){if(next_element[C.name]==null){next_element[C.name]=D[A+1]}C.onclick=auto_tab}}}}function show_indiv(){var B=document.getElementsByClassName("indiv");for(var A=0;A<B.length;A++){B[A].show()}$("hide-indiv").show();$("show-indiv").hide()}function hide_indiv(){var B=document.getElementsByClassName("indiv");for(var A=0;A<B.length;A++){B[A].hide()}$("hide-indiv").hide();$("show-indiv").show()}