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; this.siteLifeDomainOverride = null; this.siteLifeServerBaseOverride = null; this.customerCSSOverride = null; this.customerForumPagePathOverride = null; this.gcid = "Widgets1.0"; // 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; var handlers; 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 0) { name = c.substring(0, eqIndex); value = c.substring(eqIndex + 1); if (name.toLowerCase() == 'hd') { value = unescape(value); value = value.split('|'); return value[0]; } } } return null; } function createSrcUrl(baseUrl, url, userId, gcid, currentTime) { return srcUrl = baseUrl + "/Stats/Tracker.gif" + "?plckUrl=" + encodeURIComponent(url) + "&plckUserId=" + userId + "&plckGcid=" + gcid + "&plckCurrentTime=" + currentTime; } SiteLifeProxy.prototype.__InsertTrackerNode = function(baseUrl, requestUrl, userIdTrckr, gcid, currentTime) { // add script node for tracker if (document.getElementById('slImgNodeTrckr') === null) { var trackImgNode = document.createElement('img'); trackImgNode.setAttribute('id', "slImgNodeTrckr"); trackImgNode.setAttribute('src', createSrcUrl(gSiteLife.__baseUrl, requestUrl, userIdTrckr, gcid, currentTime)); if (trackImgNode.style.setAttribute) { trackImgNode.style.setAttribute('display', 'none'); } else { trackImgNode.setAttribute('style', 'display:none'); } document.getElementsByTagName('body')[0].appendChild (trackImgNode); } } SiteLifeProxy.prototype.__Send = function(url, scriptToUse, callbackName, args) { this.OnDebug("_Send " + url); // setup some items for tracker var requestUrl = location.href; var userIdTrckr = getCurrentUserFromCookie(); var me = this; function gLoadScript(url, callbackName) { var script = document.createElement('script'); var baseUrl = gSiteLife.__baseUrl; script.setAttribute('type', 'text/javascript'); script.setAttribute('charset', 'utf-8'); script.setAttribute('src', url + (callbackName ? '&EVENT_ID=' + callbackName : '')); document.getElementsByTagName('head')[0].appendChild (script); } function initializeTracking() { var d = new Date(); // We are using jQuery's object detection to determine if the browser is ready for us // to insert our stat tracker node. // Mozilla, Opera and webkit nightlies currently support this event if (document.addEventListener) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", function(){ document.removeEventListener( "DOMContentLoaded", arguments.callee, false ); me.__InsertTrackerNode(gSiteLife.__baseUrl, requestUrl, userIdTrckr, me.gcid, d.getTime()); }, false ); // If IE event model is used } else if (document.attachEvent) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", function(){ if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", arguments.callee ); me.__InsertTrackerNode(gSiteLife.__baseUrl, requestUrl, userIdTrckr, me.gcid, d.getTime()); } }); // If IE and not an iframe // continually check to see if the document is ready if ( document.documentElement.doScroll && window == window.top ) (function(){ try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch( error ) { setTimeout( arguments.callee, 0 ); return; } // and execute any waiting functions me.__InsertTrackerNode(gSiteLife.__baseUrl, requestUrl, userIdTrckr, me.gcid, d.getTime()); })(); } } function bind(_function, _this, _arguments) { var f = function() { _function.apply(_this, _arguments); }; f['__Bound'] = true; return f; }; var func; if ((typeof callbackName == 'string') && (func = this.__eventHandlers[callbackName]) && (typeof func == 'function') && !func['__Bound']) { this.__eventHandlers[callbackName] = bind(func, this, args); } //append our various parameters as necessary url = this.__AppendUrlValues(url); this.OnDebug("_Send (updated) " + url); // add the script node to the document if (document.createElement && ! this.__isMacIE) { gLoadScript(url, callbackName); initializeTracking(); return; } // could fall back to sync at this point, but will bust if the page is already loaded this.OnError("No support for async in this browser"); } SiteLifeProxy.prototype.Logout = function(ScriptToUse, IsRestPage) { var plckRest = IsRestPage ? true : false; this.__Send(this.__baseUrl + '/Utility/Logout?plckRedirectUrl=' + escape(window.location.href) + '&plckRest=' + plckRest, ScriptToUse); return false; } SiteLifeProxy.prototype.AddLoadEvent = function(func) { if(window.addEventListener){ window.addEventListener("load", func, false); }else{ if(window.attachEvent){ window.attachEvent("onload", func); }else{ if(document.getElementById){ var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); }}}}}} SiteLifeProxy.prototype.AdInsertHelper = function() { for(var src in gSiteLife.__adsToInsert) { if(src == "extend") continue; var dest = gSiteLife.__adsToInsert[src]; var parent = document.getElementById(dest); var newChild = document.getElementById(src); if( ! parent || ! newChild ) {continue; } parent.replaceChild( newChild, document.getElementById(dest + "Child")); newChild.style.display = "block"; parent.style.display = "block"; } } SiteLifeProxy.prototype.InsertAds = function(source, destination) { gSiteLife.__adsToInsert = new Object(); for(ii=0; ii< this.InsertAds.arguments.length; ii+=2) { gSiteLife.__adsToInsert[this.InsertAds.arguments[ii]] = this.InsertAds.arguments[ii+1];} this.AddLoadEvent(gSiteLife.AdInsertHelper); } SiteLifeProxy.prototype.TitleTag = function() { var titleTag = document.getElementById("plckTitleTag"); return titleTag ? titleTag.innerText || titleTag.textContent : null; } SiteLifeProxy.prototype.WriteDiv = function(id, divClass) { var cssClass = divClass ? divClass : ""; document.write('
'); 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.PersonaHeaderRequest(UserId); } SiteLifeProxy.prototype.PersonaHeaderInbox = function() { // if DAAPI proxy is not present, fail gracefully if (!document.getElementById('PrivateMessageInbox') || !window.RequestBatch || !window.PrivateMessageFolderList) { var pmContainer = document.getElementById('PersonaHeader_PrivateMessageContent'); if (pmContainer) { pmContainer.style.display = 'none'; } 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 = "Messages ({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) { var me = this; this.AddEventHandler('persona:home:complete', function() { me.PopulateGroupsDiv(UserId, 1); }); 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 DAAPI objects; if not there, fail gracefully if (window.RequestBatch && window.CommunityGroupMembershipPage && window.UserKey) { var requestBatch = new RequestBatch(); requestBatch.AddToRequest(new CommunityGroupMembershipPage(new UserKey(UserId+""), 8, OnPage, "TimeStampAscending", "Member")); requestBatch.BeginRequest("http://sitelife.boston.com/ver1.0/Direct/Process", function(responseBatch) { if (responseBatch.Responses.length > 0 && responseBatch.Responses[0].CommunityGroupMembershipPage) { // create the div that will house all this info var groupsDiv = document.createElement('div'); groupsDiv.className = 'PersonaStyle_ItemContainer'; var groupsContainer = document.getElementById('PersonaStyle_GroupsContainer'); // Check groupsContainer is null because PersonaStyle_GroupContainer may be absent due to private persona files. if (groupsContainer != null) { groupsContainer.appendChild(groupsDiv); var groupBaseUrl = "http://www.boston.com/community/groups.html"; 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) { // Look for any query parameters that are already using ? var groupUrlResults = groupBaseUrl.match(/\?/); if (groupUrlResults != null) { var groupUrl = groupBaseUrl + "&slGroupKey=" + currentGroup.CommunityGroupKey.Key; } else { var groupUrl = groupBaseUrl + "?slGroupKey=" + currentGroup.CommunityGroupKey.Key; } groupsHtml += ""; } } //Pagination for Group List groupsHtml += "

"; groupsHtml += "
"; groupsDiv.innerHTML = groupsHtml; while(groupsContainer.hasChildNodes()) { groupsContainer.removeChild(groupsContainer.childNodes[0]); } groupsContainer.appendChild(groupsDiv); } } }); } // 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.PersonaConnectionAddFriend = function(UserId) { return this.PersonaSend('PersonaConnectionAddFriend', 'personaDest', 'personaScript', UserId, null, 'persona:connections'); } SiteLifeProxy.prototype.PersonaRemoveFriend = function(UserId, Friend, Div, View, Expanded, confirmMsg) { if(!Expanded) Expanded = "false"; if (confirm(confirmMsg) == true) { return this.PersonaSend('PersonaRemoveFriend', Div, 'personaScript', UserId, 'plckFriendView=' + View + '&plckFriend=' + Friend + '&plckExpanded=' + Expanded); } return false; } SiteLifeProxy.prototype.PersonaRemovePendingFriend = function(UserId, PendingFriend, Div, confirmMsg) { if (confirm(confirmMsg) == 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, confirmMsg) { if (confirm(confirmMsg) == 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, plckFindCommentKey) { var findCommentKey = gSiteLife.ReadFindCommentKey(findCommentKey, "widget:personaGalleryPhoto"); return this.PersonaPhotoSend('PersonaGalleryPhoto', 'personaDest', 'personaScript', UserId, 'plckFindCommentKey=' + findCommentKey, "widget:personaGalleryPhoto"); } 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, plckFindCommentKey) { var findCommentKey = gSiteLife.ReadFindCommentKey(findCommentKey, "widget:personaPhoto"); var photoid = gSiteLife.GetParameter('plckPhotoID'); return this.PersonaPhotoSend('PersonaGalleryPhoto', 'personaDest','personaScript', UserId,'&plckPhotoID=' +photoid + '&plckFindCommentKey=' +findCommentKey, "widget:personaPhoto"); } 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.PersonaConnections = function(UserId){ var AdParams = ""; return this.PersonaSend('PersonaConnections', 'personaDest', 'personaScript', UserId, AdParams, 'persona:connections'); } SiteLifeProxy.prototype.UpdateTwitterPrefs = function(UserId, tweetOnPersona, tweetComments) { return this.PersonaSend('UpdateTwitterPrefs', 'personaDest', 'personaScript', UserId, '?tweetMyComments=' + tweetComments + '&personaTwitterWidget=' + tweetOnPersona); } SiteLifeProxy.prototype.UpdateYahooPrefs = function(UserId, yahooComments) { return this.PersonaSend('UpdateYahooPrefs', 'personaDest', 'personaScript', UserId, '?yahooMyComments=' + yahooComments); } SiteLifeProxy.prototype.UpdateLinkedInPrefs = function(UserId, linkedInComments) { return this.PersonaSend('UpdateLinkedInPrefs', 'personaDest', 'personaScript', UserId, '?LinkedInMyComments=' + linkedInComments); } SiteLifeProxy.prototype.TextCounter = function(textarea, counterID, maxLen, defaultMsg) { var cnt = document.getElementById(counterID); if (textarea.value.length > maxLen) { textarea.value = textarea.value.substring(0, maxLen); return false; } var currentCnt = maxLen - textarea.value.length; cnt.innerHTML = currentCnt + " characters remaining"; } 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 findCommentKey = gSiteLife.ReadFindCommentKey(null, "widget:galleryPhoto"); var url = this.__baseUrl + '/Photo/GalleryPhoto?plckElementId=' + elementId + '&plckPhotoID=' +photoid + '&plckFindCommentKey=' + findCommentKey; this.__Send(url, null, "widget:galleryPhoto"); 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; } //