function toggleBox(a,c){if(document.layers){document.layers[a].visibility=c?"show":"hide"}else{if(document.getElementById){var b=document.getElementById(a);b.style.visibility=c?"visible":"hidden"}else{if(document.all){document.all[a].style.visibility=c?"visible":"hidden"}}}}function showNote(a){toggleBox(a,1)}function hideNote(a){toggleBox(a,0)}var divCandidateNote=null;var activeCandidateId=null;var getCandidateNotesSuccess=function(d){var a=document.getElementById(d.argument.divId);if(d.responseText!==undefined){a.innerHTML=d.responseText}setCHNoteHeight(d.argument.candidateId,"candy");var c=document.getElementById(a.id.replace("candyNotes","addCandyNoteForm"));if(c!=null){try{c.getElementsByTagName("textarea")[0].focus();redrawRecruiterNoteIcon()}catch(b){}}};var getCandidateNotesFailure=function(a){alert("getCandidateNotesFailure: "+a.responseText)};function getCandidateNotes(c,g,a,h){var d="addCandyNote_form"+c+"__"+h;checkNoteDraggable("Candy",c,h);divCandidateNote=document.getElementById(a);activeCandidateId=c;var e=YAHOO.util.Connect.asyncRequest("GET","/note/candidate.do?dispatch=getCandidateNotes&id="+c,{success:getCandidateNotesSuccess,failure:getCandidateNotesFailure,argument:{divId:a,candidateId:c}},null);for(var b=0;b<document.forms.length;b++){if(document.forms[b].name==d){break}}new Popup(g,"addCandyNote"+c+"__"+h).popupAction()}var deleteCandidateNoteSuccess=function(o){if(o.responseText!==undefined){try{var note=YAHOO.lang.JSON.parse(o.responseText)}catch(e){try{var note=eval("("+o.responseText+")")}catch(e){var note=eval('({"noteCount":"-1"})')}}if(note.noteCount<1){var elements=YAHOO.util.Dom.getElementsByClassName("candy_link"+activeCandidateId,"","");for(var i=0;i<elements.length;i++){if(elements[i].getElementsByTagName("img")[0].height>16){elements[i].getElementsByTagName("img")[0].src="/images/add_note_blank_big.gif"}else{elements[i].getElementsByTagName("img")[0].src="/images/add_note_blank.gif"}}}}var transaction=YAHOO.util.Connect.asyncRequest("GET","/note/candidate.do?dispatch=getCandidateNotes&id="+(activeCandidateId),{success:getCandidateNotesSuccess,failure:getCandidateNotesFailure,argument:{divId:divCandidateNote.id,candidateId:activeCandidateId}},null)};var deleteCandidateNoteFailure=function(a){alert("The note was not deleted.")};var deleteCandidateNoteCallback={success:deleteCandidateNoteSuccess,failure:deleteCandidateNoteFailure};function deleteCandidateNote(a){if(confirm("Do you really want to delete this note?")){var b=YAHOO.util.Connect.asyncRequest("GET","/note/candidate.do?dispatch=deleteCandidateNote&id="+a,deleteCandidateNoteCallback,null)}}var addCandidateNoteSuccess=function(h){if(h.responseText!==undefined){var d=activeCandidateId;var a=divCandidateNote.id.replace("candyNotes"+activeCandidateId+"__","");var c=(document.getElementById("candy_link"+activeCandidateId+"__"+a).getElementsByTagName("img")[0].src);if(!c.match("add_note_populated.gif")&&!c.match("add_note_populated_big.gif")){var e=YAHOO.util.Dom.getElementsByClassName("candy_link"+d,"","");for(var b=0;b<e.length;b++){if(e[b].getElementsByTagName("img")[0].height>16){e[b].getElementsByTagName("img")[0].src="/images/add_note_populated_big.gif"}else{e[b].getElementsByTagName("img")[0].src="/images/add_note_populated.gif"}}}}var g=YAHOO.util.Connect.asyncRequest("GET","/note/candidate.do?dispatch=getCandidateNotes&id="+d,{success:getCandidateNotesSuccess,failure:getCandidateNotesFailure,argument:{divId:divCandidateNote.id,candidateId:activeCandidateId}},null)};var addCandidateNoteFailure=function(a){alert("The note was not added.")};var addCandidateNoteCallback={success:addCandidateNoteSuccess,failure:addCandidateNoteFailure};function submitAjax(e,g){var d=document.forms[e];if(d==null){d=document.getElementById(e)}if(d!=null){var a="";var b="";for(var c=0;c<d.elements.length;c++){if(d.elements[c].name.length){if(d.elements[c].name.length>0){if(d.elements[c].name.indexOf("assessments")>=0){if(d.elements[c].checked){a+="&"+d.elements[c].name+"=true"}else{a+="&"+d.elements[c].name+"=false"}}else{a+="&"+d.elements[c].name+"="+encodeURIComponent(d.elements[c].value)}}}}if(d.text.value.length>0||a.indexOf("assessments")>=2){YAHOO.util.Connect.asyncRequest("POST",d.action,g,a.substr(1))}d.getElementsByTagName("textarea")[0].value="";if(e.substring(3,5)=="Ca"){noteSetPublic("false","candidate","publicNote"+e.replace("addCandyNoteForm",""))}else{if(e.substring(3,5)=="HH"){noteSetPublic("true","headhunter","publicNote"+e.replace("addHHNoteForm",""))}}}}var divRecruiterNote=null;var activeRecruiterId=null;var pageHHoverrideDispatch="getRecruiterNotes";var doRecruiterNoteCount=function(){var a=0;var c=YAHOO.util.Dom.getElementsByClassName("CHNote_topNote","div",divRecruiterNote);for(var b=0;b<c.length;b++){a++}return a};var doRecruiterAssessmentCount=function(){id__uniq=divRecruiterNote.id.replace("hhNotes","");f=document.getElementById("addHHNoteForm"+id__uniq);if(f==null){return -1}var b=0;for(var a=0;a<f.elements.length;a++){if(f.elements[a].name.length){if(f.elements[a].name.length>0){if(f.elements[a].name.indexOf("assessments")>=0){if(f.elements[a].checked){b++}}}}}return b};function redrawRecruiterNoteIcon(){var b=activeRecruiterId;var c=divRecruiterNote.id.replace("hhNotes"+activeRecruiterId+"__","");var g=document.getElementById("hh_link"+activeRecruiterId+"__"+c).getElementsByTagName("img")[0];var e=(g.src);var h="/images/add_note_populated.gif";var d="/images/add_note_populated_big.gif";if(doRecruiterNoteCount()+doRecruiterAssessmentCount()<1){h="/images/add_note_blank.gif";d="/images/add_note_blank_big.gif"}if(!e.match(h)&&!e.match(d)){var a=YAHOO.util.Dom.getElementsByClassName("hh_link"+b,"","");for(var k=0;k<a.length;k++){var j=a[k].getElementsByTagName("img")[0];if(j.height>16){j.src=d}else{j.src=h}}}}function setPageHHoverrideDispatch(a){pageHHoverrideDispatch=a}var getRecruiterNotesSuccess=function(d){divRecruiterNote=document.getElementById(divRecruiterNote.id);var c=document.getElementById(divRecruiterNote.id.replace("hhNotes","addHHNoteForm"));if(d.responseText!==undefined){if(d.responseText.indexOf("<checkBoxInfo>")){checkBoxInfo=d.responseText.substring(d.responseText.indexOf("<checkBoxInfo>")+14,d.responseText.indexOf("</checkBoxInfo>"));d.responseText=d.responseText.substring(d.responseText.indexOf("</checkBoxInfo>")+15);var b=YAHOO.util.Dom.getElementsByClassName("acheckbox","input",divRecruiterNote.id.replace("hhNotes","addHHNoteForm"));for(i=0;i<b.length;i++){isChecked=(+checkBoxInfo.substring((checkBoxInfo.indexOf("<box"+i+">")+5+i.toString().length),checkBoxInfo.indexOf("</box"+i+">")));b[i].checked=Boolean(isChecked)}}divRecruiterNote.innerHTML=d.responseText}setCHNoteHeight(activeRecruiterId,"hh");try{c.getElementsByTagName("textarea")[0].focus();redrawRecruiterNoteIcon()}catch(a){}};var getRecruiterNotesFailure=function(a){};var getRecruiterNotesCallback={success:getRecruiterNotesSuccess,failure:getRecruiterNotesFailure};function getRecruiterNotes(b,j,k,h,g){g=g||"getRecruiterNotes";checkNoteDraggable("HH",b,h);var e="addHHNoteForm"+b+"__"+h;divRecruiterNote=document.getElementById(k);activeRecruiterId=b;var a=YAHOO.util.Connect.asyncRequest("GET","/note/recruiter.do?dispatch="+g+"&id="+b,getRecruiterNotesCallback,null);for(var c=0;c<document.forms.length;c++){if(document.forms[c].name==e){var d=document.forms[c];if(e.substring(3,5)=="Ca"){noteSetPublic("false","candidate","publicNote"+e.replace("addCandyNoteForm",""))}else{if(e.substring(3,5)=="HH"){noteSetPublic("true","headhunter","publicNote"+e.replace("addHHNoteForm",""))}}break}}new Popup(j,"addHHNote"+b+"__"+h).popupAction()}var deleteRecruiterNoteSuccess=function(o){if(o.responseText!==undefined){try{var note=YAHOO.lang.JSON.parse(o.responseText)}catch(e){try{var note=eval("("+o.responseText+")")}catch(e){var note=eval('({"noteCount":"-1"})')}}redrawRecruiterNoteIcon()}var transaction=YAHOO.util.Connect.asyncRequest("GET","/note/recruiter.do?dispatch="+pageHHoverrideDispatch+"&id="+(activeRecruiterId),getRecruiterNotesCallback,null)};var deleteRecruiterNoteFailure=function(a){alert("The note was not deleted.")};var deleteRecruiterNoteCallback={success:deleteRecruiterNoteSuccess,failure:deleteRecruiterNoteFailure};function deleteRecruiterNote(a){if(confirm("Do you really want to delete this note?")){var b=YAHOO.util.Connect.asyncRequest("GET","/note/recruiter.do?dispatch=deleteRecruiterNote&id="+a,deleteRecruiterNoteCallback,null)}}var addRecruiterNoteSuccess=function(b){if(b.responseText!==undefined){}var a=YAHOO.util.Connect.asyncRequest("GET","/note/recruiter.do?dispatch="+pageHHoverrideDispatch+"&id="+(activeRecruiterId),getRecruiterNotesCallback,null)};var addRecruiterNoteFailure=function(a){alert("The note was not added.")};var addRecruiterNoteCallback={success:addRecruiterNoteSuccess,failure:addRecruiterNoteFailure};function addRecruiterNote(a,e,c){var b="dispatch=addRecruiterNote&id="+a+"&publicNote="+c+"&text="+e;var d=YAHOO.util.Connect.asyncRequest("POST","/note/recruiter.do",addRecruiterNoteCallback,b)}function validatePublicCandidateNote(c){var b=document.getElementById("rbpu"+c);var a=document.getElementById("rbpr"+c);if(confirm("Are you sure you want to send this note to the Headhunter?")){document.getElementById("addCandyNoteForm"+c).publicNote.value="true"}else{document.getElementById("addCandyNoteForm"+c).publicNote.value="false"}}function setCHNoteHeight(l,c){if(c=="candy"){NoteType="Candy";subjectId=activeCandidateId.id;noteDiv=divCandidateNote}else{if(c=="hh"){NoteType="HH";subjectId=activeRecruiterId.id;noteDiv=divRecruiterNote}else{if(c=="hm"){NoteType="HM";subjectId=activeEmployerId.id;noteDiv=divEmployerNote}}}noteDiv=document.getElementById(noteDiv.id);var d=noteDiv.scrollHeight;var e=305;if(d>276){noteDiv.style.overflowY="scroll";e=e-18}else{noteDiv.style.overflowY="hidden";e=e-2}var a=YAHOO.util.Dom.getElementsByClassName("CHNote_topNote_content","",subjectId);for(var g=0;g<a.length;g++){a[g].style.width=e+"px"}var a=YAHOO.util.Dom.getElementsByClassName("CHNote_topNote_delete","",subjectId);for(var g=0;g<a.length;g++){var b=a[g].getElementsByTagName("A");if(b&&b[0]){b=b[0];if(b.style.display=="none"||a[g].style.display==""){b.style.display="block"}}}var m=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);var k=YAHOO.util.Dom.getViewportHeight();var n=parseInt(k+m);var h=document.getElementById(noteDiv.id.replace(c+"Notes","add"+NoteType+"Note"));var o=YAHOO.util.Dom.getXY(h);var j=n-(o[1]+h.offsetHeight);if(j<0){window.scrollBy(0,(j*-1))}}if(!(typeof replaceTextForField=="function")){var script=document.createElement("script");script.src="/javascript/removespecialchars.js";script.type="text/javascript";var head=document.getElementsByTagName("head").item(0);head.appendChild(script)}function noteSetPublic(b,g,c){var d=document.getElementById(c);var a=document.getElementById(c+"_checkbox");var h="";var e=false;if(g=="headhunter"){e=true}if(g=="candidate"&&b=="toggle"&&document.getElementById(c).value=="false"){if(!(confirm("Are you sure you want to send this note to the Headhunter?"))){b="false"}}if(b=="toggle"){if(document.getElementById(c).value=="false"){h="true"}else{h="false"}}else{h=b}if(h=="true"){d.value="true";if(e){a.checked=false}else{a.checked=true}}else{d.value="false";if(e){a.checked=true}else{a.checked=false}}}var divEmployerNote=null;var activeEmployerId=null;var pageHMoverrideDispatch="getEmployerNotes";var doEmployerNoteCount=function(){var a=0;var c=YAHOO.util.Dom.getElementsByClassName("CHNote_topNote","div",divEmployerNote);for(var b=0;b<c.length;b++){a++}return a};function redrawEmployerNoteIcon(){var g="/images/add_note_populated.gif";if(doEmployerNoteCount()<1){g="/images/add_note_blank.gif"}var a=activeEmployerId;var b=divEmployerNote.id.replace("hmNotes"+activeEmployerId+"__","");var d=(document.getElementById("hm_link"+activeEmployerId+"__"+b).getElementsByTagName("img")[0].src);if(!d.match(g)){var e=YAHOO.util.Dom.getElementsByClassName("hm_link"+a,"","");for(var c=0;c<e.length;c++){e[c].getElementsByTagName("img")[0].src=g}}}function setPageHMoverrideDispatch(a){pageHMoverrideDispatch=a}var getEmployerNotesSuccess=function(c){divEmployerNote=document.getElementById(divEmployerNote.id);var b=document.getElementById(divEmployerNote.id.replace("hmNotes","addHMNoteForm"));if(c.responseText!==undefined){divEmployerNote.innerHTML=c.responseText}setCHNoteHeight(activeEmployerId,"hm");try{b.getElementsByTagName("textarea")[0].focus();redrawEmployerNoteIcon()}catch(a){}};var getEmployerNotesFailure=function(a){alert("getEmployerNotesFailure: "+a.responseText)};var getEmployerNotesCallback={success:getEmployerNotesSuccess,failure:getEmployerNotesFailure};function getEmployerNotes(h,d,a,g,e){e=e||"getEmployerNotes";checkNoteDraggable("HM",h,g);var b="addHMNoteForm"+h+"__"+g;divEmployerNote=document.getElementById(a);activeEmployerId=h;var c=YAHOO.util.Connect.asyncRequest("GET","/note/employer.do?dispatch="+e+"&id="+h,getEmployerNotesCallback,null);new Popup(d,"addHMNote"+h+"__"+g).popupAction()}var deleteEmployerNoteSuccess=function(o){if(o.responseText!==undefined){try{var note=YAHOO.lang.JSON.parse(o.responseText)}catch(e){try{var note=eval("("+o.responseText+")")}catch(e){var note=eval('({"noteCount":"-1"})')}}redrawEmployerNoteIcon()}var transaction=YAHOO.util.Connect.asyncRequest("GET","/note/employer.do?dispatch="+pageHMoverrideDispatch+"&id="+(activeEmployerId),getEmployerNotesCallback,null)};var deleteEmployerNoteFailure=function(a){alert("The note was not deleted.")};var deleteEmployerNoteCallback={success:deleteEmployerNoteSuccess,failure:deleteEmployerNoteFailure};function deleteEmployerNote(a){if(confirm("Do you really want to delete this note?")){var b=YAHOO.util.Connect.asyncRequest("GET","/note/employer.do?dispatch=deleteEmployerNote&id="+a,deleteEmployerNoteCallback,null)}}var addEmployerNoteSuccess=function(b){if(b.responseText!==undefined){}var a=YAHOO.util.Connect.asyncRequest("GET","/note/employer.do?dispatch="+pageHMoverrideDispatch+"&id="+(activeEmployerId),getEmployerNotesCallback,null)};var addEmployerNoteFailure=function(a){alert("The note was not added.")};var addEmployerNoteCallback={success:addEmployerNoteSuccess,failure:addEmployerNoteFailure};function addEmployerNote(e,d,b){var a="dispatch=addEmployerNote&id="+e+"&publicNote="+b+"&text="+d;var c=YAHOO.util.Connect.asyncRequest("POST","/note/employer.do",addEmployerNoteCallback,a)}function checkNoteDraggable(c,e,d){var b=document.getElementById("add"+c+"Note_title"+e+"__"+d);if(b){if(typeof(b.isHandle)=="undefined"){b.isHandle=false}if(!(b.isHandle)){b.isHandle=true;var a=new YAHOO.util.DD("add"+c+"Note"+e+"__"+d);a.setHandleElId("add"+c+"Note_title"+e+"__"+d)}}};
