BJUtil.help=new Object;BJUtil.help.widgets=new Object;BJUtil.help.widgets.activeId=false;BJUtil.help.widgets.checkTimer=false;BJUtil.help.widgets.mouseXY=[0,0];BJUtil.help.togglersList=new Array;BJUtil.help.tooltipsList=new Array;BJUtil.help.tooltipsById=new Object;BJUtil.help.fakeWidgetsList=new Array;BJUtil.help.helpAreasList=new Array;BJUtil.help.helpTextCache=new Array;BJUtil.help.display=false;BJUtil.help.loaded=false;BJUtil.help.init=function(){var a=YAHOO.util.Dom.getElementsByClassName("utilHelpToggler","a");if(a&&a.length>0){for(var b=0;b<a.length;b++){if(BJUtil.help.togglersList.indexOf(a[b])<0){BJUtil.help.togglersList.push(a[b]);a[b].style.cursor="pointer";YAHOO.util.Event.addListener(a[b],"click",BJUtil.help.toggle)}}}if(BJUtil.help.display==true){BJUtil.help.show()}};BJUtil.help.loadTooltips=function(){var a=YAHOO.util.Dom.getElementsByClassName("utilHelpArea","div").concat(YAHOO.util.Dom.getElementsByClassName("utilHelpArea","span"));if(a&&a.length>0){var b=BJUtil.help.helpAreasList.length;for(var c=0;c<a.length;c++){if(!YAHOO.util.Dom.hasClass(a[c],"tooltipWidgetLink")){BJUtil.help.helpAreasList.push(a[c])}}if(b<=BJUtil.help.helpAreasList.length){for(var c=0;c<b;c++){BJUtil.help.tooltipsList[c].div=document.getElementById(BJUtil.help.tooltipsList[c].id)}for(var c=b;c<BJUtil.help.helpAreasList.length;c++){if(typeof BJUtil.help.tooltipsList[c]=="undefined"){BJUtil.help.widgets.setupWidget(c)}else{};}}}return true};BJUtil.help.widgets.setupWidget=function(a){if(typeof BJUtil.help.tooltipsList[a]=="undefined"){BJUtil.help.tooltipsList[a]=new Object;BJUtil.help.tooltipsList[a].div=BJUtil.help.helpAreasList[a];if(BJUtil.help.helpAreasList[a].id==""){BJUtil.help.helpAreasList[a].id="utilHelpArea"+a}BJUtil.help.tooltipsList[a].id=BJUtil.help.helpAreasList[a].id;YAHOO.util.Dom.addClass(BJUtil.help.helpAreasList[a],"tooltipWidgetLink");BJUtil.help.tooltipsById[BJUtil.help.helpAreasList[a].id]=a;BJUtil.help.tooltipsList[a].hide="widgetclose('"+BJUtil.help.helpAreasList[a].id+"Widget');";var b=BJUtil.help.tooltipsList[a].div.getAttribute("helpText");if(!b){var c=BJUtil.help.tooltipsList[a].div.getAttribute("helpTextProxy");if(c){b=String(document.getElementById("helpTextProxy-"+c).innerHTML)}else{var d=BJUtil.help.tooltipsList[a].div.getAttribute("helpTextXML");if(d){if(typeof BJUtil.help.helpTextCache[d]!="undefined"){b=BJUtil.help.helpTextCache[d]}else{xml=String(document.getElementById("helpTextXML-"+d).innerHTML);xml=xml.substring(xml.indexOf("<root>"));xml=xml.substring(0,xml.indexOf("</root>")+7);var e=XMLObjectifier.xmlToJSON(XMLObjectifier.textToXML(xml));e=e.help;b=e[0].Text;var f="";f+="<table style='width:100%;'><tbody><tr class='actionlist'><td>";for(var g=1;g<e.length;g++){f+='<div style="padding:2px 3px;">';f+='<div style="cursor:pointer;padding:1px 6px;" id="'+BJUtil.help.helpAreasList[a].id+"fakeWidget_helper"+g+'" class="utilHelpArea tipAlignLeft" helpText="'+e[g].Text+'">'+e[g].label+"</div>";f+="</div>"}f+="</td></tr></tbody></table>";if(BJUtil.help.tooltipsList[a].div&&typeof BJUtil.help.tooltipsList[a].div.firstChild!="undefined"){var h=BJUtil.help.tooltipsList[a].div.childNodes;for(var i=0;i<h.length;i++){if(h[i].tagName=="A"&&YAHOO.util.Dom.hasClass(h[i],"widget")){var j=new Object;var k=h[i];var l=String(k.innerHTML);if(k.helpTitleText!=null){l=k.helpTitleText}else{if(k.attributes.helpTitleText!=null){l=k.attributes.helpTitleText.value}}var m='<div class="pWidget4_Box" style="width:150px;">';m+='  <div id="'+BJUtil.help.helpAreasList[a].id+'fakeWidget_Top" class="pWidget4_Top">';m+='    <div id="'+BJUtil.help.helpAreasList[a].id+'fakeWidget_Close" class="pWidget4_Close">';m+="       <div>X";m+="       </div>";m+="    </div>";m+='    <div class="clear"></div>';m+="  </div>";m+='  <div id="'+BJUtil.help.helpAreasList[a].id+'fakeWidget_Title" class="pWidget4_Title">';m+="    "+l.replace(/[^a-zA-Z0-9\s]/g," ")+" Help";m+="  </div>";m+='  <div class="pWidget4_Content" id="'+BJUtil.help.helpAreasList[a].id+'fakeWidget_Content">';m+=f;m+="  </div>";m+="</div>";var n=document.createElement("div");n.style.visibility="hidden";n.id=BJUtil.help.helpAreasList[a].id+"fakeWidget";n.style.position="absolute";n.innerHTML=m;document.body.appendChild(n);Bounty.widgets.shadow.add(n);Bounty.widgets.shadow.update(n);j.link=k;j.div=n;BJUtil.help.fakeWidgetsList[BJUtil.help.fakeWidgetsList.length]=j;YAHOO.util.Event.addListener(String(BJUtil.help.helpAreasList[a].id+"fakeWidget_Close"),"mousedown",function(a){this.parentNode.parentNode.parentNode.parentNode.parentNode.style.display="none"});YAHOO.util.Event.addListener(String(BJUtil.help.helpAreasList[a].id+"fakeWidget_Close"),"mouseover",function(){YAHOO.util.Dom.addClass(this,"closeHover")});YAHOO.util.Event.addListener(String(BJUtil.help.helpAreasList[a].id+"fakeWidget_Close"),"mouseout",function(){YAHOO.util.Dom.removeClass(this,"closeHover")});j.div.style.display="none";j.div.style.visibility="visible";for(var g=1;g<e.length;g++){var o=document.getElementById(BJUtil.help.helpAreasList[a].id+"fakeWidget_helper"+g);var p=BJUtil.help.helpAreasList.push(o)-1;o.id="utilHelpArea"+p;o.setAttribute("id",o.id);BJUtil.help.widgets.setupWidget(p)}break}}}BJUtil.help.helpTextCache[d]=b}}}}if(b){b=b.replace(/\n\r/g," ").replace(/\r/g," ").replace(/\n/g," ");b=b.replace(new RegExp("'","g"),"\\'");b=b.replace(new RegExp("<hr>","g"),"<br><br>");BJUtil.help.tooltipsList[a].show="legacyWidgetsPopup.showTooltipPopup('"+BJUtil.help.helpAreasList[a].id+"',false,'"+b+"');";BJUtil.help.tooltipsList[a].region=YAHOO.util.Dom.getRegion(BJUtil.help.tooltipsList[a].div)}}};BJUtil.help.widgets.show=function(e){if(!e){var e=window.event}BJUtil.help.widgets.mouseXY=YAHOO.util.Event.getXY(e);if(BJUtil.help.display){if(!(BJUtil.help.widgets.activeId&&BJUtil.help.widgets.activeId==this.id)){if(BJUtil.help.widgets.activeId&&BJUtil.help.widgets.activeId!=this.id){widgetclose(BJUtil.help.widgets.activeId+"Widget");BJUtil.help.widgets.hide(e,BJUtil.help.widgets.activeId,true)}var i=BJUtil.help.tooltipsById[this.id];if(BJUtil.help.tooltipsList[i]&&(!BJUtil.help.tooltipsList[i].visibile||Bounty.widgets.widget[this.id+"Widget"]!=null&&!Bounty.widgets.widget[this.id+"Widget"].isVisible())){BJUtil.help.tooltipsList[i].visibile=true;if(BJUtil.help.widgets.checkTimer){clearTimeout(BJUtil.help.widgets.checkTimer)}var divGet=document.getElementById(BJUtil.help.tooltipsList[i].id+"Widget");if(divGet&&typeof divGet.firstChild!="undefined"&&divGet.firstChild){if(typeof divGet.firstChild.style!="undefined"){divGet.firstChild.style.display=""}}eval(BJUtil.help.tooltipsList[i].show);var parent=BJUtil.help.tooltipsList[i].div.parentNode;if(parent&&parent.title&&parent.title!=""){BJUtil.help.tooltipsList[i].parentTitle=parent.title;parent.setAttribute("title","")}var children=BJUtil.help.tooltipsList[i].div.childNodes;if(typeof children[0]!="undefined"&&children){for(var ci=0;ci<children.length;ci++){var child=children[ci];if(typeof child.getAttribute!="undefined"&&child.getAttribute("title")&&child.getAttribute("title")!=""){if(typeof child.tagName!="undefined"){BJUtil.help.tooltipsList[i].childTitle=child.getAttribute("title");child.setAttribute("title","");child.title=""}}}}BJUtil.help.widgets.activeId=this.id;BJUtil.help.tooltipsList[i].tipRegion=YAHOO.util.Dom.getRegion(BJUtil.help.tooltipsList[i].id+"Widget");YAHOO.util.Event.addListener(document.body,"mousemove",BJUtil.help.widgets.check)}}}};BJUtil.help.widgets.check=function(a){if(!a){var a=window.event}if(a&&typeof a!="undefined"){BJUtil.help.widgets.mouseXY=YAHOO.util.Event.getXY(a)}if(BJUtil.help.widgets.activeId){BJUtil.help.widgets.hide(a,BJUtil.help.widgets.activeId)}else{if(Bounty.widgets.foregroundId.indexOf("utilHelpArea")>-1){BJUtil.help.widgets.hide(a,Bounty.widgets.foregroundId.replace("Widget",""))}}};BJUtil.help.widgets.hide=function(a,b,c){if(!a){var a=window.event}if(!b){b=this.id}var d=BJUtil.help.tooltipsById[b];if(b&&BJUtil.help.tooltipsList[d]){var e=YAHOO.util.Event.getXY(a);var f=e[0],g=e[1];var h=BJUtil.help.tooltipsList[d].region;var i=BJUtil.help.tooltipsList[d].tipRegion;if(h==null||h==false){BJUtil.help.tooltipsList[d].region=YAHOO.util.Dom.getRegion(BJUtil.help.tooltipsList[d].div);h=BJUtil.help.tooltipsList[d].region}var j=7;if(c||!(f>=h.left-j&&f<=h.right+j&&g>=h.top-j&&g<=h.bottom+j||f>=i.left-j&&f<=i.right+j&&g>=i.top-j&&g<=i.bottom+j)){if(BJUtil.help.widgets.checkTimer){clearTimeout(BJUtil.help.widgets.checkTimer)}widgetclose(b+"Widget");var k=document.getElementById(b+"Widget");if(k&&typeof k.firstChild!="undefined"&&k.firstChild){k.firstChild.style.display="none";var l=BJUtil.help.tooltipsList[d].div.parentNode;if(typeof BJUtil.help.tooltipsList[d].parentTitle!="undefined"&&BJUtil.help.tooltipsList[d].parentTitle){l.setAttribute("title",BJUtil.help.tooltipsList[d].parentTitle)}var m=BJUtil.help.tooltipsList[d].div.childNodes;if(typeof m[0]!="undefined"&&m){for(var n=0;n<m.length;n++){var o=m[n];if(typeof o.setAttribute!="undefined"&&typeof BJUtil.help.tooltipsList[d].childTitle!="undefined"&&BJUtil.help.tooltipsList[d].childTitle){o.setAttribute("title",BJUtil.help.tooltipsList[d].childTitle)}}}}BJUtil.help.widgets.activeId=false;BJUtil.help.widgets.checkTimer=setTimeout("BJUtil.help.widgets.stopCheck()",500)}}};BJUtil.help.widgets.stopCheck=function(){YAHOO.util.Event.removeListener(document.body,"mousemove",BJUtil.help.widgets.check)};BJUtil.help.toggle=function(){if(BJUtil.help.display){BJUtil.help.hide()}else{BJUtil.help.show()}};BJUtil.help.createFeedbackTip=function(){var a=YAHOO.util.Dom.getRegion("feedbackbox");var b=document.createElement("div");b.id="helpFeedbackTip";b.style.position="absolute";feedbackText="Place the cursor over the yellow highlights to learn ";feedbackText+="more and click Hide Help when you are done.";b.innerHTML=feedbackText;document.body.appendChild(b);var c=document.getElementById("MainNavMenus");if(c){document.body.appendChild(c)}YAHOO.util.Dom.addClass(b,"feedbacktext");YAHOO.util.Dom.addClass(b,"utilHelpAreaHighlighted");b.pushContentDown=0;if(YAHOO.util.Dom.hasClass("MainHeaderTab","MainHeaderTab_long","MainHeaderTab_long_long")){a[0]+=-60;b.pushContentDown=12}if(document.getElementById("feedbacktext")){b.pushContentDown+=8}YAHOO.util.Dom.setXY(b,a);return b};BJUtil.help.positionFeedbackTip=function(){document.body.style.position="relative";var a=YAHOO.util.Dom.getRegion("feedbackbox");var b=YAHOO.util.Dom.getRegion("helpFeedbackTip");b.width=b.right-b.left;var c=document.getElementById("helpFeedbackTip");if(YAHOO.util.Dom.hasClass("MainHeaderTab","MainHeaderTab_long","MainHeaderTab_long_long")){a[0]+=-60;leftBlock=YAHOO.util.Dom.getRegion("MainHeaderTab_left");if(b.width+a[0]+5>=leftBlock[0]){a[0]=leftBlock[0]-5-b.width}a[1]=b[1]}YAHOO.util.Dom.setXY(c,a)};BJUtil.help.showFakeWidgets=function(){for(var a=0;a<BJUtil.help.fakeWidgetsList.length;a++){BJUtil.help.fakeWidgetsList[a].div.style.display="block"}BJUtil.help.positionFakeWidgets()};BJUtil.help.hideFakeWidgets=function(){for(var a=0;a<BJUtil.help.fakeWidgetsList.length;a++){BJUtil.help.fakeWidgetsList[a].div.style.display="none"}};BJUtil.help.positionFakeWidgets=function(){for(var a=0;a<BJUtil.help.fakeWidgetsList.length;a++){var b=BJUtil.help.fakeWidgetsList[a].link;for(n=0;n<3;n++){if(!YAHOO.util.Dom.hasClass(b,"buttonbg")){b=b.parentNode}}var c=YAHOO.util.Dom.getRegion(b);c[0]+=-56;c[1]+=c.bottom-c.top-2;var d=Math.round(document.getElementById("wrapper").offsetLeft);if(Math.round(c[0])<d){c[0]=d+20}YAHOO.util.Dom.setXY(BJUtil.help.fakeWidgetsList[a].div,c)}};BJUtil.help.show=function(){if(!BJUtil.help.loaded){BJUtil.help.loaded=BJUtil.help.loadTooltips()}var a=BJUtil.help.togglersList;if(a&&a.length>0){for(var b=0;b<a.length;b++){a[b].innerHTML="Hide Help"}}if(document.getElementById("regionTR")){t1=document.getElementById("regionTR");t2=document.getElementById("jobCategoryTR");t3=document.getElementById("industryTR");t4=document.getElementById("goButtonTR");if(t1&&t2&&t3&&t4){t1.setAttribute("notitle",t1.getAttribute("title"));t1.setAttribute("title","");t2.setAttribute("notitle",t2.getAttribute("title"));t2.setAttribute("title","");t3.setAttribute("notitle",t3.getAttribute("title"));t3.setAttribute("title","");t4.setAttribute("notitle",t4.getAttribute("title"));t4.setAttribute("title","")}}if(BJUtil.help.tooltipsList&&BJUtil.help.tooltipsList.length>0){for(var b=0;b<BJUtil.help.tooltipsList.length;b++){YAHOO.util.Dom.addClass(BJUtil.help.tooltipsList[b].div,"utilHelpAreaHighlighted");YAHOO.util.Event.addListener(BJUtil.help.tooltipsList[b].div,"mouseover",BJUtil.help.widgets.show);YAHOO.util.Event.addListener(BJUtil.help.tooltipsList[b].div,"mouseout",BJUtil.help.widgets.hide)}}var c=document.getElementById("helpFeedbackTip");if(!c){c=BJUtil.help.createFeedbackTip()}else{c.style.display="block"}document.getElementById("MainContent").style.marginTop=c.pushContentDown+"px";BJUtil.help.display=true;YAHOO.util.Event.addListener(window,"resize",BJUtil.help.resize);BJUtil.help.showFakeWidgets()};BJUtil.help.resize=function(){BJUtil.help.positionFeedbackTip();BJUtil.help.positionFakeWidgets();for(var a=0;a<BJUtil.help.tooltipsList.length;a++){BJUtil.help.tooltipsList[a].region=YAHOO.util.Dom.getRegion(BJUtil.help.tooltipsList[a].div);BJUtil.help.tooltipsList[a].tipRegion=YAHOO.util.Dom.getRegion(BJUtil.help.tooltipsList[a].id+"Widget")}};BJUtil.help.hide=function(){YAHOO.util.Event.removeListener(window,"resize",BJUtil.help.resize);var a=BJUtil.help.togglersList;if(a&&a.length>0){for(var b=0;b<a.length;b++){a[b].innerHTML="Help"}}document.getElementById("MainContent").style.marginTop="";if(document.getElementById("regionTR")){t1=document.getElementById("regionTR");t2=document.getElementById("jobCategoryTR");t3=document.getElementById("industryTR");t4=document.getElementById("goButtonTR");if(t1&&t2&&t3&&t4){t1.setAttribute("title",t1.getAttribute("notitle"));t2.setAttribute("title",t2.getAttribute("notitle"));t3.setAttribute("title",t3.getAttribute("notitle"));t4.setAttribute("title",t4.getAttribute("notitle"))}}if(BJUtil.help.tooltipsList&&BJUtil.help.tooltipsList.length>0){for(var b=0;b<BJUtil.help.tooltipsList.length;b++){YAHOO.util.Dom.removeClass(BJUtil.help.tooltipsList[b].div,"utilHelpAreaHighlighted");YAHOO.util.Event.removeListener(BJUtil.help.tooltipsList[b].div,"mouseover",BJUtil.help.widgets.show);YAHOO.util.Event.removeListener(BJUtil.help.tooltipsList[b].div,"mouseout",BJUtil.help.widgets.hide)}}var c=document.getElementById("helpFeedbackTip");if(c){c.style.display="none"}BJUtil.help.hideFakeWidgets();BJUtil.help.display=false};YAHOO.util.Event.onContentReady("bottom_border",function(a){if(BJUtil!=null&&BJUtil.help!=null){BJUtil.help.init()}},this);
