function gaTrack(e){_gaq=window._gaq||[],_gaq.push(["_trackPageview",e])}function gaEvent(e){_gaq=window._gaq||[],e.splice(0,0,"_trackEvent"),_gaq.push(e),window.tf&&window.tf.isDebug()&&console.log("GA Event: "+e)}function showOverlay(e){window.helpPopup&&helpPopup.hide();var t=$("#overlay");tf.ie6&&t.height(Math.max($("body").height(),1200)),t.show(),e&&t.css("opacity",0).animate({opacity:.7},e),tf.ie6||$("#headerAnnounce").css("top","0px")}function hideOverlay(){window.helpPopup&&helpPopup.hide(),$("#overlay").hide(),tf.ie6||$("#headerAnnounce").css("top",null)}function initLoginIframe(){function e(t,i,n,r){t.length>0?t[0]($.extend({},i),function(o){o&&(n.willReload=n.willReload&&o.willReload,n.href=n.href||o.href),e(t.slice(1),i,n,r)}):r&&r(n)}tf=window.tf||{},tf.loginIframeReload=1;var t=new tf.Mutex,i=[];tf.loginIframeAddcallback=function(e,t){i.splice(t?0:i.length,0,e)},tf.loginIframeRemoveCallback=function(e){i=$.grep(i,function(t){return t!=e})},tf.loginIframeAddcallback(function(e,t){if(e.isLoggedIn&&(tf.toggleLogInPane(0,1),$("#headerSignInPane").toggle(!e.isLoggedIn),$("#headerSignedInPane").toggle(e.isLoggedIn),e.isLoggedIn)){var i=getLoggedInUser();i&&($("#headerUsername").text(tf.truncate(i.fullName,25)).toggleClass("broadcastingEvents",tf.isAdmin()&&!i.silent),$("#headerMyInfo").attr("href",getHost()+"/profile?uid="+i.userId))}t(e)}),tf.access={pro:1,prior:2,granted:3,email:4,cancel:5},tf.accessType={pnl:0,pdf:1,analyst_text:2,article:3},tf.accessTypeInv=["pnl","pdf","analyst_text","article"],tf.requireAccess=function(e,i,n,r,o){function a(e,t){t&&(c.hide(),window.hideOverlay&&hideOverlay()),r&&r({status:e,access:e<4})}function s(t,n){"success"==tf.status(t,n)?(t.granted&&(properties.fullAccessSymbols().push(e),gaEvent(["fullaccess","granted:"+e,tf.accessTypeInv[i]])),u&&u.notifyAccessGranted(),$(".lockAccessBlue").hide(),a(t.granted?tf.access.granted:tf.access.prior)):(l(),gaEvent(["fullaccess","failed:"+e,tf.accessTypeInv[i]]))}function l(){function o(e,t,i,n){var r=tf.accessType;return t==r.analyst_text?"/company?hm="+e+".trefis&from=accessEmail"+(1==i.type||3==i.type?"&driver="+i.id:"")+(1==i.type?"&div=true":"")+"&scroll=1":t==r.article?"/articles/"+i.articleId+"?from=accessEmail":t==r.pdf?"/company?hm="+e+".trefis&from=accessEmail&pdf=1":t==r.pnl?"/company?hm="+e+".trefis&from=accessEmail&driver="+i.id:void 0}function s(o){t.a()&&tf.ajax({type:"POST",url:getHost()+"/servlet/AccessService/scheduleEmail",dataType:"json",data:{symbol:e,type:i,extra:JSON.stringify(n)},success:function(s,l){t.r(),"success"==tf.status(s,l)?a(tf.access.email,1):(announce("Error scheduling email",1),o&&tf.requireAccess(e,i,n,r))},error:function(a,s,l){t.r(),tf.ajaxError(a,s,l),announce("Unexpected error scheduling email",1),o&&tf.requireAccess(e,i,n,r)}})}function l(){return a(tf.access.cancel,1),!1}function u(t,o,a){o&&o(),c.css({zIndex:100}),a?s(1):tf.requireAccess(e,i,n,r)}function h(e,t){u(e,t,1)}tf.getComponent("popup/accessPopup",function(t){var r=window.getSwfObj&&-1!=location.href.indexOf("company"),a=r?getSwfObj():0,p=a&&a.userModelId?a.userModelId():0,f="postSubscribe="+escape(o(e,i,n,!d&&p?["userModelId="+p]:[]))+"; path=/";announceClear(),c.html(t).show(),tf.initPopup(c,l),c.find(".acp_registered").toggle(d),c.find(".acp_unregistered").toggle(!d),c.find(".acp_symbol").text(e),c.show(),c.find(".acp_cancelBtn").click(l),c.find("#acp_emailBtn").click(function(){return s(),!1}),c.find("#acp_registerBtn").click(function(){return c.css({zIndex:9}),tf.requireLogin(h,"Please register to be notified when you have access to "+e,1,function(){u()}),!1}),c.find(".acp_loginBtn").click(function(){return c.css({zIndex:9}),tf.requireLogin(u,"Please log in for Pro access",1,function(){u()},1),!1}),c.find("#acp_proUpgradeBtn").click(function(){return document.cookie=f,location.href=getHost()+"/subscribe/billing?from=requireAccess",!1}),c.find("#acp_proSignupBtn").click(function(){return document.cookie=f,location.href=getHost()+"/subscribe/email?from=requireAccess",!1}),tf.ie6&&window.DD_belatedPNG&&DD_belatedPNG.fix("#accessPopupHolder .coAll,#accessPopupHolder .pngfix,#accessPopupHolder .obutton,#accessPopupHolder .obutton span,#accessPopupHolder .csp_greyx"),c.css("margin-top",tf.scrollY()+20+"px"),showOverlay()})}var c=$("#accessPopupHolder"),d=!!getLoggedInUser(),u=getSwfObj();d&&getLoggedInUser().fullAccessAll?a(tf.access.pro):tf.hasAccess(e)?a(tf.access.prior):o?l():$.ajax({type:"POST",url:getHost()+"/servlet/AccessService/attemptFullAccess",data:{s:e,t:i},dataType:"json",success:s})},tf.accessStatus=function(e){return tf.hasAccess(e)?2:properties.fullAccessSymbols().length<3?1:0},tf.hasAccess=function(e){return getLoggedInUser()&&getLoggedInUser().fullAccessAll||-1!=$.inArray(e,properties.fullAccessSymbols())},tf.requireLogin=function(e,t,i,n,r){if(getLoggedInUser())e({hasStatusChanged:!1,isLoggedIn:!0,willReload:!1,newUser:!1},function(){});else{var o=function(t,i){tf.loginIframeRemoveCallback(o),t.isLoggedIn?e(t,i):n?n(t,i):i()};tf.loginIframeAddcallback(o,1),tf.toggleLogInPane(1,1,i,t,0,r)}},tf.canSaveModel=function(e,t){function i(i,s){function l(e,t){return"/company"+(t.length>0?"?"+t.join("&"):"")+"#/"+e}function c(e,i){o.hide(),window.hideOverlay&&hideOverlay(),t(e,i)}function d(e,t){tf.ajax({type:"POST",url:getHost()+"/servlet/ProfileService/setAutosaveModels",dataType:"json",data:{a:e},success:function(e,i){t("success"==tf.status(e,i))},error:function(e,i,n){tf.ajaxError(e,i,n),t(r)}})}function u(){return announceClear(),c(r,r),!1}tf.getComponent("popup/canSaveModelPopup",function(t){function r(){return o.find("#csp_autosaveCB").prop("checked")}function h(){var e=[];return ulObj.find("a").each(function(){var t=$(this);t.find(".csp_undo").is(":visible")&&$.each(t[0].className.split(" "),function(t,i){"symbol."==i.substring(0,7)&&e.push(i.substring(7))})}),e}function p(e,t){return f(e)&&t}function f(e){return"number"==typeof s&&i.length-e.length>=s}function g(){csp_okBtn.toggleClass("gbutton2-disabled",p(h(),r())),tf.ie6&&window.DD_belatedPNG&&DD_belatedPNG.fix("#csp_okBtn")}o.html(t).show(),tf.initPopup(o,u);var m=window.getSwfObj&&-1!=location.href.indexOf("company"),v=m?getSwfObj():0,y=v?v.userModelId():0,b="postSubscribe="+escape(l(e,!a&&y?["userModelId="+y]:[]))+"; path=/";ulObj=o.find(".csp_models"),csp_okBtn=o.find("#csp_okBtn"),$(".numToDelete").text(1+i.length-s),$.each(i,function(e,t){ulObj.append("