function sanitizecharset( s )
{
// This while loop should not be nessecary. If js worked as described it wound only run once...
	while(s.indexOf(unescape( '%uFFFD' ))>0){
		s = escape( s );
		s = s.replace('%uFFFD','%27');
		s = unescape( s );
	}
// We will probably also have problems with é

//	alert(s.substr(317,1)+' is '+ escape(s.substr(317,1)));

  return s ;
}

		function submitRequest() {   
			
			if(articleid) {
            	pullCounts(articleid);
			}

        }

		function pullCounts(articlekey) {

            var articleKey = new ArticleKey(articlekey);   

            var requestBatch = new RequestBatch();   

            requestBatch.AddToRequest(articleKey);    

            requestBatch.BeginRequest(serverUrl, renderArticle);    

        }  

           

        function renderArticle(responseBatch) { 

            if (responseBatch.Responses.length == 0) {    

				var commentCount = document.getElementById('articleCommentCount' + articleid);   

                var recommendCount = document.getElementById('articleRecommendCount' + articleid);   

                // update page elements  

				commentCount.style.visibility = 'hidden';

				recommendCount.style.visibility = 'hidden'; 

                commentCount.innerHTML = 0;   

                recommendCount.innerHTML = 0;

            } else {   

                // get article from response   

                var article = responseBatch.Responses[0].Article;

                // get page elements   

                var commentCount = document.getElementById('articleCommentCount' + article.ArticleKey.Key);   

                var recommendCount = document.getElementById('articleRecommendCount' + article.ArticleKey.Key);

                // update page elements   

                commentCount.innerHTML = article.Comments.NumberOfComments;   

                recommendCount.innerHTML = article.Recommendations.NumberOfRecommendations;

				var isRecommended = article.Recommendations.CurrentUserHasRecommended;

				if(isRecommended == "True") {

					var recommendLink = document.getElementById('recommendlink' + article.ArticleKey.Key);

					recommendLink.innerHTML = "<span class='Article_Recommended'>Recommended</span>";

				}

				commentCount.style.visibility = 'visible';

				recommendCount.style.visibility = 'visible';

            }   

        }

		function recommendReview(key) {  
		
			var requestBatch = new RequestBatch();   

            var articleKey = new ArticleKey(key);   

            var recommendAction = new RecommendAction(articleKey);   

            requestBatch.AddToRequest(recommendAction);    

            requestBatch.BeginRequest(serverUrl, recommendationComplete);     

        }   

           

        function recommendationComplete(responseBatch) {
            if(responseBatch.Responses.length > 0) {

                submitRequest();
			}
			else {
				//alert('did not exist');
				updateArticle();	
			}

        }


		function updateArticle() {   

            // get form elements and page info   

            var articleKey = new ArticleKey(articleid);   

            var pageUrl = document.location.href;
			
			var section = new Section(sectionTitle);
			
			var categories = new Array();

  

            // create and send request   

            var requestBatch = new RequestBatch();               

            var updateAction = new UpdateArticleAction(articleKey, pageUrl, pageTitle, section);   

            requestBatch.AddToRequest(updateAction);    

            requestBatch.BeginRequest(serverUrl, articleUpdated);    

        }   

           

        function articleUpdated(responseBatch) {   

            if (responseBatch.Messages[0].Message == 'ok') {   
                  submitRequest();
				  //recommendReview(articleid);

            } 

        }
		
		function recommendReviewAbox(key) {

            var requestBatch = new RequestBatch();   

            var articleKey = new ArticleKey(key);   

            var recommendAction = new RecommendAction(articleKey);   

            requestBatch.AddToRequest(recommendAction);    

            requestBatch.BeginRequest(serverUrl, recommendationCompleteAbox); 

        }
		
		function recommendationCompleteAbox(responseBatch) { 

                	SubmitListRequest();

        }
		
		function recommendReviewList(key) {

            var requestBatch = new RequestBatch();   

            var articleKey = new ArticleKey(key);   

            var recommendAction = new RecommendAction(articleKey);   

            requestBatch.AddToRequest(recommendAction);    

            requestBatch.BeginRequest(serverUrl, recommendationCompleteList); 

        }   

           

        function recommendationCompleteList(responseBatch) { 

                	getRecentActivity();

        }
		
		function getRecentActivity() {
			var sections = new Array(new Section("All"));
			var categories = new Array(new Category("All"));
			var contributors = new Array(new UserTier("All"));
			var activity = new Activity("Commented");
			var age = 2;
			var numItemsToGet = 5;
			
			var requestBatch = new RequestBatch();
			var discoveryAction = new DiscoverArticlesAction(sections, categories, contributors, activity, age, numItemsToGet);
			requestBatch.AddToRequest(discoveryAction);
			requestBatch.BeginRequest(serverUrl, renderRecentContent);
		}
		
		function renderRecentContent(responseBatch) {  
             if (responseBatch.Responses.length == 1) {
                 var discoveryAction = responseBatch.Responses[0].DiscoverArticlesAction;
                 var recentList = document.getElementById('mostcommented_list');  
				 if(recentList) {
                 	var recentHTML = "";  
                 	for (var i = 0; i < discoveryAction.DiscoveredArticles.length; i++) {
                     	recentHTML += getArticleLink(discoveryAction.DiscoveredArticles[i]);  
                 	}
                 	recentList.innerHTML = recentHTML;  
				 }
             }  
         }  
           
         function getArticleLink(article) {
             var html = "<div id='commentsummary'><a href='" + fixURL(article.PageUrl) + "' class='article_list_title' class='bullet'>" + fixTitle(article.PageTitle) + "</a><br>";
			 html += "<span id='slcomments'><a href='" + fixURL(article.PageUrl) + "#comments' class='Article_Comment'>Comments <span id='articleCommentCount' class='Article_Comment_Count'>" + article.Comments.NumberOfComments + "</span></a></span> | ";
			 if(article.Recommendations.CurrentUserHasRecommended == "True") {
				 html += "<span id='recommendations'><span id='recommendlink'><span class='Article_Recommended'>Recommended</span></span><span id='articleRecommendCount' class='Article_Recommend_Count'>" + article.Recommendations.NumberOfRecommendations + "</span></span>";
			 }
			 else {
			 	html += "<span id='recommendations'><span id='recommendlink'><a href=\"#\" onclick='recommendReviewList(\"" + article.ArticleKey.Key + "\")' class=\"Article_Recommend\">Recommend </a></span><span id='articleRecommendCount' class='Article_Recommend_Count'>" + article.Recommendations.NumberOfRecommendations + "</span></span>";
			 }
			 html += "</div>";
             return html;  
         }  
		 
		 function getMostCommentedArticle() {
			var sections = new Array(new Section("All"));
			var categories = new Array(new Category("All"));
			var contributors = new Array(new UserTier("All"));
			var activity = new Activity("Commented");
			var age = 15;
			var numItemsToGet = 5;

			var requestBatch = new RequestBatch();
			var discoveryAction = new DiscoverArticlesAction(sections, categories, contributors, activity, age, numItemsToGet);
			requestBatch.AddToRequest(discoveryAction);
			requestBatch.BeginRequest(serverUrl, renderMostCommentedArticle);
		}
		
		function renderMostCommentedArticle(responseBatch) {  
             if (responseBatch.Responses.length == 1) {
                 var discoveryAction = responseBatch.Responses[0].DiscoverArticlesAction;
                 var recentList = document.getElementById('mostcommented');  
                 var recentHTML = ""; 
                 for (var i = 0; i < discoveryAction.DiscoveredArticles.length; i++) {  
                     recentHTML += getArticleLinkArticle(discoveryAction.DiscoveredArticles[i]);  
                 }  
                 recentList.innerHTML = "<ul>" + recentHTML + "</ul>";  
             }
         }  
           
         function getArticleLinkArticle(article) {  
             var html = "<p><a href='" + fixURL(article.PageUrl) + "'>" + fixTitle(article.PageTitle) + "</a></p>";
             return html;  
         }
		 
		 function getMostRecommendedArticle() {
			var sections = new Array(new Section("All"));
			var categories = new Array(new Category("All"));
			var contributors = new Array(new UserTier("All"));
			var activity = new Activity("Recommended");
			var age = 15;
			var numItemsToGet = 5;
			
			var requestBatch = new RequestBatch();
			var discoveryAction = new DiscoverArticlesAction(sections, categories, contributors, activity, age, numItemsToGet);
			requestBatch.AddToRequest(discoveryAction);
			requestBatch.BeginRequest(serverUrl, renderMostRecommendedArticle);
		}
		
		function renderMostRecommendedArticle(responseBatch) {  
             if (responseBatch.Responses.length == 1) {
                 var discoveryAction = responseBatch.Responses[0].DiscoverArticlesAction;
                 var recentList = document.getElementById('mostrecommended_list_article');  
                 var recentHTML = "";  
                 for (var i = 0; i < discoveryAction.DiscoveredArticles.length; i++) {  
                     recentHTML += getArticleLinkArticle(discoveryAction.DiscoveredArticles[i]);  
                 }  
                 recentList.innerHTML = recentHTML;  
             }  
         }  
		 
		 function getMostCommentedRecommendedArticleList() {
			var sections = new Array(new Section("All"));
			var categories = new Array(new Category("All"));
			var contributors = new Array(new UserTier("All"));
			var commentactivity = new Activity("Commented");
			var recommendactivity = new Activity("Recommended");
			var age = 2;
			var numItemsToGet = 9;

			var requestBatch = new RequestBatch();
			var commentdiscoveryAction = new DiscoverArticlesAction(sections, categories, contributors, commentactivity, age, numItemsToGet);
			var recommendeddiscoveryAction = new DiscoverArticlesAction(sections, categories, contributors, recommendactivity, age, numItemsToGet);
			requestBatch.AddToRequest(commentdiscoveryAction);
			requestBatch.AddToRequest(recommendeddiscoveryAction);
			requestBatch.BeginRequest(serverUrl, renderMostCommentedArticle);
		}
		
		function renderMostCommentedArticle(responseBatch) {  
             if (responseBatch.Responses.length >= 1) {
                 var discoveryAction = responseBatch.Responses[0].DiscoverArticlesAction;
                 var recentList = document.getElementById('buzz_mostcommented');  
                 var recentHTML = ""; 
                 for (var i = 0; i < discoveryAction.DiscoveredArticles.length; i++) {  
                     recentHTML += getArticleLinkArticle(discoveryAction.DiscoveredArticles[i]);  
                 } 
					  recentHTML = sanitizecharset(recentHTML);
                 recentList.innerHTML = recentHTML;  
             }
			 if (responseBatch.Responses.length >= 2) {
				 var discoveryAction = responseBatch.Responses[1].DiscoverArticlesAction;
                 var recentList = document.getElementById('buzz_mostrecommended');  
                 var recentHTML = "";  
                 for (var i = 0; i < discoveryAction.DiscoveredArticles.length; i++) {  
                     recentHTML += getArticleLinkArticle(discoveryAction.DiscoveredArticles[i]);  
                 }  
					  recentHTML = sanitizecharset(recentHTML);
                 recentList.innerHTML = recentHTML;
			 }
         }
		 
		 function isLoggedIn() {
			var ocCookies = document.cookie.split( ';' );
			var tempCookie = "";
			for(i=0; i < ocCookies.length; i++) {
				tempCookie = ocCookies[i].split('=');
				cookie_name = tempCookie[0].replace(/^\s+|\s+$/g, '');
				
				if(cookie_name == "at") {
					return true;
				}
			}
			return false;
		 }
		 
		 
		 function slLogout() {
			var cookie_date = new Date(2000, 01, 01);
			var ocCookies = document.cookie.split( ';' );
			var tempCookie = "";
			for(i=0; i < ocCookies.length; i++) {
				tempCookie = ocCookies[i].split('=');
				cookie_name = tempCookie[0].replace(/^\s+|\s+$/g, '');
				
				if(cookie_name == "at") {
					document.cookie = "at=;	expires=" + cookie_date.toGMTString() + "; path=/; domain=.eastvalleytribune.com;";
					location.reload(true);
				}
			}
		 }
		 
		 function changeWidgetLinks() {
			var commentsFrame = document.getElementById('commentsiframe');
			var login_text = "You must be logged in to contribute. <a href=\"javascript:parent.scroll(0,0);parent.show_login()\">Login</a> | <a href='javascript:parent.scroll(0,0);parent.show_registration()'>Register</a>";
			if(commentsFrame) {
				var sl_login_text = commentsFrame.contentWindow.document.getElementById('SiteLife_Login');
				if(sl_login_text) {
					sl_login_text.innerHTML = login_text;
				}
			}
			
			var messagesFrame = document.getElementById('messagesiframe');
			if(messagesFrame) {
				var sl_login_text = messagesFrame.contentWindow.document.getElementById('Messages_NewMessageHead');
				if(sl_login_text) {
					sl_login_text.innerHTML = login_text;
				}
			}
			
			var personaFrame = document.getElementById('personaprofileiframe');
			 if(personaFrame) {
				 //personaFrame.style.width = "600px";
				 var editLink = personaFrame.contentWindow.document.getElementById('ProfileEdit_SectionDescription_Link');
				 editLink.style.display = "none";
			 }
		 }
		 
		 function changeForumLinks() {
			if(!isLoggedIn()) {
				var login_btn = document.getElementById('CreateDiscussion1');
				var login_btn2 = document.getElementById('CreateDiscussion2');
				var reg_btn = document.getElementById('A1');
				var add_post_btn = document.getElementById('ForumDiscussionAddPost');
				if(login_btn) {
					login_btn.href = "javascript:scroll(0,0);show_login();";	
				}
				if(login_btn2) {
					login_btn2.href = "javascript:scroll(0,0);show_login();";	
				}
				if(reg_btn) {
					reg_btn.href = "javascript:scroll(0,0);show_registration();";
					reg_att = reg_btn.attributes;
					for(i=0;i<reg_att.length;i++) {
						if(reg_att[i].name == "onclick") {
							reg_att[i].value = "scroll(0,0);show_registration();";
						}
					}
				}
				if(add_post_btn) {
					add_post_btn.href = "javascript:scroll(0,0);show_login();";	
				}
			}

		 }
		 
		 function createArticle(articleid, pageUrl, pageTitle, sectionTitle) { 

            // get form elements and page info   

            var articleKey = new ArticleKey(articleid);
			
			var section = new Section(sectionTitle);
			
			var categories = new Array();

            // create and send request   

            var requestBatch = new RequestBatch();               

            var updateAction = new UpdateArticleAction(articleKey, pageUrl, pageTitle, section);   

            requestBatch.AddToRequest(updateAction);    

            requestBatch.BeginRequest(serverUrl, articleCreated);    

        }   

           

        function articleCreated(responseBatch) {   
            if (responseBatch.Messages[0].Message == "ok") {   
            } 

        }
		
		function getUserInfo(uuId) {
			if(uuId != "") {
				var userKey = new UserKey(uuId);
				var requestBatch = new RequestBatch();
				requestBatch.AddToRequest(userKey);
				requestBatch.BeginRequest(serverUrl, renderUserData);
			}
		}
		 
		function renderUserData(responseBatch) {
			if(responseBatch.Responses.length != 0) {
				var user = responseBatch.Responses[0].User;
				
				var status_links = document.getElementById('status_links');
				var user_messages = document.getElementById('user_messages');
				var avatar = document.getElementById('status_avatar');
				var join_link = document.getElementById('SitelifeJoin');
				var login_link = document.getElementById('SitelifeLogin');
				var buttons = document.getElementById('BillboardButtons');
				
				if(join_link) {
					join_link.style.display = "none";
				}
				if(login_link) {
					login_link.style.display = "none";
				}
				if(buttons) {
					buttons.style.display = "none";
				}
				
				var message_html = "<a href='/share/profiles/?plckPersonaPage=PersonaHome&slid=" + user.UserKey.Key + "&plckUserId=" + user.UserKey.Key + "'>" + user.NumberOfMessages + " messages</a>";
				
				user_messages.innerHTML = message_html;
				avatar.src = user.AvatarPhotoUrl;
				
			}
		}
		
		var aboxArticles = new Array();
		function SubmitListRequest() {
			
			var requestBatch = new RequestBatch();
			
			for(var i=0;i<aboxArticles.length;i++) {
				requestBatch.AddToRequest(new ArticleKey(aboxArticles[i]));
			}
			
			requestBatch.BeginRequest(serverUrl, renderArticleList); 
		}
		
		function renderArticleList(responseBatch) { 

            if (responseBatch.Responses.length == 0) {    

				var commentCount = document.getElementById('articleCommentCount' + articleid);   

                var recommendCount = document.getElementById('articleRecommendCount' + articleid);   

                // update page elements  

				commentCount.style.visibility = 'hidden';

				recommendCount.style.visibility = 'hidden'; 

                commentCount.innerHTML = 0;   

                recommendCount.innerHTML = 0;

            } else {   
			
				for(var i=0;i<responseBatch.Responses.length;i++) {

                // get article from response   

                var article = responseBatch.Responses[i].Article;

                // get page elements   

                var commentCount = document.getElementById('articleCommentCount' + article.ArticleKey.Key);   

                var recommendCount = document.getElementById('articleRecommendCount' + article.ArticleKey.Key);

                // update page elements   

                commentCount.innerHTML = article.Comments.NumberOfComments;   

                recommendCount.innerHTML = article.Recommendations.NumberOfRecommendations;

				var isRecommended = article.Recommendations.CurrentUserHasRecommended;

				if(isRecommended == "True") {

					var recommendLink = document.getElementById('recommendlink' + article.ArticleKey.Key);

					recommendLink.innerHTML = "<span class='Article_Recommended'>Recommended</span>";

				}

				commentCount.style.visibility = 'visible';

				recommendCount.style.visibility = 'visible';
				
				}

            }   

        }
		
		function popUp(URL) {
			day = new Date();
			id = day.getTime();
			eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=300,left = 390,top = 312');");
		}

		function fixURL(URL) {
			URL = URL.replace('index_pluck.php?sty=', 'story/');
			if (URL.indexOf('#') > -1) URL = URL.replace(URL.substr(URL.indexOf('#')), '');
			if (URL.indexOf('?') > -1) URL = URL.replace(URL.substr(URL.indexOf('?')), '');
			return URL;
		}
	
		function fixTitle(title) {
			var title = title.split('|');
			title[0] = (title[0] == 'East Valley Tribune ') ? title[1] : title[0];
			return (title[0].length > 48) ? title[0].substr(0, title[0].substr(0, 45).lastIndexOf(' ')) + '...' : title[0];
		}

		function billboardNav(linktype) {
			var linkbox = document.getElementById(linktype);
			location.href = linkbox.value;
		}
		

function getBillboardLinks(attemptnum) {
if(!attemptnum) attemptnum = 1;
var photolinks = new Array;
var photoimgs = new Array;
var links = document.getElementsByTagName("a");
for(var i=0;i<links.length;i++) {
var thislink = String(links[i]);
var in_array = false;
	if(thislink.match("/share/photo")) {
		for(var j=0;j<photolinks.length;j++) {
			if(photolinks[j] == thislink) {
				in_array = true;
			}
		}
		if(!in_array) {
			photolinks[photolinks.length] = thislink;
		}
	}
}

var images = document.getElementsByTagName("img");
for(var i=0;i<images.length;i++) {
	var thisimage = String(images[i].src);
	if(thisimage.match("sitelife.ocregister.com") && (thisimage.match(".Small.jpg") || thisimage.match(".Small.gif") || thisimage.match(".Small.bmp"))) {
		photoimgs[photoimgs.length] = thisimage;
	}
}

var photo1link = document.getElementById('photo1link');
if (photo1link) photo1link.href = photolinks[0];
var photo2link = document.getElementById('photo2link');
if (photo2link) photo2link.href = photolinks[1];
var photo3link = document.getElementById('photo3link');
if (photo3link) photo3link.href = photolinks[2];

var photo1img = document.getElementById('photo1img');
var photo2img = document.getElementById('photo2img');
var photo3img = document.getElementById('photo3img');
if(isLoggedIn() && photoimgs.length >= 5) {
	if (photo1img) photo1img.src = photoimgs[2];
	if (photo2img) photo2img.src = photoimgs[3];
	if (photo3img) photo3img.src = photoimgs[4];
}
else if(photoimgs.length >= 3) {
	if (photo1img) photo1img.src = photoimgs[0];
	if (photo2img) photo2img.src = photoimgs[1];
	if (photo3img) photo3img.src = photoimgs[2];
}
else {
	if(attemptnum <= 3) {
		attemptnum = attemptnum + 1;
		setTimeout('getBillboardLinks(' + attemptnum + ')', 1000);
	}
}
}

		var showRecommendedOnly = false;
		var orderby = 'TimeStampAscending';
		var oncommentsPage = 1;
		function pullCommentsInitial(orderby, showRecommendedOnly, oncommentsPage) {
			var showreconlylink = document.getElementById('showreconly'); 
			if(showreconlylink) {
				if(showRecommendedOnly) {
					showreconlylink.innerHTML = "Show All Comments";
				}
				else {
					showreconlylink.innerHTML = "Show Recommended Comments Only";
				}
			}
			
			var requestBatch = new RequestBatch();  
			var articleKey = new ArticleKey(articleid);  
			var commentPage = new CommentPage(articleKey, 10, oncommentsPage, orderby);          
			requestBatch.AddToRequest(commentPage);   
			requestBatch.BeginRequest(serverUrl, renderCommentPage); 
		}
		
		function pullComments(orderby, showRecommendedOnly, oncommentsPage) {
			var showreconlylink = document.getElementById('showreconly'); 
			if(showreconlylink) {
				if(showRecommendedOnly) {
					showreconlylink.innerHTML = "Show All Comments";
				}
				else {
					showreconlylink.innerHTML = "Show Recommended Comments Only";
				}
			}
			
			var requestBatch = new RequestBatch();  
			var articleKey = new ArticleKey(articleid);  
			var commentPage = new CommentPage(articleKey, 10, oncommentsPage, orderby);          
			requestBatch.AddToRequest(commentPage);   
			requestBatch.BeginRequest(serverUrl, renderCommentPage); 
			top.location = top.location.href.replace('#slComments', '') + '#slComments';
		}
		
		function renderCommentPage(responseBatch) { 
			if (responseBatch.Responses.length == 0) {  
				alert('Article Not Found.');  
			} else {  
				var commentBlock = document.getElementById('slrenderedComments'); 
				var commentBlockHtml = "<div id='Comments_OuterContainer' class='Comments_Container'><table class='Comments_Table' cellspacing='0' cellpadding='0'>";  
				var commentPage = responseBatch.Responses[0].CommentPage;  
				var total_comments = commentPage.NumberOfComments;
				for(var i=0; i < commentPage.Comments.length; i++) {
					if(commentPage.Comments[i].Author.IsBlocked == "False" && ((showRecommendedOnly && commentPage.Comments[i].NumberOfRecommendations > 0) || !showRecommendedOnly)) {
						commentBlockHtml += getCommentHtml(commentPage.Comments[i]);
					}
				}
				commentBlockHtml += "</table><div class='commentPagination'>";
				var numPages = Math.ceil(total_comments / 10);
				
				if(numPages > 1 && oncommentsPage != 1) {
					commentBlockHtml += 	" <a href='javascript:var oncommentsPage = 1;pullComments(orderby, showRecommendedOnly, 1)'>&lt;&lt;First</a> ";
				}
				
				for(var j=1; j <= numPages; j++) {
					if(j == oncommentsPage) {
						commentBlockHtml += " " + j + " ";	
					}
					else {
						commentBlockHtml += " <a href='javascript:var oncommentsPage = " + j + ";pullComments(orderby, showRecommendedOnly, " + j + ")'>" + j + "</a> ";
					}
				}
				
				if(numPages > 1 && oncommentsPage != numPages) {
					commentBlockHtml += 	" <a href='javascript:var oncommentsPage = " + numPages + ";pullComments(orderby, showRecommendedOnly, " + numPages + ")'>Last&gt;&gt;</a> ";
				}
				commentBlockHtml += "</div></div>";
                   
				
				commentBlock.innerHTML = commentBlockHtml;  
			}  
		}  
          
		function getCommentHtml(comment) {
			var html = "";
			html += '<tr class="Comments_TableRowColor"><td class="Comments_UserImage">';
			html += '<a href="/share/profiles?slid=' + comment.Author.UserKey.Key + '&plckUserId=' + comment.Author.UserKey.Key + '">';
			html += '<img src="' + comment.Author.AvatarPhotoUrl + '" border="0"></a>';
			html += '</td><td class="Comments_TableRight"><div class="Comments_From">';
			html += '<a href="/share/profiles?slid=' + comment.Author.UserKey.Key + '&plckUserId=' + comment.Author.UserKey.Key + '">';
			html += comment.Author.DisplayName + '</a> wrote:</div>';
			html += '<div id="CommentBody" class="Comments_CommentText">' + comment.CommentBody + '</div>';
			html += '<div class="Comments_NestedDate">' + comment.PostedAtTime + '</div>';
			html += '<table class="Comments_NestedTable" cellspacing="0" cellpadding="0"><tr>';
			html += '<td class="Comments_NestedRecommend">';
			if(comment.CurrentUserHasRecommended == "True") {
				html += '<div id="recommend:' + comment.CommentKey.Key + '">';
				html += '<div style="display: inline;"><div class="Recommend_Container">';
				
				html += '<span class="SiteLife_Recommended">Recommended (' + comment.NumberOfRecommendations + ')</span></div></div></div>';
			}
			else {
				html += '<div id="recommend:' + comment.CommentKey.Key + '">';
				html += '<a class="SiteLife_Recommend" onclick="return gSiteLife.PostRecommendation(';
				html += "'Comment', '" + comment.CommentKey.Key + "', 'recommend:" + comment.CommentKey.Key + "', document.title);";
				html += '" href="#none">Recommend</a>(' + comment.NumberOfRecommendations + ')</div>';
			}
			html += '</td><td class="Comments_NestedReport">';
			if(comment.CurrentUserHasReportedAbuse == "True") {
				html += '<div id="rpt_' + comment.CommentKey.Key + '"><div style="display: inline;">';
				html += '<span class="SiteLife_Reported">Reported</span></div></div>';
			}
			else {
				html += '<div id="rpt_' + comment.CommentKey.Key + '"><span>';
				html += '<a id="' + comment.CommentKey.Key + '_RptAbuse" class="SiteLife_ReportAbuse" onclick="ShowReportAbuse(event,document.URL,gSiteLife.__baseUrl + \'/AbuseReport/ReportAbuse?plckElementId=rpt_' + comment.CommentKey.Key + '&plckTargetKey=' + comment.CommentKey.Key + '&plckTargetKeyType=Comment\');';
				html += 'return false;" href="#none">Report Abuse</a></span></div>';
			}
			html += '</td></tr></table></td></tr>';
			return html;  
		} 
