document.write("");
document.write("");
document.write("");
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) {this.__eventHandlers[event_name] = callback;}
SiteLifeProxy.prototype.FireEvent = function (event_name) {
if(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];}
return this.__eventHandlers[event_name].apply(this, A);
}
}
SiteLifeProxy.prototype.ScriptId = function() { return this.__scriptId = "_bb_script_" + this.__sendInvokeCount; }
// Default error handler for the proxy object, simple alert
SiteLifeProxy.prototype.OnError = function(msg) {
alert("OnError: " + msg);
}
// Default debug handler for the proxy object, simple alert
SiteLifeProxy.prototype.OnDebug = function(msg) {
if (this.debug)
alert("Debug: " + msg);
}
// fetch a named request parameter from the page URL
SiteLifeProxy.prototype.GetParameter = function(parameterName) {
var key = parameterName + "=";
var parameters = document.location.search.substring(1).split("&");
for (var i = 0; i < parameters.length; i++)
{
if (parameters[i].indexOf(key) == 0)
return parameters[i].substring(key.length);
}
return null;
};
// browser independent method to get elements by ID
SiteLifeProxy.prototype.GetElement = function(id) {
this.OnDebug("GetElement " + id);
if (document.getElementById)
return document.getElementById(id);
if (document.all)
return document.all[id];
this.OnError("No support for GetElement() in this browser");
return null;
}
// browser independent method to get elements by tag name
SiteLifeProxy.prototype.GetTags = function(tagName) {
this.OnDebug("GetTags " + tagName);
if (document.getElementsByTagName)
return document.getElementsByTagName(tagName);
if (document.all)
return document.tags(tagName);
this.OnError("No support for GetTags() in this browser");
return null;
}
SiteLifeProxy.prototype.EscapeValue = function(s) {
return encodeURIComponent(s);
};
SiteLifeProxy.prototype.__ArrayValidation = function(s)
{
if ((typeof s == 'undefined') || (s.length < 1))
{
return false;
}
return true;
}
SiteLifeProxy.prototype.__CheckErrorHandler = function(onError) {
this.OnDebug("__CheckErrorHandler " + onError);
if ((typeof onError == 'undefined') || (eval("window." + onError) == null))
{
return "gSiteLife.OnError";
}
return onError;
}
SiteLifeProxy.prototype.SetCookie = function SetCookie( name, value) {
var today = new Date(); today.setTime( today.getTime() );
var expires_date = new Date( today.getTime() + 126144000000 );
document.cookie = name + "=" +escape( value ) +
";expires=" + expires_date.toGMTString() +
";path=/" + ";domain=foxnews.com" ;
}
// validate and fetch arguments, if the argument is missing and optional, we return an empty string
SiteLifeProxy.prototype.__GetArgument = function(variableName, variableValue, isRequired, isArray) {
this.OnDebug("__GetArgument " + variableName + "," + variableValue + "," + isRequired + "," + isArray);
if (typeof variableValue == "undefined" || variableValue == null || variableValue == "")
{
if (isRequired)
{
this.OnError("Missing required parameter " + variableName);
this.__isValid = false;
return "";
}
else
return "";
}
if (isRequired && isArray)
{
if (!this.__ArrayValidation(variableValue))
{
this.OnError("Invalid array parameter " + variableName);
this.__isValid = false;
return "";
}
}
return "&" + variableName + "=" + this.EscapeValue(variableValue);
};
SiteLifeProxy.prototype.__SafeAppendUrlValue = function(url, key, value) {
url += url.indexOf("?") != -1 ? "&" : "?";
return url + key + "=" + value;
}
SiteLifeProxy.prototype.__AppendUrlValues = function (url)
{
time = new Date();
url += this.__GetArgument("plckNoCache", time.getTime(), false, false);
url += this.__GetArgument("plckApiKey", this.apiKey, true, false);
return url;
}
SiteLifeProxy.prototype.ReloadPage = function(params) {
var sSearch = window.location.search.substring(1);
var sNVPs = sSearch.split('&');
var newSearch = "";
for(var k in params) {
if(k == "extend") continue;
if(newSearch == "") newSearch += "?"; else newSearch += "&";
newSearch += k + '=' + params[k];
}
for (var i = 0; i < sNVPs.length; i++) {
var kv = sNVPs[i].split('=');
if(kv[0] && kv[0].indexOf('plck') != 0 && ! params[kv[0]]) {
newSearch += "&" + sNVPs[i];
}
}
window.location.search = newSearch;
}
function loadScript (url, callback) {
var script = document.createElement('script');
script.type = 'text/javascript';
if (callback)
script.onload = script.onreadystatechange = function() {
if (script.readyState && script.readyState != 'loaded' && script.readyState != 'complete')
return;
script.onreadystatechange = script.onload = null;
callback();
};
script.src = url;
document.getElementsByTagName('head')[0].appendChild (script);
}
SiteLifeProxy.prototype.__Send = function(url, scriptToUse) {
this.OnDebug("_Send " + url);
if (this.__isSafari) {
loadScript(url);
return;
}
scriptToUse = scriptToUse || this.ScriptId();
//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) {
var scriptNode = document.getElementById(scriptToUse);
var head = this.GetTags('head')[0];
if ( (scriptNode != null) && (scriptNode != undefined) && (!this.__isExplorer) && head.removeChild && (!this.__isSafari)) {
head.removeChild(scriptNode);
scriptNode = null;
}
if(scriptNode == null) {
scriptNode = document.createElement('script');
scriptNode.id = scriptToUse;
scriptNode.setAttribute('type','text/javascript');
scriptNode.setAttribute('charset', 'utf-8');
head.appendChild(scriptNode);
}
scriptNode.setAttribute('src', url);
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) {
this.__Send(this.__baseUrl + '/Utility/Logout?plckRedirectUrl=' + escape(window.location.href), 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) {document.write('
'); return id;}
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.KeyTypeExternalResource = "ExternalResource";
SiteLifeProxy.prototype.PersonaHeaderRequest = function(UserId) {
var url = this.__baseUrl + '/Persona/PersonaHeader?plckElementId=personaHDest&plckUserId='+ UserId;
this.__Send(url, "personaHeaderScript");
}
SiteLifeProxy.prototype.PersonaHeader = function(UserId) {
this.WriteDiv("personaHDest", "Persona_Main");
this.PersonaHeaderRequest(UserId);
}
SiteLifeProxy.prototype.Persona = function(UserId) {
this.WriteDiv("personaDest", "Persona_Main");
var action = this.GetParameter("plckPersonaPage");
if(action) eval('gSiteLife.'+action+'(\''+UserId+'\');');
else this.PersonaHome(UserId);
}
SiteLifeProxy.prototype.LoadPersonaPage = function(PageName, UserId) {
var params = new Object(); params['plckPersonaPage'] = PageName; params['plckUserId'] = UserId; params['newspaperUserId'] = 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);
}
SiteLifeProxy.prototype.WatchItem = function(UserId, Controller,Method,WatchKey, targetDiv) {
var url = this.__baseUrl + '/'+Controller+'/' + Method + '?' + 'plckWatchKey=' + WatchKey + '&plckElementId=' + targetDiv + '&plckUserId=' + UserId + '&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;}
return this.PersonaSend('PersonaMessages', 'personaDest', 'personaScript', UserId, AdParams);
}
SiteLifeProxy.prototype.PersonaComments = function(UserId) {
var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
return this.PersonaSend('PersonaComments', 'personaDest', 'personaScript', UserId, AdParams);
}
SiteLifeProxy.prototype.PersonaBlog = function(UserId) {
var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
return this.PersonaBlogSend('PersonaBlog', 'personaDest', 'personaScript', UserId, AdParams);
}
SiteLifeProxy.prototype.PersonaProfile = function(UserId) {
return this.PersonaSend('PersonaProfile', 'personaDest', 'personaScript', UserId);
}
SiteLifeProxy.prototype.PersonaWatchListPaginate = function(UserId, pageNum) {
return this.PersonaPaginate('WatchList', pageNum, UserId);
}
SiteLifeProxy.prototype.PersonaFriendsPaginate = function(UserId, pageNum) {
return this.PersonaPaginate('Friends', pageNum, UserId);
}
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){
var url = this.__baseUrl + '/Persona/' + ApiName + '?plckElementId=' + DestDiv + '&plckUserId='+ UserId;
if(AddParams) url += '&' + AddParams;
this.__Send(url, ScriptName);
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){
var url = this.__baseUrl + '/PersonaPhoto/' + ApiName + '?plckElementId=' + DestDiv + '&plckUserId='+ UserId;
if(AddParams) url += '&' + AddParams;
this.__Send(url, ScriptName);
return false;
}
SiteLifeProxy.prototype.PersonaMostRecent = function(UserId, PhotoID, DestDiv) {
return this.PersonaPhotoSend('PersonaMostRecent', DestDiv, 'personaScript', UserId,'plckPhotoID=' + PhotoID);
}
SiteLifeProxy.prototype.PersonaCreateGallery = function(UserId) {
return this.PersonaPhotoSend('UserGalleryCreate', 'personaDestPhoto', 'personaScript', UserId);
}
SiteLifeProxy.prototype.PersonaEditGallery = function(UserId,GalleryID) {
return this.PersonaPhotoSend('UserGalleryEdit', 'personaDestPhoto', 'personaScript', UserId,'plckGalleryID=' + GalleryID);
}
SiteLifeProxy.prototype.PersonaGalleryEdit = function(UserId,GalleryID) {
return this.PersonaPhotoSend('UserGalleryCreate', 'personaDestPhoto', 'personaScript', UserId,'plckGalleryID=' + GalleryID);
}
SiteLifeProxy.prototype.PersonaUploadToUserGallery = function(GalleryId) {
var url = this.__baseUrl + '/Photo/PhotoUpload?plckElementId=personaDestPhoto&plckGalleryID='+ GalleryId;
this.__Send(url);
return false;
}
SiteLifeProxy.prototype.PersonaPhotos = function(UserId) {
return this.PersonaPhotoSend('PersonaPhotos', 'personaDest', 'personaScript', UserId);
}
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.PersonaGalleryLoad = function(UserId) {
var GalleryId = gSiteLife.GetParameter('plckGalleryID');
return this.PersonaPhotoSend('PersonaGallery', 'personaDest', 'personaScript', UserId,'plckGalleryID='+ GalleryId + '&plckPageNum=0');
}
SiteLifeProxy.prototype.PersonaGallery = function(UserId,GalleryId,PageNum) {
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'] = 'PersonaGalleryLoad'; params['plckUserId'] = UserId; params['newspaperUserId'] = 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['newspaperUserId'] = 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['newspaperUserId'] = UserId;
params['plckPhotoID'] = PhotoID;
this.ReloadPage(params);
return false;
}
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 url = this.__baseUrl + '/Photo/PublicGalleries?plckElementId=' + elementId;
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)
{
return this.CommentsInternal(parentKeyType, parentKey, parentUrl, parentTitle, pageSize, sort, showTabs, tab, false, false);
};
SiteLifeProxy.prototype.CommentsInput = function(parentKeyType, parentKey, redirectToUrl)
{
return this.CommentsInternal(parentKeyType, parentKey, null, null, null, null, null, null, true, false, redirectToUrl);
};
SiteLifeProxy.prototype.CommentsOutput = function(parentKeyType, parentKey)
{
return this.CommentsInternal(parentKeyType, parentKey, null, null, null, null, null, null, false, true);
}
SiteLifeProxy.prototype.CommentsInternal = function(parentKeyType, parentKey, pageSize, sort, showTabs, tab, parentUrl, parentTitle, hideView, hideInput, redirectToUrl)
{
document.write("");
var oldDocOnLoad = window.onload;
function loadComments() {
if (oldDocOnLoad != null) {
oldDocOnLoad();
}
gSiteLife.GetComments(parentKeyType, parentKey, parentUrl, parentTitle, 0, pageSize, sort, showTabs, tab, hideView, hideInput, redirectToUrl);
}
window.onload = loadComments;
return false;
}
SiteLifeProxy.prototype.GetComments = function(parentKeyType, parentKey, parentUrl, parentTitle, page, pageSize, sort, showTabs, tab, hideView, hideInput, redirectTo)
{
parentKeyType = parentKeyType || "ExternalResource";
parentUrl = parentUrl || window.location.href;
parentKey = parentKey || window.location.href;
parentTitle = parentTitle || gSiteLife.EscapeValue(document.title);
page = page || 0;
pageSize = pageSize || 10;
sort = sort || "TimeStampAscending";
showTabs = showTabs || false;
tab = tab || "MostRecent";
hideView = hideView || false;
hideInput = hideInput || false;
redirectTo = redirectTo || "";
var url = this.__baseUrl +
'/Comment/GetPage.rails?&plckTargetKeyType='+ parentKeyType +
'&plckTargetKey=' + escape(parentKey) +
"&plckCurrentPage=" + page +
"&plckItemsPerPage=" + pageSize +
"&plckSort=" + sort +
"&plckElementId=Comments_Container" +
"&plckTargetUrl=" + parentUrl +
"&plckTargetTitle=" + parentTitle +
"&plckHideView=" + hideView +
"&plckHideInput=" + hideInput +
"&plckRedirectToUrl=" + redirectTo ;
if (showTabs) {
url = url + "&plckShowTabs=true&plckTab=" + tab;
}
this.__Send(url, "getComments");
return false;
};
SiteLifeProxy.prototype.PersonaBlogPaginate = function(ApiName, PageNum, UserId, AddParams){
var url = this.__baseUrl + '/PersonaBlog/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.PersonaBlogViewEdit = function(UserId) {
return this.PersonaBlogSend('PersonaBlogViewEdit', 'personaDest', 'personaScript', UserId);
}
SiteLifeProxy.prototype.PersonaBlogPostCreate = function(userId) {
return this.PersonaBlogSend('PersonaBlogPostCreate', 'personaDest', 'personaScript', userId, 'plckRedirectUrl=' + this.EscapeValue(window.location.href));
}
SiteLifeProxy.prototype.PersonaBlogPendingComments = function(UserId, page, pageSize) {
return this.PersonaBlogSend('PersonaBlogPendingComments', 'personaDest', 'personaScript', UserId);
}
SiteLifeProxy.prototype.PersonaBlogCommentsPaginate = function(UserId, pageNum) {
return this.PersonaBlogPaginate('BlogPendingComments', pageNum, UserId);
}
SiteLifeProxy.prototype.PersonaBlogSettings = function(UserId) {
return this.PersonaBlogSend('PersonaBlogSettings', 'personaDest', 'personaScript', UserId);
}
SiteLifeProxy.prototype.PersonaBlogEditPost = function(userId, postId, selection, daysBack) {
return this.PersonaBlogSend('PersonaBlogPostEdit', 'personaDest', 'personaScript', userId, 'plckPostId=' + postId + '&plckSelection=' + selection + '&plckDaysBack=' + daysBack + '&plckRedirectUrl=' + this.EscapeValue(window.location.href));
}
SiteLifeProxy.prototype.PersonaBlogRemovePost = function(userId, postId, selection, daysBack) {
if (confirm("Are you sure you want to delete this item?") == true) {
return this.PersonaBlogSend('PersonaBlogRemovePost', 'personaDest', 'personaScript', userId, 'plckPostId=' + postId + '&plckSelection=' + selection + '&plckDaysBack=' + daysBack );
}
else {
return false;
}
}
SiteLifeProxy.prototype.PersonaBlogViewPost = function(userId, postId, selection, daysBack) {
if(!postId ) { postId = gSiteLife.GetParameter('plckPostId'); }
return this.PersonaBlogSend('PersonaBlogViewPost', 'personaDest', 'personaScript', userId, 'plckPostId=' + postId + '&plckSelection=' + selection + '&plckDaysBack=' + daysBack );
}
SiteLifeProxy.prototype.PersonaBlogViewMonth = function(userId, monthId) {
if(!monthId ) { monthId = gSiteLife.GetParameter('plckMonthId'); }
var AdParams = 'plckMonthId=' + monthId;
AdParams += this.GetParameter('plckCurrentPage') ? '&plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
return this.PersonaBlogSend('PersonaBlogViewMonth', 'personaDest', 'personaScript', userId, AdParams);
}
SiteLifeProxy.prototype.PersonaAddBlogWatchItem= function(UserId, Url, Title, WatchKey) {
return this.PersonaBlogSend('PersonaAddBlogWatch', 'plckBlogWatchDiv', 'personaScript', UserId, 'plckWatchKey=' + WatchKey + '&plckWatchUrl=' + this.EscapeValue(Url) + '&plckWatchTitle=' + this.EscapeValue(Title));
}
SiteLifeProxy.prototype.PersonaRemoveBlogWatchItem= function(UserId, WatchKey) {
return this.PersonaBlogSend('PersonaRemoveBlogWatch', 'plckBlogWatchDiv', 'personaScript', UserId, 'plckWatchKey=' + WatchKey);
}
SiteLifeProxy.prototype.PersonaBlogViewTag = function(userId, tag) {
if(!tag ) { tag = gSiteLife.GetParameter('plckTag'); }
var AdParams = 'plckTag=' + tag;
AdParams += this.GetParameter('plckCurrentPage') ? '&plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
return this.PersonaBlogSend('PersonaBlogViewTag', 'personaDest', 'personaScript', userId, AdParams );
}
SiteLifeProxy.prototype.PersonaBlogRefreshViewEditList= function(userId, selection, daysBack) {
return this.PersonaBlogSend('PersonaBlogRefreshViewEditList', 'personaDest', 'personaScript', userId, 'plckSelection=' + selection + '&plckDaysBack=' + daysBack );
}
SiteLifeProxy.prototype.LoadBlogPostPage = function(userId, postKey) {
var params = new Object();
params['plckPersonaPage'] = 'PersonaBlogViewPost';
params['plckUserId'] = userId;
params['newspaperUserId'] = userId;
params['plckPostId'] = postKey;
this.ReloadPage(params);
return false;
}
SiteLifeProxy.prototype.LoadBlogListPage = function(userId, monthId) {
var params = new Object();
params['plckPersonaPage'] = 'PersonaBlogViewMonth';
params['plckUserId'] = userId;
params['newspaperUserId'] = userId;
params['plckMonthId'] = monthId;
this.ReloadPage(params);
return false;
}
SiteLifeProxy.prototype.LoadBlogListPageFilteredByTag = function(userId, tag) {
var params = new Object();
params['plckPersonaPage'] = 'PersonaBlogViewTag';
params['plckUserId'] = userId;
params['newspaperUserId'] = userId;
params['plckTag'] = tag;
this.ReloadPage(params);
return false;
}
SiteLifeProxy.prototype.PersonaBlogSend = function(apiName, destDiv, scriptName, userId, addParams){
var url = this.__baseUrl + '/PersonaBlog/' + apiName + '?plckElementId=' + destDiv + '&plckUserId=' + userId + '&' + addParams;
this.__Send(url, scriptName);
return false;
}
SiteLifeProxy.prototype.PersonaBlogsPaginate = function(apiName, pageNum, userId, addParams){
var url = this.__baseUrl + '/PersonaBlog/' + apiName + '?' + apiName + 'PageNum=' + pageNum + '&plckElementId=Persona' + apiName + 'Dest&plckUserId='+ userId;
if(addParams) url += '&' + addParams;
this.__Send(url, 'Persona'+ apiName + 'Script');
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.PersonaBlogSelectPendingComments = function(formId, checked) {
var form = document.getElementById(formId);
for (i=0; i");
SiteLifeProxy.prototype.Forums = function() {
this.WriteDiv("forumDest", "Forum_Main");
var action = this.GetParameter("plckForumPage");
if(action) eval('gSiteLife.'+action+'();');
else this.ForumCategories();
}
SiteLifeProxy.prototype.ForumCategories = function() {
return this.ForumSend("ForumCategories", "forumDest", "ForumMain");
}
SiteLifeProxy.prototype.Forum = function() {
var forumId = this.GetParameter('plckForumId');
var pageNum = this.GetParameter('plckCurrentPage');
if(pageNum == null) pageNum = 0;
return this.ForumSend('Forum', 'forumDest', 'ForumMain', 'plckForumId=' + forumId + '&plckCurrentPage=' + pageNum);
}
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;
adParam += "&plckCurrentPage=" + pageNum;
return this.ForumSend("ForumDiscussion", "forumDest", "ForumMain", adParam);
}
SiteLifeProxy.prototype.ForumCreateDiscussion = 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;
var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId;
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;
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;
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, divId) {
var divElem = document.getElementById(divId);
var imgElem = document.getElementById(imageId);
if(divElem.style.display == 'none') {
divElem.style.display='block';
this.SetCookie(divId,'block');
imgElem.src = this.__baseUrl + "/Content/images/forums/minus.gif"
}else {
divElem.style.display='none';
this.SetCookie(divId, 'none');
imgElem.src = this.__baseUrl + "/Content/images/forums/plus.gif"
}
}
SiteLifeProxy.prototype.ForumSearch = function(suffix) {
var searchText = document.getElementById('plckSearchText'+suffix).value;
searchText = FixSearchString(searchText); if(searchText.length <= 0) return;
var searchArea = document.getElementById('plckSearchArea'+suffix).value;
this.LoadForumPage("ForumSearchPaginate", "plckSearchText", searchText, "plckSearchArea", searchArea, "plckCurrentPage", "0");
}
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.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;
this.__Send(url, ScriptName);
return false;
}
SiteLifeProxy.prototype.ForumDiscussionEdit = function(discussionId, curView, curPage) {
return this.ForumSend('ForumDiscussionEdit', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckCurrentView=' + curView + '&plckCurrentPage=' + curPage );
}
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.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.Recommend = function(keyType, targetKey) {
keyType = keyType || "ExternalResource";
targetKey = targetKey || window.location.href;
var divId = "Recommend" + targetKey;
this.WriteDiv(divId, "Recommend");
var url = this.__baseUrl + '/Recommend/Recommend?plckElementId=' + divId + '&plckTargetKey=' +targetKey + '&plckTargetKeyType=' + keyType;
this.__Send(url);
return false;
}
SiteLifeProxy.prototype.PostRecommendation = function(keyType, targetKey, recommendDiv, parentTitle) {
var url = this.__baseUrl + '/Recommend/PostRecommendation?plckElementId=' + recommendDiv + '&plckTargetKey=' +targetKey + '&plckTargetKeyType=' + keyType;
if(parentTitle) url += '&plckParentTitle=' + parentTitle;
this.__Send(url);
return false;
}
SiteLifeProxy.prototype.RateItem = function (itemId, itemType, rating, targetDiv, parentTitle) {
var url = this.__baseUrl + '/Rating/Rate?plckElementId=' + targetDiv +
'&plckTargetKey=' + itemId +
'&plckTargetKeyType=' + itemType +
'&plckRating=' + rating;
if(parentTitle) url += '&plckParentTitle=' + parentTitle;
this.__Send(url);
return false;
}
SiteLifeProxy.prototype.Rating = function(itemType, itemId) {
itemType = itemType || "ExternalResource";
itemId = itemId || this.EscapeValue(window.location.href);
var divId = "rate_" + new Date().getTime() + Math.floor(Math.random()*1000);
this.WriteDiv(divId, "Rating");
var url = this.__baseUrl + '/Rating/GetRating?plckElementId=' + divId +
'&plckTargetKey=' + itemId +
'&plckTargetKeyType=' + itemType;
this.__Send(url, new Date().getTime());
return false;
}
SiteLifeProxy.prototype.RatingClickStar = function (index, targetKey, targetKeyType, targetDiv, parentTitle) {
gSiteLife.RateItem(targetKey, targetKeyType, index, targetDiv, parentTitle);
}
SiteLifeProxy.prototype.RatingFillStar = function(index, targetKey) {
var stars = document.getElementsByName(targetKey+"Stars");
var label = document.getElementById(targetKey + "Rating-label");
var selectedIndex = parseInt(document.getElementById(targetKey+"Rating-value").value);
if (index < 0 && selectedIndex >= 0) index = selectedIndex;
for(i=1; i <= stars.length; i++) {
if (index > 0 && i <= index) {
stars[i-1].src = this.__baseUrl + "/Content/images/icons/fullstar.gif";
}else {
stars[i-1].src = this.__baseUrl + "/Content/images/icons/emptystar.gif";
}
}
switch (index) {
case 0: label.innerHTML = "Not rated"; break;
case 1: label.innerHTML = "Horrible!"; break;
case 2: label.innerHTML = "Not for me."; break;
case 3: label.innerHTML = "It's alright."; break;
case 4: label.innerHTML = "I like it."; break;
case 5: label.innerHTML = "I love it!"; break;
default: label.innerHTML = "Blah";
}
}
SiteLifeProxy.prototype.Review = function(parentKeyType, parentKey, reviewedTitle, reviewCategory, pageSize, sort) {
parentKeyType = parentKeyType || "ExternalResource";
parentKey = parentKey || window.location.href;
reviewedTitle = reviewedTitle || document.title;
reviewCateogry = reviewCategory || "Uncategorized";
pageSize = pageSize || 10;
sort = sort || "TimeStampAscending";
var divId = "review_" + parentKey;
this.WriteDiv(divId, "Review");
var url = this.__baseUrl + '/Review/GetReviews?plckElementId=' + divId +
'&plckTargetKey=' + parentKey +
'&plckTargetKeyType=' + parentKeyType +
'&plckReviewedTitle=' + reviewedTitle +
'&plckReviewCategory=' + reviewCategory +
'&plckSort=' + sort +
'&plckParentUrl=' + window.location.href +
'&plckParentTitle=' + gSiteLife.EscapeValue(document.title);
this.__Send(url);
return false;
}
SiteLifeProxy.prototype.ReviewClickStar = function (index, targetKey, targetKeyType, targetDiv) {
document.getElementById(targetKey+"Rating-value").value = index;
}
SiteLifeProxy.prototype.SummaryBlogsRecentPostsByTag = function(count, tagFilter) {
return this.SummaryPanel("SummaryBlogsRecentPostsByTag", count, tagFilter);
}
SiteLifeProxy.prototype.SummaryPhotosRecentPhotosByTag = function(count, tagFilter) {
return this.SummaryPanel("SummaryPhotosRecentPhotosByTag", count, tagFilter);
}
SiteLifeProxy.prototype.SummaryArticlesRecentlyReviewed = function(count) {
return this.SummaryPanel("SummaryArticlesRecentlyReviewed", count);
}
SiteLifeProxy.prototype.SummaryPhotosMostCommentedPhotos = function(count) {
return this.SummaryPanel("SummaryPhotosMostCommentedPhotos", count);
}
SiteLifeProxy.prototype.SummaryPhotosRecentPhotos = function(count) {
return this.SummaryPanel("SummaryPhotosRecentPhotos", count);
}
SiteLifeProxy.prototype.SummaryBlogsRecentPosts = function(count, tagFilter) {
return this.SummaryPanel("SummaryBlogsRecentPosts", count, tagFilter);
}
SiteLifeProxy.prototype.SummaryArticlesRecentlyRated = function(count) {
return this.SummaryPanel("SummaryArticlesRecentlyRated", count);
}
SiteLifeProxy.prototype.SummaryArticlesMostRated = function(count) {
return this.SummaryPanel("SummaryArticlesMostRated", count);
}
SiteLifeProxy.prototype.SummaryArticlesMostCommented = function(count) {
return this.SummaryPanel("SummaryArticlesMostCommented", count);
}
SiteLifeProxy.prototype.SummaryArticlesMostRecommended = function(count) {
return this.SummaryPanel("SummaryArticlesMostRecommended", count);
}
SiteLifeProxy.prototype.SummaryPhotosMostRecommendedPhotos = function(count) {
return this.SummaryPanel("SummaryPhotosMostRecommendedPhotos", count);
}
SiteLifeProxy.prototype.SummaryPhotosRecentGalleries = function(count) {
return this.SummaryPanel("SummaryPhotosRecentGalleries", count);
}
SiteLifeProxy.prototype.SummaryPhotosMostRecommendedGalleries = function(count) {
return this.SummaryPanel("SummaryPhotosMostRecommendedGalleries", count);
}
SiteLifeProxy.prototype.SummaryForumsRecentDiscussions = function(count) {
return this.SummaryPanel("SummaryForumsRecentDiscussions", count);
}
SiteLifeProxy.prototype.SummaryForumsMostCommentedDiscussions = function(count) {
return this.SummaryPanel("SummaryForumsMostCommentedDiscussions", count);
}
SiteLifeProxy.prototype.SummaryBlogsRecent = function(count, tagFilter) {
return this.SummaryPanel("SummaryBlogsRecent", count, tagFilter);
}
SiteLifeProxy.prototype.SummaryBlogsMostRecommendedPosts = function(count, tagFilter) {
return this.SummaryPanel("SummaryBlogsMostRecommendedPosts", count, tagFilter);
}
SiteLifeProxy.prototype.SummaryBlogsMostCommentedPosts = function(count, tagFilter) {
return this.SummaryPanel("SummaryBlogsMostCommentedPosts", count, tagFilter);
}
SiteLifeProxy.prototype.SummaryPersonaProfileRecent = function(count, tagFilter) {
return this.SummaryPanel("SummaryPersonaProfileRecent", count, tagFilter);
}
SiteLifeProxy.prototype.SummaryPanel = function(methodName, count, tagFilter) {
var divId = tagFilter ? methodName + tagFilter : methodName;
this.WriteDiv(divId, divId);
return this.SummarySend(methodName, divId, divId + "Script", "plckCount", count, "plckTagFilter", tagFilter);
}
SiteLifeProxy.prototype.SummarySend = function(ApiName, DestDiv, ScriptName){
var url = this.__baseUrl + '/Summary/' + ApiName + '?plckElementId=' + DestDiv;
for(ii=3; ii< this.SummarySend.arguments.length; ii+=2) { if(this.SummarySend.arguments[ii+1]) { url += "&" + this.SummarySend.arguments[ii] + "=" + this.SummarySend.arguments[ii+1];} }
this.__Send(url, ScriptName);
return false;
}
document.write("");
SiteLifeProxy.prototype.MyNews = function() {
this.WriteDiv("myNewsDest", "MyNews_Main");
return this.MyNewsSend("MyNews", "myNewsDest", "myNewsScript");
}
SiteLifeProxy.prototype.MyNews = function(userFieldName, passwordFieldName) {
this.WriteDiv("myNewsDest", "MyNews_Main");
return this.MyNewsSend("MyNews", "myNewsDest", "myNewsScript", 'plckUserFieldName=' + userFieldName + '&plckPasswordFieldName=' + passwordFieldName);
}
SiteLifeProxy.prototype.MyNewsSeeMore = function() {
this.WriteDiv("myNewsDest", "MyNews_Main");
return this.MyNewsSend("MyNewsGroup", "myNewsDest", "myNewsScript", "plckGroupName=" + this.GetParameter("plckGroupName"));
}
SiteLifeProxy.prototype.MyNewsSeeMore = function(userFieldName, passwordFieldName) {
this.WriteDiv("myNewsDest", "MyNews_Main");
return this.MyNewsSend("MyNewsGroup", "myNewsDest", "myNewsScript", "plckGroupName=" + this.GetParameter("plckGroupName") + '&plckUserFieldName=' + userFieldName + '&plckPasswordFieldName=' + passwordFieldName);
}
SiteLifeProxy.prototype.MyNewsUpdateOrder = function(order) {
return this.MyNewsSend('MyNewsUpdateOrder', 'myNewsDest', 'myNewsScript', 'plckOrder=' + order );
}
SiteLifeProxy.prototype.MyNewsSearch = function(query, groupId, currentPage) {
return this.MyNewsSend('MyNewsSearch', groupId + '_SearchResult', 'myNewsScript', 'plckQuery=' + query + '&plckGroupId=' + groupId + '&plckCurrentPage=' + currentPage + '&plckPostBack=true');
}
SiteLifeProxy.prototype.MyNewsSend = function(ApiName, DestDiv, ScriptName, AddParams){
var url = this.__baseUrl + '/MyNews/' + ApiName + '?plckElementId=' + DestDiv;
if(AddParams) url += '&' + AddParams;
this.__Send(url, ScriptName);
return false;
}
document.write("");
var gSiteLife = new SiteLifeProxy("http://mynews.foxnews.com/ver1.0");
gSiteLife.apiKey = "${APIKey}";
gSiteLife.AddEventHandler('ExternalResourceLink', function(rk) {return rk;});
if(gSiteLife.GetParameter('plckPersonaPage') && gSiteLife.GetParameter('plckPersonaPage').indexOf('PersonaBlog') == 0) {
document.write(""); }