/* * All comments have been removed from these files. To view licenses, attributions and comments see this url: http://nmp.newsgator.com/NGBuzz/load.ashx/toolbar/unpacked */ if(typeof NewsGator=="undefined"){NewsGator={}}if(typeof NewsGator.PrivateLabel=="undefined"){NewsGator.PrivateLabel={};NGToolbarAPI={className:"NGBuzz.Classes.ToolbarAPI,NGBuzz",getUserId:function(c,a,b,d){ng.dsr.bind(this.ajaxUrl,{C_:this.className,M_:"GetUserId",orgCode:c},a,b,d)},createUser:function(c,a,b,d){ng.dsr.bind(this.ajaxUrl,{C_:this.className,M_:"CreateUser",orgCode:c},a,b,d)},getTemplate:function(c,a,b,d){ng.dsr.bind(this.ajaxUrl,{C_:this.className,M_:"GetTemplate",templateName:c},a,b,d)},getPostRating:function(d,c,a,b,e){ng.dsr.bind(this.ajaxUrl,{C_:this.className,M_:"GetPostRating",orgCode:d,postId:c},a,b,e)},ratePost:function(e,d,c,a,b,f){ng.dsr.bind(this.ajaxUrl,{C_:this.className,M_:"RatePost",orgCode:e,postId:d,rating:c},a,b,f)},clipPost:function(d,c,a,b,e){ng.dsr.bind(this.ajaxUrl,{C_:this.className,M_:"ClipPost",orgCode:d,postId:c},a,b,e)},deleteClipping:function(d,c,a,b,e){ng.dsr.bind(this.ajaxUrl,{C_:this.className,M_:"DeleteClipping",orgCode:d,postId:c},a,b,e)}}}if(typeof NewsGator.PrivateLabel.NGToolBar4=="undefined"){(function(){var d=null;var c=null;var b=[];var g=[];var f=false;var e=false;var a=false;NewsGator.PrivateLabel.NGToolBar4=function(l,k,h,m){if(l&&!l.nodeType&&l.toUpperCase){l=document.getElementById(l)}if(!l){return}this.toolbarItemId="ng_toolbar4_"+Math.floor(Math.random()*1000000);NewsGator.PrivateLabel.NGToolBar4[this.toolbarItemId]=this;this.elemId=l.id=l.id||this.toolbarItemId;this.buzzObj=h;if(h){this.BASE_URL=h.ngBaseUrl;this.DIRECT_URL=h.directUrl;this.analytics=h.analytics}else{this.BASE_URL=k||"http://nmp.newsgator.com/";this.DIRECT_URL="http://hosted.newsgator.com/"}this.BASE_BUZZ_URL=this.BASE_URL+"NGBuzz";this.BASE_TOOLBAR_URL=this.BASE_BUZZ_URL+"/ToolBar";if(NGToolbarAPI&&!NGToolbarAPI.ajaxUrl){NGToolbarAPI.ajaxUrl=this.DIRECT_URL+"/NGBuzz/gateway.ashx/ngdsr"}this.parseAttributes(m);this._bootstrap()};NewsGator.PrivateLabel.NGToolBar4.Load=function(l){var n=NewsGator.PrivateLabel.NGToolBar4.prototype.GetElementsByClass("ng_toolbar");for(var k=0;k0){k&&k(c>0);return}else{h._isUserLoggedIn(function(m){if(m){k&&k(true)}else{g.push(k);if(!a){a=true;var l=function(){var n;while(n=g.shift()){n((c>0))}};NGToolbarAPI.createUser(h.ngOrg,function(o,n){var o=(o&&n.result&&n.result>0);h.debug("Create user finished",(o?"worked!":"failed"));c=(o?parseInt(n.result):0);l()})}}})}},_isUserLoggedIn:function(l){var k=this;if(c!=null){if(l){setTimeout(function(){l(c>0)},0)}return}else{b.push(l);if(!e){e=true;var h=function(){var m;while(m=b.shift()){m((c>0))}};NGToolbarAPI.getUserId(k.ngOrg,function(m,n){if(m&&n&&n.result&&parseInt(n.result)>0){c=parseInt(n.result)}else{c=0}h()})}}},render:function(){var l=document.getElementById(this.elemId);if(!l){this.debug("Element is null in the render() method, this should never happen. You've got a problem. ElemID: "+this.elemId);return}var k=this.parsedTemplate||TrimPath.parseTemplate(d);this._MODIFIERS=ng_JST_Modifiers;var h=k.process(this,{throwErrors:true});l.innerHTML=h;if(l.style.display=="none"){l.style.display=""}l.style.visibility="visible";l.style.height="auto";if(this.ratingsEnabled&&!this.ratingsLoaded){var n=this;this._getRatings(function(){if(n.ratingsLoaded){n.render()}})}if(typeof _IG_AdjustIFrameHeight!="undefined"){_IG_AdjustIFrameHeight()}if(typeof ng_toolbarRenderedCallback!="undefined"){try{ng_toolbarRenderedCallback(this)}catch(m){this.debug("Caught error from ng_toolbarRenderedCallback",m)}}},_getRatings:function(k){if(this.ratingsLoaded){k();return}var h=this;this._isUserLoggedIn(function(l){if(l){NGToolbarAPI.getPostRating(h.ngOrg,h.ngPostId,function(m,n){h.ratingsLoaded=true;if(m&&n&&n.result){h.userRating=n.result.userRating;h.numRatings=n.result.numberOfRating;h.avgRating=n.result.avgRating}else{h.userRating=h.numRatings=h.avgRating=0}if(k){k()}},null,"rating-"+h.ngPostId)}else{if(k){k()}}})},ShowToolbarForm:function(h,m,k,l){this.HideAllToolbarForms();ng_showWidgetPopup(h,document.getElementById(this.elemId),m,null,k,l)},HideToolbarForm:function(h,k){ng_hideWidgetPopup(document.getElementById(this.elemId),k)},ShowToolbarAlertAtPosition:function(h,l,k){this.HideAllToolbarForms();ng_showWidgetPopupAtLocation(h,l,document.getElementById(this.elemId),k)},HideAllToolbarForms:function(){var k=this.GetElementsByClass("ng_ShowFormClass");if(k.length>1){for(var h=0;h0&&!this._emailRegex.test(h[m])){return false}}return true}else{return(this._emailRegex.test(l))}},ShowEmailForm:function(h,m){var o=this;var l=function(q,r){r=r||"";var p=document.getElementById(q+"_"+o.toolbarItemId);if(p.value){p.value=r}if(p.innerHTML){p.innerHTML=r}p.style.backgroundColor="white"};var n=document.createElement("DIV");n.innerHTML=this.ngEmailTitle;this.ngEmailTitle=n.innerHTML;l("ngEmailToTxt");l("ngEmailFromTxt");l("ngEmailTitleTxt",this.ngEmailTitle);l("ngEmailMsgTxt");var k=document.getElementById("ngEmailFeedback_"+o.toolbarItemId);k.style.color="white";this.logEvent("showEmail",h,document.getElementById(m));this.ShowToolbarForm(h,m,300)},SubmitToolbarEmail:function(s,k){var m=this;m.logEvent("email",s,k);var l=function(t){return document.getElementById(t+"_"+m.toolbarItemId)};var r=l("ngEmailToTxt");var q=l("ngEmailFromTxt");var h=l("ngEmailTitleTxt");var p=l("ngEmailMsgTxt");var o=l("ngEmailFeedback");r.style.backgroundColor="white";q.style.backgroundColor="white";if(!this.IsValidEmail(r.value,true)){r.style.backgroundColor="#EAA";o.innerHTML="Required Field";o.style.color="red"}else{if(!this.IsValidEmail(q.value,false)){q.style.backgroundColor="#EAA";o.innerHTML="Required Field";o.style.color="red"}else{var n={pid:this.ngPostId,comment:p.value,from:q.value,to:r.value,subject:h.value,header:this.ngEmailHeaderMessage,footer:this.ngEmailFooterMessage};if(this.ngEmailTemplate){n.template=this.ngEmailTemplate}if(this.buzzObj){n.buzzId=this.buzzObj.buzzId;n.apiToken=this.buzzObj.apiToken;n=ng_mixin(n,this.buzzObj._extraArgs)}ng.dsr.bind(this.DIRECT_URL+"NGBuzz/EmailHandler.ashx",n,null);o.innerHTML="Email sent";this.AutoCloseForm(s,"ngEmailFormHtmlDiv_"+this.toolbarItemId,2000)}}},SaveToolbarItem:function(h,k,l){var n=this;var m=ng_getEventLocation(h);m[0]+=ng_getScrollLeft();m[1]+=ng_getScrollTop();this._ensureUserLoggedIn(function(o){if(o){NGToolbarAPI.clipPost(n.ngOrg,n.ngPostId,function(p,q){n.debug("Clipped post");n.ShowToolbarAlertAtPosition(m[0],m[1],l,200);n.AutoCloseAlert(l,2000);n.logEvent("save",h,k)})}else{n.debug("Failed to clip post because user couldn't be logged in")}})},DeleteSaveToolbarItem:function(h){NGToolbarAPI.deleteClipping(this.ngOrg,this.ngPostId);this.logEvent("deleteClip");var k="ngDeleteSaveFormHtml_"+this.toolbarItemId;this.ShowToolbarForm(h,k);this.AutoCloseAlert(k,1000)},GetElementsByClass:function(p,n,h){var m=new Array();if(n==null){n=document}if(h==null){h="*"}var l=n.getElementsByTagName(h);var k=l.length;var o=new RegExp("(^|\\s)"+p+"(\\s|$)");for(i=0,j=0;i0){this.ngRatings=k("ngRatings","");this.ratingsEnabled=h(this.ngRatings);this.ratingsImgBase=k("ngRatingsImgBase",this.BASE_BUZZ_URL+"/Images/rate_");this.ratingsImgSuffix=k("ngRatingsImgSuffix",".gif")}else{this.ngRatings="none";this.ratingsEnabled=false}},toString:function(){return"NGToolbar4["+this.elemId+"]"}}})()}; var ng_toolbar4Html = '{eval} /* NOTE! that there are minimal newlines inside the tags. That\'s to prevent IE using extra vertical pixels. Please make sure the tags are right up against the and likewise with the following
if any */{/eval}\r\n\r\n \r\n {if emailEnabled}\r\n \r\n\t\t{/if}\r\n\t\t\r\n\t\t{if saveEnabled}\r\n\t\t\r\n\t\t{/if}\r\n\r\n\t\t{if deleteSaveEnabled}\t\t\r\n\t\t\r\n\t\t{/if}\r\n\t\t\r\n\t\t{if ratingsEnabled}\r\n {var tableId = "starRatings_" + toolbarItemId}\r\n \r\n {/if}\r\n \r\n
\r\n\t\t\t\t\t\r\n\t\t\t\t\t{var ratingTitle = (defined(\'avgRating\') ? "Average rating " + _MODIFIERS.round(avgRating, 0.5) : "")}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t{for ratingName in ["one","two","three","four","five"]}\r\n\t\t\t\t\t\t{var rating = (parseInt(ratingName_index) + 1)}\r\n\t\t\t\t\t\t{var avgImgIdx = ""}\r\n\t\t\t\t\t\t{eval}\r\n\t\t\t\t\t\t\tavgRating = (defined("avgRating") ? avgRating : 0);\r\n\t\t\t\t\t\t\tif (rating <= avgRating){\r\n\t\t\t\t\t\t\t\tavgImgIdx = "1";\r\n\t\t\t\t\t\t\t} else if(rating - avgRating > 0 && rating - avgRating < 1){\r\n\t\t\t\t\t\t\t\tavgImgIdx = "2";\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tavgImgIdx = "3";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!defined(\'userRating\') || userRating < rating){\r\n\t\t\t\t\t\t\t\tavgImgIdx += "a";\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tavgImgIdx += "b";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t{/eval}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t{/for}\r\n\t\t\t\t\t\r\n\t\t\t\t
${ratingTitle}${ratingTitle}${ratingTitle}
\r\n\t\t\t\t{if defined(\'avgRating\')}\r\n\t\t\t\t\t\r\n\t\t\t\t{/if}\r\n\t\t\t
'; var ng_toolbar4Css = '.ng_toolbarIcons .ng_ShowFormClass{position:absolute;display:block;background:#FFF;border:solid 1px black;padding:5px;font-family:Arial,Verdana;font-size:11pt;width:auto;height:auto;overflow-y:auto;z-index:10001;background-color:White;}.ng_toolbarIcons .ng_EmailForm{width:100%;}.ng_toolbarIcons .ng_ShowFormClass .ng_FormExample{color:#777;font-size:7pt;}.ng_toolbarIcons .ng_ShowFormClass INPUT,.ng_toolbarIcons .ng_ShowFormClass TEXTAREA{width:95%;}.ng_toolbarIcons .ng_FormContainer{text-align:left;}.ng_toolbarIcons .ng_ShowFormClass INPUT.ng_FormSubmitButton{background-color:#f4f4f4;border:1px solid;border-color:#ccc #666 #666 #ccc;color:#555;font-size:10px;cursor:pointer;width:auto;}.ng_toolbarIcons .ng_ShowFormClass .ng_Feedback{padding-right:4px;}.ng_toolbarIcons .IM_menu_item,.ng_toolbarIcons .IM_menu_item_hover{cursor:pointer;border-bottom:solid 1px #DDD;}.ng_toolbarIcons .IM_menu_item_hover{background:#CDCDCD;}.ng_toolbarIcons .ng_toolbarIcons TD{cursor:pointer;padding:0;}.ng_toolbarIcons table.ng_star-rating,.ng_toolbarIcons table.ng_star-rating-hover{margin:0;padding:0;height:14px;line-height:1px;}.ng_toolbarIcons .ng_star-rating td{padding:0;margin:0;line-height:1px;width:14px;}.ng_toolbarIcons .ng_star-rating td img{padding:0;margin:0;width:14px;height:14px;border:0;}.ng_toolbarIcons .ng_star-rating td img.on,.ng_toolbarIcons .ng_star-rating td img.off{display:none;}.ng_toolbarIcons .ng_star-rating td img.avg{display:inline;}.ng_toolbarIcons .ng_star-rating-hover img.on,.ng_toolbarIcons .ng_star-rating-hover td img.avg{display:none;}.ng_toolbarIcons .ng_star-rating-hover td img.off{display:inline;}.ng_toolbarIcons .one_star td.one_star img.on,.ng_toolbarIcons .two_star td.one_star img.on,.ng_toolbarIcons .three_star td.one_star img.on,.ng_toolbarIcons .four_star td.one_star img.on,.ng_toolbarIcons .five_star td.one_star img.on,.ng_toolbarIcons .two_star td.two_star img.on,.ng_toolbarIcons .three_star td.two_star img.on,.ng_toolbarIcons .four_star td.two_star img.on,.ng_toolbarIcons .five_star td.two_star img.on,.ng_toolbarIcons .three_star td.three_star img.on,.ng_toolbarIcons .four_star td.three_star img.on,.ng_toolbarIcons .five_star td.three_star img.on,.ng_toolbarIcons .four_star td.four_star img.on,.ng_toolbarIcons .five_star td.four_star img.on,.ng_toolbarIcons .five_star td.five_star img.on{display:inline;}.ng_toolbarIcons .one_star tr td.one_star img.off,.ng_toolbarIcons .two_star tr td.one_star img.off,.ng_toolbarIcons .three_star tr td.one_star img.off,.ng_toolbarIcons .four_star tr td.one_star img.off,.ng_toolbarIcons .five_star tr td.one_star img.off,.ng_toolbarIcons .two_star tr td.two_star img.off,.ng_toolbarIcons .three_star tr td.two_star img.off,.ng_toolbarIcons .four_star tr td.two_star img.off,.ng_toolbarIcons .five_star tr td.two_star img.off,.ng_toolbarIcons .three_star tr td.three_star img.off,.ng_toolbarIcons .four_star tr td.three_star img.off,.ng_toolbarIcons .five_star tr td.three_star img.off,.ng_toolbarIcons .four_star tr td.four_star img.off,.ng_toolbarIcons .five_star tr td.four_star img.off,.ng_toolbarIcons .five_star tr td.five_star img.off{display:none;}.ng_ShowFormClass{position:absolute;display:block;background:#FFF;border:solid 1px black;padding:5px;font-family:Arial,Verdana;font-size:11pt;width:auto;height:auto;overflow-y:auto;z-index:10001;}.ng_EmailForm{width:100%;}.ng_ShowFormClass .ng_FormExample{color:#777;font-size:7pt;}.ng_ShowFormClass INPUT,.ng_ShowFormClass TEXTAREA{width:95%;}.ng_FormContainer{text-align:left;}.ng_ShowFormClass INPUT.ng_FormSubmitButton{background-color:#f4f4f4;border:1px solid;border-color:#ccc #666 #666 #ccc;color:#555;font-size:10px;cursor:pointer;width:auto;}.ng_ShowFormClass .ng_Feedback{padding-right:4px;}'; try{window['ng_toolbar'] = true;}catch(e){}