if(typeof GD==="undefined"){var GD={}
}if(typeof GD.empInfo==="undefined"){GD.empInfo={}
}GD.empInfo.watchEmployer=function(D,E,A,C){if(typeof D!="function"){D=null
}if(typeof A=="undefined"){A=0
}if(typeof C=="undefined"){C=""
}var B="./watchEmployerAjax.htm?employerId="+E+"&hooversId="+A+"&email="+C;
GD.ajax.request(B,GD.empInfo.watchEmployerCallback,D)
};
GD.empInfo.watchEmployerCallback=function(result){if(result!=null){var response=eval("("+result.responseText+")");
var watchCount=-1;
if(response.employerWatched==true){if(typeof result.data=="function"){result.data(true,response.watchCount)
}}else{if(typeof result.data=="function"){if(response.error!=null&&response.error.length>0){result.data(false,response.watchCount,response.error)
}else{result.data(false)
}}}}};
GD.empInfo.startWatchCallback=function(B,A){if(B){GD.empInfo.toggleWatchUI(true,A)
}};
GD.empInfo.toggleWatchUI=function(B,A){if(typeof B!="boolean"){B=true
}if(typeof A!="number"){A=0
}if(B){id("isNotWatching").style.display="none";
id("isWatching").style.display="inline"
}else{id("isNotWatching").style.display="inline";
id("isWatching").style.display="none"
}id("watchingCount")=A.toString();
return false
};
GD.empInfo.submitSurveyBasedReviewBasicFilter=function(A){var B=id(A);
if(B&&B.submit){GD.augments.uninstallPromptNode("#FilterJobTitle");
B.submit();
GD.dom.clearPage()
}return false
};
GD.empInfo.toggleReviewFilters=function(A,F){var E=id("FilterClosed");
var B=id("FilterOpened");
var D=id("ReviewFilterAdvanced");
if(E&&B&&D){var C=(B.style.display==="block");
if(C){B.style.display="none";
E.style.display="block";
D.style.display="none"
}else{E.style.display="none";
B.style.display="block";
D.style.display="block";
GD.empInfo.initRatingSlider(A,F);
var G=id("FilterJobTitle");
if(G){G.focus()
}}}return false
};
GD.empInfo.initRatingSlider=function(F,D){var A=id("RatingFilterSlider");
if(typeof A==="object"){var B=A.gdSlider;
var E=84;
var G=4/E;
var I=function(K){var J=Math.round(K*G*10)/10;
J+=1;
J+="";
return J
};
if(!B){var C;
if((typeof F=="number")&&(typeof D==="number")){if(F<0){F=0
}else{F=Math.round((F-1)/G)
}if(D<0){D=E
}else{D=Math.round((D-1)/G)
}C=[F,D]
}else{C=[0,E]
}B=YAHOO.widget.Slider.getHorizDualSlider("RatingFilterSlider","RatingFilterSliderThumbLow","RatingFilterSliderThumbHigh",E,0,C);
B.minRange=0;
var H=function(){var J=I(B.minVal);
var K=I(B.maxVal);
id("RatingFilterValueLow").innerHTML=J;
id("RatingFilterValueHigh").innerHTML=K;
id("FilterRatingLow").value=J;
id("FilterRatingHigh").value=K
};
B.subscribe("ready",H);
B.subscribe("change",H);
A.gdSlider=B
}}};
GD.empInfo.onShareDialogLoad=function(A){if(A){GD.site.trackURL(A)
}id("InviteFriendsForm_inviteMessageUIData_emailAddresses").focus()
};
GD.empInfo.showShareEmployerSectionPageDialogBox=function(E,D,C,B){var A="/employerInfo/popup/sharePageDialog";
return GD.empInfo.showShareDialogBox(E,D,C,false,false,B,A)
};
GD.empInfo.showShareReviewDialogBox=function(G,F,E,D,B,C){var A="/employerInfo/popup/shareReviewDialog";
return GD.empInfo.showShareDialogBox(G,F,E,D,B,C,A)
};
GD.empInfo.showShareDialogBox=function(G,F,E,D,B,C,A){urlShareDialog="/employerInfoAndSearch/shareReviewPopup_input.htm?employerId="+G+"&currentSection="+F;
if(D){urlShareDialog+="&singleReview=true"
}if(B){urlShareDialog+="&singleQuestion=true"
}urlShareDialog+="&shareURL="+encodeURIComponent(E);
if(C){urlShareDialog+="&"+C
}GD.dialogManager.addAjaxDialog(urlShareDialog,null,true,false,true,"GD.empInfo.closeReviewDialog()",null,function(){GD.empInfo.onShareDialogLoad(A)
});
return false
};
GD.empInfo.closeReviewDialog=function(){GD.dialogManager.closeAllDialogs()
};
GD.empInfo.submitShareDialog=function(){var A=document.getElementById("InviteFriendsForm");
GD.ajax.submitForm("InviteFriendsForm",A.action,GD.empInfo.processShareDialogResult);
return false
};
GD.empInfo.processShareDialogResult=function(A){if(typeof (A)!="undefined"){if((A.json!=null)&&(A.json.resultCode=="success")){GD.empInfo.closeReviewDialog()
}else{GD.dialogManager.getCurrentDialog().setContents(A.responseText)
}}else{GD.empInfo.closeReviewDialog()
}};
GD.empInfo.submitJobDetailsFilter=function(){var A=id("SalaryJobSummaryFilterForm");
if(A&&A.submit){A.submit()
}return false
};
GD.empInfo.submitSalaryBasicFilter=function(){var A=id("SalaryFilterBasicForm");
if(A&&A.submit){GD.augments.uninstallPromptNode("#FilterJobTitle");
A.submit();
GD.dom.clearPage()
}return false
};
GD.empInfo.onBasicFilterSearchButtonClick=function(){GD.augments.uninstallPromptNode("#FilterJobTitle");
GD.dom.clearPage();
return true
};
GD.empInfo.submitEmpInfoSortChange=function(B){if(B&&B.options){var A=B.options[B.selectedIndex].value;
if(A){GD.dom.clearPageAndRedirect(A)
}}};
GD.empInfo.getEmployerOverallRatingDetails=function(D,H,F,G){var B=$("#CompanyRatingDetailsContainer");
var E=B.html().trim();
var C;
var A;
if(E.length>0){return 
}if(isNaN(D)){return 
}B.html("<img src='/static/img/icons/wait/spinner-orange-16.gif' width='16' height='16' alt='please wait...' class='spinner' />");
C="/Reviews/findEmployerOverallRollupDetailsAjax.htm?employerId="+D;
if((H.trim().length!=0)&&(F.trim().length!=0)){C+="&locationId="+H+"&locationType="+F
}if(G.trim().length!=0){C+="&jobTitle="+encodeURIComponent(G)
}var I;
I={url:C,dataType:"json",success:function(J,K){GD.empInfo.locationResponseHandler(J)
},error:function(J,L,K){GD.empInfo.locationResponseHandler(null)
}};
jQuery.ajax(I)
};
GD.empInfo.locationResponseHandler=function(F){var G;
if(F==null){G="<p><strong>An error occurred in retrieving the details for this company.</strong></p><p>Please try again.  If the problem persists, please be assured that our engineers are scrambling to fix the problem.</p>"
}else{var E=F.resultSet;
G="<table>";
for(var B=0;
B<E.length;
B++){var D=E[B];
var C="gdRatingValue ";
if(D.value>=4){C+="gdrHigh"
}else{if(D.value>=2){C+="gdrMid"
}else{if(D.value==0){C+="gdrNotApplicable"
}else{C+="gdrLow"
}}}G+="<tr>";
G+="<th>"+D.question+"</th>";
G+="<td><span class='"+C+"'>"+D.value+"</span></td>";
G+="</tr>"
}G+="</table>"
}var A=$("#CompanyRatingDetailsContainer");
A.html(G);
GD.effects.constructBrowserShim("CompanyRatingDetails")
};
GD.empInfo.markHelpfulReview=function(B,C,D){if((B==null)){throw"GD.empInfo.markHelpfulReview must have an id."
}if((C==null)){throw"GD.empInfo.markHelpfulReview must have a type indicator."
}if((D==null)){throw"GD.empInfo.markHelpfulReview must have a helpful indicator."
}var A;
if(C=="EMPLOYER_REVIEW"){A="/Reviews/markHelpfulReviewAjax.htm?respondableId="
}else{if(C=="INTERVIEW_REVIEW"){A="/Interview/markHelpfulReviewAjax.htm?respondableId="
}else{if(C=="USER_QUESTION"){A="/Interview/markHelpfulQuestionAjax.htm?respondableId="
}else{if(C=="USER_RESPONSE"){A="/employerInfoAndSearch/markHelpfulResponseAjax.htm?respondableId="
}}}}var F={success:GD.empInfo.markHelpfulReviewCallback,failure:GD.empInfo.markHelpfulReviewCallback};
var E;
E=YAHOO.util.Connect.asyncRequest("POST",A+encodeURIComponent(B)+"&helpful="+encodeURIComponent(D),F,null);
return false
};
GD.empInfo.markHelpfulReviewCallback=function(response){if((response!=null)&&(response.responseText.length>0)){var result=eval("("+response.responseText+")");
if(result.respondableId&&result.type){var messageBlock=$("#helpful_"+result.type+"_"+result.respondableId);
if(messageBlock.length){messageBlock.html("Thanks for your feedback.")
}messageBlock=$("#helpfulSummary_"+result.type+"_"+result.respondableId);
var countBlock=id("helpfulCount_"+result.type+"_"+result.respondableId);
var totalBlock=id("helpfulTotal_"+result.type+"_"+result.respondableId);
if(messageBlock.length&&countBlock&&totalBlock){if(result.helpful){countBlock.innerHTML=(countBlock.innerHTML-0)+1
}totalBlock.innerHTML=(totalBlock.innerHTML-0)+1;
if(messageBlock.hasClass("hidden")){messageBlock.removeClass("hidden")
}else{var tagName=messageBlock[0].tagName.toLowerCase();
if(tagName=="span"){messageBlock.style.display="inline"
}else{messageBlock.style.display="block"
}}}}else{throw"GD.empInfo.markHelpfulReviewCallback - missing response."
}}else{throw"GD.empInfo.markHelpfulReviewCallback - missing response."
}};
GD.empInfo.onInterviewReviewSearchButtonClick=function(){GD.augments.uninstallPromptNode("#FilterJobTitle");
GD.dom.clearPage();
return true
};
GD.empInfo.showAllInterviewTopJobs=function(){var A=id("TopJobsListShort");
var B=id("TopJobsListLong");
if(A){A.style.display="none"
}if(B){B.style.display="inline"
}return false
};
GD.empInfo.clearInterviewReviewFilters=function(){var A=id("FilterLocation");
var C=id("FilterJobTitle");
var B=id("InterviewsFilterBasicForm");
if(A&&A.selectedIndex){A.selectedIndex=0
}if(C){C.value=""
}GD.augments.uninstallPromptNode("#FilterJobTitle");
if(B){B.submit()
}GD.dom.clearPage();
return true
};
GD.empInfo.toggleAddTagModule=function(A){var B=$("#AddTagsForm_"+A);
var C=$("#AddTagsToggle_"+A);
if(B.length){var D=(B.css("display")!="none");
if(D){B.css("display","none");
if(C.length){C.css("background-image","url(/static/img/icons/arrows/right.gif)")
}}else{B.css("display","block");
if(C.length){C.css("background-image","url(/static/img/icons/arrows/down.gif)")
}B.find("input[type='text']").focus()
}}return false
};
GD.empInfo.cancelAddTag=function(A,B){GD.empInfo.toggleAddTagModule(A);
GD.augments.clearTags(B);
return false
};
GD.empInfo.addTagsToQuestion=function(A){try{if((A==null)){throw"must have a question id."
}var D=id("QuestionTagEditor_"+A+"_Value");
if((D==null)){throw"must have tag editor input field."
}var B;
B=D.value;
if(B==null||B.length==0){var C=id("TagError_"+A);
C.innerHTML="You must enter a value for this field.";
C.style.display="block";
return 
}else{var C=id("TagError_"+A);
C.innerHTML="";
C.style.display="none"
}var G={success:GD.empInfo.addTagsToQuestionCallBack,failure:GD.empInfo.addTagsToQuestionCallBack,argument:{tagEditorId:"QuestionTagEditor_"+A}};
var F;
F=YAHOO.util.Connect.asyncRequest("POST","/Interview/addTagsToQuestion.htm?questionId="+encodeURIComponent(A)+"&newTags="+encodeURIComponent(B),G,null);
GD.empInfo.toggleAddTagModule()
}catch(E){Logger.fatal("GD.empInfo.addTagsToQuestion",E)
}return false
};
GD.empInfo.addTagsToQuestionCallBack=function(response){var expandableTagsThreshold=9;
try{if((response!=null)&&(response.responseText.length>0)){var result=eval("("+response.responseText+")");
if(result.questionId){if(result.error){var errorBlock=id("TagError_"+result.questionId);
errorBlock.innerHTML=result.error;
errorBlock.style.display="block"
}else{if(result.tagsWithLinks){var tagBlock=id("QuestionTags_"+result.questionId);
GD.tagList.addTags(result.questionId,result.tagsWithLinks);
tagBlock.style.display="block";
if(response.argument&&response.argument.tagEditorId){GD.augments.clearTags(response.argument.tagEditorId)
}}else{throw"missing error or tags."
}}}else{throw"missing question id."
}}else{throw"missing response."
}}catch(e){Logger.fatal("interviews.js / GD.empInfo.addTagsToQuestionCallBack()",e)
}};
GD.empInfo.toggleDifficultyFilters=function(A,F){var E=id("FilterClosed");
var B=id("FilterOpened");
var D=id("InterviewReviewFilterAdvanced");
if(E&&B&&D){var C=(B.style.display==="block");
if(C){B.style.display="none";
E.style.display="block";
D.style.display="none"
}else{E.style.display="none";
B.style.display="block";
D.style.display="block";
GD.empInfo.initDifficultySlider(A,F);
var G=id("FilterJobTitle");
if(G){G.focus()
}}}return false
};
GD.empInfo.initDifficultySlider=function(F,D){var A=id("DifficultyFilterSlider");
if(typeof A==="object"){var B=A.gdSlider;
var E=84;
var G=4/E;
var I=function(K){var J=Math.round(K*G*10)/10;
J+=1;
J+="";
return J
};
if(!B){var C;
if((typeof F=="number")&&(typeof D==="number")){if(F<0){F=0
}else{F=Math.round((F-1)/G)
}if(D<0){D=E
}else{D=Math.round((D-1)/G)
}C=[F,D]
}else{C=[0,E]
}B=YAHOO.widget.Slider.getHorizDualSlider("DifficultyFilterSlider","DifficultyFilterSliderThumbLow","DifficultyFilterSliderThumbHigh",E,0,C);
B.minRange=0;
var H=function(){var J=I(B.minVal);
var K=I(B.maxVal);
id("RatingFilterValueLow").innerHTML=J;
id("RatingFilterValueHigh").innerHTML=K;
id("FilterRatingLow").value=J;
id("FilterRatingHigh").value=K
};
B.subscribe("ready",H);
B.subscribe("change",H);
A.gdSlider=B
}}};
