function calculate(){total=60;tmp=0;var A=document.forms[0];for(i=0;i<A.elements.length;i++){if(A.elements[i].type=="hidden"){tmp=(tmp*1)+(A.elements[i].value*1)}}if(total-tmp>=0){$("points_remaining").innerHTML=total-tmp;$("commit").disabled=false}else{$("points_remaining").innerHTML="<font color=red>You've reached the max number of points</font>";$("commit").disabled=true}}function setV(B,A){$(B).value=A}function addSkill(A){if($("skill_div").innerHTML==""){$("skill_div").innerHTML=A;new Effect.Highlight("skill_div")}else{$("skill_div").innerHTML=$("skill_div").innerHTML+", "+A;new Effect.Highlight("skill_div")}}function showSkills(){win=new Window("dialog1",{className:"dialog",width:300,height:200,zIndex:100,resizable:true,title:"Please select skills",hideEffect:Effect.Fade});win.getContent().innerHTML="<div style='padding:10px; line-height:20px'> <a href='javascript:void(0)' onClick='addSkill(\"Skill 1\")'>Skill 1</a> <br> <a href='javascript:void(0)' onClick='addSkill(\"Skill 2\")'>Skill 2</a> <br> <a href='javascript:void(0)' onClick='addSkill(\"Skill 3\")'>Skill 3</a> <br> <a href='javascript:void(0)' onClick='addSkill(\"Skill 4\")'>Skill 4</a> </div>";win.showCenter()}function calculation(A){total=60;tmp=0;var B=document.forms[1];for(i=0;i<B.elements.length;i++){if(B.elements[i].type=="radio"){if(B.elements[i].checked){tmp=(tmp*1)+(B.elements[i].value*1)}}}if(total-tmp>=0){document.getElementById("points_remaining").innerHTML=total-tmp}else{alert("You do not have enough points for this combination");A.checked=false}}function clearReference(){$("reference_first_name").value="";$("reference_last_name").value="";$("reference_phone").value="";$("reference_email").value=""}function clearKeyword(){$("keyword_name").value=""}function clearEducation(){$("education_degree_name_id").value="";$("education_major").value="";$("education_school").value="";$("education_year").value=""}function finish_employment(){$("work_city").value="";$("work_state").value="";$("work_from_year").value="";$("work_to_year").value="";$("work_to_month").value="";$("work_from_month").value="";$("work_company").value="";$("work_role_id").value="";$("work_resignation_reason_id").value="";$("work_resignation_reason_id").enabled=false;new Effect.Highlight("work_experiences")}function sendForm(){if($("points_remaining").innerHTML>=0){document.forms[0].onsubmit()}}function toggleOccupation(D,C,A,B){r=document.getElementsByTagName("span");for(i=0;i<r.length;i++){if(r[i].id==C){r[i].style.display=D}}more_link=$(A);if(D=="inline"){more_link.innerHTML="hide...";more_link.onclick=function(){toggleOccupation("none",C,A,B)}}else{more_link.innerHTML="<img border=0 src='/images/down_arrow.gif' /> ...more ( "+B+" )";more_link.onclick=function(){toggleOccupation("inline",C,A,B)}}}function check_max_length(B){var A=B.getAttribute?parseInt(B.getAttribute("maxlength")):"";if(B.getAttribute&&B.value.length>A){B.value=B.value.substring(0,A)}}function edit_experience(G,E,D,A,C,I,B,F,H){$("work_company").value=G;$("work_role_id").value=E;$("work_city").value=D;$("work_state").value=A;$("work_from_month").value=C;$("work_from_year").value=I;$("work_to_month").value=B;$("work_to_year").value=F;$("work_resignation_reason_id").value=H;$("work_resignation_reason_id").disabled=false}function edit_education(D,B,A,C){$("education_degree_name_id").value=D;$("education_school").value=B;$("education_major").value=A;$("education_year").value=C}function disable_key(B){var A;if(window.event){A=window.event.keyCode}else{A=B.which}if(A==13){return false}else{return true}}function enter_submits_form(C,B){var A;if(window.event){A=window.event.keyCode}else{A=C.which}if(A==13){return submit_keyword(B)}else{return true}}function submit_keyword(A){field=document.getElementById("keyword_name");new Ajax.Request("/climbers/"+A+"/keywords?keyword%5Bname%5D="+field.value,{asynchronous:true,evalScripts:true,onComplete:function(B){clearKeyword()},onLoading:function(B){Element.show("waiting")}});field.value=""}function toggle_selection(A){frm=document.forms[""+A+""].elements;for(x=0;x<frm.length;x++){if(frm[x].type=="checkbox"){frm[x].checked?frm[x].checked=false:frm[x].checked=true}}}function all_boxes(A){frm=document.forms[""+A+""].elements;for(x=0;x<frm.length;x++){if(frm[x].type=="checkbox"){frm[x].checked=true}}}function no_boxes(A){frm=document.forms[""+A+""].elements;for(x=0;x<frm.length;x++){if(frm[x].type=="checkbox"){frm[x].checked=false}}}function getCheckedValue(B,A,D){var C=null;Form.getInputs($(B),A,D).each(function(E){if(E.checked){C=Form.Element.serialize(E)}});return C}function import_contacts(A){LightWindow=new lightwindow();LightWindow.activateWindow({href:A,title:"",author:"",caption:""})}function noenter(){return !(window.event&&window.event.keyCode==13)}function load_keywords(A){new Ajax.Request("/climbers/"+A+"/keywords/show",{asynchronous:true,evalScripts:true,method:"get",onComplete:function(B){new Effect.Highlight("keywords");Element.hide("waiting")},onLoading:function(B){Element.show("waiting")}})}function load_experiences(A){new Ajax.Request("/climbers/"+A+"/work_experiences/list",{asynchronous:true,evalScripts:true,method:"get",onComplete:function(B){new Effect.Highlight("experiences");Element.hide("waiting_experiences")},onLoading:function(B){Element.show("waiting_experiences")}})}function load_educations(A){new Ajax.Request("/climbers/"+A+"/educations/list",{asynchronous:true,evalScripts:true,method:"get",onComplete:function(B){new Effect.Highlight("educations");Element.hide("waiting_educations")},onLoading:function(B){Element.show("waiting_educations")}})}function premierTracker(A){new Ajax.Request("/payments/tracker?field="+A,{asynchronous:true,evalScripts:true,method:"get"})}var fields=["non_normalized_filter_field","normalized_filter_field"];var field_buttons={non_normalized_filter_field:"non_normalized_filter_button",normalized_filter_field:"normalized_filter_button"};function check_cr(A){var A=(A)?A:((A)?event:null);var B=(A.target)?A.target:((A.srcElement)?A.srcElement:null);if((A.keyCode==13)&&fields.indexOf(B.id)!=-1){$(field_buttons[B.id]).onclick();return false}};