if(typeof GD==="undefined"){var GD={}
}if(typeof GD.survey==="undefined"){GD.survey={}
}GD.survey.initSurveyStart=function(){$("#SurveyStartModeChoiceSalaries input").click(function(A){GD.survey.selectSalaryMode(A.target);
return true
});
$("#SurveyStartModeChoiceReviews input").click(function(A){GD.survey.selectReviewsMode(A.target);
return true
});
$("#SurveyChoiceRadioCurrentEmployer,#SurveyChoiceRadioFormerEmployer").click(function(A){GD.survey.selectEmployerSurveyRadio(A.target)
});
$("#SurveyChoiceRadioInterview").click(function(A){GD.survey.selectInterviewRadio(A.target)
});
$("#SalarySurveyCurrentJobChoices input[type=radio]").click(function(A){GD.survey.toggleSalaryJobEndingYear()
});
$(".outcomeRadioButton input[type=radio]").click(function(A){GD.survey.onInterviewOutcomeClick(A.target)
});
$(".outcomeRadioButton input[type=radio]").filter(":checked").parent().addClass("selected");
if($("#SurveyStartModeChoiceReviews").hasClass("selected")){if($("#SurveyChoiceRadioFormerEmployer").is(":checked")){$("#EmployerJobEndingYearRow").removeClass("hidden")
}}else{if($("#SalaryCurrentJobfalse").is(":checked")){GD.survey.toggleSalaryJobEndingYear()
}}};
GD.survey.selectSalaryMode=function(A){GD.survey.onSurveyChange(A);
GD.survey.showSidebarContent(A.id);
$("#SalaryJobTitleEditField").focus()
};
GD.survey.selectReviewsMode=function(A){GD.survey.onSurveyChange(A);
GD.survey.showSidebarContent(A.id);
$("#EmployerNameEditField").focus()
};
GD.survey.selectEmployerSurveyRadio=function(F){var D=$("#EmployerJobEndingYearRow");
var C=id("EmployerJobEndingYearSelectField");
var B=id("EmployerReviewCurrentJob");
var E=id("EmployerJobEndingYearSelectField");
var A=$("#SurveyChoiceRadioCurrentEmployer").is(":checked");
GD.survey.showReviewSurveyPage(true);
if(A){D.addClass("hidden");
E.selectedIndex=1
}else{D.removeClass("hidden");
E.selectedIndex=0
}if(B){B.value=A.toString()
}GD.survey.setReviewInterviewsModeStyling(F);
GD.survey.showSidebarContent(F.id)
};
GD.survey.selectInterviewRadio=function(B){var A=$("#EmployerJobEndingYearRow");
GD.survey.showReviewSurveyPage(false);
A.addClass("hidden");
GD.survey.setReviewInterviewsModeStyling(B);
GD.survey.showSidebarContent(B.id)
};
GD.survey.showSidebarContent=function(C){var B=$(".sideBarText .sideBarTextOption");
var A;
if(B.length){if(C=="SurveyStartModeChoiceSalariesRadio"){A=$("#SidebarTextSalaries");
if(A.is(":visible")){A=""
}}else{if((C=="SurveyChoiceRadioCurrentEmployer")||(C=="SurveyChoiceRadioFormerEmployer")){A=$("#SidebarTextReviews");
if(A.is(":visible")){A=""
}}else{if(C=="SurveyChoiceRadioInterview"){A=$("#SidebarTextInterviews");
if(A.is(":visible")){A=""
}}else{if(C=="SurveyStartModeChoiceReviewsRadio"){if($("#SurveyChoiceRadioInterview").is(":checked")){A=$("#SidebarTextInterviews")
}else{A=$("#SidebarTextReviews")
}if(A.is(":visible")){A=""
}}}}}if(A){B.addClass("hidden");
A.removeClass("hidden")
}}};
GD.survey.setReviewInterviewsModeStyling=function(A){$("#ReviewsInterviewsSurveyModeChoices li").removeClass("selected");
$(A).parent().addClass("selected")
};
GD.survey.onSurveyChange=function(E){try{var H=!$(E).parent().hasClass("selected");
if(H){var A=$("#SalarySurveyStart");
var C=$("#ReviewsInterviewsSurveyStart");
var B=$("#SurveyStartModeChoiceReviews input");
var G=$("#SurveyStartModeChoiceSalaries input");
var D=A.is(":hidden");
if(D){B.removeAttr("checked");
$("#SurveyStartModeChoiceSalaries").addClass("selected");
$("#SurveyStartModeChoiceReviews").removeClass("selected");
C.addClass("hidden");
A.removeClass("hidden");
trackerURL="/survey/salary/surveyStart"
}else{G.removeAttr("checked");
$("#SurveyStartModeChoiceSalaries").removeClass("selected");
$("#SurveyStartModeChoiceReviews").addClass("selected");
A.addClass("hidden");
C.removeClass("hidden");
var I=$("#SurveyChoiceRadioInterview").is(":checked");
if(I){trackerURL="/survey/interview/surveyStart"
}else{trackerURL="/survey/employer/surveyStart"
}}GD.site.trackURL(trackerURL);
GD.survey.clearAllSurveyStartErrors()
}}catch(F){Logger.fatal("survey.js / GD.survey.onSurveyChange()",F)
}return true
};
GD.survey.showReviewSurveyPage=function(E){var C=$("#EmployerSurveyStartSection");
var B=$("#InterviewSurveyStartForm");
if(C.length&&B.length){var F=C.css("display")!="none";
var D=B.css("display")!="none";
var A;
if(E){if(!F){B.css("display","none");
C.css("display","block")
}A="/survey/employer/surveyStart"
}else{if(!D){C.css("display","none");
B.css("display","block")
}A="/survey/interview/surveyStart"
}GD.site.trackURL(A);
GD.survey.clearAllSurveyStartErrors()
}return true
};
GD.survey.toggleSalaryJobEndingYear=function(){var A=$("#SurveyChoiceRadioCurrentJob").is(":checked");
var B=$("#SalaryJobEndingYearRow");
if(A){B.addClass("hidden");
$("#SurveyChoiceRadioCurrentJob").parent().addClass("selected");
$("#SurveyChoiceRadioFormerJob").parent().removeClass("selected")
}else{B.removeClass("hidden");
$("#SurveyChoiceRadioCurrentJob").parent().removeClass("selected");
$("#SurveyChoiceRadioFormerJob").parent().addClass("selected")
}return true
};
GD.survey.onInterviewOutcomeClick=function(A){$(".outcomeRadioButton").removeClass("selected");
$(A).parent().addClass("selected")
};
GD.survey.clearAllSurveyStartErrors=function(){if(typeof clearErrorMessages==="function"){var A=$("form#SalarySurveyStartForm");
if(A.length){clearErrorMessages(A[0])
}A=$("form#EmployerSurveyStartForm");
if(A.length){clearErrorMessages(A[0])
}A=$("form#InterviewSurveyStartForm");
if(A.length){clearErrorMessages(A[0])
}}};
GD.survey.toggleEmployerJobEndingYear=function(){if($("#EmployerCurrentJobtrue").is(":checked")){$("#EmployerJobEndingYearRow").addClass("hidden");
id("EmployerJobEndingYearSelectField").options[1].selected=true
}else{$("#EmployerJobEndingYearRow").removeClass("hidden");
id("EmployerJobEndingYearSelectField").options[0].selected=true
}};
GD.survey.HARD_MIN_EMPLOYER_REVIEW_WORDS=5;
GD.survey.HARD_MAX_EMPLOYER_REVIEW_CHARS=5000;
GD.survey.HARD_MAX_EMPLOYER_REVIEW_SUMMARY_CHARS=120;
GD.survey.MIN_EMPLOYER_REVIEW_WORDS=60;
GD.survey.EMPLOYER_REVIEW_PROS_QUESTION_ID=100;
GD.survey.EMPLOYER_REVIEW_CONS_QUESTION_ID=101;
GD.survey.EMPLOYER_REVIEW_ADVICE_QUESTION_ID=102;
GD.survey.EMPLOYER_REVIEW_SUMMARY_QUESTION_ID=200;
GD.survey.EMPLOYER_REVIEW_CEO_QUESTION_ID=300;
GD.survey.EMPLOYER_REVIEW_TEXT_QUESTION_IDS=[GD.survey.EMPLOYER_REVIEW_PROS_QUESTION_ID,GD.survey.EMPLOYER_REVIEW_CONS_QUESTION_ID,GD.survey.EMPLOYER_REVIEW_ADVICE_QUESTION_ID];
GD.survey.lastEmployerButtonEvent=null;
GD.survey.lastEmployerButtonId=null;
GD.survey.surveyCheers={$defaultColor:"#000000",$errorColor:"#B00000",$validColor:"#000000",$cheerPrefix:" - ",answer100:{tooFew:"C'mon, there has to be something good to say.",messages:[]},answer101:{tooFew:"Really? There's nothing wrong with this company?",messages:[]},answer200:{tooMany:"Can you summarize this into 120 characters?",messages:[]}};
GD.survey.initializeQuestionButton=function(A){var G="btnGrp"+A;
var H=id(G);
if(H){var F=GD.survey.getRadioButtonTitles("surveyForm","questionIdToAnswerMap["+A+"]");
var B=new YAHOO.widget.ButtonGroup(G);
var E=B.getButtons();
for(var C=0;
C<E.length;
C++){var D=E[C];
D._button.title=D.RADIO_DEFAULT_TITLE=D.RADIO_CHECKED_TITLE=F[C];
D.addListener("click",GD.survey.onButtonClick);
D.addListener("mouseover",GD.survey.onButtonOver);
D.addListener("mouseout",GD.survey.onButtonOut)
}}};
GD.survey.getRadioButtonTitles=function(C,E){var D=new Array();
var F=document.forms[C];
if(F){var B=F[E];
for(var A=0;
A<B.length;
A++){if(B[A].title){D.push(B[A].title)
}else{D.push(B[A].value)
}}}return D
};
GD.survey.onButtonClick=function(A){A=GD.dom.fixEvent(A);
A=GD.survey.getTargetInfo(A,true);
if(A.targetId){if((GD.survey.lastEmployerButtonEvent!="click")||(A.targetId!=GD.lastEmployerButtonId)){GD.survey.lastEmployerButtonEvent="click";
GD.survey.lastEmployerButtonId=A.targetId;
var B=GD.survey.getQuestionIds(A.targetId);
if(B){var D="<p class='select'>"+A.targetTitle+"</p>";
if(A.target.innerHTML=="NA"){var C=id("btnGrpNAHint"+B[0]);
if(C){D="<p class='select'>"+C.innerHTML+"</p>"
}}$("#btnGrpHint"+B[0]).html(D);
$("#btnGrpDefaultHint"+B[0]).html(D);
GD.survey.revealCheckmark("btnGrpCheck"+B[0])
}}}return true
};
GD.survey.onButtonOver=function(A){A=GD.dom.fixEvent(A);
A=GD.survey.getTargetInfo(A);
if(A.targetId){if((GD.survey.lastEmployerButtonEvent!="over")||(A.targetId!=GD.lastEmployerButtonId)){GD.survey.lastEmployerButtonEvent="over";
GD.survey.lastEmployerButtonId=A.targetId;
var B=GD.survey.getQuestionIds(A.targetId);
if(B&&A.targetTitle){var D="<p class='hint'>"+A.targetTitle+"<p>";
if(A.target.innerHTML=="NA"){var C=id("btnGrpNAHint"+B[0]);
if(C){D="<p class='hint'>"+C.innerHTML+"</p>"
}}$("#btnGrpHint"+B[0]).html(D)
}}}return true
};
GD.survey.onButtonOut=function(A){A=GD.dom.fixEvent(A);
A=GD.survey.getTargetInfo(A);
if(A.targetId){if((GD.survey.lastEmployerButtonEvent!="out")||(A.targetId!=GD.lastEmployerButtonId)){GD.survey.lastEmployerButtonEvent="out";
GD.survey.lastEmployerButtonId=A.targetId;
var B=GD.survey.getQuestionIds(A.targetId);
if(B){var C=id("btnGrpDefaultHint"+B[0]).innerHTML;
id("btnGrpHint"+B[0]).innerHTML=C
}}}return true
};
GD.survey.getTargetInfo=function(E,A){var D;
var B=null;
D=E.target;
if(D&&(D.tagName=="BUTTON")){E.targetId=D.parentNode.parentNode.id;
E.targetTitle=D.title
}else{if(D&&(D.tagName=="SPAN")){E.targetId=D.parentNode.id;
var C=D.getElementsByTagName("BUTTON");
if(C.length>0){E.targetTitle=C[0].title
}else{E.targetTitle="Thank you!"
}}}return E
};
GD.survey.getQuestionIds=function(D){var B="radio";
var A=null;
if(D.startsWith(B)){var C=D.substring(B.length);
A=C.split("-")
}return A
};
GD.survey.revealCheckmark=function(B){var A=$("#"+B);
if(A.length){A.fadeIn(800)
}};
GD.survey.updateSurveyWordCount=function(B,I,F,L,A){if(typeof I!="number"){I=-1
}if(typeof F!="number"){F=-1
}if(typeof L!="boolean"){L=false
}if(typeof A!="boolean"){A=false
}var K="answer"+B;
var D=id(K);
var J=D.value;
var H=J.countWords();
var E="question"+B+"_wordCount";
var G=id(E);
if(G&&G.value){G.value=H
}if((I>=0)&&(F>=0)){var C="question"+B+"_wordCountLabel";
GD.ajax.updateWordCounter(K,C,I,F,A);
if(L&&D.hasFocus){GD.coach.cheer("question"+B+"_coach",GD.survey.surveyCheers,K,H,I,F);
id(C).style.color=id("question"+B+"_coach").style.color
}}};
GD.survey.surveyWordCountFocus=function(A,G,H){if(typeof G!="number"){G=-1
}if(typeof H!="number"){H=-1
}var D="answer"+A;
var C=id(D);
if(!C.hasFocus){C.hasFocus=true;
var E=C.value;
var F=E.countWords();
GD.survey.updateSurveyWordCount(A,G,H,false);
if((G>=0)||(H>0)){GD.coach.cheer("question"+A+"_coach",GD.survey.surveyCheers,D,F,G,H);
var B="question"+A+"_wordCountLabel";
id(B).style.color=id("question"+A+"_coach").style.color
}}return true
};
GD.survey.surveyWordCountBlur=function(A,G,H){if(typeof G!="number"){G=-1
}if(typeof H!="number"){H=-1
}var D="answer"+A;
var C=id(D);
if(C.hasFocus){C.hasFocus=false;
var E=C.value;
var F=E.countWords();
GD.survey.updateSurveyWordCount(A,G,H,false);
if((G>=0)||(H>0)){GD.coach.cheer("question"+A+"_coach",GD.survey.surveyCheers,D,F,G,H,false);
var B="question"+A+"_wordCountLabel";
id(B).style.color=id("question"+A+"_coach").style.color
}}return true
};
GD.survey.updateSurveyCharCount=function(B,G,E,J,A){if(typeof J!="boolean"){J=true
}if(typeof A!="boolean"){A=false
}var I="answer"+B;
var D=id(I);
var H=D.value;
var C="question"+B+"_charCounter";
var F=H.length;
GD.ajax.updateCharCounter(I,C,G,E,A);
if(J&&D.hasFocus){GD.coach.cheer("question"+B+"_coach",GD.survey.surveyCheers,I,F,G,E);
id(C).style.color=id("question"+B+"_coach").style.color
}GD.survey.updateSurveyWordCount(B)
};
GD.survey.surveyCharCountFocus=function(A,G,H){var D="answer"+A;
var C=id(D);
if(!C.hasFocus){C.hasFocus=true;
var E=C.value;
var F=E.length;
GD.survey.updateSurveyCharCount(A,G,H,false);
GD.coach.cheer("question"+A+"_coach",GD.survey.surveyCheers,D,F,G,H);
var B="question"+A+"_charCounter";
id(B).style.color=id("question"+A+"_coach").style.color
}GD.survey.surveyWordCountFocus(A);
return true
};
GD.survey.surveyCharCountBlur=function(A,G,H){var D="answer"+A;
var C=id(D);
if(C.hasFocus){C.hasFocus=false;
var E=C.value;
var F=E.length;
GD.survey.updateSurveyCharCount(A,G,H,false);
GD.coach.cheer("question"+A+"_coach",GD.survey.surveyCheers,D,F,G,H,false);
var B="question"+A+"_charCounter";
id(B).style.color=id("question"+A+"_coach").style.color
}GD.survey.surveyWordCountBlur(A);
return true
};
GD.survey.prepareFormForSubmit=function(B){var A=id(B);
if(A){if(A.onsubmit()){YAHOO.widget.Button.addHiddenFieldsToForm(A);
A.submit()
}}return false
};
GD.survey.calcTotalReviewWordCount=function(){var B=0;
for(var A=0;
A<GD.survey.EMPLOYER_REVIEW_TEXT_QUESTION_IDS.length;
A++){var D="answer"+GD.survey.EMPLOYER_REVIEW_TEXT_QUESTION_IDS[A];
var D=id(D);
if(D){var C=D.value;
if(C){B+=C.countWords()
}}}return B
};
GD.survey.checkReviewCounts=function(C){var D=true;
var H;
var I="Please enter at least 5 words.";
var K="Wow, that's wordy!  Do you think that you can get it under 5,000 characters?";
var F="Your summary can not be longer than than 120 characters";
var N="Your downsides to working for this employer cannot be the same as your good reasons.";
var J=id("answer"+GD.survey.EMPLOYER_REVIEW_PROS_QUESTION_ID);
C=id(C);
YAHOO.widget.Button.addHiddenFieldsToForm(C);
if(J){var B=J.value;
if(B){H=B.countWords();
if(B.length>GD.survey.HARD_MAX_EMPLOYER_REVIEW_CHARS){addError(J,K);
D=false
}else{if(H<GD.survey.HARD_MIN_EMPLOYER_REVIEW_WORDS){addError(J,I);
D=false
}}}}var L=id("answer"+GD.survey.EMPLOYER_REVIEW_CONS_QUESTION_ID);
if(L){var B=L.value;
if(B){H=B.countWords();
if(B.length>GD.survey.HARD_MAX_EMPLOYER_REVIEW_CHARS){addError(L,K);
D=false
}else{if(H<GD.survey.HARD_MIN_EMPLOYER_REVIEW_WORDS){addError(L,I);
D=false
}}}}if(J&&L){var A=J.value.trim();
var E=L.value.trim();
if((A.length>0)&&(A==E)){addError(L,N);
D=false
}}J=id("answer"+GD.survey.EMPLOYER_REVIEW_ADVICE_QUESTION_ID);
if(J){var B=J.value;
if(B){if(B.length>GD.survey.HARD_MAX_EMPLOYER_REVIEW_CHARS){addError(J,K);
D=false
}}}J=id("answer"+GD.survey.EMPLOYER_REVIEW_SUMMARY_QUESTION_ID);
if(J){var B=J.value;
if(B){if(B.length>GD.survey.HARD_MAX_EMPLOYER_REVIEW_SUMMARY_CHARS){addError(J,F);
D=false
}}}J=C.elements["questionIdToAnswerMap["+GD.survey.EMPLOYER_REVIEW_CEO_QUESTION_ID+"]"];
var M=GD.dom.getRadioValue(J);
if(M==""){var G=id("answer"+GD.survey.EMPLOYER_REVIEW_CEO_QUESTION_ID+"_pleaseAnswer");
G.style.display="block";
D=false
}return D
};
GD.survey.forceSubmitReviewProcessForm=function(){var A=id("surveyForm");
A.skipWordCountWarning=true;
A.submit();
return false
};
GD.survey.checkReviewWordCountOnSubmit=function(C){var F=true;
var G=true;
var B=false;
var A=id("ShortProcessDescWarningGiven");
if(typeof C.skipWordCountWarning==="boolean"){B=true
}else{if(A){try{B=A.value==="true"
}catch(D){B=false
}}}if(!B){var E=GD.survey.calcTotalReviewWordCount();
if(E<GD.survey.MIN_EMPLOYER_REVIEW_WORDS){G=false;
if(A){A.value="true"
}GD.dialogManager.showPromptDialog("Are you sure you don't have more to say?",null,"MoreToSayPromptDialog",false)
}}return G
};
GD.survey.reviseTitle=function(){GD.ajax.showEditInPlace("UserOcc");
GD.button.enable("PrevButton",false);
GD.button.enable("NextButton",false)
};
GD.survey.finishReviseTitle=function(A,B){if(typeof B!=="boolean"){B=false
}if(B){id("SelectOccUser").focus()
}if(GD.ajax.isEditInPlace("UserOcc")){GD.ajax.finishEditInPlace("UserOcc",A);
GD.button.enable("PrevButton");
GD.button.enable("NextButton")
}};
GD.survey.onEditEnter=function(){id("SaveButton").onclick();
return true
};
GD.survey.onEditCancel=function(){GD.survey.finishReviseTitle(true,true);
return true
};
GD.survey.toggleFindMoreTitles=function(){$("#FindMoreOccListToggle").toggleClass("opened");
if($("#FindMoreOccListToggle").hasClass("opened")){$("#FindMoreOccFields").show("blind")
}else{$("#FindMoreOccFields").hide("blind")
}};
GD.survey.nonSpecificEmployerFormShown=false;
GD.survey.showNonSpecificEmployerForm=function(B,A){if(B){$("#DontSpecifyEmployerCheckbox").attr("checked",B)
}else{$("#DontSpecifyEmployerCheckbox").removeAttr("checked")
}if(B){$("#EmpNameEditFieldLabel").addClass("disabled");
$("#EmployerNameEditField").attr("disabled",true);
if(!A){$("#NonSpecificEmployerDiv").show("blind",null,null,function(){$("#EmployerTypeInput").select().focus()
})
}}else{$("#EmpNameEditFieldLabel").removeClass("disabled");
$("#EmployerNameEditField").removeAttr("disabled");
if(!A){$("#NonSpecificEmployerDiv").hide("blind",null,null,function(){$("#EmployerNameEditField").select().focus()
})
}}$("#SpecificEmployerInput").val(!B);
GD.survey.nonSpecificEmployerFormShown=B
};
GD.survey.toggleNonSpecificEmployerForm=function(){GD.survey.showNonSpecificEmployerForm(!GD.survey.nonSpecificEmployerFormShown,false)
};
GD.survey.showOccList=function(){$("#HiddenOccList").css("display","block");
$("#SeeMoreOccList").html("");
if(GD.isIE()){$("#PageBottom").css("display","none");
$("#PageBottom").css("display","block")
}};
if(typeof GD==="undefined"){var GD={}
}if(typeof GD.survey==="undefined"){GD.survey={}
}GD.survey.invalidNumberError="Please enter a valid number!";
GD.survey.hasNumericValue=function(G,H,F,B){var E;
if(typeof H!="boolean"){H=true
}if(typeof F!="boolean"){F=false
}if(typeof F!="boolean"){F=false
}if(typeof B!="boolean"){B=true
}G=GD.jquery(G);
if(!G.length){return false
}var D=G.val();
D=D.trim();
if(D.length<=0){return B
}var A="^";
if(H){A+="[+-]?"
}if(F){A+="[0-9\\,]*"
}else{A+="[0-9]*"
}A+="(\\.[0-9]*)?$";
A=new RegExp(A);
var C=A.test(D);
return C
};
GD.survey.initSalaryEditForm=function(B,A){id("BasePay").focus();
GD.survey.onVacationFocus(false);
GD.survey.onVacationUpdate();
GD.survey.onCurrencyChange();
if(typeof GD.survey.showNonSpecificEmployerForm==="function"){GD.survey.showNonSpecificEmployerForm(B,A)
}};
GD.survey.getPayPeriodNote=function(){var D=$("#EditSalaryForm");
var B="";
if(D.length){var A=D[0]["form.basePayPeriod"];
var C=GD.dom.getRadioValue(A);
switch(C){case"HOURLY":B="(per hour)";
break;
case"MONTHLY":B="(per month)";
break;
case"ANNUAL":default:B="(per year)";
break
}}return B
};
GD.survey.onPayPeriodUpdate=function(){var C=$("#EditSalaryForm");
var A=C[0]["form.basePayPeriod"];
var B=GD.dom.getRadioValue(A);
switch(B){case"HOURLY":$("#BasePayLabel").html("Hourly Rate");
break;
case"MONTHLY":$("#BasePayLabel").html("Monthly Income");
break;
case"ANNUAL":default:$("#BasePayLabel").html("Annual Salary");
break
}GD.survey.onCurrencyFieldUpdate("#BasePay",GD.survey.getPayPeriodNote(),true);
return true
};
GD.survey.onCurrencyFieldUpdate=function(K,G,A){var L=$(K);
var D=$(K+"Formatted");
var F="";
var E=null;
if(typeof A!=="boolean"){A=false
}if(A){var J=$("#EditSalaryForm");
var C=J[0]["form.basePayPeriod"];
var B=GD.dom.getRadioValue(C);
if(B!="HOURLY"){E=0
}}else{E=0
}if(GD.survey.hasNumericValue(L,true,true)){if(typeof G!="string"){G=""
}if(L.length&&D.length){var I=L.val();
var H=id("Currency").value;
I=I.trim();
I=I.replace(/[\$,]+/g,"");
if(I.length>0){I=parseFloat(I);
if(isNaN(I)||(I==0)){F=""
}else{F=GD.formatNumber(I,H,E);
if(G.length>0){F=F+" "+G
}}}}}else{F=GD.survey.invalidNumberError
}D.html(F);
return true
};
GD.survey.onCurrencyChange=function(){var A=$("#Currency").val();
var B=$("#OtherAmountCurrency");
if(A.length){B.html("(in "+A+")")
}else{B.html("")
}GD.survey.onCurrencyFieldUpdate("#BasePay",GD.survey.getPayPeriodNote(),true);
GD.survey.onCurrencyFieldUpdate("#CashBonusAmount","(per year)");
GD.survey.onAdditionalIncomeRadio("CashBonusSpecified","#CashBonusAmount");
GD.survey.onCurrencyFieldUpdate("#StockBonusAmount","(per year)");
GD.survey.onAdditionalIncomeRadio("StockBonusSpecified","#StockBonusAmount");
GD.survey.onCurrencyFieldUpdate("#ProfitSharingAmount","(per year)");
GD.survey.onAdditionalIncomeRadio("ProfitSharingSpecified","#ProfitSharingAmount");
GD.survey.onCurrencyFieldUpdate("#SalesCommissionAmount","(per year)");
GD.survey.onAdditionalIncomeRadio("SalesCommissionSpecified","#SalesCommissionAmount");
GD.survey.onCurrencyFieldUpdate("#TipsAmount","(per year)");
GD.survey.onAdditionalIncomeRadio("TipsSpecified","#TipsAmount");
return true
};
GD.survey.onAdditionalIncomeRadio=function(C,B){var E=$("#EditSalaryForm");
if(E.length){C=E[0][C];
if(C){var D=GD.dom.getRadioValue(C);
var A=$(B);
D=(D=="true");
if(A.length){if(!D){A.value="";
GD.survey.onCurrencyFieldUpdate(B,"(per year)")
}}}}};
GD.survey.onVacationFocus=function(B){var C=$("#VacationWeeks");
var A="Number of Weeks";
GD.effects.toggleFieldPrompt(C,B,A)
};
GD.survey.onVacationUpdate=function(){var B=$("#VacationWeeksFormatted");
if(GD.survey.hasNumericValue("#VacationWeeks",true,true)){if(B.length){var A="";
var C=id("VacationWeeks").value;
C=C.trim();
if(C.length>0){C=parseFloat(C);
if(isNaN(C)||(C<0)){A=""
}else{if((C>=10)&&(C<50)){A="<span class='negative'>Whoa! Do you really get "+C+" <em>weeks</em> vacation?</span>"
}else{if((C>=50)&&(C<=52)){A="<span class='negative'>Wow! "+C+" weeks? Isn't that technically 'retired'?</span>"
}else{if(C>52){A="<span class='negative'>(There are only 52 weeks in a year!)</span>"
}else{A=C+" week";
if((C==0)||(C>1)){A=A+"s"
}}}}}}}}else{A=GD.survey.invalidNumberError
}B.html(A);
return true
};
GD.survey.getCheckboxes=function(I,A,G,H){var B=document.forms[I];
var A=GD.jquery(A);
var H=GD.jquery(H);
var D=new Array();
if(typeof G=="undefined"){G=null
}if(H.length){H=H[0]
}else{H=null
}for(var E=0;
E<B.elements.length;
E++){var C=$(B.elements[E]);
if(C!=H){if(!A.length||GD.dom.isDescendant(C,A)){var F=C.attr("type");
if(F=="checkbox"){if((G==null)||(C[0].checked==G)){D.push(C[0])
}}}}}return D
};
GD.survey.setCheckboxes=function(E,B,H,A){var G=document.forms[E];
var B=GD.jquery(B);
var A=GD.jquery(A);
if(typeof H!="boolean"){H=true
}for(var D=0;
D<G.elements.length;
D++){var F=$(G.elements[D]);
if(F[0]!=A[0]){if(!B.length||GD.dom.isDescendant(F,B)){var C=F.attr("type");
if(C=="checkbox"){F[0].checked=H
}}}}};
GD.survey.onBenefitsChanged=function(B,D,C,F,A){D=GD.jquery(D);
F=GD.jquery(F);
A=GD.jquery(A);
if(C){if(D.is(":checked")){GD.survey.setCheckboxes(B,F,false,A)
}}else{if(D.is(":checked")){if(A.length){A[0].checked=false
}}else{var E;
E=GD.survey.getCheckboxes(B,F,true,A);
if(E.length==0){if(A.length){A[0].checked=true
}}}}};
if(typeof GD==="undefined"){var GD={}
}if(typeof GD.survey==="undefined"){GD.survey={}
}GD.survey.MAX_INTERVIEW_QUESTIONS=5;
GD.survey.MIN_PROCESS_DESCRIPTION_WORDS=50;
GD.survey.initProcessWordCounter=function(F){F=GD.jquery(F);
if(!F.length){Logger.warn("GD.survey.initProcessWordCounter: no text area field found.")
}F.keyup(GD.survey.onDescribeProcessKeyup);
var D=id("ProcessDescription");
if(D){var B=D.value;
var E=B.countWords();
var C=id("ProcessDescUnderMinimum");
var A=id("ProcessDescOverMinimum");
if(C&&A){if(E>=GD.survey.MIN_PROCESS_DESCRIPTION_WORDS){C.style.display="none";
A.style.display="block"
}else{C.style.display="block";
A.style.display="none"
}}}};
GD.survey.checkWordCountOnSubmit=function(C){var B=true;
var H=id("ProcessDescription");
var A=true;
var E=false;
var I=$("#ShortProcessDescWarningGiven");
if(typeof C.skipWordCountWarning==="boolean"){E=true
}else{if(I.length){try{E=I.val()==="true"
}catch(F){E=false
}}}if(!E){if(H){var D=H.value;
var G=D.countWords();
if(G<GD.survey.MIN_PROCESS_DESCRIPTION_WORDS){A=false;
if(I){I.value="true"
}GD.dialogManager.showPromptDialog("Are you sure you don't have more to say?",null,"MoreToSayPromptDialog",false)
}}}return A
};
GD.survey.forceSubmitInterviewProcessForm=function(){var A=id("InterviewSurveyProcessForm");
A.skipWordCountWarning=true;
A.submit();
return false
};
GD.survey.onDescribeProcessKeyup=function(C){var G=true;
var E=id("ProcessDescription");
if(E){var B=E.value;
var F=B.countWords();
var D=id("ProcessDescUnderMinimum");
var A=id("ProcessDescOverMinimum");
if(D&&A){if(F>=GD.survey.MIN_PROCESS_DESCRIPTION_WORDS){D.style.display="none";
A.style.display="block"
}else{D.style.display="block";
A.style.display="none"
}}else{Logger.warn("[interview.js / onDescribeProcessKeydown] cannot find nodes 'ProcessDescUnderMinimum' and/or 'ProcessDescOverMinimum'")
}}return G
};
GD.survey.addInterviewQuestion=function(){try{var C=$("#AddQuestionTemplate");
var E=$("#AllInterviewQuestionCount");
var B=$("#AddQuestionPrompt");
var G=1+1;
if(C.length&&E.length&&E.val()&&B.length){var D=parseInt(E.val());
if((D!=NaN)&&(D<GD.survey.MAX_INTERVIEW_QUESTIONS)){var L=C.html();
var H;
var I;
if(D%2==0){H="grayBox";
promptClassName="whiteBox"
}else{H="whiteBox";
promptClassName="grayBox"
}if(D+1===GD.survey.MAX_INTERVIEW_QUESTIONS){promptClassName="hidden"
}I=L.printf(D,D+1,H,-1,"","","","");
var K=$("<div>");
K.html(I).css("display","none").css("overflow","hidden");
K.insertBefore(B);
K.show("blind");
GD.augments.augmentContextHelpNode("#QuestionTagHelp"+D);
GD.augments.augmentTagField("#QuestionTagEditor"+D);
$("#QuestionEdit"+D).autogrow();
$("#AnswerEdit"+D).autogrow();
B.attr("class",promptClassName);
var J="QuestionEdit"+D;
var A=id(J);
if(A&&A.focus){A.focus()
}E.val(D+1);
GD.survey.fixCollectQuestionsRenderingOnDefectiveIE()
}}return false
}catch(F){Logger.fatal("interview.js / GD.survey.addInterviewQuestion()",F)
}};
GD.survey.fixCollectQuestionsRenderingOnDefectiveIE=function(){if(GD.isIE()){var A=id("InterviewQuestionsForm");
if(A){A.style.display="none";
A.style.display="block"
}}};
function clearActionErrors(){var A=document.getElementById("actionErrorBlock");
if((typeof A==="object")&&(A!==null)){A.style.display="none"
}}function clearErrorMessages(B){clearActionErrors();
var E=B.getElementsByTagName("div");
var F=[];
var C;
for(C=0;
C<E.length;
C++){var H=E[C];
var I=H.className;
if(I=="fieldError"){F.push(H)
}}for(C=0;
C<F.length;
C++){var A=F[C];
var G=A.parentNode;
try{G.removeChild(A)
}catch(D){}}}function clearErrorLabels(C){clearActionErrors();
var D=C.getElementsByTagName("label");
for(var B=0;
B<D.length;
B++){var A=D[B];
if(A&&A.className){if((A.className==="labelError")||(A.className==="labelErrorRight")){if(A.previousClassName){A.className=A.previousClassName
}else{A.className=""
}}}}}function errorExists(C,A){var D=false;
var F=C.getElementsByTagName("div");
for(var B=0;
B<F.length;
B++){var E=F[B];
var G=E.getElementsByTagName("p")[0];
if(G){var E=G.innerHTML;
E=E.replace(/^\s+/,"");
E=E.replace(/\s+$/,"");
if(E===A){D=true;
break
}}}return D
}function flagLabel(E){if(E.id){var B=E.id;
var G=document.getElementsByTagName("label");
var C=null;
for(var A=0;
A<G.length;
A++){var F=G[A];
if(F&&F.htmlFor&&(F.htmlFor===B)){C=F;
break
}}if(C){var D=false;
if(C.className&&(C.className==="labelOptRight")||(C.className==="labelReqRight")){D=true
}if(C.className){C.previousClassName=C.className
}if(D){C.className="labelErrorRight"
}else{C.className="labelError"
}}}}function addError(N,I){try{var D=N.parentNode;
var F=D.parentNode;
var C=document.getElementById("actionErrorBlock");
if((typeof C==="object")&&(C!==null)){C.style.display="block"
}if(!D||(D.nodeName!=="DIV"&&D.nodeName!=="SPAN"&&D.nodeName!=="SELECT")||!F||F.nodeName!=="DIV"){Logger.warn("[gd-struts-validation.js / addError()] improper node structure found for field name '"+N.name+"'");
return 
}flagLabel(N);
var J=null;
var O=F.getElementsByTagName("div");
if((O!==null)&&(O.length>0)){for(var G=0;
G<O.length;
G++){var L=O[G].className;
if(L==="fieldError"){J=O[G];
break
}}}if(!J){var E=F.getElementsByTagName("div")[0];
var B="<div class='errorMessage'>\n    <p class='stopIcon'>        "+I+"\n    </p></div>\n<div class='clear'></div>";
if(!E){E=F.getElementsByTagName("span")[0]
}J=document.createElement("div");
J.className="fieldError";
J.innerHTML=B;
F.insertBefore(J,E)
}else{if(!errorExists(J,I)){var M=document.createElement("div");
var K="<p>"+I+"</p>\n";
var H=document.createElement("div");
H.className="errorMessage";
H.innerHTML=K;
M.className="clear";
J.appendChild(H);
J.appendChild(M)
}}}catch(A){alert(A)
}};
