function RenderItemTemplate($f, item) {
if ($f == null) {
return;
}
var Id = replaceAll($f.html(), "${Id}", item.Id);
var FirefoxId = replaceAll(Id, "$%7BId%7D", item.Id);
var Title = replaceAll(FirefoxId, "${Title}", item.Title);
var FirefoxTitle = replaceAll(Title, "$%7BTitle%7D", item.Title);
var Description = replaceAll(FirefoxTitle, "${Description}", item.Description);
var FirefoxDescription = replaceAll(Description, "$%7BDescription%7D", item.Description);
var PublishDate = replaceAll(FirefoxDescription, "${PublishDate}", item.Date);
var FirefoxPublishDate = replaceAll(PublishDate, "$%7BPublishDate%7D", item.Date);
var PrettyDate = replaceAll(FirefoxPublishDate, "${PrettyDate}", item.PrettyDate);
var FirefoxPrettyDate = replaceAll(PrettyDate, "$%7BPrettyDate%7D}", item.PrettyDate);
var ItemContent = replaceAll(FirefoxPrettyDate, "${ItemContentPreview}", item.ItemContentPreview);
var FirefoxItemContent = replaceAll(ItemContent, "$%7BItemContentPreview%7D", item.ItemContentPreview);
var SourceLink = replaceAll(FirefoxItemContent, "${SourceLink}", item.SourceLink);
var FirefoxSourceLink = replaceAll(SourceLink, "$%7BSourceLink%7D", item.SourceLink);
var Data = replaceAll(FirefoxSourceLink, "${Data}", item.Data);
var FirefoxData = replaceAll(Data, "$%7BData%7D", item.Data);
var SourceId = replaceAll(FirefoxData, "${SourceId}", item.SourceId);
var FirefoxSourceId = replaceAll(SourceId, "$%7BSourceId%7D", item.SourceId);
var CommentCount = replaceAll(FirefoxSourceId, "${CommentCount}", item.CommentCount);
var FirefoxCommentCount = replaceAll(CommentCount, "$%7BCommentCount%7D", item.CommentCount);
var SourceTypeName = replaceAll(FirefoxCommentCount, "${SourceTypeName}", item.SourceTypeName);
var FirefoxSourceTypeName = replaceAll(SourceTypeName, "$%7BSourceTypeName%7D", item.SourceTypeName);
var SourceTitle = replaceAll(FirefoxSourceTypeName, "${SourceTitle}", item.SourceTitle);
var FirefoxSourceTitle = replaceAll(SourceTitle, "$%7BSourceTitle%7D", item.SourceTitle);
return FirefoxSourceTitle;
}
function replaceAll(OldString, FindString, ReplaceString) {
var SearchIndex = 0;
var NewString = "";
while (OldString.indexOf(FindString, SearchIndex) != -1) {
NewString += OldString.substring(SearchIndex, OldString.indexOf(FindString, SearchIndex));
NewString += ReplaceString;
SearchIndex = (OldString.indexOf(FindString, SearchIndex) + FindString.length);
}
NewString += OldString.substring(SearchIndex, OldString.length);
return NewString;
}
encodeHTML = function(original) {
return EscapeHTML(original).replace(/&/g, '&').replace(//g, '>');
};
encodeHTMLWhiteList = function(original) {
return original.replace(/&/g, '&').replace(//g, '>').replace('\n','
');
};
decodeHTML = function(original) {
return original.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
};
RenderButtonRollovers = function() {
$(".ro").mouseover(
function() {
if ($(this).attr("src").indexOf("_active") == -1) {
var newSrc = $(this).attr("src").replace("_up.png", "_active.png");
$(this).attr("src", newSrc);
}
}
)
$(".ro").mouseout(
function() {
if ($(this).attr("src").indexOf("_active") != -1) {
var newSrc = $(this).attr("src").replace("_active.png", "_up.png");
$(this).attr("src", newSrc);
}
}
)
}
EscapeHTML = function(original) {
var eHtml = escape(original);
eHtml = eHtml.replace(/\//g, "%2F");
eHtml = eHtml.replace(/\?/g, "%3F");
eHtml = eHtml.replace(/=/g, "%3D");
eHtml = eHtml.replace(/&/g, "%26");
eHtml = eHtml.replace(/@/g, "%40");
return eHtml;
}
AjaxFailure = function(XMLHttpRequest, textStatus, errorThrown) {
debugger
if (textStatus == "timeout") {
alert("Sorry, there was a delay in accessing the site database and the request has timed out. The site may be busy or having problems. If this problem persists, please contact the site administrator.");
}
else {
alert("Sorry, there was an error and the request could not be completed. The site may be busy or having problems. If this problem persists, please contact the site administrator.");
}
};
/*
* jQuery pager plugin
* Version 1.0 (12/22/2008)
* @requires jQuery v1.2.6 or later
*
* Example at: http://jonpauldavies.github.com/PagerDemo.html
*
* Copyright (c) 2008-2009 Jon Paul Davies
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Read the related blog post and contact the author at http://www.j-dee.com
*
* This version is far from perfect and doesn't manage it's own state, therefore contributions are more than welcome!
*
* Usage: .pager({ pagenumber: 1, pagecount: 15, buttonClickCallback: PagerClickTest });
*
* Where pagenumber is the visible page number
* pagecount is the total number of pages to display
* buttonClickCallback is the method to fire when a pager button is clicked.
*
* buttonClickCallback signiture is PagerClickTest = function(pageclickednumber)
* Where pageclickednumber is the number of the page clicked in the control.
*
*/
(function($) {
$.fn.pager = function(options) {
var opts = $.extend({}, $.fn.pager.defaults, options);
return this.each(function() {
// empty out the destination element and then render out the pager with the supplied options
$(this).empty().append(renderpager(parseInt(options.pagenumber), parseInt(options.pagecount), options.buttonClickCallback));
// specify correct cursor activity
$('.pages li').mouseover(function() { document.body.style.cursor = "pointer"; }).mouseout(function() { document.body.style.cursor = "auto"; });
});
};
// render and return the pager with the supplied options
function renderpager(pagenumber, pagecount, buttonClickCallback) {
// setup $pager to hold render
var $pager = $('