document.write(""); document.write(""); document.write(""); ///constructor to create a new SiteLifeProxy function SiteLifeProxy(url) { // User Configurable Properties - these can be set at any time // your apiKey, this value must be set! this.apiKey = null; // sniff the browser for custom behaviors this.__isExplorer = navigator.userAgent.toLowerCase().indexOf('msie') != -1; this.__isSafari = navigator.userAgent.toLowerCase().indexOf('safari') != -1; this.__isMac = navigator.platform.toLowerCase().indexOf('mac') != -1; this.__isMacIE = this.__isMac && this.__isExplorer; // if enabled, spit out debug information through alert() this.debug = false; // used to track the id of the handler expecting the results from the immediately preceeding method invocation // this is used only for testing purposes this.lastHandlerId = ""; // Methods You can Overide // // OnSuccess(returnValue) - is passed the return value at the end of a successful call, default does nothing // OnError(msg) - is passed an error message if a problem occurs // OnDebug(msg) - is called when debugging is enabled this.__baseUrl = url; this.__sendInvokeCount = 0; this.__eventHandlers = new Object(); }; SiteLifeProxy.prototype.AddEventHandler = function (event_name, callback) { var eventList = this.__eventHandlers[event_name]; if (!eventList){ eventList = new Array(); this.__eventHandlers[event_name] = eventList; } eventList.push(callback); }; SiteLifeProxy.prototype.FireEvent = function (event_name) { var func; if(handlers = this.__eventHandlers[event_name]) { var A = new Array(); for (var i = 1; i < this.FireEvent.arguments.length; i++){ A[i - 1] = this.FireEvent.arguments[i];} for(var x=0;x'); return id; } SiteLifeProxy.prototype.InnerHtmlWrite = function(elementId, innerContents ) { var el = document.createElement("div"); try { if(document.location.href.indexOf("debug=true") > -1) { el.innerHTML += "
 ? 
" + innerContents + "
"; } else { el.innerHTML += innerContents; el.style.display = "inline"; } var destDiv = document.getElementById(elementId); while (destDiv.childNodes.length >= 1) { destDiv.removeChild(destDiv.childNodes[0]); } destDiv.appendChild(el); } catch (error) { alert(elementId + " Error " + error.number + ": " + error.description); } } SiteLifeProxy.prototype.SortTimeStampDescending = "TimeStampDescending"; SiteLifeProxy.prototype.SortTimeStampAscending = "TimeStampAscending"; SiteLifeProxy.prototype.SortRecommendationsDescending = "RecommendationsDescending"; SiteLifeProxy.prototype.SortRecommendationsAscending = "RecommendationsAscending"; SiteLifeProxy.prototype.SortRatingDescending = "RatingDescending"; SiteLifeProxy.prototype.SortRatingAscending = "RatingAscending"; SiteLifeProxy.prototype.SortAlphabeticalAscending = "AlphabeticalAscending"; SiteLifeProxy.prototype.SortAlphabeticalDescending = "AlphabeticalDescending"; SiteLifeProxy.prototype.KeyTypeExternalResource = "ExternalResource"; SiteLifeProxy.prototype.PersonaHeaderRequest = function(UserId) { var url = this.__baseUrl + '/Persona/PersonaHeader?plckElementId=personaHDest&plckUserId='+ UserId; this.__Send(url, "personaHeaderScript", 'persona:header', arguments); } SiteLifeProxy.prototype.PersonaHeader = function(UserId) { this.WriteDiv("personaHDest", "Persona_Main"); this.AddEventHandler('persona:header', function() { gSiteLife.PersonaHeaderInbox(); }); this.PersonaHeaderRequest(UserId); } SiteLifeProxy.prototype.PersonaHeaderInbox = function() { if (!document.getElementById('PrivateMessageInbox')) return; var rb = new RequestBatch(); rb.AddToRequest(new PrivateMessageFolderList()); rb.BeginRequest(serverUrl, function(responseBatch) { var count = ''; try { if (responseBatch && responseBatch.Messages && responseBatch.Messages.length && responseBatch.Messages[0].Message == 'ok') { var folders = responseBatch.Responses[0].PrivateMessageFolderList.FolderList; for (var i = 0; i < folders.length; i++) { var f = folders[i]; if (f.FolderID == 'Inbox') { count = f.UnreadMessageCount; break; } } } } catch (e) {} var inboxStr = "Inbox ({0})"; var idx = inboxStr.indexOf("{0}"); if (inboxStr == '' || idx >= -1) inboxStr = inboxStr.substring(0, idx) + count + inboxStr.substring(idx+3); var inbox = document.getElementById('PrivateMessageInbox'); inbox.innerHTML = inboxStr; if (count > 0) inbox.style.fontWeight = 'bold'; }); } SiteLifeProxy.prototype.Persona = function(UserId) { this.WriteDiv("personaDest", "Persona_Main"); var action = this.GetParameter("plckPersonaPage"); if(action && (typeof this[action] == 'function')) this[action](UserId); else this.PersonaHome(UserId); } SiteLifeProxy.prototype.LoadPersonaPage = function(PageName, UserId) { var params = new Object(); params['plckPersonaPage'] = PageName; params['plckUserId'] = UserId; params['uid'] = UserId; for(ii=2; ii< this.LoadPersonaPage.arguments.length; ii+=2) { params[this.LoadPersonaPage.arguments[ii]] = this.LoadPersonaPage.arguments[ii+1];} this.ReloadPage(params); return false; } SiteLifeProxy.prototype.PersonaHome = function(UserId) { return this.PersonaSend('PersonaHome', 'personaDest', 'personaScript', UserId, null, 'persona:home:complete'); } SiteLifeProxy.htmlEncode = function(str){ // Fix HTML var ret = str; var div = document.createElement('div'); var text = document.createTextNode(str); div.appendChild(text); ret = new String(div.innerHTML); // The above doesn't take care of quotes. ret = ret.replace(/"/g, '"'); return ret; }; SiteLifeProxy.prototype.PopulateGroupsDiv = function(UserId, OnPage) { // check for groups div... if it's there, populate it var groupsDiv = document.getElementById("PersonaStyle_GroupsContainer"); if (groupsDiv) { var requestBatch = new RequestBatch(); requestBatch.AddToRequest(new CommunityGroupMembershipPage(new UserKey(UserId), 8, OnPage, "TimeStampAscending", "Member")); requestBatch.BeginRequest("http://community.npr.org/ver1.0/Direct/Process", function(responseBatch) { if (responseBatch.Responses.length > 0 && responseBatch.Responses[0].CommunityGroupMembershipPage) { var groupBaseUrl = "http://www.npr.org/templates/community/group.php"; var groupMembershipPage = responseBatch.Responses[0].CommunityGroupMembershipPage; var groupsHtml = "
Groups
"; groupsHtml += "
"; for (var index = 0; index < groupMembershipPage.CommunityGroupMemberships.length; index++) { var currentGroup = groupMembershipPage.CommunityGroupMemberships[index].CommunityGroup; // if current group is private and user is non-member, don't display var display = true; if (currentGroup.CommunityGroupVisibility == 'Private') { display = (currentGroup.RequestingUsersMembershipTier != 'NonMember' && currentGroup.RequestingUsersMembershipTier != 'Banned'); } if (display) { var groupUrl = groupBaseUrl + "?slGroupKey=" + currentGroup.CommunityGroupKey.Key; groupsHtml += ""; } } //Pagination for Group List groupsHtml += "

"; groupsHtml += "
"; groupsDiv.innerHTML = groupsHtml; } }); } // fire any other events this.FireEvent('persona:home'); } SiteLifeProxy.prototype.WatchItem = function(Controller,Method,WatchKey, targetDiv) { var url = this.__baseUrl + '/'+Controller+'/' + Method + '?' + 'plckWatchKey=' + WatchKey + '&plckElementId=' + targetDiv + '&plckWatchUrl=' + this.EscapeValue(window.location.href); this.__Send(url, "AddWatchScript"); return false; } SiteLifeProxy.prototype.PersonaRemoveWatchItem= function(UserId, WatchKey, Div, View) { return this.PersonaSend('PersonaRemoveWatchItem', Div, 'personaScript', UserId, 'plckWatchView=' + View + '&plckWatchKey=' + WatchKey); } SiteLifeProxy.prototype.PersonaAddFriend= function(UserId) { return this.PersonaSend('PersonaAddFriend', 'personaHDest', 'personaScript', UserId); } SiteLifeProxy.prototype.PersonaRemoveFriend = function(UserId, Friend, Div, View, Expanded) { if(!Expanded) Expanded = "false"; if (confirm("Are you sure you want to delete this user from your list of Friends?") == true) { return this.PersonaSend('PersonaRemoveFriend', Div, 'personaScript', UserId, 'plckFriendView=' + View + '&plckFriend=' + Friend + '&plckExpanded=' + Expanded); } return false; } SiteLifeProxy.prototype.PersonaRemovePendingFriend = function(UserId, PendingFriend, Div) { if (confirm("Are you sure you want to delete this user's invite?") == true) { return this.PersonaSend('PersonaRemovePendingFriend', Div, 'personaScript', UserId, 'plckPendingFriend=' + PendingFriend); } return false; } SiteLifeProxy.prototype.PersonaAddPendingFriend = function(UserId, PendingFriend, Div) { return this.PersonaSend('PersonaAddPendingFriend', Div, 'personaScript', UserId, 'plckPendingFriend=' + PendingFriend); } SiteLifeProxy.prototype.PersonaMessages = function(UserId) { var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : ""; var scrl = this.GetParameter('plckScrollToAnchor'); if(scrl){ if(AdParams) {AdParams +='&';} AdParams += 'plckScrollToAnchor=' + scrl;} if(this.GetParameter('plckMessageSubmitted')){if(AdParams) {AdParams +='&';} AdParams += 'plckMessageSubmitted=' + this.GetParameter('plckMessageSubmitted');} return this.PersonaSend('PersonaMessages', 'personaDest', 'personaScript', UserId, AdParams, 'persona:messages'); } SiteLifeProxy.prototype.PersonaComments = function(UserId) { var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : ""; return this.PersonaSend('PersonaComments', 'personaDest', 'personaScript', UserId, AdParams, 'persona:comments'); } SiteLifeProxy.prototype.PersonaBlog = function(UserId) { var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : ""; if(AdParams) {AdParams +='&';} AdParams += 'plckBlogId=' + UserId; var url = this.__baseUrl + '/PersonaBlog/PersonaBlog?plckElementId=personaDest&plckUserId='+ UserId + '&' + AdParams; this.__Send(url, 'personaScript', 'persona:blog', arguments); return false; } SiteLifeProxy.prototype.PersonaProfile = function(UserId) { return this.PersonaSend('PersonaProfile', 'personaDest', 'personaScript', UserId, null, 'persona:profile'); } SiteLifeProxy.prototype.PersonaWatchListPaginate = function(UserId, pageNum) { return this.PersonaPaginate('WatchList', pageNum, UserId); } SiteLifeProxy.prototype.PersonaFriendsPaginate = function(UserId, pageNum) { var AdParam = "plckFullFriendsList=true"; return this.PersonaPaginate('Friends', pageNum, UserId, AdParam); } SiteLifeProxy.prototype.PersonaFriendsExpand= function(UserId) { var url = this.__baseUrl + '/Persona/PersonaFriends?plckFullFriendsList=true&plckFriendsPageNum=0&plckElementId=PersonaFriendsDest&plckUserId='+ UserId; this.__Send(url, 'PersonaFriendsScript'); return false; } SiteLifeProxy.prototype.PersonaFriendsCollapse= function(UserId, pageNum) { var url = this.__baseUrl + '/Persona/PersonaFriends?plckFullFriendsList=false&plckFriendsPageNum=0&plckElementId=PersonaFriendsDest&plckUserId='+ UserId; this.__Send(url, 'PersonaFriendsScript'); return false; } SiteLifeProxy.prototype.PersonaPendingFriendsPaginate = function(UserId, pageNum) { var AdParam = "plckPendingFriendsPageNum=" + pageNum; return this.PersonaPaginate('Friends', 0, UserId,AdParam); } SiteLifeProxy.prototype.PersonaMessagesPreviewPaginate = function(UserId, pageNum) { return this.PersonaPaginate('MessagesPreview', pageNum, UserId); } SiteLifeProxy.prototype.PersonaMessageRemove = function(UserId, pageNum, MessageKey) { if (confirm("Are you sure you want to remove this message from the page?") == true) { return this.PersonaSend('PersonaRemoveMessage', 'personaDest', 'PersonaMessagesPageScript', UserId, 'plckCurrentPage='+ pageNum + '&plckMessageKey='+MessageKey); } return false; } SiteLifeProxy.prototype.PersonaSend = function(ApiName, DestDiv, ScriptName, UserId, AddParams, eventId){ var url = this.__baseUrl + '/Persona/' + ApiName + '?plckElementId=' + DestDiv + '&plckUserId='+ UserId; if(AddParams) url += '&' + AddParams; this.__Send(url, ScriptName, eventId, arguments); return false; } SiteLifeProxy.prototype.PersonaPaginate = function(ApiName, PageNum, UserId, AddParams){ var url = this.__baseUrl + '/Persona/Persona' + ApiName + '?plck' + ApiName + 'PageNum=' + PageNum + '&plckElementId=Persona' + ApiName + 'Dest&plckUserId='+ UserId; if(AddParams) url += '&' + AddParams; this.__Send(url, 'Persona'+ ApiName + 'Script'); return false; } SiteLifeProxy.prototype.PersonaPhotoSend = function(ApiName, DestDiv, ScriptName, UserId, AddParams, eventId){ var url = this.__baseUrl + '/PersonaPhoto/' + ApiName + '?plckElementId=' + DestDiv + '&plckUserId='+ UserId; if(AddParams) url += '&' + AddParams; this.__Send(url, ScriptName, eventId, arguments); return false; } SiteLifeProxy.prototype.PersonaMostRecent = function(UserId, PhotoID, DestDiv) { return this.PersonaPhotoSend('PersonaMostRecent', DestDiv, 'personaScript', UserId,'plckPhotoID=' + PhotoID); } SiteLifeProxy.prototype.PersonaCommunityGroupsPaginate = function(UserId, PageNum){ return this.PersonaPaginate('CommunityGroups', PageNum, UserId); } SiteLifeProxy.prototype.PersonaCreateGallery = function(UserId) { return this.PersonaPhotoSend('UserGalleryCreate', 'personaDestPhoto', 'personaScript', UserId); } SiteLifeProxy.prototype.PersonaEditGallery = function(UserId,GalleryID) { return this.PersonaPhotoSend('UserGalleryEdit', 'userGalleryDest', 'personaScript', UserId,'plckGalleryID=' + GalleryID); } SiteLifeProxy.prototype.PersonaUploadToUserGallery = function(GalleryId) { var url = this.__baseUrl + '/Photo/PhotoUpload?plckElementId=userGalleryDest&plckGalleryID='+ GalleryId; this.__Send(url); return false; } SiteLifeProxy.prototype.PersonaPhotos = function(UserId) { return this.PersonaPhotoSend('PersonaPhotos', 'personaDest', 'personaScript', UserId, null, 'persona:photos'); } SiteLifeProxy.prototype.PersonaAllPhotos = function(UserId) { return this.PersonaPhotoSend('PersonaAllPhotos', 'personaDest', 'personaScript', UserId); } SiteLifeProxy.prototype.PersonaGalleryPhoto = function(UserId) { return this.PersonaPhotoSend('PersonaGalleryPhoto', 'personaDest', 'personaScript', UserId); } SiteLifeProxy.prototype.PersonaMyRecentPhotos = function(UserId,ElementId, PageNum) { return this.PersonaPhotoSend('PersonaMyRecentPhotos', ElementId, 'personaScript', UserId,'plckPageNum=' + PageNum); } SiteLifeProxy.prototype.PersonaGallery = function(UserId,GalleryId,PageNum) { if(!PageNum){ PageNum = gSiteLife.GetParameter("plckPageNum") ? gSiteLife.GetParameter("plckPageNum") : 0; } if(!GalleryId) { GalleryId = gSiteLife.GetParameter("plckGalleryID"); } return this.PersonaPhotoSend('PersonaGallery', 'personaDest', 'personaScript', UserId,'plckGalleryID='+ GalleryId + '&plckPageNum=' + PageNum); } SiteLifeProxy.prototype.UserGalleryList = function(UserId,ElementId, PageNum) { return this.PersonaPhotoSend('UserGalleryList', ElementId, 'personaScript', UserId,'plckPageNum=' + PageNum); } SiteLifeProxy.prototype.PersonaGallerySubmissions = function(UserId,ElementId, PageNum){ return this.PersonaPhotoSend('PersonaGallerySubmissions', ElementId, 'personaScript', UserId,'plckPageNum=' + PageNum); } SiteLifeProxy.prototype.PersonaGalleryPhoto = function(UserId) { var photoid = gSiteLife.GetParameter('plckPhotoID'); return this.PersonaPhotoSend('PersonaGalleryPhoto', 'personaDest','personaScript', UserId,'&plckPhotoID=' +photoid); } SiteLifeProxy.prototype.PersonaRecentGalleryPhoto = function(UserId) { var photoid = gSiteLife.GetParameter('plckPhotoID'); return this.PersonaPhotoSend('PersonaRecentGalleryPhoto', 'personaDest','personaScript', UserId,'&plckPhotoID=' +photoid); } SiteLifeProxy.prototype.LoadPersonaGalleryPage = function(UserId,GalleryID) { var params = new Object(); params['plckPersonaPage'] = 'PersonaGallery'; params['plckUserId'] = UserId; params['uid'] = UserId; params['plckGalleryID'] = GalleryID; this.ReloadPage(params); return false; } SiteLifeProxy.prototype.LoadPersonaPhotoPage = function(UserId,PhotoID) { var params = new Object(); params['plckPersonaPage'] = 'PersonaGalleryPhoto'; params['plckUserId'] = UserId; params['uid'] = UserId; params['plckPhotoID'] = PhotoID; this.ReloadPage(params); return false; } SiteLifeProxy.prototype.LoadPersonaRecentPhotoPage = function(UserId,PhotoID) { var params = new Object(); params['plckPersonaPage'] = 'PersonaRecentGalleryPhoto'; params['plckUserId'] = UserId; params['uid'] = UserId; params['plckPhotoID'] = PhotoID; this.ReloadPage(params); return false; } var fbHelpDialogTimeout; SiteLifeProxy.prototype.ShowFacebookHelpDialog = function(icon){ var x = 0; var y = icon.clientHeight/2; do { x += icon.offsetLeft; y += icon.offsetTop; } while(icon = icon.offsetParent); var fb_div = document.getElementById("Persona_FacebookHelpDialog"); fb_div.style.position = "absolute"; fb_div.style.display = "block"; // position div to the left of icon. var newX = x - fb_div.clientWidth; var newY = y - Math.floor(fb_div.clientHeight/2); fb_div.style.left = newX + "px"; fb_div.style.top = newY + "px"; return false; } SiteLifeProxy.prototype.HideFacebookHelpDialog = function(){ var fb_div = document.getElementById("Persona_FacebookHelpDialog"); fb_div.style.display = "none"; } SiteLifeProxy.prototype.CopyRssUrlToClipboard = function(){ rssUrl = document.getElementById("rssUrl"); copy(rssUrl); return false; } /* note: doesn't work with flash 10 */ function copy(inElement) { if (inElement.createTextRange) { var range = inElement.createTextRange(); if (range) range.execCommand('Copy'); } else { var flashcopier = 'flashcopier'; if(!document.getElementById(flashcopier)) { var divholder = document.createElement('div'); divholder.id = flashcopier; document.body.appendChild(divholder); } document.getElementById(flashcopier).innerHTML = ''; var divinfo = ''; document.getElementById(flashcopier).innerHTML = divinfo; } } SiteLifeProxy.prototype.UpdateExternalUserId = function(ExternalSiteName, ExternalSiteUserId) { var adParam = this.BaseAdParam(); adParam += "&externalSiteName=" + ExternalSiteName; adParam += "&externalSiteUserId=" + ExternalSiteUserId; return this.PersonaSend('UpdateExternalUserId', 'personaHDest', 'personaScript', adParam); } SiteLifeProxy.prototype.SolicitPhoto = function(galleryID) { var elementId = 'plcksolicit' + galleryID; this.WriteDiv(elementId); var url = this.__baseUrl + '/Photo/SolicitPhoto?plckElementId=' + elementId + '&plckGalleryID=' +galleryID; this.__Send(url); return false; } SiteLifeProxy.prototype.PhotoUpload = function() { var elementId = 'plcksubmit'; this.WriteDiv(elementId); var galleryID = gSiteLife.GetParameter('plckGalleryID'); var url = this.__baseUrl + '/Photo/PhotoUpload?plckElementId=' + elementId + '&plckGalleryID=' +galleryID; this.__Send(url); return false; } SiteLifeProxy.prototype.PublicGallery = function() { var elementId = 'plckgallery'; this.WriteDiv(elementId); var galleryID = gSiteLife.GetParameter('plckGalleryID'); var pageNum = gSiteLife.GetParameter('plckPageNum'); var url = this.__baseUrl + '/Photo/PublicGallery?plckElementId=' + elementId + '&plckGalleryID=' +galleryID + '&plckPageNum=' +pageNum; this.__Send(url); return false; } SiteLifeProxy.prototype.GalleryPhoto = function() { var elementId = 'plckphoto'; this.WriteDiv(elementId); var photoid = gSiteLife.GetParameter('plckPhotoID'); var url = this.__baseUrl + '/Photo/GalleryPhoto?plckElementId=' + elementId + '&plckPhotoID=' +photoid; this.__Send(url); return false; } SiteLifeProxy.prototype.PublicGalleries = function() { var elementId = 'plckgalleries'; this.WriteDiv(elementId); var pageNum = gSiteLife.GetParameter('plckPageNum') ? gSiteLife.GetParameter('plckPageNum') : "0"; var url = this.__baseUrl + '/Photo/PublicGalleries?plckElementId=' + elementId + '&plckPageNum=' + pageNum; this.__Send(url); return false; } SiteLifeProxy.prototype.PhotoRecommend = function(targetid,recommendDiv,isGallery) { var url = this.__baseUrl + '/Photo/Recommend?plckElementId=' + recommendDiv + '&plckTargetid=' +targetid + '&plckIsGallery=' +isGallery ; this.__Send(url); return false; } //parentKeyType can be any gSiteLife.KeyType* value, but for including this widget on an article page the value is //typically gSiteLife.KeyTypeExternalResource SiteLifeProxy.prototype.Comments = function(parentKeyType, parentKey, pageSize, sort, showTabs, tab, parentUrl, parentTitle, refreshPage) { return this.CommentsInternal(parentKeyType, parentKey, pageSize, sort, showTabs, tab, parentUrl, parentTitle, false, false, null, refreshPage); }; SiteLifeProxy.prototype.CommentsInput = function(parentKeyType, parentKey, redirectToUrl) { return this.CommentsInternal(parentKeyType, parentKey, null, "TimeStampDescending", null, null, null, null, true, false, redirectToUrl, false); }; SiteLifeProxy.prototype.CommentsOutput = function(parentKeyType, parentKey, refreshPage, pageSize, sortOrder) { sortOrder = sortOrder || "TimeStampDescending"; return this.CommentsInternal(parentKeyType, parentKey, pageSize, sortOrder, null, null, null, null, false, true, null, refreshPage); } SiteLifeProxy.prototype.CommentsRefresh = function(parentKeyType, parentKey, pageSize, sortOrder) { if (!parentKey || parentKey == "") throw "Must pass in value for parentKey!"; return this.CommentsInternal(parentKeyType, parentKey, pageSize, sortOrder, null, null, null, null, false, false, null, true); } SiteLifeProxy.prototype.CommentsInternal = function(parentKeyType, parentKey, pageSize, sort, showTabs, tab, parentUrl, parentTitle, hideView, hideInput, redirectToUrl, refreshPage) { var divId = 'Comments_Container'; if(this.numCommentsWidgets){ divId += this.numCommentsWidgets; } else { this.numCommentsWidgets = 0; } document.write("
"); this.numCommentsWidgets++; var oldDocOnLoad = window.onload; function loadComments() { if (oldDocOnLoad != null) { oldDocOnLoad(); } gSiteLife.GetComments(parentKeyType, parentKey, parentUrl, parentTitle, 0, pageSize, sort, showTabs, tab, hideView, hideInput, redirectToUrl, refreshPage, divId); } window.onload = loadComments; return false; } SiteLifeProxy.prototype.GetComments = function(parentKeyType, parentKey, parentUrl, parentTitle, page, pageSize, sort, showTabs, tab, hideView, hideInput, redirectTo, refreshPage, divId) { parentKeyType = parentKeyType || "ExternalResource"; parentUrl = parentUrl || gSiteLife.__StripAnchorFromUrl(window.location.href); parentUrl = gSiteLife.EscapeValue(parentUrl); parentKey = parentKey || gSiteLife.__StripAnchorFromUrl(window.location.href); parentTitle = parentTitle || gSiteLife.EscapeValue(document.title); page = page || gSiteLife.GetParameter('plckCurrentPage') || 0; pageSize = pageSize || 10; sort = sort || "TimeStampAscending"; showTabs = showTabs || false; tab = tab || "MostRecent"; hideView = hideView || false; hideInput = hideInput || false; redirectTo =gSiteLife.EscapeValue(redirectTo) || ""; refreshPage = refreshPage || false; var url = this.__baseUrl + '/Comment/GetPage.rails?plckTargetKeyType='+ parentKeyType + '&plckTargetKey=' + escape(parentKey) + "&plckCurrentPage=" + page + "&plckItemsPerPage=" + pageSize + "&plckSort=" + sort + "&plckElementId=" + divId + "&plckTargetUrl=" + parentUrl + "&plckTargetTitle=" + parentTitle + "&plckHideView=" + hideView + "&plckHideInput=" + hideInput + "&plckRefreshPage=" + refreshPage + "&plckRedirectToUrl=" + redirectTo ; if (showTabs) { url = url + "&plckShowTabs=true&plckTab=" + tab; } this.__Send(url); return false; }; SiteLifeProxy.prototype.Blog = function(BlogId) { this.WriteDiv("blogDest", "Persona_Main"); var action = this.GetParameter("plckBlogPage"); if(action && action != "Blog" && (typeof this[action] == 'function')){ return this[action](BlogId); }else{ var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : ""; return this.BlogSend('Blog', 'Blog', 'blogDest', 'blogScript', BlogId, AdParams); } } SiteLifeProxy.prototype.LoadBlogPage = function(PageName, BlogId) { var params = new Object(); params['plckBlogPage'] = PageName; params['plckBlogId'] = BlogId; for(ii=2; ii< this.LoadBlogPage.arguments.length; ii+=2) { params[this.LoadBlogPage.arguments[ii]] = this.LoadBlogPage.arguments[ii+1];} this.ReloadPage(params); return false; } SiteLifeProxy.prototype.BlogViewEdit = function(blogId) { return this.BlogSend(null, 'BlogViewEdit', null, null, blogId); } SiteLifeProxy.prototype.BlogPostCreate = function(blogId) { return this.BlogSend(null, 'BlogPostCreate', null, null, blogId, 'plckRedirectUrl=' + this.GetParameter("plckRedirectUrl")); } SiteLifeProxy.prototype.BlogPendingComments = function(blogId, currentPage) { if( !currentPage) currentPage = 0; return this.BlogSend(null, 'BlogPendingComments', null, null, blogId, 'plckCurrentPage='+currentPage); } SiteLifeProxy.prototype.BlogSettings = function(blogId) { return this.BlogSend(null, 'BlogSettings', null, null, blogId); } SiteLifeProxy.prototype.BlogEditPost = function(blogId, controller, div, script, postId, selection, daysBack) { return this.BlogSend(controller, 'BlogPostEdit', div, script, blogId, 'plckPostId=' + postId + '&plckSelection=' + selection + '&plckDaysBack=' + daysBack + '&plckRedirectUrl=' + this.EscapeValue(window.location.href)); } SiteLifeProxy.prototype.BlogRemovePost = function(blogId, controller, div, script, postId, selection, daysBack) { if (confirm("Are you sure you want to delete this item?") == true) { return this.BlogSend(controller, 'BlogRemovePost', div, script, blogId, 'plckPostId=' + postId + '&plckSelection=' + selection + '&plckDaysBack=' + daysBack ); } return false; } SiteLifeProxy.prototype.BlogViewPost = function(blogId, postId, selection, daysBack) { if(!postId ) { postId = gSiteLife.GetParameter('plckPostId'); } return this.BlogSend(null, 'BlogViewPost', null, null, blogId, 'plckPostId=' + postId + '&plckSelection=' + selection + '&plckDaysBack=' + daysBack + '&plckCommentSortOrder=' + this.GetParameter('plckCommentSortOrder')); } SiteLifeProxy.prototype.BlogViewMonth = function(blogId, monthId) { if(!monthId ) { monthId = gSiteLife.GetParameter('plckMonthId'); } var AdParams = 'plckMonthId=' + monthId; AdParams += this.GetParameter('plckCurrentPage') ? '&plckCurrentPage=' + this.GetParameter('plckCurrentPage') : ""; return this.BlogSend(null, 'BlogViewMonth', null, null, blogId, AdParams); } SiteLifeProxy.prototype.AddBlogWatchItem= function(blogId, controller, script, Url, WatchKey) { return this.BlogSend(controller, 'AddBlogWatch', 'plckBlogWatchDiv', script, blogId, 'plckWatchKey=' + WatchKey + '&plckWatchUrl=' + this.EscapeValue(Url)); } SiteLifeProxy.prototype.RemoveBlogWatchItem= function(blogId, controller, script, WatchKey) { return this.BlogSend(controller, 'RemoveBlogWatch', 'plckBlogWatchDiv', script, blogId, 'plckWatchKey=' + WatchKey); } SiteLifeProxy.prototype.BlogViewTag = function(blogId, tag) { if(!tag ) { tag = gSiteLife.GetParameter('plckTag'); } var AdParams = 'plckTag=' + tag; AdParams += this.GetParameter('plckCurrentPage') ? '&plckCurrentPage=' + this.GetParameter('plckCurrentPage') : ""; return this.BlogSend(null, 'BlogViewTag', null, null, blogId, AdParams ); } SiteLifeProxy.prototype.BlogRefreshViewEditList= function(blogId, controller, div, script, selection, daysBack) { return this.BlogSend(controller, 'BlogRefreshViewEditList', div, script, blogId, 'plckSelection=' + selection + '&plckDaysBack=' + daysBack ); } SiteLifeProxy.prototype.BlogSend = function(controller, apiName, destDiv, scriptName, blogId, addParams){ if(!controller) controller = this.GetParameter('plckController'); if(!destDiv) destDiv = this.GetParameter('plckElementId'); if(!scriptName) scriptName = this.GetParameter('plckScript'); var url = this.__baseUrl + '/' + controller + '/' + apiName + '?plckElementId=' + destDiv + '&plckBlogId=' + blogId + '&' + addParams; this.__Send(url, scriptName, 'widget:blog'); return false; } SiteLifeProxy.prototype.Recommend = function(controller, itemId, recommendDiv) { var url = this.__baseUrl + '/' + controller + '/Recommend?plckElementId=' + recommendDiv + '&plckItemId=' +itemId; this.__Send(url); return false; } SiteLifeProxy.prototype.BlogSelectPendingComments = function(formId, checked) { var form = document.getElementById(formId); for (i=0; i SiteLifeProxy.prototype.Forums = function(numPerPage) { var forumId = this.GetParameter('plckForumId'); if (forumId) { forumId = unescape(forumId); var i = forumId.indexOf('Forum:'); forumId = forumId.substring(i).replace(':', '_'); } else { var discussionId = this.GetParameter('plckDiscussionId'); if (discussionId) { discussionId = unescape(discussionId); var i = discussionId.indexOf('Forum:'); var j = discussionId.indexOf('Discussion:'); forumId = discussionId.substring(i, j).replace(':', '_'); } } if (forumId) { this.WriteDiv("forumDest", "Forum_Main " + forumId); } else { this.WriteDiv("forumDest", "Forum_Main"); } var action = this.GetParameter("plckForumPage"); var categoryCurrentPage = this.GetParameter('plckCategoryCurrentPage'); if(action && (typeof this[action] == 'function') && action != 'ForumCategories'){ this[action](); } else { if( numPerPage == null ){ numPerPage = this.GetParameter('plckNumPerPage'); } this.ForumCategories(numPerPage, categoryCurrentPage); } } SiteLifeProxy.prototype.ForumCategories = function(numPerPage, categoryCurrentPage) { var pageNum = this.GetParameter('plckCurrentPage'); if(pageNum == null) pageNum = 0; var urlPageInfoStr = ''; urlPageInfoStr = '&plckNumPerPage=' + numPerPage; urlPageInfoStr += '&plckCategoryCurrentPage=' + categoryCurrentPage; return this.ForumSend("ForumCategories", "forumDest", "ForumMain", 'plckCurrentPage=' + pageNum + urlPageInfoStr); } SiteLifeProxy.prototype.Forum = function() { var forumId = this.GetParameter('plckForumId'); var categoryPageNum = this.GetParameter('plckCategoryCurrentPage'); if(categoryPageNum == null) { categoryPageNum = 0; } var discussionPageNum = this.GetParameter('plckCurrentPage'); if (discussionPageNum == null) { discussionPageNum = 0; } var numPerPage = this.GetParameter('plckNumPerPage'); var urlPageInfoStr = ''; if( numPerPage != null ){ urlPageInfoStr = '&plckNumPerPage=' + numPerPage; } return this.ForumSend('Forum', 'forumDest', 'ForumMain', 'plckForumId=' + forumId + '&plckCurrentPage=' + discussionPageNum + '&plckCategoryCurrentPage=' + categoryPageNum + urlPageInfoStr ); } SiteLifeProxy.prototype.ForumDiscussion = function() { var dId = this.GetParameter("plckDiscussionId"); var adParam = "plckDiscussionId=" + dId; var showLast = this.GetParameter("plckShowLastPage"); if(showLast) adParam += "&plckShowLastPage=true"; var pageNum = this.GetParameter('plckCurrentPage'); if(pageNum == null) pageNum = 0; var showFirstUnread = this.GetParameter('plckShowFirstUnread'); if(showFirstUnread != null){ adParam += "&plckShowFirstUnread=" + showFirstUnread; this.AddEventHandler("widget:forums", function(){gSiteLife.DiscussionScrollToPost()}); } var showLatestPost = this.GetParameter('plckShowLatestPost'); if(showLatestPost != null){ adParam += "&plckShowLatestPost=" + showLatestPost; this.AddEventHandler("widget:forums", function(){gSiteLife.DiscussionScrollToPost()}); } adParam += "&plckCurrentPage=" + pageNum; adParam += "&plckCategoryCurrentPage=" + this.GetParameter('plckCategoryCurrentPage'); this.AddEventHandler("widget:forums", function(){gSiteLife.DiscussionScanForUnread(dId);}); return this.ForumSend("ForumDiscussion", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.DiscussionScanForUnread = function(discussionKey){ var postDatesContainer = document.getElementById("PostDateInfoContainer"); if(!postDatesContainer){ return; } this.postDates = eval(postDatesContainer.value); this.latestPost = new Date(document.getElementById("LastReadContainer").value); this.screenBottom = 0; this.discussionKey = discussionKey; this.checkForReadInterval = setInterval(function(){gSiteLife.DiscussionCheckForLatestPost();}, 1000); } SiteLifeProxy.prototype.DiscussionScrollToPost = function(){ if(!document.getElementById("Discussion_ScrollToPostKey")){ return false; } var postKey = document.getElementById("Discussion_ScrollToPostKey").value; var post = document.getElementById(postKey); if(!post){ return false; } var postTop = 0; if(post.offsetParent){ obj = post; do{ postTop += obj.offsetTop; } while(obj = obj.offsetParent); window.scrollBy(0, postTop); } } SiteLifeProxy.prototype.IsPostOnScreen = function(screenBottom, postIndex){ var postId = "readIndicator_" + this.postDates[postIndex].Key; var post = document.getElementById(postId); if(post){ var postTop = 0; if(post.offsetParent){ obj = post; do{ postTop += obj.offsetTop; } while(obj = obj.offsetParent); } var postBottom = postTop + post.offsetHeight; if(postBottom < screenBottom){ return true; } } return false; } SiteLifeProxy.prototype.DiscussionCheckForLatestPost = function(){ var screenTop = 0; if (typeof(document.documentElement) !== 'undefined' && typeof(document.documentElement.scrollTop) !== 'undefined') { screenTop = document.documentElement.scrollTop; } else if (typeof(document.body.scrollTop) !== 'undefined') { screenTop = document.body.scrollTop; } else if (typeof(window.pageYOffset) !== 'undefined') { screenTop = window.pageYOffset; } var screenBottom = Math.pow(2,52); /*Supposing our browser can't get the height, we mark everything as read.*/ if(window.innerHeight){ screenBottom = screenTop + window.innerHeight; } else if(document.documentElement.clientHeight && document.documentElement.clientHeight != 0){ screenBottom = screenTop + document.documentElement.clientHeight; } else if(document.body.clientHeight){ screenBottom = screenTop + document.body.clientHeight; } /* Only update if we've scrolled down since last poll. */ if(screenBottom <= this.screenBottom){ return; } /* Just give up if there are no posts. */ if(!this.postDates || this.postDates.length <= 0){ clearInterval(this.checkForReadInterval); return; } /* If the last post is already marked read, don't bother polling. */ if(this.postDates[(this.postDates.length - 1)].Timestamp <= this.latestPost){ clearInterval(this.checkForReadInterval); return; } this.screenBottom = screenBottom; var latestKey = null; for(i=0; i < this.postDates.length; i++){ if(this.IsPostOnScreen(screenBottom, i)){ if(this.postDates[i].Timestamp >= this.latestPost){ latestKey = this.postDates[i].Key; this.latestPost = this.postDates[i].Timestamp; } } } if(latestKey){ this.ForumSetLastRead(this.discussionKey, latestKey); } } SiteLifeProxy.prototype.ForumCreateDiscussion = function() { var adParam = "plckRedirectUrl=" + this.GetParameter("plckRedirectUrl"); var fId = this.GetParameter("plckForumId"); adParam += "&plckForumId=" + fId; var curView = this.GetParameter("plckCurrentView"); if(curView) adParam += "&plckCurrentView=" + curView; var curPage = this.GetParameter("plckCurrentPage"); if(curPage) adParam += "&plckCurrentPage=" + curPage; var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId; adParam += "&plckCategoryCurrentPage=" + this.GetParameter('plckCategoryCurrentPage'); return this.ForumSend("ForumCreateDiscussion", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumMain = function() { return this.ForumSend("ForumMain", "forumDest", "ForumMain"); } SiteLifeProxy.prototype.ForumCreatePost = function() { var adParam = "plckDiscussionId=" + this.GetParameter("plckDiscussionId") + "&plckRedirectUrl=" + this.EscapeValue(window.location.href); var PostId = this.GetParameter("plckPostId"); if(PostId) adParam = adParam + "&plckPostId=" + PostId; var IsReply = this.GetParameter("plckIsReply"); if(IsReply) adParam = adParam + "&plckIsReply=" + IsReply; var curPage = this.GetParameter("plckCurrentPage"); if(curPage) adParam = adParam + "&plckCurrentPage=" + curPage; adParam += "&plckCategoryCurrentPage=" + this.GetParameter("plckCategoryCurrentPage"); return this.ForumSend("ForumCreatePost", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumEditPost = function() { var adParam = "plckDiscussionId=" + this.GetParameter("plckDiscussionId") + "&plckRedirectUrl=" + this.EscapeValue(window.location.href); var PostId = this.GetParameter("plckPostId"); if(PostId) adParam = adParam + "&plckPostId=" + PostId; var CurrPage = this.GetParameter("plckCurrentPage"); if(!CurrPage) CurrPage="0"; adParam = adParam + "&plckCurrentPage=" + CurrPage; adParam += "&plckCategoryCurrentPage=" + this.GetParameter('plckCategoryCurrentPage'); return this.ForumSend("ForumEditPost", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumEditProfile = function() { return this.ForumSend("ForumEditProfile", "forumDest", "ForumMain", "plckRedirectUrl=" + this.EscapeValue(window.location.href)); } SiteLifeProxy.prototype.ToggleExpand = function(imageId, tableId) { if (!this.collapsedCategories) { var cookie = document.cookie && document.cookie.match(/forumCatState=([^;]+)/); cookie = (cookie ? cookie[1].replace(/^\s+|\s+$/g, '') : []); this.collapsedCategories = (cookie.length ? unescape(cookie).split('|') : []); } var tableElem = document.getElementById(tableId), imgElem = document.getElementById(imageId), id = tableId.split(':')[1], cats = this.collapsedCategories, expire; if (tableElem.style.display == 'none') { tableElem.style.display = 'block'; imgElem.src = this.__baseUrl + '/Content/images/forums/minus.gif'; for (var i = 0, length = cats.length; i < length; i++) { if ((cats[i] == id) || (cats[i] === '')) cats.splice(i,1); } } else { tableElem.style.display = 'none'; cats.push(id); imgElem.src = this.__baseUrl + '/Content/images/forums/plus.gif'; } this.SetCookie('forumCatState', cats.join('|')); } SiteLifeProxy.prototype.ForumSearch = function(suffix) { var searchText = document.getElementById('plckSearchText'+suffix).value; searchText = FixSearchString(searchText); var searchArea = document.getElementById('plckSearchArea'+suffix).value; this.LoadForumPage("ForumSearchPaginate", "plckSearchText", searchText, "plckSearchArea", searchArea, "plckCurrentPage", "0"); return false; } SiteLifeProxy.prototype.ForumSearchKeyPress = function(event, suffix) { if(IsEnter(event)){return this.ForumSearch(suffix);}else{return true;} } SiteLifeProxy.prototype.ForumSearchPaginate = function() { return this.ForumSend('ForumSearchPaginate', 'forumDest', 'ForumMain', 'plckSearchArea=' + this.GetParameter('plckSearchArea') + '&plckSearchText=' + this.GetParameter('plckSearchText') + '&plckCurrentPage=' + this.GetParameter('plckCurrentPage')); } SiteLifeProxy.prototype.ForumSpecificForumSearchKeyPress = function(event, suffix, forumId) { if(IsEnter(event)){return this.ForumSpecificForumSearch(suffix, forumId);}else{return true;} } SiteLifeProxy.prototype.ForumSpecificForumSearch = function(suffix, forumId) { var searchText = document.getElementById('plckSearchText'+suffix).value; searchText = FixSearchString(searchText); this.LoadForumPage("ForumSearchSpecificForumPaginate", "plckSearchText", searchText, "plckForumId", forumId, "plckCurrentPage", "0"); return false; } SiteLifeProxy.prototype.ForumSearchSpecificForumPaginate = function(title) { return this.ForumSend('ForumSearchSpecificForumPaginate', 'forumDest', 'ForumMain', 'plckForumId=' + this.GetParameter('plckForumId') + '&plckSearchText=' + this.GetParameter('plckSearchText') + '&plckCurrentPage=' + this.GetParameter('plckCurrentPage')); } SiteLifeProxy.prototype.LoadForumPage = function(PageName, paramName, paramVal) { var params = new Object(); params['plckForumPage'] = PageName; for(ii=1; ii< this.LoadForumPage.arguments.length; ii+=2) { params[this.LoadForumPage.arguments[ii]] = this.LoadForumPage.arguments[ii+1];} this.ReloadPage(params); return false; } SiteLifeProxy.prototype.ForumSend = function(ApiName, DestDiv, ScriptName, AddParams){ var url = this.__baseUrl + '/Forums/' + ApiName + '?plckElementId=' + DestDiv; if(AddParams) url += '&' + AddParams; var plckPostSort = this.GetParameter('plckPostSort'); if (plckPostSort != null){ url += "&plckPostSort=" + plckPostSort; } this.__Send(url, ScriptName, 'widget:forums', arguments); return false; } SiteLifeProxy.prototype.ForumDiscussionEdit = function(discussionId, curView, curPage) { return this.ForumSend('ForumDiscussionEdit', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckCurrentView=' + curView + '&plckCurrentPage=' + curPage + '&plckRedirectUrl=' + this.EscapeValue(window.location.href)); } SiteLifeProxy.prototype.ForumDiscussionToggleIsSticky = function(discussionId, curView, curPage) { return this.ForumSend('ForumDiscussionToggleIsSticky', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckCurView=' + curView + '&plckCurrentPage=' + curPage); } SiteLifeProxy.prototype.ForumDiscussionToggleIsClosed = function(discussionId, curView, curPage) { return this.ForumSend('ForumDiscussionToggleIsClosed', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckCurView=' + curView + '&plckCurrentPage=' + curPage ); } SiteLifeProxy.prototype.ForumDiscussionDelete = function(discussionId, curPage) { if (confirm("Are you sure you want to delete this discussion?") == true) { return this.ForumSend('ForumDiscussionDelete', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckCurrentPage=' + curPage ); } else { return false; } } SiteLifeProxy.prototype.MoveDiscussion = function(discussionKey, toForum, curView, curPage) { return this.ForumSend('MoveDiscussion', 'forumDest', 'ForumMain', 'discussionKey=' + discussionKey + '&toForum=' + toForum + '&plckCurView=' + curView + '&plckCurrentPage=' + curPage ); } SiteLifeProxy.prototype.ForumEdit = function(forumId, curPage) { return this.ForumSend('ForumEdit', 'forumDest', 'ForumMain', 'plckForumId=' + forumId + '&plckCurrentPage=' + curPage ); } SiteLifeProxy.prototype.ForumToggleIsClosed = function(forumId, curPage) { return this.ForumSend('ForumToggleIsClosed', 'forumDest', 'ForumMain', 'plckForumId=' + forumId + '&plckCurrentPage=' + curPage ); } SiteLifeProxy.prototype.ForumDelete = function(forumId) { if (confirm("Are you sure you want to delete this forum?") == true) { return this.ForumSend('ForumDelete', 'forumDest', 'ForumMain', 'plckForumId=' + forumId ); } else { return false; } } SiteLifeProxy.prototype.ForumPostDelete = function(postId, curPage) { if (confirm("Are you sure you want to delete this post?") == true) { return this.ForumSend('ForumPostDelete', 'forumDest', 'ForumMain', 'plckPostId=' + postId + '&plckCurPage=' + curPage); } else { return false; } } SiteLifeProxy.prototype.ForumBlockUser = function(postId, userId, value, curPage) { return this.ForumSend('ForumBlockUser', 'forumDest', 'ForumMain', 'plckPostId=' + postId + '&plckUserId=' + userId + '&plckValue=' + value + '&plckCurPage=' + curPage); } SiteLifeProxy.prototype.ForumMyDiscussionsPaginate = function(pageNum) { return this.ForumSend('ForumMyDiscussionsPaginate', 'ForumMyDiscussionsDiv', 'ForumMain', 'plckMyDiscussionsPage=' + pageNum); } SiteLifeProxy.prototype.ForumImage = function() { var adParam = "plckRedirectUrl=" + this.GetParameter("plckRedirectUrl"); var pId = this.GetParameter("plckPhotoId"); adParam += "&plckPhotoId=" + pId; return this.ForumSend('ForumImage', 'forumDest', 'ForumMain', adParam); } SiteLifeProxy.prototype.BaseAdParam = function () { var adParam = "plckRedirectUrl=" + this.EscapeValue(window.location.href); var fId = this.GetParameter("plckForumId"); adParam += "&plckForumId=" + fId; var curView = this.GetParameter("plckCurrentView"); if(curView) adParam += "&plckCurrentView=" + curView; var curPage = this.GetParameter("plckCurrentPage"); if(curPage) adParam += "&plckCurrentPage=" + curPage; return adParam; } SiteLifeProxy.prototype.ForumJoinGroup = function() { var adParam = this.BaseAdParam(); var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId; return this.ForumSend("ForumJoinGroup", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumLeaveGroup = function() { var adParam = this.BaseAdParam(); var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId; return this.ForumSend("ForumLeaveGroup", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumGroupMemberList = function() { var adParam = this.BaseAdParam(); return this.ForumSend("ForumGroupMemberList", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumInviteUser = function() { var adParam = this.BaseAdParam(); return this.ForumSend("ForumInviteUser", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumGroupConfirm = function() { var adParam = this.BaseAdParam(); var confirmType = this.GetParameter("plckConfirmType"); if (confirmType) adParam += "&plckConfirmType=" + confirmType; return this.ForumSend("ForumGroupConfirm", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumSendInviteToUser = function(username, email) { var adParam = this.BaseAdParam(); var username = this.GetParameter("plckUsername"); if (username) adParam += "&plckUsername=" + username; var email = this.GetParameter("plckUserEmail"); if (email) adParam += "&plckUserEmail" + email; return this.ForumSend("ForumSendInviteToUser", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumAddEnemy = function(enemyKey) { var adParam = this.BaseAdParam(); adParam += "&enemyKey=" + enemyKey; var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId; return this.ForumSend("ForumAddEnemy", "forumDest", "ForumMain", adParam); } SiteLifeProxy.prototype.ForumRemoveEnemy = function(enemyKey) { var adParam = this.BaseAdParam(); adParam += "&enemyKey=" + enemyKey; var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId; return this.ForumSend("ForumRemoveEnemy", "forumDest", "ForumMain", adParam); } function slGetElementsByClassName(classname, node) { if(!node) node = document.getElementsByTagName("body")[0]; var a = []; var re = new RegExp('\\b' + classname + '\\b'); var els = node.getElementsByTagName("*"); for(var i=0,j=els.length; i"); }