var TEMPLATE_COMMENT='<div id="${comment_id}" class="ceq_rating_box"> \n<span id="${rating_id}" style="vertical-align:middle;"><span id="RateAL${item_id}" class="widgetlisting" align="right" valign="bottom" style="font-size: smaller; display: none">Lulz</span>\n<span class="inline-rating" valign="top">\n<ul id="Rate${item_id}" class="ceq_rating small-star" title="0">\n<li id="RateC${item_id}" class="curr-rating" style="width:${rating_width}%">Currently ${rating}/5 Stars.</li>\n<li id="RateU${item_id}" class="done-rating" style="width:${rating_user_width}%; display: none;">You have rated ${rating_user}/0 Stars.</li>\n<li><a href="javascript:void(0);" style="z-index: 4;" rating_val="1" title="Poor" class="one-star">1</a></li>\n<li><a href="javascript:void(0);" style="z-index: 3;" rating_val="2" title="Nothing Special" class="two-stars">2</a></li>\n<li><a href="javascript:void(0);" style="z-index: 2;" rating_val="3" title="Worth Reading" class="three-stars">3</a></li>\n<li><a href="javascript:void(0);" style="z-index: 1;" rating_val="4" title="Pretty Cool" class="four-stars">4</a></li>\n<li><a href="javascript:void(0);" style="z-index: 0;" rating_val="5" title="Awesome" class="five-stars">5</a></li>\n</ul>\n</span>\n<span style="vertical-align:top">(<span id="RateX${item_id}"  rating_user="${rating_user}">${rating_count}</span>)</span>\n</span>\n<span id="span1_${comment_id}">\n<img border="0" id="addcomment" src="${WIDGET_RESSOURCE_PATH}/ceq_comment/img/ceq_rating_comment.png" class="ceq_rating_comment" width="14" height="14" align="absbottom">\n <span class="ceq_rating_comment">(${comment_count})</span>\n</span> \n<span id="span2_${comment_id}">\n<img border="0" src="${WIDGET_RESSOURCE_PATH}/ceq_comment/img/ceq_rating_cq.png" class="ceq_rating_ceqinfo" width="14" height="14" align="absbottom" rel="#commenting_overlay" id="openactivities_${comment_id}"> \n<span class="ceq_rating_cq">(${equity})</span>\n</span> \n</div>\n<div class="ceq_rating_commentbox" style="position:absolute; display: none; z-index:1000;">\n<span class="ceq_rating_post">\n<div class="ceq_rating_header">\n<span class="ceq_rating_close" id="ceq_comment_close"><img border="0" src="${WIDGET_RESSOURCE_PATH}/ceq_comment/img/ceq_close.gif"/></span>\n</div>\n<span class="ceq_rating_firstrow">\n<img border="0" src="${WIDGET_RESSOURCE_PATH}/ceq_comment/img/ceq_defaultavatar.png" class="ceq_rating_pic">\n<textarea name="ceq_rating_input" class="ceq_rating_input" cols="1" rows="1">${comment}</textarea>\n</span>\n<span class="ceq_rating_secondrow">\n<input type="submit" value="Comment" name="ceq_rating_comment" class="ceq_rating_button">\n</span>\n</span>\n</div>\n<span id="RateA${item_id}" class="widgetlisting" align="right" valign="bottom" style="font-size: smaller;"></span>\n\n\n</div></div>';(function(b){function a(d,c){return b.i18n("commenting",d,c)}b.Commenting=function(c){this.ID=-1;if(c!=null){this.ID=c}this.CONTAINER_ID="comment_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.CONTAINER_RATING_ID="rating_"+this.ID;this.RATING_CS="#"+this.CONTAINER_RATING_ID+" ";this.RATING_USER=0;this.RATING_AVG=0;this.RATING_COUNT=0;this.COMMENT_COUNT=0;this.COMMENT="0";this.EQUITY=0;this.PLACEHOLDER="";this.MSGS_ID="#RateA";this.HEIGHT="120px";this.VIEWCOUNT=false;this.COUNTVIEWS=0;this.URL;this.SHOW_RATING=true;this.SHOW_COMMENTING=true;this.SHOW_ACTIVITY=true;this.template_comment=b.template(TEMPLATE_COMMENT);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/InformationParticipationP";this.ACTIVITY_WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/ActivityListingP";this.getRequestUrlRating=function(){var d=this.WEBSERVICE_URL;d+="?output=short&infoid="+this.ID;d+="&viewcount="+this.VIEWCOUNT;return d};this.handleResponse=function(d){if(d.statusCode=="200"){this.createItems(d.data)}else{if(d.statusCode=="403"){var e=document.createElement("a");e.href=d.url+"?goto="+location.href;e.appendChild(document.createTextNode(d.message));b(this.CS+" "+this.MSGS_ID+this.ID).append(e)}else{this.setError("Service not available")}}};this.loadRating=function(){if(this.ID!=-1){this.loadRatingFromRemote()}};this.loadRatingFromRemote=function(){var d=this;b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:this.getRequestUrlRating(),dataType:"json",error:function(f,e){d.setError(document.createTextNode("Service not available"))},success:function(e){d.handleResponse(e)}})};this.createItems=function(d){var e=this;e.hideWait();if((d==undefined)||(d==null)){e.setError("Service not available");return false}if((d.averageRating==undefined)||(d.averageRating==null)){e.setError("Service not available ");return false}e.setRatingAverage(d.averageRating);if((d.countRating==undefined)||(d.countRating==null)){e.setError("Service not available");return false}e.setRatingAverage(d.averageRating);e.setRatingUser(d.myRating);e.setRatingCount(d.countRating);e.setCommentCount(d.countComments);e.setComment(d.myComment);e.setEquity(d.informationEquity);e.setCountViews(d.countViews);e.refresh()};this.showLeft=function(d){if(d){this.MSGS_ID="#RateAL"}else{this.MSGS_ID="#RateA"}};this.showRating=function(d){this.SHOW_RATING=d};this.showCommenting=function(d){this.SHOW_COMMENTING=d};this.showActivity=function(d){this.SHOW_ACTIVITY=d};this.showWait=function(){b(this.RATING_CS+" #Rate"+this.ID).fadeTo("fast",0.5)};this.hideWait=function(){b(this.RATING_CS+" #Rate"+this.ID).fadeTo("normal",1)};this.setPlaceholder=function(d){this.PLACEHOLDER=d};this.setId=function(d){this.ID=d;this.CONTAINER_ID="comment_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.CONTAINER_RATING_ID="rating_"+this.ID;this.RATING_CS="#"+this.CONTAINER_RATING_ID+" "};this.setWebserviceURL=function(d){this.WEBSERVICE_URL=d};this.enableViewcount=function(){this.VIEWCOUNT=true};this.disableViewcount=function(){this.VIEWCOUNT=false};this.setRatingUser=function(d){this.RATING_USER=d};this.setRatingAverage=function(d){this.RATING_AVG=d};this.setRatingCount=function(d){this.RATING_COUNT=d};this.setEquity=function(d){this.EQUITY=d};this.setComment=function(d){this.COMMENT=d};this.setCommentCount=function(d){this.COMMENT_COUNT=d};this.setCountViews=function(d){this.COUNTVIEWS=d};this.setURL=function(d){this.URL=d;this.getIDwithURL()};this.refresh=function(){var d=this.RATING_COUNT;b(this.RATING_CS+" #RateX"+this.ID).html(""+this.RATING_COUNT);b(this.RATING_CS+" #RateC"+this.ID).css("width",(this.RATING_AVG*2*10)+"%");b(this.RATING_CS+" #RateU"+this.ID).css("width",(this.RATING_USER*2*10)+"%");b(this.RATING_CS+" #RateX"+this.ID).attr("rating_user",""+this.RATING_USER);b(this.CS+" .ceq_rating_comment").html("("+this.COMMENT_COUNT+")");b(this.CS+" .ceq_rating_input").val(this.COMMENT);b(this.CS+" .ceq_rating_cq").html("("+Math.round(this.EQUITY)+")");b(this.CS+" .ceq_countviews").html(" Views ("+this.COUNTVIEWS+")")};this.setHeight=function(d){this.HEIGHT=d};this.setError=function(d){b(this.CS+" "+this.MSGS_ID+this.ID).html(d)};this.sayThanks=function(){b(this.CS+" "+this.MSGS_ID+this.ID).html("Thanks!")};this.deploy=function(f){this.PLACEHOLDER=f;var i={};i.comment_id=this.CONTAINER_ID;i.rating_id=this.CONTAINER_RATING_ID;i.rating_width=this.getRatingWidth(this.RATING_AVG);i.rating_user_width=this.getRatingUserWidth(this.RATING_USER);i.rating=this.RATING_AVG;i.rating_user=this.RATING_USER;i.rating_count=this.RATING_COUNT;i.item_id=this.ID;i.comment_count=this.COMMENT_COUNT;i.comment=this.COMMENT;i.equity=this.EQUITY;i.countviews=this.COUNTVIEWS;i.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;b("#"+f).html("<div id='"+this.CONTAINER_ID+"' height='"+this.HEIGHT+"' class='ceq_ratingwidget'></div><div class='overlay' id='commenting_overlay' style='left: 20px; width:545px; height: 290px; '> <div id='commenting_overlay_activitylog' style='width: 500px'> </div></div>");b(this.CS).append(this.template_comment,i);if(!this.SHOW_RATING){b(this.CS+" #rating_"+this.ID).hide()}if(!this.SHOW_COMMENTING){b(this.CS+" #span1_comment_"+this.ID).hide()}if(!this.SHOW_ACTIVITY){b(this.CS+" #span2_comment_"+this.ID).hide()}var h=this;var e=function(){b(h.CS+" #RateC"+h.ID).hide();b(h.CS+" #RateU"+h.ID).show();if(b(h.CS+" #RateU"+h.ID).css("width")=="0%"){b(h.CS+" "+h.MSGS_ID+h.ID).html("Please rate")}else{b(h.CS+" "+h.MSGS_ID+h.ID).html("You've rated ("+h.RATING_USER+")")}b(h.CS+" "+h.MSGS_ID+h.ID).show()};var g=function(){b(h.CS+" #RateU"+h.ID).hide();b(h.CS+" #RateC"+h.ID).show();b(h.CS+" "+h.MSGS_ID+h.ID).hide();b(h.CS+" "+h.MSGS_ID+h.ID).html("You have rated")};b(this.RATING_CS).hover(e,g);var d=function(){var k=b(h.CS+" #Rate"+h.ID).attr("title");if(k!=""){var l=this.innerHTML;h.showWait();var m=h.WEBSERVICE_URL+"?infoid="+h.ID+"&rating="+l+"";b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:m,dataType:"json",error:function(o,n){h.setError("Service not available")},success:function(n){h.setRatingUser(l);h.handleResponse(n);if(n.statusCode=="200"){h.sayThanks()}}})}};var j=function(){var l=b(h.CS+" .ceq_rating_input").val();if(l!=""){h.showWait();var k=h.WEBSERVICE_URL+"?infoid="+h.ID+"&comment="+l+"";b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:k,dataType:"json",error:function(n,m){b(h.CS+" .ceq_rating_commentbox").toggle("slow");h.setError("Service not available")},success:function(m){b(h.CS+" .ceq_rating_commentbox").toggle("slow");h.handleResponse(m);if(m.statusCode=="200"){h.sayThanks()}}})}};b(this.RATING_CS+" #Rate"+this.ID+" a[rating_val]").click(d);b(this.CS+" .ceq_rating_button").click(j);b(this.CS+" #addcomment").click(function(){b(h.CS+" .ceq_rating_commentbox").toggle("slow")});b(this.CS+" #ceq_comment_close").click(function(){b(h.CS+" .ceq_rating_commentbox").toggle("slow")});b("#"+f+" #openactivities_comment_"+h.ID).click(function(){var k=new b.ActivityLog(h.ID);k.setWebserviceURL(h.ACTIVITY_WEBSERVICE_URL);k.setInfoID(h.ID);k.deploy("commenting_overlay_activitylog")});b("#"+f+" #openactivities_comment_"+h.ID).overlay();this.loadCSSImages();this.refresh()};this.getRatingUserWidth=function(d){return d/0.05};this.getRatingWidth=function(d){return d/0.05};this.loadCSSImages=function(){b(".small-star").css("background-image","url("+WIDGET_RESSOURCE_PATH+"/ceq_comment/img/star_small.png)");b(".small-star a:hover").css("background-image","url("+WIDGET_RESSOURCE_PATH+"/ceq_comment/img/star_small.png)");b(".curr-rating").css("background-image","url("+WIDGET_RESSOURCE_PATH+"/ceq_comment/img/star_small.png)");b(".done-rating").css("background-image","url("+WIDGET_RESSOURCE_PATH+"/ceq_comment/img/star_small.png)");b(".ceq_rating_commentbox ").css("background-image","url("+WIDGET_RESSOURCE_PATH+"/ceq_comment/img/ceq_rating_commentboxbg.gif)")};this.getIDwithURL=function(){var e=this;var d=e.WEBSERVICE_URL.replace("InformationParticipationP","InformationP/ByURL")+"?application=Test+Wiki&url="+this.URL;b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:d,dataType:"json",error:function(g,f){e.setError("Service not available")},success:function(f){e.setId(f.data.infoid);e.loadRating();e.deploy(e.PLACEHOLDER)}})}}})(jQuery);var TEMPLATE_ACTIVITY_WIDGET='<div id="loglisting_header${id}" class="ceq_listing_activity_header"><h3>&nbsp;\n<select class="ceq_input" id="ActivityLogFilter${id}" size="1">\n	<option value="">Filter by:</option>\n	<option value="">All</option>\n    <option value="RATE">Rated</option>\n	<option value="COMMENT">Commented</option>\n	<option value="TAG">Tagged</option>\n    <option value="VIEW">Viewed / Downloaded </option>\n    <option value="CREATE">Created </option>\n    <option value="DELETE">Deleted </option>\n<option value="CLONE">Cloned </option>\n<option value="UPDATE_CONTENT">Updated content</option>\n	<option value="UPDATE_META_DATA">Updated meta data</option>\n</select>\n</h3></div><div id="loglisting_content${id}">\n<div id="loading${id}"><img width="12px" height="12px" src="${WIDGET_RESSOURCE_PATH}/ceq_listing_activity/images/wait.gif"/>&nbsp;Please wait...</div>\n</div>\n<div class="ceq_listing_footer">\n<div class="ceq_listing_divider"></div>\n<span id="loglisting_pager${id}" class="ceq_listing_pageroption" style="display: none">\n       <a id="loglisting_prev_page${id}" href="javascript:void(0)"><span class="ceq_listing_arrow"> &laquo; </span> Previous</a>\n        <span id="loglisting_page_number${id}">&nbsp;</span><span id="loglisting_page_count${id}">&nbsp;</span>\n        <a id="loglisting_next_page${id}" href="javascript:void(0)">More <span class="ceq_listing_arrow"> &raquo; </span></a>\n</span></div>';var TEMPLATE_ITEM='<div class="ceq_listing_activity_item"> \n    <img border="0" title="${info_id}" class="ceq_listing_item_icon" src="${WIDGET_RESSOURCE_PATH}/ceq_listing_activity/images/${item_image}"/>\n    <span class="ceq_listing_item_title"> ${item_operation} ${item_parameter} \n   ${time_ago} by <a href="${item_modifier_link}" title="${item_modifier}">${item_modifier}</a></span></div>';(function($){function _(str,args){return $.i18n("activitylog",str,args)}$.ActivityLog=function(id){this.ORDER_DATE="date";this.ORDER_ACTION="action";this.ID=1;if(id!=null){this.ID=id}this.CONTAINER_ID="activity_log_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.PAGENR=1;this.COUNT=10;this.FILTER=this.FILTER_ALL;this.ORDER=this.ORDER_DATE;this.REVERSE=false;this.TAGS=null;this.USERID="";this.INFOID=null;this.PAGECOUNT=0;this.ITEM_COUNT=0;this.SHOW_ITEM_COUNT=true;this.HAS_MORE_ITEMS=false;this.HEIGHT="320px";this.timeRenderer=new TimeRenderer();this.template_widget=$.template(TEMPLATE_ACTIVITY_WIDGET);this.template_item=$.template(TEMPLATE_ITEM);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/ActivityListingP";this.CURRENT_USER=false;this.getRequestUrl=function(){var res=this.WEBSERVICE_URL+"?count="+this.COUNT+"&pagenr="+this.PAGENR+"&filter="+this.FILTER+"&order="+this.ORDER+"&reverse="+this.REVERSE;if(this.INFOID!=null){res+="&infoid="+this.INFOID}if(this.TAGS!=null){res+="&tags="+this.TAGS}if(this.USERID!=null){res+="&userid="+this.USERID}if(this.CURRENT_USER==true){res+="&currentuser=true"}return res};this.setHeight=function(height){this.HEIGHT=height};this.setId=function(id){this.ID=id;this.CONTAINER_ID="activity_log_"+this.ID;this.CS="#"+this.CONTAINER_ID+" "};this.setWebserviceURL=function(urlvar){this.WEBSERVICE_URL=urlvar};this.setCurrentUserFilter=function(bool){this.CURRENT_USER=bool};this.setCount=function(count){this.COUNT=count};this.setPageNr=function(pageNr){this.PAGENR=pageNr};this.setFilter=function(filter){this.FILTER=filter};this.setOrder=function(order){this.ORDER=order};this.setReverse=function(reverse){this.REVERSE=reverse};this.setTags=function(tags){this.TAGS=tags};this.setUserID=function(userid){this.USERID=userid};this.setInfoID=function(infoid){this.INFOID=infoid};this.setShowItemCount=function(show){this.SHOW_ITEM_COUNT=show};this.hideContent=function(){};this.showContent=function(){var loglisting=this;$(this.CS+" #loglisting_content"+this.ID+" .item_div").each(function(index,item){$(item).slideToggle("normal",function(){$(loglisting.CS+" #"+item.id+" #item_rating_cell").show()})})};this.removeContent=function(){$(this.CS+" #loglisting_content"+this.ID).html("")};this.showWait=function(){$(this.CS+"#loglisting_content"+this.ID).html("<div id='listing_loading'><img width='12px' height='12px' src='"+WIDGET_RESSOURCE_PATH+"/ceq_listing_activity/images/wait.gif'/>&nbsp;Please wait...</div>")};this.showLoginLink=function(loginurl){var link=document.createElement("a");link.href=loginurl+"?goto="+location.href;link.appendChild(document.createTextNode("Please login!"));$(this.CS+" #loglisting_content"+this.ID).html("");$(this.CS+" #loglisting_content"+this.ID).append(link)};this.hideItemCount=function(){$(this.CS+"#loglisting_item_count"+this.ID).contents().remove();$(this.CS+"#loglisting_item_count"+this.ID).hide()};this.refreshItemCount=function(){$(this.CS+"#loglisting_item_count"+this.ID).contents().remove();if(this.ITEM_COUNT>0){var string="Total "+this.ITEM_COUNT;if(this.VIEW_MODE==this.VIEWMODE_ALL){string=string+" items."}else{if(this.VIEW_MODE==this.VIEWMODE_MYSHARE){string=string+" files."}else{if(this.VIEW_MODE==this.VIEWMODE_WIKI){string=string+" pages."}}}$(this.CS+"#loglisting_item_count"+this.ID).append(document.createTextNode(string))}else{$(this.CS+"#loglisting_content"+this.ID).append(document.createTextNode("Empty list."))}};this.showItemCount=function(){if(!this.SHOW_ITEM_COUNT){return}this.refreshItemCount();$(this.CS+"#loglisting_item_count"+this.ID).show()};this.disablePager=function(){$(this.CS+"#loglisting_prev_page"+this.ID).unbind("click");$(this.CS+"#loglisting_next_page"+this.ID).unbind("click")};this.enablePager=function(){var loglisting=this;$(this.CS+"#loglisting_prev_page"+this.ID).click(function(){if(loglisting.PAGENR==1){return false}loglisting.PAGENR--;loglisting.refreshPager();loglisting.disablePager();loglisting.hideContent();loglisting.showWait();loglisting.loadItems()});$(this.CS+"#loglisting_next_page"+this.ID).click(function(){if(loglisting.PAGENR==loglisting.PAGECOUNT){return false}loglisting.PAGENR++;loglisting.refreshPager();loglisting.disablePager();loglisting.hideContent();loglisting.showWait();loglisting.loadItems()})};this.hidePager=function(){$(this.CS+"#loglisting_pager"+this.ID).hide()};this.showPager=function(){$(this.CS+"#loglisting_pager"+this.ID).show()};this.calculatePageCount=function(){var pageCount=this.ITEM_COUNT/this.COUNT;var modulo=this.ITEM_COUNT%this.COUNT;if(modulo>0){pageCount=pageCount-(modulo/this.COUNT);pageCount++}this.PAGECOUNT=pageCount};this.refreshPager=function(){if(this.PAGENR>this.PAGECOUNT){this.PAGENR=this.PAGECOUNT}$(this.CS+"#loglisting_page_number"+this.ID).contents().remove();$(this.CS+"#loglisting_page_number"+this.ID).append(document.createTextNode(""));$(this.CS+"#loglisting_page_count"+this.ID).contents().remove();$(this.CS+"#loglisting_page_count"+this.ID).append(document.createTextNode(""));if(this.PAGENR>1){$(this.CS+"#loglisting_prev_page"+this.ID).show()}else{$(this.CS+"#loglisting_prev_page"+this.ID).hide()}if(this.HAS_MORE_ITEMS){$(this.CS+"#loglisting_next_page"+this.ID).show()}else{$(this.CS+"#loglisting_next_page"+this.ID).hide()}};this.handleResponse=function(response){if(response.statusCode=="200"){this.createItems(response.data)}else{if(response.statusCode=="403"){this.showLoginLink(response.url)}else{$(this.CS+"#loglisting_content"+this.ID).append(document.createTextNode("Service not available"))}}};this.createItems=function(result){var loglisting=this;loglisting.removeContent();loglisting.HAS_MORE_ITEMS=eval(result.hasMore);loglisting.ITEM_COUNT=(result.hasMore)?(this.PAGENR*result.count)+result.count+1:0;loglisting.calculatePageCount();var now=new Date();if(result.count>0){$.each(result.activities,function(i,item){var itemObj={};itemObj.container_id=loglisting.CONTAINER_ID;itemObj.item_id=item.id;itemObj.item_title=item.title;itemObj.item_operation=item.action;itemObj.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;itemObj.item_parameter="";if(item.action=="RATE"){var star_active='<img border="0" src="'+WIDGET_RESSOURCE_PATH+'/ceq_listing_activity/images/ceq_rating_staractive.png"/>';var star_inactive='<img border="0" src="'+WIDGET_RESSOURCE_PATH+'/ceq_listing_activity/images/ceq_rating_starinactive.png"/>';for(var i=1;i<=5;i++){if(i<=item.parameter){itemObj.item_parameter=itemObj.item_parameter+star_active}else{itemObj.item_parameter=itemObj.item_parameter+star_inactive}}}itemObj.item_modifier=item.personname;itemObj.item_modifier_link=item.personhomepage;var datedif=(now-item.date)/1000;itemObj.time_ago=loglisting.timeRenderer.getTimeAgo(datedif,now);itemObj.item_image="ceq_page_download.png";itemObj.info_id=item.infoid;if(item.action=="COMMENT"){itemObj.item_operation="Comment added ";itemObj.item_image="ceq_rating_comment.png"}else{if(item.action=="DELETE"){itemObj.item_image=""}else{if(item.action=="CLONE"){itemObj.item_operation="Cloned ";itemObj.item_image="ceq_page_copy.png"}else{if(item.action=="RATE"){itemObj.item_operation="Rated with ";itemObj.item_image="ceq_rating_staractive.png"}else{if(item.action=="UPDATE_CONTENT"){itemObj.item_operation="Updated content ";itemObj.item_image="ceq_page_edit.png"}else{if(item.action=="UPDATE_META_DATA"){itemObj.item_operation="Updated meta data ";itemObj.item_image="ceq_pencil.png"}else{if(item.action=="TAG"){itemObj.item_operation="Tagged ";itemObj.item_image="ceq_tag_green.png"}else{if(item.action=="VIEW"){itemObj.item_operation="Viewed ";itemObj.item_image="ceq_page_view.png"}else{if(item.action=="DOWNLOAD"){itemObj.item_image="ceq_page_download.png"}else{if(item.action=="CREATE"){itemObj.item_operation="Created ";itemObj.item_image="ceq_page_added.png"}else{if(item.action=="CHANGE_MAIN_AUTHOR"){itemObj.item_operation="Author changed ";itemObj.item_image="ceq_user.png"}}}}}}}}}}}$(loglisting.CS+" #loglisting_content"+loglisting.ID).append(loglisting.template_item,itemObj)})}loglisting.showItemCount();loglisting.showContent();if(loglisting.PAGECOUNT>1){loglisting.refreshPager();loglisting.showPager();loglisting.enablePager()}else{loglisting.hidePager()}};this.loadItems=function(){this.loadItemsFromRemote()};this.loadItemsFromRemote=function(){var listing=this;$.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:this.getRequestUrl(),dataType:"json",error:function(d,msg){listing.removeContent();$(listing.CS+"#loglisting_content"+listing.ID).append(document.createTextNode("Error"))},success:function(result){listing.handleResponse(result)}})};this.deploy=function(widgetid){var loglisting=this;$("#"+widgetid).html("<div id='"+this.CONTAINER_ID+"' class='ceq_listingwidget' height='"+this.HEIGHT+"'></div>");var itemObj={};itemObj.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;itemObj.id=loglisting.ID;$(this.CS).append(this.template_widget,itemObj);$(this.CS+" #ActivityLogFilter"+this.ID).change(function(){loglisting.setPageNr(1);loglisting.setFilter(this.value);loglisting.showWait();loglisting.loadItems()});this.showWait();this.loadItems()}}})(jQuery);function TimeRenderer(){this.getTimeAgo=function(k,c){var h=(c.getHours()*3600)+(c.getMinutes()*60)+c.getSeconds();k=Math.floor(k);if(k<60){if(k>1){return k+" seconds ago"}else{return k+" second ago"}}var e=Math.floor(k/60);if(k<=1500){if(e>1){return e+" minutes ago"}else{return e+" minute ago"}}if(k<2100){return"half an hour ago"}if(k<3600){return e+" minutes ago"}var j=Math.floor(k/3600);if(k<43200){if(j>1){return"about "+j+" hours ago"}else{return"about "+j+" hour ago"}}if(k<86400){if(k<=h){return"Today"}else{return"Yesterday"}}if(k-h<86400){return"Yesterday"}var m=Math.floor(k/86400);if(m<14){var i="";var d=(k-(m*86400))/3600;d=Math.floor(d);if(d>0){if(d<8){if(m>1){i+="about "+m+" days ago"}else{i+="about "+m+" day ago"}}else{if(d<16){if(m>1){i+=m+" days "}else{i+=m+" day "}if(d>1){i+=d+" hours ago"}else{i+=d+" hour ago"}}else{i+="about "+(m+1)+" days ago"}}}else{i+="about "+m+" days ago"}return i}var a=Math.floor(k/604800);if(a<8){var i="";if(a>1){i+=a+" weeks"}else{i+=a+" week"}var l=(k-(a*604800))/86400;l=Math.floor(l);if(l>0){if(l>1){i+=" "+l+" days ago"}else{i+=" "+l+" day ago"}}else{i="about "+i+" ago"}return i}var b=Math.floor(k/2629743.83);if(b<12){var i="";if(b>1){i+=b+" months"}var f=Math.floor((k-(b*2629743.83))/604800);if(f>0){if(f>1){i+=" "+f+" weeks ago"}else{i+=" "+f+" week ago"}}else{i="about "+i+" ago"}return i}var g=Math.floor(k/31556926);if(g>1){return"More than "+g+" years ago"}else{return"More than "+g+" year ago"}}}var TEMPLATE_ACTIVITY_LISTING_WIDGET='<div class="overlay" id="listing_overlay${item_id}">\n <div id="listing_overlay_activitylog${item_id}" style="width: 500px"> </div>\n</div>';var TEMPLATE_LISTING_WIDGET='<div id="listing_header${id}" class="ceq_listing_header">\n<span id="listing_item_count${id}" class="ceq_listing_item_total">Total items</span>\n<span class="ceq_listing_filteroption">\nShow: <span class="ceq_listing_filteroption_on"><a id="ceq_listing_filter_all${id}" href="javascript:void(0)">All</a></span> \n| <a id="ceq_listing_filter_files${id}"  href="javascript:void(0)">Files</a> \n| <a id="ceq_listing_filter_pages${id}" href="javascript:void(0)">Pages</a>\n</div>\n<div id="listing_content${id}"><div id="loading${id}"><img width="12px" height="12px" src="${WIDGET_RESSOURCE_PATH}/ceq_listing_information/images/wait.gif"/>&nbsp;Please wait...</div></div>\n<div class="ceq_listing_footer">\n<span id="listing_pager${id}" class="ceq_listing_pageroption" style="display: none">\n       <a id="listing_prev_page${id}" href="javascript:void(0)"><span class="ceq_listing_arrow"> &laquo; </span> Previous</a>\n        <span id="listing_page_number${id}">&nbsp;</span>/<span id="listing_page_count${id}">&nbsp;</span>\n        <a id="listing_next_page${id}" href="javascript:void(0)">Next <span class="ceq_listing_arrow"> &raquo; </span></a>\n</span></div>';var TEMPLATE_LISTING_ITEM_DIV='<div id="item_div_${item_id}" class="ceq_listing_item">\n<div class="ceq_listing_item_firstrow">\n<span class="application application${item_application}"></span>\n<span class="ceq_listing_item_title">\n<a class="item_link" href="${item_href}" title="${item_title}">${item_title}</a>\n</span>\n<span class="ceq_listing_item_ceqinfo">\n<img border="0" src="${WIDGET_RESSOURCE_PATH}/ceq_comment/img/ceq_rating_cq.png" class="ceq_item_ceqlabel" width="14" height="14" align="absbottom" rel="#listing_overlay${item_id}" id="openactivities_${item_id}"> \n<span class="ceq_rating_cq">(${equity})</span>\n</span>\n</div>\n<div class="ceq_listing_item_secondrow">\n<span class="ceq_listing_item_modified">${item_type} - \n${item_operation} ${time_ago} by <a href="${item_modifier_link}" title="${item_modifier}" >${item_modifier}</a>\n</span>\n</div>\n</div>';(function(b){function a(d,c){return b.i18n("informationlisting",d,c)}b.InformationListing=function(c){this.FILTER_ALL="all";this.FILTER_WIKI="wiki";this.FILTER_BLOG="blog";this.FILTER_FORUM="forum";this.FILTER_FILES="files";this.FILTER_PAGES="pages";this.ORDER_LASTCREATED="lastcreated";this.ORDER_LASTCHANGED="lastupdated";this.ORDER_TOPIQ="topiq";this.OPERATOR_AND="AND";this.OPERATOR_OR="OR";this.ID=1;if(c!=null){this.ID=c}this.CONTAINER_ID="listing_table_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.PAGENR=1;this.COUNT=5;this.FILTER=this.FILTER_ALL;this.ORDER=this.ORDER_LASTCHANGED;this.REVERSE=false;this.TAGS=null;this.AUTHOR="";this.PAGECOUNT=0;this.ITEM_COUNT=0;this.SHOW_HEADER=true;this.SHOW_FILTER=true;this.SHOW_ITEM_COUNT=true;this.HEIGHT="320px";this.OPERATOR=this.OPERATOR_OR;this.timeRenderer=new TimeRenderer();this.template_widget=b.template(TEMPLATE_LISTING_WIDGET);this.template_item_div=b.template(TEMPLATE_LISTING_ITEM_DIV);this.template_activity_widget=b.template(TEMPLATE_ACTIVITY_LISTING_WIDGET);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/InformationListingP";this.RATING_WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/InformationParticipationP";this.ACTIVITY_WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/ActivityListingP";this.CURRENT_USER=false;this.getRequestUrl=function(){var d=this.WEBSERVICE_URL+"?count="+this.COUNT+"&pagenr="+this.PAGENR+"&filter="+this.FILTER+"&order="+this.ORDER+"&reverse="+this.REVERSE;if(this.TAGS!=null){d+="&tags="+this.TAGS}if(this.OPERATOR!=null){d+="&operator="+this.OPERATOR}if(this.AUTHOR!=null){d+="&authors="+this.AUTHOR}if(this.CURRENT_USER==true){d+="&currentuser=true"}return d};this.subscribeToTagCloud=function(d){var e=this;OpenAjax.hub.subscribe("com.ceq.tagcloud."+d,function(g,f){e.setTags(f);e.setPageNr(1);e.disableFilter();e.hideContent();e.showWait();e.loadItems()})};this.setHeight=function(d){this.HEIGHT=d};this.setId=function(d){this.ID=d;this.CONTAINER_ID="listing_table_"+this.ID;this.CS="#"+this.CONTAINER_ID+" "};this.setWebserviceURL=function(d){this.WEBSERVICE_URL=d};this.setRatingWebserviceURL=function(d){this.RATING_WEBSERVICE_URL=d};this.setCurrentUserFilter=function(d){this.CURRENT_USER=d};this.setCount=function(d){this.COUNT=d};this.setPageNr=function(d){this.PAGENR=d};this.setFilter=function(d){this.FILTER=d};this.setOrder=function(d){this.ORDER=d};this.setReverse=function(d){this.REVERSE=d};this.setOperator=function(d){this.OPERATOR=d};this.setTags=function(d){this.TAGS=d};this.setAuthor=function(d){this.AUTHOR=d};this.setShowFilter=function(d){this.SHOW_FILTER=d};this.setShowItemCount=function(d){this.SHOW_ITEM_COUNT=d};this.hideContent=function(){};this.showContent=function(){var d=this;b(this.CS+"#listing_content"+this.ID+" .item_div").each(function(e,f){b(f).slideToggle("normal",function(){})})};this.removeContent=function(){b(this.CS+" a[rating_val]").unbind();b(this.CS+"#listing_content"+this.ID).html("")};this.showWait=function(){b(this.CS+"#listing_content"+this.ID).html("<div id='listing_loading'><img width='12px' height='12px' src='"+WIDGET_RESSOURCE_PATH+"/ceq_listing_information/images/wait.gif'/>&nbsp;Please wait...</div>")};this.showLoginLink=function(d){var e=document.createElement("a");e.href=d+"?goto="+location.href;e.appendChild(document.createTextNode("Please login!"));b(this.CS+" #listing_content"+this.ID).html("");b(this.CS+" #listing_content"+this.ID).append(e)};this.hideItemCount=function(){b(this.CS+"#listing_item_count"+this.ID).contents().remove();b(this.CS+"#listing_item_count"+this.ID).hide()};this.refreshItemCount=function(){b(this.CS+"#listing_item_count"+this.ID).contents().remove();if(this.ITEM_COUNT>0){var d="Total "+this.ITEM_COUNT;if(this.VIEW_MODE==this.VIEWMODE_ALL){d=d+" items."}else{if(this.VIEW_MODE==this.VIEWMODE_MYSHARE){d=d+" files."}else{if(this.VIEW_MODE==this.VIEWMODE_WIKI){d=d+" pages."}}}b(this.CS+"#listing_item_count"+this.ID).append(document.createTextNode(d))}else{b(this.CS+"#listing_content"+this.ID).append(document.createTextNode("Empty list."))}};this.showItemCount=function(){if(!this.SHOW_ITEM_COUNT){return}this.refreshItemCount();b(this.CS+"#listing_item_count"+this.ID).show()};this.disablePager=function(){b(this.CS+"#listing_prev_page"+this.ID).unbind("click");b(this.CS+"#listing_next_page"+this.ID).unbind("click")};this.enablePager=function(){var d=this;b(this.CS+"#listing_prev_page"+this.ID).click(function(){if(d.PAGENR==1){return false}d.PAGENR--;d.refreshPager();d.disablePager();d.disableFilter();d.hideContent();d.showWait();d.loadItems()});b(this.CS+"#listing_next_page"+this.ID).click(function(){if(d.PAGENR==d.PAGECOUNT){return false}d.PAGENR++;d.refreshPager();d.disablePager();d.disableFilter();d.hideContent();d.showWait();d.loadItems()})};this.hidePager=function(){b(this.CS+"#listing_pager"+this.ID).hide()};this.hidePageCount=function(){b(this.CS+"#listing_page_number"+this.ID).hide();b(this.CS+"#listing_page_count"+this.ID).hide()};this.showPager=function(){b(this.CS+"#listing_pager"+this.ID).show()};this.calculatePageCount=function(){var d=this.ITEM_COUNT/this.COUNT;var e=this.ITEM_COUNT%this.COUNT;if(e>0){d=d-(e/this.COUNT);d++}this.PAGECOUNT=d};this.refreshPager=function(){if(this.PAGENR>this.PAGECOUNT){this.PAGENR=this.PAGECOUNT}b(this.CS+"#listing_page_number"+this.ID).contents().remove();b(this.CS+"#listing_page_number"+this.ID).append(document.createTextNode(this.PAGENR));b(this.CS+"#listing_page_count"+this.ID).contents().remove();b(this.CS+"#listing_page_count"+this.ID).append(document.createTextNode(this.PAGECOUNT));if(this.PAGENR>1){b(this.CS+"#listing_prev_page"+this.ID).show()}else{b(this.CS+"#listing_prev_page"+this.ID).hide()}if(this.PAGENR<this.PAGECOUNT){b(this.CS+"#listing_next_page"+this.ID).show()}else{b(this.CS+"#listing_next_page"+this.ID).hide()}};this.disableFilter=function(){b(this.CS+" .ceq_listing_filteroption").hide();b(this.CS+"#ceq_listing_filter_all"+this.ID).unbind("click");b(this.CS+"#ceq_listing_filter_all"+this.ID).unbind("filterSwitch");b(this.CS+"#ceq_listing_filter_files"+this.ID).unbind("click");b(this.CS+"#ceq_listing_filter_files"+this.ID).unbind("filterSwitch");b(this.CS+"#ceq_listing_filter_pages"+this.ID).unbind("click");b(this.CS+"#ceq_listing_filter_pages"+this.ID).unbind("filterSwitch")};this.refreshFilter=function(){var j=this;var i=this.CS+"#ceq_listing_filter_all"+this.ID;var g=this.CS+"#ceq_listing_filter_files"+this.ID;var d=this.CS+"#ceq_listing_filter_pages"+this.ID;var f=function(k,l){j.setPageNr(1);j.setViewMode(l);j.refreshFilter();j.disableFilter();j.hideContent();j.showWait();j.loadItems()};var h=function(l){var k=null;if(l==j.VIEWMODE_ALL){k=i}else{if(l==j.VIEWMODE_MYSHARE){k=g}else{if(l==j.VIEWMODE_WIKI){k=d}}}if(k!=null){b(k).removeClass("ceq_listing_filteroption_on");b(k).addClass("ceq_listing_filteroption_off")}else{alert("disableFilterOption ERROR - unknown filterMode='"+l+"'")}};var e=function(l){var k=null;if(l==j.VIEWMODE_ALL){k=i}else{if(l==j.VIEWMODE_MYSHARE){k=g}else{if(l==j.VIEWMODE_WIKI){k=d}}}if(k!=null){b(k).removeClass("ceq_listing_filteroption_on");b(k).addClass("ceq_listing_filteroption_off");b(k).bind("filterSwitch",f);b(k).click(function(){b(k).trigger("filterSwitch",[l])})}else{alert("enableFilterOption ERROR - unknown filterMode='"+l+"'")}};if(this.VIEW_MODE==this.VIEWMODE_ALL){h(this.VIEWMODE_ALL);e(this.VIEWMODE_MYSHARE);e(this.VIEWMODE_WIKI)}else{if(this.VIEW_MODE==this.VIEWMODE_MYSHARE){h(this.VIEWMODE_MYSHARE);e(this.VIEWMODE_ALL);e(this.VIEWMODE_WIKI)}else{if(this.VIEW_MODE==this.VIEWMODE_WIKI){h(this.VIEWMODE_WIKI);e(this.VIEWMODE_MYSHARE);e(this.VIEWMODE_ALL)}}}};this.hideHeader=function(){b(this.CS+" .ceq_listing_header").hide()};this.showHeader=function(){b(this.CS+" .ceq_listing_header").show()};this.hideFilter=function(){b(this.CS+"#ceq_listing_filteroption"+this.ID).hide()};this.showFilter=function(){if(!this.SHOW_FILTER){return}this.refreshFilter();b(this.CS+"#ceq_listing_filteroption"+this.ID).show()};this.handleResponse=function(d){if(d.statusCode=="200"){this.createItems(d.data)}else{if(d.statusCode=="403"){this.showLoginLink(d.url)}else{b(this.CS+"#listing_content"+this.ID).append(document.createTextNode("Service not available"))}}};this.createItems=function(d){var f=this;f.removeContent();f.ITEM_COUNT=d.totalCount;f.calculatePageCount();var e=new Date();if(f.ITEM_COUNT>0){b.each(d.informations,function(k,l){var j={};j.container_id=f.CONTAINER_ID;j.item_id=l.id;j.item_href=l.url;j.item_title=l.title;j.item_type=l.type;j.item_application=l.application.replace(/ /g,"");if(l.changedDate!=l.createdDate){j.item_operation="Updated";if(l.changedByName!=null){j.item_modifier=l.changedByName}else{j.item_modifier=l.createdByName}}else{j.item_operation="Created";j.item_modifier=l.createdByName}j.item_modifier_link=l.createdHomepage;j.equity=Math.round(l.equity);j.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;var h=(e-l.changedDate)/1000;j.time_ago=f.timeRenderer.getTimeAgo(h,e);j.rating=l.rating;b(f.CS+" #listing_content"+f.ID).append(f.template_item_div,j);if((l.ratingCount==null)||(l.ratingCount==undefined)||(l.ratingCount=="")){j.ratingCount=0}else{j.ratingCount=l.ratingCount}b(f.CS+" #openactivities_"+l.id).click(function(){var i=new b.ActivityLog(l.id);i.setWebserviceURL(f.ACTIVITY_WEBSERVICE_URL);i.setUserID("");i.setInfoID(l.id);i.deploy("listing_overlay_activitylog"+l.id)});var g={};g.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;g.item_id=l.id;b(f.CS).append(f.template_activity_widget,g);b(f.CS+" #openactivities_"+l.id).overlay()})}f.showItemCount();f.showContent();f.showFilter();if(f.PAGECOUNT>1){f.refreshPager();f.showPager();f.enablePager()}else{f.hidePager()}};this.loadItems=function(){this.loadItemsFromRemote()};this.loadItemsFromRemote=function(){var d=this;b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:this.getRequestUrl(),dataType:"json",error:function(f,e){d.removeContent();b(d.CS+"#listing_content"+d.ID).append(document.createTextNode("Error"))},success:function(e){d.handleResponse(e)}})};this.deploy=function(e){b("#"+e).html("<div id='"+this.CONTAINER_ID+"' height='"+this.HEIGHT+"' class='ceq_listingwidget'></div>");var d={};d.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;d.id=this.ID;b(this.CS).append(this.template_widget,d);this.showWait();this.disableFilter();if(!this.SHOW_HEADER){this.hideHeader()}this.loadItems()}}})(jQuery);(function(a){a.StarRating=function(c){this.ID=c;this.CONTAINER_ID="rating_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.RATING_USER=0;this.RATING_AVG=0;this.RATING_COUNT=0;this.ITEM_ID=c;this.MSGS_ID="#RateA";this.HEIGHT="320px";this.WEBSERVICE_URL="/ceq-ws/jersey/InformationParticipationP";this.template_rating=a.template(TEMPLATE_RATING);this.showLeft=function(d){if(d){this.MSGS_ID="#RateAL"}else{this.MSGS_ID="#RateA"}};this.showWait=function(){a(this.CS+" #Rate"+this.ITEM_ID).fadeTo("fast",0.5)};this.hideWait=function(){a(this.CS+" #Rate"+this.ITEM_ID).fadeTo("normal",1)};this.setId=function(d){this.ID=d;this.CONTAINER_ID="rating_"+this.ID;this.CS="#"+this.CONTAINER_ID+" "};this.setWebserviceURL=function(d){this.WEBSERVICE_URL=d};this.setRatingUser=function(d){this.RATING_USER=d};this.setRatingAverage=function(d){this.RATING_AVG=d};this.setRatingCount=function(d){this.RATING_COUNT=d};this.refresh=function(){var d=this.RATING_COUNT;a(this.CS+" #RateX"+this.ITEM_ID).html(""+this.RATING_COUNT);a(this.CS+" #RateC"+this.ITEM_ID).css("width",(this.RATING_AVG*2*10)+"%");a(this.CS+" #RateU"+this.ITEM_ID).css("width",(this.RATING_USER*2*10)+"%");a(this.CS+" #RateX"+this.ITEM_ID).attr("rating_user",""+this.RATING_USER)};this.setHeight=function(d){this.HEIGHT=d};this.setError=function(d){a(this.CS+" "+this.MSGS_ID+this.ITEM_ID).html(d)};this.sayThanks=function(){a(this.CS+" "+this.MSGS_ID+this.ITEM_ID).html("Thanks!")};var b=this;this.handleResponse=function(d){b.hideWait();if(d.statusCode=="200"){b.sayThanks();b.setRatingAverage(d.data.averageRating);a("#item_div_"+b.ITEM_ID+" .ceq_rating_cq").html("("+Math.round(d.data.informationEquity)+")");b.setRatingCount(d.data.countRating)}else{b.setError("Service not available");return false}b.refresh();return true};this.deploy=function(g){var i={};i.rating_id=this.CONTAINER_ID;i.rating_width=this.getRatingWidth(this.RATING_AVG);i.rating_user_width=this.getRatingUserWidth(this.RATING_USER);i.rating=this.RATING_AVG;i.rating_user=this.RATING_USER;i.rating_count=this.RATING_COUNT;i.item_id=this.ITEM_ID;i.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;a(g).append(this.template_rating,i);var f=this;var e=function(){a(f.CS+" #RateC"+f.ITEM_ID).hide();a(f.CS+" #RateU"+f.ITEM_ID).show();if(a(f.CS+" #RateU"+f.ITEM_ID).css("width")=="0%"){a(f.CS+" "+f.MSGS_ID+f.ITEM_ID).html("Please rate")}else{a(f.CS+" "+f.MSGS_ID+f.ITEM_ID).html("You've rated ("+f.RATING_USER+")")}a(f.CS+" "+f.MSGS_ID+f.ITEM_ID).show()};var h=function(){a(f.CS+" #RateU"+f.ITEM_ID).hide();a(f.CS+" #RateC"+f.ITEM_ID).show();a(f.CS+" "+f.MSGS_ID+f.ITEM_ID).hide();a(f.CS+" "+f.MSGS_ID+f.ITEM_ID).html("You have rated")};a(this.CS).hover(e,h);var d=function(){var j=a(f.CS+" #Rate"+f.ITEM_ID).attr("title");if(j!=""){var k=this.innerHTML;f.showWait();var l=f.WEBSERVICE_URL+"?infoid="+f.ID+"&rating="+k+"";a.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:l,dataType:"json",error:function(n,m){f.setError("Service not available")},success:function(m){if(m.statusCode=="200"){f.sayThanks();f.setRatingUser(k)}f.handleResponse(m)}})}};a(this.CS+" #Rate"+this.ITEM_ID+" a[rating_val]").click(d);this.refresh()};this.getRatingUserWidth=function(d){return d/0.05};this.getRatingWidth=function(d){return d/0.05}}})(jQuery);var TEMPLATE_RATING='<span id="${rating_id}" style="vertical-align:middle;"><span id="RateAL${item_id}" class="widgetlisting" align="right" valign="bottom" style="font-size: smaller; display: none">Lulz</span>\n<span class="inline-rating" valign="top">\n<ul id="Rate${item_id}" class="ceq_rating small-star" title="0">\n<li id="RateC${item_id}" class="curr-rating" style="width:${rating_width}%">Currently ${rating}/5 Stars.</li>\n<li id="RateU${item_id}" class="done-rating" style="width:${rating_user_width}%; display: none;">You have rated ${rating_user}/0 Stars.</li>\n<li><a href="javascript:void(0);" style="z-index: 4;" rating_val="1" title="Poor" class="one-star">1</a></li>\n<li><a href="javascript:void(0);" style="z-index: 3;" rating_val="2" title="Nothing Special" class="two-stars">2</a></li>\n<li><a href="javascript:void(0);" style="z-index: 2;" rating_val="3" title="Worth Reading" class="three-stars">3</a></li>\n<li><a href="javascript:void(0);" style="z-index: 1;" rating_val="4" title="Pretty Cool" class="four-stars">4</a></li>\n<li><a href="javascript:void(0);" style="z-index: 0;" rating_val="5" title="Awesome" class="five-stars">5</a></li>\n</ul>\n</span>\n<span style="vertical-align:top">(<span id="RateX${item_id}"  rating_user="${rating_user}">${rating_count}</span>)</span><br/>\n<span id="RateA${item_id}" class="widgetlisting" align="right" valign="bottom" style="font-size: smaller;"></span>\n</span>';function TimeRenderer(){this.getTimeAgo=function(k,c){var h=(c.getHours()*3600)+(c.getMinutes()*60)+c.getSeconds();k=Math.floor(k);if(k<60){if(k>1){return k+" seconds ago"}else{return k+" second ago"}}var e=Math.floor(k/60);if(k<=1500){if(e>1){return e+" minutes ago"}else{return e+" minute ago"}}if(k<2100){return"half an hour ago"}if(k<3600){return e+" minutes ago"}var j=Math.floor(k/3600);if(k<43200){if(j>1){return"about "+j+" hours ago"}else{return"about "+j+" hour ago"}}if(k<86400){if(k<=h){return"Today"}else{return"Yesterday"}}if(k-h<86400){return"Yesterday"}var m=Math.floor(k/86400);if(m<14){var i="";var d=(k-(m*86400))/3600;d=Math.floor(d);if(d>0){if(d<8){if(m>1){i+="about "+m+" days ago"}else{i+="about "+m+" day ago"}}else{if(d<16){if(m>1){i+=m+" days "}else{i+=m+" day "}if(d>1){i+=d+" hours ago"}else{i+=d+" hour ago"}}else{i+="about "+(m+1)+" days ago"}}}else{i+="about "+m+" days ago"}return i}var a=Math.floor(k/604800);if(a<8){var i="";if(a>1){i+=a+" weeks"}else{i+=a+" week"}var l=(k-(a*604800))/86400;l=Math.floor(l);if(l>0){if(l>1){i+=" "+l+" days ago"}else{i+=" "+l+" day ago"}}else{i="about "+i+" ago"}return i}var b=Math.floor(k/2629743.83);if(b<12){var i="";if(b>1){i+=b+" months"}var f=Math.floor((k-(b*2629743.83))/604800);if(f>0){if(f>1){i+=" "+f+" weeks ago"}else{i+=" "+f+" week ago"}}else{i="about "+i+" ago"}return i}var g=Math.floor(k/31556926);if(g>1){return"More than "+g+" years ago"}else{return"More than "+g+" year ago"}}}(function(b){function a(d,c){return b.i18n("login",d,c)}b.Login=function(){this.ID=1;this.CONTAINER_ID="login_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.HEIGHT="200px";this.template_widget=b.template(TEMPLATE_LOGIN_WIDGET);this.template_item=b.template(TEMPLATE_LOGIN_ITEM);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/UserProfileP";this.LOGOUT_URL="/opensso/UI/Logout";this.getRequestUrl=function(){var c=this.WEBSERVICE_URL+"?currentuser=true";return c};this.setLogoutURL=function(c){this.LOGOUT_URL=c};this.setWebserviceURL=function(c){this.WEBSERVICE_URL=c};this.setHeight=function(c){this.HEIGHT=c};this.hideContent=function(){};this.showContent=function(){};this.removeContent=function(){b("#login_content").html("")};this.showWait=function(){b(this.CS+" #login_content").html("<div id='login_loading'><img width='12px' height='12px' src='"+WIDGET_RESSOURCE_PATH+"/ceq_login/images/wait.gif'/>&nbsp;Please wait...</div>")};this.showLoginLink=function(c){var d=document.createElement("a");if(!c){d.href=""}else{if(c.indexOf("?")!=-1){d.href=c+"&goto="+location.href}else{d.href=c+"?goto="+location.href}}d.appendChild(document.createTextNode("Please login!"));b(this.CS+" #login_content").html("");b(this.CS+" #login_content").append(d)};this.handleResponse=function(c){if(c.statusCode=="200"){this.setLogoutURL(c.logoutUrl);this.createItems(c.data)}else{if(c.statusCode=="403"){this.showLoginLink(c.url)}else{b(this.CS+"#login_content").append(document.createTextNode("Service not available"))}}};this.createItems=function(c){thisobj=this;thisobj.removeContent();var d={};d.LOGOUT_URL=this.LOGOUT_URL;d.GIVENNAME=c.givenname;d.SURNAME=c.surname;d.EMAIL=c.email;b(thisobj.CS+" #login_content").append(thisobj.template_item,d)};this.loadItems=function(){this.loadItemsFromRemote()};this.loadItemsFromRemote=function(){var c=this;b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:this.getRequestUrl(),dataType:"json",error:function(f,e){c.removeContent();b(c.CS+"#tagcloud_content").append(document.createTextNode("Error"))},success:function(d){c.handleResponse(d)}})};this.deploy=function(d){b("#"+d).html("<div id='"+this.CONTAINER_ID+"' class='ceq_loginwidget' height='"+this.HEIGHT+"'></div>");var c={};c.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;b(this.CS).append(this.template_widget,c);this.showWait();this.loadItems()}}})(jQuery);var TEMPLATE_LOGIN_WIDGET='<div id="login_content" class="ceq_login_box">\n</div>';var TEMPLATE_LOGIN_ITEM='${GIVENNAME} ${SURNAME} (${EMAIL}) &nbsp;  <a href="${LOGOUT_URL}">Logout</a>';(function(a){a.CliqsetConnect=function(b){this.ID=1;this.CONTAINER_ID="cliqsetconnect_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.template_cliqset=a.template(TEMPLATE_CLIQSETCONNECT_WIDGET);this.manager=b;this.deploy=function(e,d){var c=this;a("#"+e).append(this.template_cliqset);a("#cliqsetconnect_register").click(function(){jQuery("#cliqsetconnect_overlay #messages").empty();jQuery("#add_cliqset_feed").attr("disabled",false);a("#cliqsetconnect_overlay").overlay({top:100,api:true,finish:{top:100,left:"center",absolute:false}}).load()});a("#add_cliqset_feed").click(function(){a("#cliqsetconnect_content #messages").empty();var h="Cliqset";var f="activitystream";var k="http://cliqset.com/feed/atom?uid="+a("#cliqsetid").val();var j=a("#cliqsetid").val();var i="";jQuery("#cliqsetconnect_overlay #messages").empty().append('Please Wait...<img src="'+WIDGET_RESSOURCE_PATH+'/ceq_siteconnect/images/wait.gif">');jQuery("#add_cliqset_feed").attr("disabled",true);var g={};g.applicationName=h;g.feedType=f;g.feedUrl=k;g.defaultTags=i;g.ownerAlias=j;g.siteFeed=false;jQuery.ajax({type:"POST",url:"/ceq-ws/jersey/Feeds",data:g,success:function(l,m){jQuery("#cliqsetconnect_overlay #messages").empty().append("Feed Saved!");jQuery("#cliqsetconnect_overlay").overlay({api:true}).close();c.manager.updatePersonalFeedRow(l)},error:function(m,n,l){jQuery("#cliqsetconnect_overlay #messages").empty().append('<font color="red">Error registering feed - '+n+" "+m.responseText+"</font><br/>");jQuery("#add_cliqset_feed").attr("disabled",false)},dataType:"json"})})}}})(jQuery);(function(b){function a(d,c){return b.i18n("login",d,c)}b.FbConnect=function(){this.ID=1;this.CONTAINER_ID="fbconnect_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.facebook_api_key="";this.template_widget=b.template(TEMPLATE_FBCONNECT_WIDGET);this.template_item=b.template(TEMPLATE_FBCONNECT_ITEM);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/Facebook/fbstatus";this.AUTH_WEBSERVICE_URL="ceq-ws/jersey/Facebook/authorize";this.FACEBOOK_LOGIN_URL="http://www.facebook.com/login.php";String.prototype.bool=function(){return(/^true$/i).test(this)};this.removeContent=function(){b("#fbconnect_content").html("")};this.showWait=function(){b(this.CS+" #fbconnect_content").html("<div id='login_loading'><img width='12px' height='12px' src='"+WIDGET_RESSOURCE_PATH+"/ceq_siteconnect/images/wait.gif'/>&nbsp;Please wait...</div>")};this.setWebserviceURL=function(c){this.WEBSERVICE_URL=c};this.showLoginLink=function(c){var d=document.createElement("a");if(c.indexOf("?")!=-1){d.href=c+"&goto="+location.href}else{d.href=c+"?goto="+location.href}d.appendChild(document.createTextNode("Please login!"));b(this.CS+" #fbconnect_content").html("");b(this.CS+" #fbconnect_content").append(d)};this.showFacebookLoginLink=function(e){var g=b.url.setUrl(window.location).attr("base")+this.AUTH_WEBSERVICE_URL;var d=document.createElement("a");d.href="#";var f=e+"?api_key="+facebook_api_key+"&fbconnect=true&v=1.0&connect_display=popup&return_session=true&req_perms=read_stream,offline_access&next="+g;d.onclick=function(){window.open(f,"popup","width=640, height=500")};var c=document.createElement("img");c.setAttribute("src","http://static.ak.fbcdn.net/images/fbconnect/login-buttons/connect_light_large_long.gif");c.setAttribute("alt","Facebook Login");c.setAttribute("border","0");d.appendChild(c);b(this.CS+" #fbconnect_content").html("");b(this.CS+" #fbconnect_content").append(d)};this.handleResponse=function(c){if(c.statusCode=="200"){fbloggedin=false;if(c.data.attributes!=null){b.each(c.data.attributes.entry,function(d,e){if(e.key.$=="apiKey"){facebook_api_key=e.value.$}if(e.key.$=="isLoggedIn"){fbloggedin=e.value.$.bool()}})}if(!fbloggedin){if(facebook_api_key==""){b(this.CS+" #fbconnect_content").html("");b(this.CS+"#fbconnect_content").append(document.createTextNode("Facebook API Key not configured"))}else{this.showFacebookLoginLink(this.FACEBOOK_LOGIN_URL)}}else{this.createItems(c.data)}}else{if(c.statusCode=="403"){this.showLoginLink(c.url)}else{b(this.CS+"#fbconnect_content").append(document.createTextNode("Service not available"))}}};this.createItems=function(c){thisobj=this;thisobj.removeContent();var d={};d.GIVENNAME=c.givenname;d.SURNAME=c.surname;d.EMAIL=c.email;b(thisobj.CS+" #fbconnect_content").append(thisobj.template_item,d)};this.loadItemsFromLocal=function(){var c=this;b.ajax({type:"GET",url:this.WEBSERVICE_URL,dataType:"json",error:function(e,f,d){c.removeContent();if(e.status=="403"){c.showLoginLink(e.getResponseHeader("X-CeqLoginUrl"))}else{b(c.CS+"#tagcloud_content").append(document.createTextNode("Service not available"))}},success:function(d){c.handleResponse(d)}})};this.deploy=function(d){b("#"+d).html("<div id='"+this.CONTAINER_ID+"' class='ceq_loginwidget' height='"+this.HEIGHT+"'></div>");var c={};c.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;b(this.CS).append(this.template_widget,c);this.showWait();this.loadItemsFromLocal()}}})(jQuery);(function(a){a.SiteConnect=function(b){this.ID=1;if(b!=null){this.ID=b}this.CONTAINER_ID="siteconnect_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/Feeds/SiteFeeds";this.WEBSERVICE_FEED_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/Feeds";this.WEBSERVICE_PERSONAL_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/Feeds/PersonalFeeds";this.EMPTY_FEEDS_RESPONSE="EMPTY";this.template_table=a.template(TEMPLATE_SITECONNECT_TABLE);this.template_row=a.template(TEMPLATE_SITECONNECT_ROW);this.template_row_content=a.template(TEMPLATE_SITECONNECT_ROW_CONTENT);this.template_empty_row=a.template(TEMPLATE_SITECONNECT_EMPTY_ROW);this.template_personal_row=a.template(TEMPLATE_SITECONNECT_PERSONAL_ROW);this.template_personal_row_content=a.template(TEMPLATE_SITECONNECT_PERSONAL_ROW_CONTENT);this.template_personal_empty_row=a.template(TEMPLATE_SITECONNECT_PERSONAL_EMPTY_ROW);this.tmp_feeds_response=null;this.tmp_personal_feeds_response=null;this.deploy=function(g){var e=this;if(g){this.CS=g}else{throw"Container Selector not valid!"}var d={};d.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;a(this.CS).append(this.template_table,d);var f=new a.FbConnect();f.deploy("ceq_siteconnect_personal_icons");var c=new a.CliqsetConnect(e);c.deploy("ceq_siteconnect_personal_icons");a.ajax({type:"GET",url:this.WEBSERVICE_URL+"?format=json",success:function(h){e.handleGetAllFeedsResponse(h)},error:function(i,j,h){alert("Error getting the list of feeds: "+j+" "+i.responseText)},dataType:"json"});a.ajax({type:"GET",url:this.WEBSERVICE_PERSONAL_URL+"?format=json",success:function(h){e.handleGetAllPersonalFeedsResponse(h)},error:function(i,j,h){alert("Error getting the list of personal feeds: "+j+" "+i.responseText)},dataType:"json"})};this.setWebserviceURL=function(c){this.WEBSERVICE_URL=c};this.handleGetAllFeedsResponse=function(c){if(c!=null){this.tmp_feeds_response=c}else{this.tmp_feeds_response=this.EMPTY_FEEDS_RESPONSE}this.handleGetFeedsResponse()};this.handleGetAllPersonalFeedsResponse=function(c){if(c!=null){this.tmp_personal_feeds_response=c}else{this.tmp_personal_feeds_response=this.EMPTY_FEEDS_RESPONSE}this.handleGetPersonalFeedsResponse()};this.handleGetFeedsResponse=function(){var d=this;d.clearContent();if(d.tmp_feeds_response==d.EMPTY_FEEDS_RESPONSE){a("#ceq_siteconnect_table_content").append(d.template_empty_row)}else{var c=d.tmp_feeds_response.Feeds;if(!c.applicationName){a.each(c,function(e,f){d.addFeedRow(f)})}else{d.addFeedRow(c)}}};this.handleGetPersonalFeedsResponse=function(){var d=this;d.clearPersonalContent();if(d.tmp_personal_feeds_response==d.EMPTY_FEEDS_RESPONSE){a("#ceq_siteconnect_personal_table_content").append(d.template_personal_empty_row)}else{var c=d.tmp_personal_feeds_response.Feeds;if(!c.feedId){a.each(c,function(e,f){d.addPersonalFeedRow(f)})}else{d.addPersonalFeedRow(c)}}};this.updateFeedRow=function(c){this.addFeedRow(c)};this.addFeedRow=function(d){var c=this;if(a("#ceq_siteconnect_table_content #ceq_siteconnect_empty_row").length>0){a("#ceq_siteconnect_table_content #ceq_siteconnect_empty_row").remove()}if(a("[id=ceq_siteconnect_table_row_"+d.applicationName+"]").length>0){a("[id=ceq_siteconnect_table_row_"+d.applicationName+"]").empty()}else{a("#ceq_siteconnect_table_content").append(c.template_row,d)}a("[id=ceq_siteconnect_table_row_"+d.applicationName+"]").append(c.template_row_content,d);a("[id=ceq_siteconnect_button_update_"+d.applicationName+"]").click(function(){var f={};f.applicationName=d.applicationName;f.siteNames=d.userAlias;var e=new a.UpdateSiteOverlay(c,f);e.deploy(c.CS)})};this.updatePersonalFeedRow=function(c){this.addPersonalFeedRow(c)};this.addPersonalFeedRow=function(d){var c=this;if(a("#ceq_siteconnect_personal_table_content #ceq_siteconnect_personal_empty_row").length>0){a("#ceq_siteconnect_personal_table_content #ceq_siteconnect_personal_empty_row").remove()}if(a("#ceq_siteconnect_personal_table_row_"+d.feedId).length>0){a("#ceq_siteconnect_personal_table_row_"+d.feedId).empty()}else{a("#ceq_siteconnect_personal_table_content").append(c.template_personal_row,d)}a("#ceq_siteconnect_personal_table_row_"+d.feedId).append(c.template_personal_row_content,d);a("#ceq_siteconnect_personal_button_delete_"+d.feedId).click(function(){a.ajax({type:"DELETE",url:c.WEBSERVICE_FEED_URL+"/"+d.feedId,success:function(e){a("#ceq_siteconnect_personal_table_row_"+d.feedId).remove();if(a("#ceq_siteconnect_personal_table_content tr").length==0){a("#ceq_siteconnect_personal_table_content").empty().append(c.template_personal_empty_row)}},error:function(f,g,e){alert("Error deleting personal feed:"+g+" "+f.responseText)}})})};this.clearContent=function(){a("#ceq_siteconnect_table_content").empty()};this.clearPersonalContent=function(){a("#ceq_siteconnect_personal_table_content").empty()}}})(jQuery);(function(a){a.UpdateSiteOverlay=function(c,b){this.CS="";this.ID="ceq_siteconnect_overlay_update";this.template_overlay_update=a.template(TEMPLATE_SITECONNECT_OVERLAY_UPDATE);if(!c){throw"SiteConnect UpdateOverlay Init Error: manager parameter missing"}this.manager=c;if(!b){throw"UpdateOverlay Init Error: site parameter missing"}this.site=b;this.getId=function(){return this.ID};this.deploy=function(e){var d=this;if(e){this.CS=e}else{throw"Container Selector not valid!"}var f=d.site;f.overlay_id=d.ID;a(d.CS).append(d.template_overlay_update,f);a("#"+d.ID+" #update_siteconnect_submit").click(function(){a("#"+d.ID+" #messages").empty();var h=a("#"+d.ID+" #siteNames").val();var i=a("#"+d.ID+" #applicationName").val();if(i==""){a("#"+d.ID+" #messages").append("Application Name Cannot Be Empty!<br/>");return}a("#"+d.ID+" #messages").empty().append('Please Wait...<img src="'+WIDGET_RESSOURCE_PATH+'/ceq_siteconnect/images/wait.gif">');a("#"+d.ID+" button").attr("disabled",true);a("#"+d.ID+" input").attr("disabled",true);a("#"+d.ID+" select").attr("disabled",true);var g={};g.applicationName=i;g.siteNames=h;a.ajax({type:"PUT",url:d.manager.WEBSERVICE_URL,data:g,success:function(j,k){a("#"+d.ID+" #messages").empty().append("Site Names Updated!");d.closeOverlay();d.manager.updateFeedRow(j)},error:function(k,l,j){a("#"+d.ID+" #messages").empty().append('<font color="red">Error Updating Site Names - '+l+" "+k.responseText+"</font><br/>");a("#"+d.ID+" button").attr("disabled",false);a("#"+d.ID+" input").attr("disabled",false);a("#"+d.ID+" select").attr("disabled",false)},dataType:"json"})});a("#"+d.ID).overlay({top:100,api:true,onClose:function(){a("#"+d.ID).remove()},finish:{top:100,left:"center",absolute:false}}).load()};this.closeOverlay=function(){a("#"+this.ID).overlay({api:true}).close()}}})(jQuery);var TEMPLATE_SITECONNECT_TABLE='<h3>Connect Your Social Networks</h3>You can connect to your online social personality by clicking the below icons.  Once connected, your personal connections will appear in the below <strong>Personal Connections</strong> area.<br><br><div id="ceq_siteconnect_personal_icons"/><br><h3>Personal Connections</h3>You have personally connected to the following sites.  Click <b>Delete</b> to disconnect the feed.  Click the icons above to reconnect.<br><br><table id="ceq_siteconnect_personal_table"><tbody id="ceq_siteconnect_personal_table_content"><tr><td><img src="${WIDGET_RESSOURCE_PATH}/img/wait.gif">Please Wait.</td></tr></tbody></table><br><h3>Site Feed Names</h3>The following site-wide feeds are currently active.  If you participate in any of the venues associated with these feeds, click <strong>Edit...</strong> and specify your identifier for a given venue so that your activities are attributed to you.<br><br><table id="ceq_siteconnect_table"><tbody id="ceq_siteconnect_table_content"><tr><td><img src="${WIDGET_RESSOURCE_PATH}/img/wait.gif">Please Wait.</td></tr></tbody></table>';var TEMPLATE_SITECONNECT_EMPTY_ROW='<tr id="ceq_siteconnect_empty_row"><td colspan="3"><em>There are no site-wide feeds defined.</em></td></tr>';var TEMPLATE_SITECONNECT_PERSONAL_EMPTY_ROW='<tr id="ceq_siteconnect_personal_empty_row"><td colspan="3"><em>You have not personally connected to any sites.</em></td></tr>';var TEMPLATE_SITECONNECT_ROW='<tr id="ceq_siteconnect_table_row_${applicationName}"></tr>';var TEMPLATE_SITECONNECT_PERSONAL_ROW='<tr id="ceq_siteconnect_personal_table_row_${feedId}"></tr>';var TEMPLATE_SITECONNECT_ROW_CONTENT='<td align="center"><button id="ceq_siteconnect_button_update_${applicationName}">Edit...</button></td><td align="left" id="applicationName_${applicationName}">${applicationName}<input type="hidden" value="${applicationName}"></input></td><td align="center" id="siteicon_${applicationName}"><span class="application application${applicationName}"/><input type="hidden" value="${applicationName}"></input></td><td align="left" id="userAlias_${applicationName}">${userAlias}<input type="hidden" value="${userAlias}"></input></td>';var TEMPLATE_SITECONNECT_PERSONAL_ROW_CONTENT='<td align="center"><button id="ceq_siteconnect_personal_button_delete_${feedId}">Delete</button></td><td align="center" id="siteicon_${feedId}"><span class="application application${applicationName}"/></td><td align="left" id="applicationName_${feedId}">${applicationName}</td>';var TEMPLATE_SITECONNECT_OVERLAY_UPDATE='<div id="${overlay_id}" class="overlay"><span class="application application${applicationName}"/><h3>Edit Site Feed Names for ${applicationName}</h3><br/><div id="messages"></div><div id="update_siteconnect_content">    <table>        <tr>            <td><label for="enabled">Site Names:</label></td><td><input type="text" id="siteNames" name="siteNames" size="40" value="${siteNames}"></input>        </tr>        <tr><td colspan="2" align="center"><button type="button" id="update_siteconnect_submit">Update</button></td></tr>    </table><input type="hidden" name="applicationName" id="applicationName" value="${applicationName}"></input></div></div>';var TEMPLATE_FBCONNECT_WIDGET='<div id="fbconnect_content"/>';var TEMPLATE_FBCONNECT_ITEM='You are connected to Facebook [<a href="http://www.facebook.com/editapps.php">Disconnect</a>] &nbsp;';var TEMPLATE_CLIQSETCONNECT_WIDGET='<div id="cliqsetconnect_content"><img id="cliqsetconnect_register" src="http://cliqset-v3.s3.amazonaws.com/img/header-logo.png" width="120" alt="Register your Cliqset feed"/></div><div class="overlay" style="width:350px;height:150px;" id="cliqsetconnect_overlay">	<table>		<tr>			<td><label for="cliqsetid">Cliqset Username:</label></td>			<td><input type="text" id="cliqsetid" name="cliqsetid"			           size="40"/>		</tr>		<tr>			<td>				<div id="messages">&nbsp;</div>			</td>		</tr>		<tr>			<td colspan="2" align="center">				<button type="button" id="add_cliqset_feed">Connect				</button>			</td>		</tr>	</table></div></div>';function StringBuffer(){this.buffer=[]}StringBuffer.prototype.append=function append(a){this.buffer.push(a);return this};StringBuffer.prototype.toString=function toString(){return this.buffer.join("")};(function(b){function a(d,c){return b.i18n("tagcloud",d,c)}b.TagCloud=function(c){this.FILTER_ALL="all";this.FILTER_WIKI="wiki";this.FILTER_BLOG="blog";this.FILTER_FORUM="forum";this.FILTER_FILES="files";this.FILTER_PAGES="pages";this.OPERATOR_AND="AND";this.OPERATOR_OR="OR";this.ORDER_ALPHA="alpha";this.ORDER_USAGE="usage";this.ORDER_EQUITY="equity";this.ID=1;if(c!=null){this.ID=c}this.CONTAINER_ID="tagcloud_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.PAGE_NR=1;this.PAGE_SIZE=20;this.PAGE_SIZE_INITIAL=20;this.FILTER=this.FILTER_ALL;this.ORDER=this.ORDER_ALPHA;this.TAGS=null;this.TAGS_INITIAL="";this.AUTHOR=null;this.ITEM_COUNT=0;this.HIDETAGS="";this.INFOID=-1;this.REVERSE=false;this.GROUPS=null;this.HEIGHT="320px";this.OPERATOR=this.OPERATOR_OR;this.SOURCE=null;this.template_widget=b.template(TEMPLATE_TAGCLOUD_WIDGET);this.template_item_div=b.template(TEMPLATE_TAGCLOUD_ITEM_DIV);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/TagCloudP";this.CURRENT_USER=false;this.getRequestUrl=function(){var d=this.WEBSERVICE_URL+"?pagenr="+this.PAGE_NR+"&filter="+this.FILTER+"&order="+this.ORDER;d+="&authors="+this.AUTHOR;if(this.PAGE_SIZE>=0){d+="&count="+(this.PAGE_SIZE+1)}if(this.TAGS!=null){d+="&tags="+this.TAGS}if(this.OPERATOR!=null){d+="&operator="+this.OPERATOR}if(this.HIDETAGS!=null){d+="&hidetags="+this.HIDETAGS}if(this.INFOID!=-1){d+="&infoid="+this.INFOID}if(this.REVERSE==true){d+="&reverse=true"}if(this.GROUPS!=null){d+="&groups="+this.GROUPS}if(this.SOURCE!=null){d+="&source="+this.SOURCE}if(this.CURRENT_USER==true){d+="&currentuser=true"}return d};this.setId=function(d){this.ID=d;this.CONTAINER_ID="tagcloud_"+this.ID;this.CS="#"+this.CONTAINER_ID+" "};this.setWebserviceURL=function(d){this.WEBSERVICE_URL=d};this.setCurrentUserFilter=function(d){this.CURRENT_USER=d};this.setHeight=function(d){this.HEIGHT=d};this.setPageSizeInitial=function(d){this.PAGE_SIZE_INITIAL=d};this.setPageSize=function(d){this.PAGE_SIZE=d};this.setPageNr=function(d){this.PAGE_NR=d};this.setFilter=function(d){this.FILTER=d};this.setOrder=function(d){this.ORDER=d};this.setOperator=function(d){this.OPERATOR=d};this.setTagsInitial=function(d){this.TAGS_INITIAL=+","+d+","};this.setTags=function(d){this.TAGS=d;this.TAGS_INITIAL=","+d+","};this.setHidetags=function(d){this.HIDETAGS=d};this.setAuthor=function(d){this.AUTHOR=d};this.setGroups=function(d){this.GROUPS=d};this.setSource=function(d){this.SOURCE=d};this.setInfoID=function(d){this.INFOID=d};this.setReverse=function(d){this.REVERSE=d};this.hideContent=function(){};this.showContent=function(){};this.removeContent=function(){b(this.CS+" .ceq_mlink").unbind();b(this.CS+" #tagcloud_content"+this.ID).html("");b(this.CS+" #tagcloud_footer"+this.ID).html("")};this.showWait=function(){b(this.CS+" #tagcloud_content"+this.ID).html("<div id='tagcloud_loading'><img width='12px' height='12px' src='"+WIDGET_RESSOURCE_PATH+"/ceq_tagcloud/images/wait.gif'/>&nbsp;Please wait...</div>");b(this.CS+" #tagcloud_footer"+this.ID).html("")};this.showLoginLink=function(d){var e=document.createElement("a");e.href=d+"?goto="+location.href;e.appendChild(document.createTextNode("Please login!"));b(this.CS+" #tagcloud_content"+this.ID).html("");b(this.CS+" #tagcloud_content"+this.ID).append(e);b(this.CS+" #tagcloud_footer"+this.ID).html("")};this.handleResponse=function(d){if(d.statusCode=="200"){this.createItems(d.data)}else{if(d.statusCode=="403"){this.showLoginLink(d.url)}else{b(this.CS+"#tagcloud_content"+this.ID).append(document.createTextNode("Service not available"))}}};this.createItems=function(m){var h=this;h.removeContent();h.ITEM_COUNT=m.count;if(m.count==0){b(h.CS+"#tagcloud_content"+this.ID).append(document.createTextNode("Empty."))}else{var j=","+h.TAGS+",";var k=false;b.each(m.tags,function(n,o){if(j.indexOf(","+o.key+",")!=-1){k=true;return false}else{return true}});if(k){b(h.CS+" #clearbutton"+h.ID).click(function(){h.clearTagsSelection()})}else{b(h.CS+" #clearbutton"+h.ID).unbind()}var l=new StringBuffer();b.each(m.tags,function(o,q){if(o>(h.PAGE_SIZE-1)){return false}if((q!=undefined)&&(q.key!=undefined)){var n={};n.name=q.name;n.key=q.key;n.id=q.id;n.tagclassouter="";if(j.indexOf(","+q.key+",")!=-1){if(q.kind=="FOLKSONOMY"){n.tagclassouter="ceq_selecteduc"}else{n.tagclassouter="ceq_selectedc"}}n.tagclass=q.stylesheet;var p=' <a href="javascript:void(0)" id="taglink'+n.id+'" class="'+n.tagclass+'" key="'+n.key+'"><span class="'+n.tagclassouter+'">'+n.name+"</span></a>";if(h.TAGS_INITIAL.indexOf(","+q.name+",")==-1){l.append(p)}}});b(h.CS+"#tagcloud_content"+h.ID).append(l.toString());var f=0,e=m.tags.length,g=false;var d=setInterval(function(){if(!g){g=true;var n=m.tags[f];b(h.CS+"#taglink"+n.id).click(function(){h.updateTagcloud(this.attributes.key.value)});var i="Usage: "+n.usage+" TQ: "+Math.round(n.tq);b(h.CS+"#taglink"+n.id).qtip({content:i,position:{corner:{target:"bottomLeft",tooltip:"topLeft"}}});g=false;if(++f==e){clearInterval(d)}}},5);if((h.PAGE_SIZE==1000)&&(h.ITEM_COUNT>h.PAGE_SIZE)){b(h.CS+"#tagcloud_content"+h.ID).append("&nbsp;&nbsp; ... &nbsp;&nbsp;")}else{if(h.ITEM_COUNT>h.PAGE_SIZE){b(h.CS+" .ceq_tagcloud_footer").append("<a href='javascript:void(0)' class='ceq_mlink' id='morebutton'>"+a("more")+"<span class='ceq_arrow'>&raquo;</span> </a>");b(h.CS+" #morebutton"+h.ID).click(function(){h.updateSimpleTagsShowMore()})}}if(h.PAGE_SIZE==1000){b(h.CS+" .ceq_tagcloud_footer").append("<a href='javascript:void(0)' class='ceq_mlink' id='lessbutton'>"+a("less")+"<span class='ceq_arrow'>&laquo;</span> </a>");b(h.CS+" #lessbutton"+h.ID).click(function(){h.updateSimpleTagsShowLess()})}}};this.loadItems=function(){this.loadItemsFromRemote()};this.loadItemsFromRemote=function(){var d=this;b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:this.getRequestUrl(),dataType:"json",error:function(f,e){d.removeContent();b(d.CS+"#tagcloud_content"+d.ID).append(document.createTextNode("Error"))},success:function(e){d.handleResponse(e)}})};this.setInformation=function(d){this.INFORMATION_ID=d};this.updateSimpleTagsShowMore=function(){this.showWait();this.setPageSize(1000);this.loadItems()};this.updateSimpleTagsShowLess=function(){this.showWait();this.setPageSize(this.PAGE_SIZE_INITIAL);this.loadItems()};this.updateTagcloud=function(d){b(".qtip-wrapper").hide();if(this.TAGS!=null){var h=","+this.TAGS+",";if(h.indexOf(","+d+",")!=-1){var f=h.indexOf(","+d+",");var g=d.length+1;var e=f+g;this.TAGS=h.substr(0,f);if(h.length>(f+g)){this.TAGS+=h.substr(e,h.length)}}else{this.TAGS+=","+d}}else{this.TAGS=d}this.showWait();this.loadItems();OpenAjax.hub.publish("com.ceq.tagcloud."+this.ID,this.TAGS)};this.clearTagsSelection=function(){this.TAGS=this.TAGS_INITIAL;this.showWait();this.loadItems();if(this.TAGS==null){OpenAjax.hub.publish("com.ceq.tagcloud."+this.ID,"")}else{OpenAjax.hub.publish("com.ceq.tagcloud."+this.ID,this.TAGS)}};this.deploy=function(e){b("#"+e).html("<div id='"+this.CONTAINER_ID+"' class='ceq_tagcloudwidget' height='"+this.HEIGHT+"'></div>");var d={};d.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;d.id=this.ID;b(this.CS).append(this.template_widget,d);this.showWait();this.loadItems()}}})(jQuery);var TEMPLATE_TAGCLOUD_WIDGET='<div id="tagcloud_header${id}" class="ceq_tagcloud_header">\n<h3>&nbsp;<!-- selector link -->\n<a class="ceq_mlink" href="javascript:void(0)" id="clearbutton${id}">clear selection<span class="ceq_arrow">&nbsp;&raquo;</span>\n</a></h3>\n</div><div id="tagcloud_content${id}" class="ceq_tagcloud_box">\n<div id="loading${id}"><img width="12px" height="12px" src="${WIDGET_RESSOURCE_PATH}/ceq_tagcloud/images/wait.gif"/>&nbsp;Please wait...</div>\n</div>\n<div id="tagcloud_footer${id}" class="ceq_tagcloud_footer"></div>';var TEMPLATE_TAGCLOUD_ITEM_DIV=' <a href="javascript:void(0)" id="taglink${id}" class="${tagclass}" key="${key}">\n<span class="${tagclassouter}">${name}</span></a>';(function(a){a.MyCEQTxt=function(b){this.objPerson=b;this.urlService=WEBSERVICE_RESSOURCE_PATH+"/jersey/math/myCEQP";this.REMOTE_WEBSERVICE=true;this.enableRemoteWebservice=function(){this.REMOTE_WEBSERVICE=true};this.disableRemoteWebservice=function(){this.REMOTE_WEBSERVICE=false};this.setWebserviceURL=function(c){this.urlService=c};this.deploy=function(c){var d=this;var e=a(c);e.addClass("ceq_ceqwidget");this.getJSON(this.urlService,this.objPerson,function(h){e.empty();a("<div/>").addClass("ceq_myceq_title").append(a("<h3/>").append(a("<span/>").html("My Community Equity")).append(a("<span/>").addClass("ceq_myceq_help").append(a("<img/>").attr("border",0).attr("src",WIDGET_RESSOURCE_PATH+"/ceq_topceq/ceq_mycommunityequity/img/ceq_help.png")))).appendTo(e);var f=a("<img/>").attr("border",0).attr("src",WIDGET_RESSOURCE_PATH+"/ceq_topceq/ceq_mycommunityequity/img/ceq_chart_bar.png").qtip({content:"future implementation...",show:"mouseover",hide:"mouseout"});a("<div/>").addClass("ceq_myceq_box").append(a("<div/>").addClass("ceq_myceq_firstrow").append(a("<span/>").html("Contribution Equity: ")).append(a("<span/>").addClass("ceq_myceq_cqvalue").html(""+Math.round(h.CQ))).append(a("<span/>").addClass("ceq_myceq_cqstat").append(f)).append(a("<span/>").addClass("ceq_myceq_cqinfo"))).append(a("<div/>").addClass("ceq_myceq_secondrow").html("Novice User: "+Math.max(Math.round(h.CQmin),0)+" &middot; Average User: &middot; "+Math.round(h.CQavg)+" Power User: "+Math.round(h.CQmax))).append(a("<div/>").addClass("ceq_myceq_thirdrow").append(a("<span/>").html("Ranking: ")).append(a("<span/>").addClass("ceq_myceq_cqranking").html(h.CQrank)).append(a("<span/>").html(" ")).append(a("<span/>").addClass("ceq_myceq_details").html("of "+h.count+" active User"))).append(a("<div/>").addClass("ceq_myceq_divider")).appendTo(e);var g=a("<img/>").attr("border",0).attr("src",WIDGET_RESSOURCE_PATH+"/ceq_topceq/ceq_mycommunityequity/img/ceq_chart_bar.png").qtip({content:"future implementation...",show:"mouseover",hide:"mouseout"});a("<div/>").addClass("ceq_myceq_box").append(a("<div/>").addClass("ceq_myceq_firstrow").append(a("<span/>").html("Participation Equity: ")).append(a("<span/>").addClass("ceq_myceq_pqvalue").html(""+Math.round(h.PQ))).append(a("<span/>").addClass("ceq_myceq_cqstat").append(g)).append(a("<span/>").addClass("ceq_myceq_cqinfo"))).append(a("<div/>").addClass("ceq_myceq_secondrow").html("Novice User: "+Math.max(Math.round(h.PQmin),0)+" &middot; Average User: &middot; "+Math.round(h.PQavg)+" Power User: "+Math.round(h.PQmax))).append(a("<div/>").addClass("ceq_myceq_thirdrow").append(a("<span/>").html("Ranking: ")).append(a("<span/>").addClass("ceq_myceq_pqranking").html(h.PQrank)).append(a("<span/>").html(" ")).append(a("<span/>").addClass("ceq_myceq_details").html("of "+h.count+" active User"))).appendTo(e);a("<div/>").addClass("overlay").attr("id","win_overlay").css("left","20px").css("width","545px").css("height","290px").append(a("<div/>").attr("id","overlay_activitylog").css("width","500px")).appendTo(e)},function(f){e.html(f)})};this.getJSON=function(e,g,c,f){var d=this;if(this.REMOTE_WEBSERVICE){a.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:e,data:g,dataType:"json",error:function(i,h){f("Service not available")},success:function(h){d.handleResponse(h,c,f)}})}else{a.ajax({type:"GET",url:e,data:g,dataType:"json",error:function(i,j,h){if(i.status=="403"){d.showLoginLink(i.getResponseHeader("X-CeqLoginUrl"),f)}else{f("Service not available")}},success:function(h){d.handleResponse(h,c,f)}})}};this.handleResponse=function(d,c,e){if(d.statusCode=="200"){c(d.data)}else{if(d.statusCode=="403"){this.showLoginLink(d.url,e)}else{e("Service not available")}}};this.showLoginLink=function(d,c){c("Access denied")}}})(jQuery);(function(b){function a(d,c){return b.i18n("ceq",d,c)}b.TopCommunities=function(c){this.ID=1;if(c!=null){this.ID=c}this.CONTAINER_ID="topcommunities_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.HEIGHT="320px";this.template_widget=b.template(TEMPLATE_TOPCOMMUNITIES_WIDGET);this.template_item_div=b.template(TEMPLATE_TOPCOMMUNITIES_ITEM_DIV);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/math/statisticsP";this.COUNT=10;this.getRequestUrl=function(){var d=this.WEBSERVICE_URL+"?report=topcommunity&count="+this.COUNT;return d};this.setWebserviceURL=function(d){this.WEBSERVICE_URL=d};this.setHeight=function(d){this.HEIGHT=d};this.deploy=function(e){b("#"+e).html("<div id='"+this.CONTAINER_ID+"' class='ceq_ceqwidget' height='"+this.HEIGHT+"'></div>");var d={};d.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;d.id=this.ID;b(this.CS).append(this.template_widget,d);this.showWait();this.loadItems()};this.showWait=function(){b(this.CS+" #topcommunities_content"+this.ID).html("<div id='topcommunities_loading'><img width='12px' height='12px' src='"+WIDGET_RESSOURCE_PATH+"/ceq_tagcloud/images/wait.gif'/>&nbsp;Please wait...</div>")};this.loadItems=function(){this.loadItemsFromRemote()};this.loadItemsFromRemote=function(){var d=this;b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:this.getRequestUrl(),dataType:"json",error:function(f,e){b(d.CS+" #topcommunities_content"+d.ID).html("Service not available")},success:function(e){d.handleResponse(e)}})};this.handleResponse=function(d){if(d.statusCode=="200"){this.createItems(d.data)}else{if(d.statusCode=="403"){this.showLoginLink(d.url)}else{b(this.CS+" #topcommunities_content"+this.ID).html("Error "+d.message+" (HTTP Status Code: "+d.statusCode+")")}}};this.createItems=function(g){var f=this;f.removeContent();if(g.communities!=undefined){var h=1;for(var e in g.communities){var d={};d.ranking=h;d.title=g.communities[e].name;b(f.CS+"#topcommunities_content"+this.ID).append(f.template_item_div,d);h++}}};this.removeContent=function(){b(this.CS+" #topcommunities_content"+this.ID).html("");b(this.CS+" #topcommunities_footer"+this.ID).html("")};this.showLoginLink=function(d){b(this.CS+" #topcommunities_content"+this.ID).html('Please <a href="'+d+"?goto="+location.href+'">login</a>!')};this.setCount=function(d){this.COUNT=d}}})(jQuery);var TEMPLATE_TOPCOMMUNITIES_WIDGET='<div id="topcommunities_content${id}"> \n<div id="loading${id}"><img width="12px" height="12px" src="${WIDGET_RESSOURCE_PATH}/ceq_tagcloud/images/wait.gif"/>&nbsp;Please wait...</div>\n</div>\n<div id="topcommunities_footer${id}"></div>';var TEMPLATE_TOPCOMMUNITIES_ITEM_DIV='<div class="ceq_ceq_item"> \n<span class="ceq_ceq_ranking">${ranking}</span>\n<span class="ceq_ceq_content">${title}</span></<div>';(function(b){function a(d,c){return b.i18n("ceq",d,c)}b.TopCountries=function(c){this.ID=1;if(c!=null){this.ID=c}this.CONTAINER_ID="topcountries_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.HEIGHT="320px";this.TAGS="";this.template_widget=b.template(TEMPLATE_TOPCOUNTRIES_WIDGET);this.template_item_div=b.template(TEMPLATE_TOPCOUNTRIES_ITEM_DIV);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/math/statisticsP";this.COUNT=10;this.getRequestUrl=function(){var d=this.WEBSERVICE_URL+"?report=topcountry&count="+this.COUNT;d+="&tagKey="+this.TAGS;return d};this.setWebserviceURL=function(d){this.WEBSERVICE_URL=d};this.setTags=function(d){this.TAGS=d};this.setHeight=function(d){this.HEIGHT=d};this.deploy=function(e){b("#"+e).html("<div id='"+this.CONTAINER_ID+"' class='ceq_ceqwidget' height='"+this.HEIGHT+"'></div>");var d={};d.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;d.id=this.ID;b(this.CS).append(this.template_widget,d);this.showWait();this.loadItems()};this.showWait=function(){b(this.CS+" #topcountries_content"+this.ID).html("<div id='topcountries_loading'><img width='12px' height='12px' src='"+WIDGET_RESSOURCE_PATH+"/ceq_tagcloud/images/wait.gif'/>&nbsp;Please wait...</div>")};this.loadItems=function(){this.loadItemsFromRemote()};this.loadItemsFromRemote=function(){var d=this;b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:this.getRequestUrl(),dataType:"json",error:function(f,e){b(d.CS+" #topcountries_content"+d.ID).html("Service not available")},success:function(e){d.handleResponse(e)}})};this.handleResponse=function(d){if(d.statusCode=="200"){this.createItems(d.data)}else{if(d.statusCode=="403"){this.showLoginLink(d.url)}else{b(this.CS+" #topcountries_content"+this.ID).html("Error "+d.message+" (HTTP Status Code: "+d.statusCode+")")}}};this.createItems=function(g){var f=this;f.removeContent();if(g.countries!=undefined){var h=1;for(var e in g.countries){var d={};d.ranking=h;d.title=g.countries[e].name;if(g.countries[e].flag!=undefined&&g.countries[e].flag.length>0){d.imgtag='<img border="0" class="ceq_topcountry_flagimg" src="'+WIDGET_RESSOURCE_PATH+"/img/flags/"+g.countries[e].flag+'"/>'}else{d.imgtag=""}b(f.CS+"#topcountries_content"+f.ID).append(f.template_item_div,d);h++}}};this.removeContent=function(){b(this.CS+" #topcountries_content"+this.ID).html("");b(this.CS+" #topcountries_footer"+this.ID).html("")};this.showLoginLink=function(d){b(this.CS+" #topcountries_content"+this.ID).html('Please <a href="'+d+"?goto="+location.href+'">login</a>!')};this.subscribeToTagCloud=function(d){var e=this;OpenAjax.hub.subscribe("com.ceq.tagcloud."+d,function(h,g){if(g.indexOf(",")!=-1){var f=g.substring((g.lastIndexOf(",")+1),g.length);e.setTags(f)}else{if(g==null){e.setTags("")}else{e.setTags(g)}}e.showWait();e.loadItems()})};this.setCount=function(d){this.COUNT=d}}})(jQuery);var TEMPLATE_TOPCOUNTRIES_WIDGET='<div id="topcountries_content${id}" class="ceq_ceqwidget">\n<div id="loading${id}"><img width="12px" height="12px" src="${WIDGET_RESSOURCE_PATH}/ceq_tagcloud/images/wait.gif"/>&nbsp;Please wait...</div>\n</div>\n<div id="topcountries_footer${id}"></div>';var TEMPLATE_TOPCOUNTRIES_ITEM_DIV='<div class="ceq_ceq_item"> \n<span class="ceq_ceq_ranking">${ranking}</span>\n<span class="ceq_topcountry_flag"> \n${imgtag} \n</span> \n<span class="ceq_topcountry_content">${title}</span></<div>';(function(b){function a(d,c){return b.i18n("ceq",d,c)}b.TopInformation=function(c){this.ID=1;if(c!=null){this.ID=c}this.CONTAINER_ID="topinformation_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.HEIGHT="320px";this.TAGS="";this.template_widget=b.template(TEMPLATE_TOPINFORMATION_WIDGET);this.template_item_div=b.template(TEMPLATE_TOPINFORMATION_ITEM_DIV);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/math/statisticsP";this.COUNT=10;this.getRequestUrl=function(){var d=this.WEBSERVICE_URL+"?report=topinfo&count="+this.COUNT;d+="&tagKey="+this.TAGS;return d};this.setWebserviceURL=function(d){this.WEBSERVICE_URL=d};this.setTags=function(d){this.TAGS=d};this.setHeight=function(d){this.HEIGHT=d};this.deploy=function(e){b("#"+e).html("<div id='"+this.CONTAINER_ID+"' class='ceq_ceqwidget' height='"+this.HEIGHT+"'></div>");var d={};d.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;d.id=this.ID;b(this.CS).append(this.template_widget,d);this.showWait();this.loadItems()};this.showWait=function(){b(this.CS+" #topinformation_content"+this.ID).html("<div id='topinformation_loading'><img width='12px' height='12px' src='"+WIDGET_RESSOURCE_PATH+"/ceq_tagcloud/images/wait.gif'/>&nbsp;Please wait...</div>")};this.loadItems=function(){this.loadItemsFromRemote()};this.loadItemsFromRemote=function(){var d=this;b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:this.getRequestUrl(),dataType:"json",error:function(f,e){b(d.CS+" #topinformation_content"+d.ID).html("Service not available")},success:function(e){d.handleResponse(e)}})};this.handleResponse=function(d){if(d.statusCode=="200"){this.createItems(d.data)}else{if(d.statusCode=="403"){this.showLoginLink(d.url)}else{b(this.CS+" #topinformation_content"+this.ID).html("Error "+d.message+" (HTTP Status Code: "+d.statusCode+")")}}};this.createItems=function(g){var f=this;f.removeContent();if(g.informations!=undefined){var h=1;for(var e in g.informations){var d={};d.ranking=h;d.title=g.informations[e].title;d.url=g.informations[e].url;b(f.CS+"#topinformation_content"+f.ID).append(f.template_item_div,d);h++}}};this.removeContent=function(){b(this.CS+" #topinformation_content"+this.ID).html("");b(this.CS+" #topinformation_footer"+this.ID).html("")};this.showLoginLink=function(d){b(this.CS+" #topinformation_content"+this.ID).html('Please <a href="'+d+"?goto="+location.href+'">login</a>!')};this.subscribeToTagCloud=function(d){var e=this;OpenAjax.hub.subscribe("com.ceq.tagcloud."+d,function(h,g){if(g.indexOf(",")!=-1){var f=g.substring((g.lastIndexOf(",")+1),g.length);e.setTags(f)}else{if(g==null){e.setTags("")}else{e.setTags(g)}}e.showWait();e.loadItems()})};this.setCount=function(d){this.COUNT=d}}})(jQuery);var TEMPLATE_TOPINFORMATION_WIDGET='<div id="topinformation_content${id}">\n<div id="loading${id}"><img width="12px" height="12px" src="${WIDGET_RESSOURCE_PATH}/ceq_tagcloud/images/wait.gif"/>&nbsp;Please wait...</div>\n</div>\n<div id="topinformation_footer${id}"></div>';var TEMPLATE_TOPINFORMATION_ITEM_DIV='<div class="ceq_ceq_item"> \n<span class="ceq_ceq_ranking">${ranking}</span>\n<span class="ceq_ceq_content"><a class="item_link" href="${url}" title="${title}">${title}</a></span></<div>';(function(b){function a(d,c){return b.i18n("ceq",d,c)}b.TopPeople=function(c){this.ID=1;if(c!=null){this.ID=c}this.ORDER_CQ="cq";this.ORDER_PQ="pq";this.ORDER_TOTAL="total";this.CONTAINER_ID="toppeople_"+this.ID;this.CS="#"+this.CONTAINER_ID+" ";this.HEIGHT="320px";this.SHOW_PHOTO=false;this.TAGS="";this.ORDER=this.ORDER_CQ;this.template_widget=b.template(TEMPLATE_TOPPEOPLE_WIDGET);this.template_item_div=b.template(TEMPLATE_TOPPEOPLE_ITEM_DIV);this.template_item_photo_div=b.template(TEMPLATE_TOPPEOPLE_ITEM_PHOTO_DIV);this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/math/statisticsP";this.COUNT=10;this.nItemMaxSize=10000;this.getRequestUrl=function(){var d=this.WEBSERVICE_URL+"?report=topcontrib&count="+this.COUNT;d+="&tagKey="+this.TAGS+"&order="+this.ORDER;return d};this.setId=function(d){this.ID=d;this.CONTAINER_ID="toppeople_"+this.ID;this.CS="#"+this.CONTAINER_ID+" "};this.setWebserviceURL=function(d){this.WEBSERVICE_URL=d};this.setTags=function(d){this.TAGS=d};this.setHeight=function(d){this.HEIGHT=d};this.deploy=function(e){b("#"+e).html("<div id='"+this.CONTAINER_ID+"' class='ceq_ceqwidget' height='"+this.HEIGHT+"'></div>");var d={};d.id=this.ID;d.WIDGET_RESSOURCE_PATH=WIDGET_RESSOURCE_PATH;b(this.CS).append(this.template_widget,d);this.showWait();this.loadItems()};this.showWait=function(){b(this.CS+" #toppeople_content"+this.ID).html("<div id='toppeople_loading'><img width='12px' height='12px' src='"+WIDGET_RESSOURCE_PATH+"/ceq_tagcloud/images/wait.gif'/>&nbsp;Please wait...</div>")};this.loadItems=function(){this.loadItemsFromRemote()};this.loadItemsFromRemote=function(){var d=this;b.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:this.getRequestUrl(),dataType:"json",error:function(f,e){b(d.CS+" #toppeople_content"+d.ID).html("Service not available")},success:function(e){d.handleResponse(e)}})};this.handleResponse=function(d){if(d.statusCode=="200"){this.createItems(d.data)}else{if(d.statusCode=="403"){this.showLoginLink(d.url)}else{b(this.CS+" #toppeople_content"+this.ID).html("Error "+d.message+" (HTTP Status Code: "+d.statusCode+")")}}};this.createItems=function(h){var f=this;f.removeContent();if(h.persons!=undefined){var g=1;for(var e in h.persons){var d={};d.ranking=g;d.title="";if(h.persons[e].givenname!=undefined){d.title=h.persons[e].givenname+" "}if(h.persons[e].surname!=undefined){d.title=d.title+h.persons[e].surname}if(h.persons[e].pictureurl!=undefined){d.pictureurl=h.persons[e].pictureurl}else{d.pictureurl=WIDGET_RESSOURCE_PATH+"/img/ceq_defaultavatar.png"}if((h.persons[e].homepage!=undefined)&&(h.persons[e].homepage!="")){d.title='<a class="item_link" href="'+h.persons[e].homepage+'" title="'+d.title+'">'+d.title+"</a>"}if(h.persons[e].authenticated!=undefined){d.title="<b>"+d.title+"</b>";if(h.persons[e].rank!=undefined){d.ranking="<b>"+h.persons[e].rank+"</b>"}}if(this.SHOW_PHOTO){b(f.CS+"#toppeople_content"+f.ID).append(f.template_item_photo_div,d)}else{b(f.CS+"#toppeople_content"+f.ID).append(f.template_item_div,d)}g++}}};this.removeContent=function(){b(this.CS+" #toppeople_content"+this.ID).html("");b(this.CS+" #toppeople_footer"+this.ID).html("")};this.showPhoto=function(){this.SHOW_PHOTO=true};this.hidePhoto=function(){this.SHOW_PHOTO=false};this.showLoginLink=function(d){b(this.CS+" #toppeople_content"+this.ID).html('Please <a href="'+d+"?goto="+location.href+'">login</a>!')};this.subscribeToTagCloud=function(d){var e=this;OpenAjax.hub.subscribe("com.ceq.tagcloud."+d,function(h,g){if(g.indexOf(",")!=-1){var f=g.substring((g.lastIndexOf(",")+1),g.length);e.setTags(f)}else{if(g==null){e.setTags("")}else{e.setTags(g)}}e.showWait();e.loadItems()})};this.setCount=function(d){this.COUNT=d};this.setOrder=function(d){this.ORDER=d}}})(jQuery);var TEMPLATE_TOPPEOPLE_WIDGET='<div id="toppeople_content${id}">\n<div id="loading${id}"><img width="12px" height="12px" src="${WIDGET_RESSOURCE_PATH}/ceq_tagcloud/images/wait.gif"/>&nbsp;Please wait...</div>\n</div>\n<div id="toppeople_footer${id}"></div>';var TEMPLATE_TOPPEOPLE_ITEM_DIV='<div class="ceq_ceq_item"> \n<span class="ceq_ceq_ranking">${ranking}</span>\n<span class="ceq_ceq_content">${title}</span></<div>';var TEMPLATE_TOPPEOPLE_ITEM_PHOTO_DIV='<div class="ceq_toppeople_item"> \n<span class="ceq_ceq_ranking">${ranking}</span>\n<span class="ceq_toppeople_photo"><img border="0" class="ceq_toppeople_img" src="${pictureurl}"></span>\n<span class="ceq_toppeople_content">${title}</span></<div>';(function(a){a.MyCEQ=function(b){this.objPerson=b;this.REMOTE_WEBSERVICE=false;this.nX=0;this.nY=0;this.sViewType="all";this.sCQText="Contribution Equity";this.sPQText="Participation Equity";this.nEquityPosition=5;this.nEquityHeight=56;this.cEquity="black";this.fsEquity=12;this.cMyRanking="black";this.cMyRankingNum="#ff9933";this.nMyRankingX=14;this.nMyRankingY=18;this.fsMyRanking=12;this.cScale="#4d7896";this.nScalePositionX=30;this.nScalePositionY=32;this.nScaleWidth=207;this.nScaleHeight=12;this.cAvg="#C6D3E0";this.nAvgHeight=7;this.urlCommunity=WIDGET_RESSOURCE_PATH+"/myCEQ/img/ceq_community.gif";this.urlMe=WIDGET_RESSOURCE_PATH+"/myCEQ/img/ceq_me.gif";this.nMeWidth=15;this.fsPerCent=9;this.nPerCentSymbolWidth=5;this.bBottomText="on";this.nBottomTextPos=20;this.cBottomText="black";this.fsBottomText=12;this.nBottomCommX=60;this.nBottomUserX=140;this.sAvgText="Community Average";this.sUserText="User";this.WEBSERVICE_URL=WEBSERVICE_RESSOURCE_PATH+"/jersey/math/myCEQ";this.sWhatIs="What's this?";this.urlWhatIs="";this.nWhatIsX=116;this.nWhatIsY=1;this.fsWhatIs=11;this.cWhatIs="black";this.enableRemoteWebservice=function(){this.REMOTE_WEBSERVICE=true};this.disableRemoteWebservice=function(){this.REMOTE_WEBSERVICE=false};this.setWebserviceURL=function(c){this.WEBSERVICE_URL=c};this.getPosition=function(d,e,c,f){if(f>c){return(d-c)*e/(f-c)}else{return 0}};this.drawEquity=function(n,h,j,e,p,c,k,d){var f=this.getPosition(p,this.nScaleWidth-2,k,c);var o=Math.floor(this.getPosition(p,100,k,c))+"%";var l=this.drawString(this.nX+this.nEquityPosition,n,h,this.fsEquity,this.cEquity)+this.fillRect(this.nX+this.nScalePositionX,n+this.nScalePositionY-this.nScaleHeight,1,this.nScaleHeight,this.cScale)+this.fillRect(this.nX+this.nScalePositionX,n+this.nScalePositionY,this.nScaleWidth,1,this.cScale)+this.fillRect(this.nX+this.nScaleWidth+this.nScalePositionX-1,n+this.nScalePositionY-this.nScaleHeight,1,this.nScaleHeight,this.cScale)+this.fillRect(this.nX+this.nScalePositionX+1,n+this.nScalePositionY-this.nAvgHeight,f,this.nAvgHeight,this.cAvg)+this.drawImage(this.nX+this.nScalePositionX+3,n+this.nScalePositionY-this.nAvgHeight+1,this.urlCommunity)+this.drawString(this.nX+this.nScalePositionX+1+f-o.length*this.nPerCentSymbolWidth,n+this.nScalePositionY-this.nAvgHeight-this.fsPerCent-2,o,this.fsPerCent,this.cScale)+this.drawString(this.nX+this.nScalePositionX+this.nScaleWidth-this.nPerCentSymbolWidth*2,n+this.nScalePositionY-this.nScaleHeight-this.fsPerCent-2,"100%",this.fsPerCent,this.cScale)+this.drawString(this.nX+this.nWhatIsX,n+this.nWhatIsY,"<a href='"+this.urlWhatIs+"'>"+this.sWhatIs+"</a>",this.fsWhatIs,this.cWhatIs);var m="";if(j!=undefined){var g=this.getPosition(j,this.nScaleWidth-2,k,c);var i=Math.floor(this.getPosition(j,100,k,c))+"%";l+=this.drawImage(this.nX+this.nScalePositionX+1+g-this.nMeWidth/2,n+this.nScalePositionY-6,this.urlMe)+this.drawString(this.nX+this.nScalePositionX+1+g-i.length*this.nPerCentSymbolWidth/2,n+this.nScalePositionY+13,i,this.fsPerCent,this.cScale);m=(this.cMyRankingText+"<b>"+e+"/"+d)+"</b>";m="<b><font color='"+this.cMyRankingNum+"'>"+e+"</font></b> [Me] of "}m+="<b><font color='"+this.cMyRankingNum+"'>"+d+"</font></b> [Community]";l+=this.drawString(this.nX+this.nScalePositionX+this.nScaleWidth+this.nMyRankingX,n+this.nMyRankingY,m,this.fsMyRanking,this.cMyRanking);return l};this.drawBottom=function(c){return this.drawImage(this.nX+this.nBottomCommX,c,this.urlCommunity)+this.drawString(this.nX+this.nBottomCommX+this.nBottomTextPos,c,this.sAvgText,this.fsBottomText,this.cBottomText)+this.drawImage(this.nX+this.nBottomCommX+this.nBottomUserX,c,this.urlMe)+this.drawString(this.nX+this.nBottomCommX+this.nBottomTextPos+this.nBottomUserX,c,this.sUserText,this.fsBottomText,this.cBottomText)};this.drawImage=function(e,d,c){return'<div style="position:absolute;left:'+e+"px;top:"+d+'px;"><img src="'+c+'"></div>'};this.fillRect=function(g,f,c,d,e){return'<div style="position:absolute;left:'+g+"px;top:"+f+"px;width:"+c+"px;height:"+d+"px;background-color:"+e+'" ></div>'};this.drawString=function(g,f,d,c,e){return'<div style="position:absolute;white-space:nowrap;left:'+g+"px;top:"+f+"px;font-size:"+c+";color:"+e+'">'+d+"</div>"};this.getAbsoluteOffset=function(d){var c=new Object();c.top=0;c.left=0;while(d!=null){c.top+=d.offsetTop;c.left+=d.offsetLeft;d=d.offsetParent}return c};this.deploy=function(c){var e=this;var d=this.getAbsoluteOffset(a(c)[0]);this.nX=d.left;this.nY=d.top;this.getJSON(this.WEBSERVICE_URL,this.objPerson,function(g){var h="";var f=e.nY+e.nEquityPosition;if((e.sViewType=="cq")||(e.sViewType=="all")){h=e.drawEquity(f,e.sCQText,g.CQ,g.CQrank,g.CQavg,g.CQmax,Math.min(g.CQmin,0),g.count);f+=e.nEquityHeight}if((e.sViewType=="pq")||(e.sViewType=="all")){h+=e.drawEquity(f,e.sCQText,g.PQ,g.PQrank,g.PQavg,g.PQmax,0,g.count);f+=e.nEquityHeight}if(e.bBottomText=="on"){h+=e.drawBottom(f)}a(c).html(h)},function(f){a(c).html(f)})};this.getJSON=function(e,g,c,f){var d=this;if(this.REMOTE_WEBSERVICE){a.jsonp({type:"GET",callbackParameter:"callback",callback:"callbackFunction",url:e,data:g,dataType:"json",error:function(i,h){f("Error")},success:function(h){d.handleResponse(h,c,f)}})}else{a.ajax({type:"GET",url:e,data:g,dataType:"json",error:function(i,j,h){if(i.status=="403"){d.showLoginLink(i.getResponseHeader("X-CeqLoginUrl"),f)}else{f("Error (HTTP Status Code: "+i.status+")")}},success:function(h){d.handleResponse(h,c,f)}})}};this.handleResponse=function(d,c,e){if(d.statusCode=="200"){c(d.data)}else{if(d.statusCode=="403"){this.showLoginLink(d.url,e)}else{e("Error "+d.message+" (HTTP Status Code: "+d.statusCode+")")}}};this.showLoginLink=function(d,c){c('Please <a href="'+d+"?goto="+location.href+'">login</a>!')}}})(jQuery);