var defaultFuseAction = "vids.ajaxAction"; var defaultMethod = "get"; var url = "/index.cfm"; var pageTypeId = ""; var commentsAction = ""; var addCommentsAction = ""; var lastCommentAuthorId = ""; var deleteCommentAction = ""; var progressBarPath = "http://x.myspace.com/images/myspacetv/progressbar.gif"; function LoginAlert(msg) { if (confirm(msg))
{ new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "ENFORCELOGIN"}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); if (json.ServerResponse.IsRequestSuccessful) {  _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'location', location, 0, 0), 'href', '=', ( json.ServerResponse.DisplayText));} else { alert(json.ServerResponse.DisplayText);}
}
});}
}
function GetMoreVideos(selectedTab) { switch (selectedTab)
{ case "related":
$("morevideos_related").className = "more_from_user"; $("morevideos_user").className = ""; $("morevids_related").style.display = "block"; $("morevids_user").style.display = "none"; break; case "user":
default:
$("morevideos_user").className = "more_from_user"; $("morevideos_related").className = ""; $("morevids_user").style.display = "block"; $("morevids_related").style.display = "none"; break;}
}
function ChannelSubscription(typeId, displayTagId, handlerAction, hash) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: handlerAction, id: typeId, h: hash}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); if (!json.ServerResponse.IsRequestSuccessful)
{ alert(json.ServerResponse.DisplayText);}
else if (displayTagId === "")
{  _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'location', location, 0, 0), 'href', '=', ( url + "?fuseaction=vids.mySubscriptions"));}
else
{ var notice = $(displayTagId); notice.update('<span class="successfulRequest">' + json.ServerResponse.DisplayText + '</span>');}
}
});}
function DeleteVideo(videoId) { if(confirm(Resources.playlist_areyousure))
{ new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "DELETEVIDEO", videoid: videoId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); if (json.ServerResponse.IsRequestSuccessful) {  _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'location', location, 0, 0), 'href', '=', ( url + "?fuseaction=vids.myVideos"));} else { alert(json.ServerResponse.DisplayText);}
}
});}
}
function RemoveFavoriteVideo(videoId) { if(confirm(Resources.playlist_areyousure))
{ new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "DELETEFAVOURITEVIDEO", videoid: videoId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); if (json.ServerResponse.IsRequestSuccessful) {  _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'location', location, 0, 0), 'href', '=', ( url + "?fuseaction=vids.myFavorites"));} else { alert(json.ServerResponse.DisplayText);}
}
});}
}
function SetVideoPublic(videoId) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "SETVIDEOPUBLIC", videoid: videoId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var status = $('videostatus_' + videoId); var notice = $('makeprivate_' + videoId); if (json.ServerResponse.IsRequestSuccessful)
{ status.update(Resources.subscription_public); notice.update("<a href=\"javascript:SetVideoPrivate(" + videoId + ");\">" + Resources.videoitem_makeprivate + "</a>");}
alert(json.ServerResponse.DisplayText);}
});}
function SetVideoPrivate(videoId) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "SETVIDEOPRIVATE", videoid: videoId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var status = $('videostatus_' + videoId); var notice = $('makeprivate_' + videoId); if (json.ServerResponse.IsRequestSuccessful)
{ status.update(Resources.subscription_private); notice.update("<a href=\"javascript:SetVideoPublic(" + videoId + ");\">" + Resources.videoitem_makepublic + "</a>");}
alert(json.ServerResponse.DisplayText);}
});}
function AddToChannel(videoId, displayTagId, hash) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "ADDTOCHANNEL", videoid: videoId, h: hash}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); if (displayTagId === "" || !json.ServerResponse.IsRequestSuccessful)
{ alert(json.ServerResponse.DisplayText);}
else
{ var notice = $(displayTagId); notice.update('<span class="successfulRequest">' + json.ServerResponse.DisplayText + '</span>');}
}
});}
function AddToProfile(videoId, displayTagId, hash) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "ADDTOPROFILE", videoid: videoId, h: hash}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); if (displayTagId === "" || !json.ServerResponse.IsRequestSuccessful)
{ alert(json.ServerResponse.DisplayText);}
else
{ var notice = $(displayTagId);  _proxy_jslib_assign('', notice, 'innerHTML', '=', ( '<span class="successfulRequest">' + json.ServerResponse.DisplayText + '</span>'));}
}
});}
function RemoveFromProfile(videoId, displayTagId, hash) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "REMOVEPROFILEVIDEO", videoid: videoId, h: hash}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); if (displayTagId === "" || !json.ServerResponse.IsRequestSuccessful)
{ alert(json.ServerResponse.DisplayText);}
else
{ var notice = $(displayTagId);  _proxy_jslib_assign('', notice, 'innerHTML', '=', ( '<span class="successfulRequest">' + json.ServerResponse.DisplayText + '</span>'));}
}
});}
function AddToFavorites(videoId, displayTagId, hash) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "SAVETOFAVOURITE", videoid: videoId, h: hash}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var notice = $(displayTagId); if (json.ServerResponse.IsRequestSuccessful) {  _proxy_jslib_assign('', notice, 'innerHTML', '=', ( '<span class="successfulRequest">' + json.ServerResponse.DisplayText + '</span>'));} else { alert(json.ServerResponse.DisplayText);}
}
});}
function FlagVideoAsInappropriate(videoId, displayTagId, hash) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "FLAGVIDEO", videoid: videoId, h: hash}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var notice = $(displayTagId); if (json.ServerResponse.IsRequestSuccessful) { notice.update('<span class="successfulRequest">' + json.ServerResponse.DisplayText + '</span>');} else { alert(json.ServerResponse.DisplayText);}
}
});}
function rateVideo(videoId, displayTagId, hash, choice) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "RATING", videoid: videoId, h: hash, rating: choice}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var notice = $(displayTagId); if (json.ServerResponse.IsRequestSuccessful)
 _proxy_jslib_assign('', notice, 'innerHTML', '=', ( '<span class="successfulRequest">' + json.ServerResponse.DisplayText + '</span>')); else
alert(json.ServerResponse.DisplayText);}
});}
function SetChannelPublic(channelId) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "SETCHANNELPUBLIC", channelid: channelId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var status = $("videostatus"); var notice = $("changevideostatus"); if (json.ServerResponse.IsRequestSuccessful)
{ status.update(Resources.subscription_public); notice.update('<a href="javascript:SetChannelPrivate(' + channelId + ');">' + Resources.videoitem_makeprivate + '</a>'); alert(json.ServerResponse.DisplayText);}
else
{ alert(json.ServerResponse.DisplayText);}
}
});}
function SetChannelPrivate(channelId) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "SETCHANNELPRIVATE", channelid: channelId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var status = $("videostatus"); var notice = $("changevideostatus"); if (json.ServerResponse.IsRequestSuccessful)
{ status.update(Resources.subscription_private); notice.update('<a href="javascript:SetChannelPublic(' + channelId + ');">' + Resources.videoitem_makepublic + '</a>'); alert(json.ServerResponse.DisplayText);}
else
{ alert(json.ServerResponse.DisplayText);}
}
});}
function SetNotificationsOn(channelId) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "SETNOTIFICATIONSON", channelid: channelId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var status = $("notificationstatus"); var notice = $("changenotificationstatus"); if (json.ServerResponse.IsRequestSuccessful)
{ status.update(Resources.subscription_notificationon); notice.update('<a href="javascript:SetNotificationsOff(' + channelId + ');">' + Resources.subscription_turnoff + '</a>'); alert(json.ServerResponse.DisplayText);}
else
{ alert(json.ServerResponse.DisplayText);}
}
});}
function SetNotificationsOff(channelId) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: "SETNOTIFICATIONSOFF", channelid: channelId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var status = $("notificationstatus"); var notice = $("changenotificationstatus"); if (json.ServerResponse.IsRequestSuccessful)
{ status.update(Resources.subscription_notificationoff); notice.update('<a href="javascript:SetNotificationsOn(' + channelId + ');">' + Resources.subscription_turnon + '</a>'); alert(json.ServerResponse.DisplayText);}
else
{ alert(json.ServerResponse.DisplayText);}
}
});}
var CommentPlacement = { ViewVideoTop: 1, ViewVideoBottom: 2, ViewChannelTop: 3, ViewVideoChannelTop: 4, Video_Video: 1, Channel_Channel: 21, Channel_ChannelBeFirst: 22, Channel_Profile: 23, Channel_Video: 24, Home_HotVideo: 41

}; var commentlicious = { posLeft: 0, posTop : 0, captchaURL : "", captchaGuid : "", _hasForm: false, addForm : function() { if (this._hasForm) return; getPageType(); var theBody =  _proxy_jslib_handle(document, 'getElementsByTagName', '', 1, 0)('BODY')[0]; var popcont = document.createElement('div'); popcont.id = 'comment_form'; var popmask = document.createElement('div'); popmask.id = 'popupMask';  _proxy_jslib_assign('', popcont, 'innerHTML', '=', ( "<div id=\"comment_form_inner0\"><div id=\"comment_form_inner1\">"+ "<h2 onmousedown=\"dragStart(event, 'comment_form')\" title=\"" + Resources.comment_title_hover +"\">"+ "<a href=\"#\" onclick=\"return commentlicious.hide(false);\" id=\"hide_button\" title=\"" +Resources.comment_close_hover +"\">X</a>"+Resources.comment_title+"</h2>"+ "<fieldset>"+ "<div id=\"commentArea\">"+ "<label for=\"ajax_comment\">"+Resources.comment_instructions+"</label>"+ "<br /><small>"+Resources.comment_characterremaining+" <span id=\"ajax_comment_length\">250</span></small>"+ "<textarea class=\"commenttext\" name=\"ajax_comment\" id=\"ajax_comment\" rows=\"4\"></textarea>"+ "</div>"+ "<div id=\"comment_form_captcha\" style=\"display: none;\">"+ Resources.captcha_enter_text+ "<img id=\"captchaImg\" src=\"\" />"+ "<a href=\"#\" onclick=\"return commentlicious.refreshCaptcha();\"><img id=\"captchaRefresh\" src=\"http://x.myspace.com/images/icons/refreshicon2.jpg\"></a>"+ "<div id=\"captcha_response\"><input name=\"captcha_text\" id=\"captcha_text\" type=\"text\" size=\"8\" maxlength=\"10\" />&nbsp;<label for=\"captcha_text\">" + Resources.captcha_user_input + "</label></div>"+ "</div>"+ "<div id=\"comment_buttons\">"+ "<input type=\"button\" name=\"addcomment\" id=\"addcomment\" value=\""+Resources.btn_submit+"\" onclick=\"commentlicious.commentSubmitClick();\" />"+ "<input type=\"button\" name=\"cancel\" id=\"cancel\" value=\""+Resources.btn_cancel+"\" onclick=\"commentlicious.hide(false);\" style=\"margin-left:20px;\" />"+ "</div>"+ "</fieldset>"+ "</div></div> "+ "<div id=\"comment_shadow\"> </div> ")); theBody.appendChild(popmask); theBody.appendChild(popcont);  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("ajax_comment").onkeyup= function() { showCharsRemaining("ajax_comment","ajax_comment_length",250);}; this._hasForm = true;}, addEmbeddedForm : function(ele) { if (this._hasForm) return; getPageType(); var popcont = document.createElement('div'); popcont.id = 'embedded_comment_form'; var refreshIcon = MS.Videos.sp + "img/refresh_icon1.gif";  _proxy_jslib_assign('', popcont, 'innerHTML', '=', ( "<div id=\"comment_embedded_inner0\"><div id=\"comment_embedded_inner1\">"+ "<h2 style=\"color:White;\">"+Resources.comment_title+"</h2>"+ "<div style=\"margin-top:5px; padding: 2px 5px 2px 2px;\" id=\"commentArea\">"+ "<label for=\"ajax_comment\">"+Resources.comment_instructions+"</label>"+ "<br /><small>"+Resources.comment_characterremaining+" <span id=\"ajax_comment_length\">250</span></small>"+ "<textarea class=\"commenttext\" name=\"ajax_comment\" id=\"ajax_comment\" rows=\"4\"></textarea>"+ "</div>"+ "<div style=\"margin-top:5px; padding: 5px 5px 2px 2px; display: none;\" id=\"comment_embedded_captcha\" >"+Resources.captcha_enter_text+ "<img id=\"captchaImg\" src=\"\" />"+ "<a href=\"#\" onclick=\"return commentlicious.refreshCaptcha();\"><img id=\"captchaRefresh\" src=\""+refreshIcon+ "\" /></a>"+ "<div id=\"captcha_response\" style=\"margin-left:2px;\" ><input name=\"captcha_text\" id=\"captcha_text\" type=\"text\" size=\"8\" maxlength=\"10\" />&nbsp;<label for=\"captcha_text\">" + Resources.captcha_user_input + "</label></div>"+ "</div>"+ "<div id=\"comment_embedded_buttons\">"+ "<input type=\"button\" class=\"comment_btn\" id=\"addcomment\" value=\""+Resources.btn_submit+"\" onclick=\"commentlicious.commentSubmitClick();\" onmouseover=\"this.className='comment_btn btnhov';\" onmouseout=\"this.className='comment_btn'\" />"+ "<input type=\"button\" class=\"comment_btn\" id=\"cancel\" value=\""+Resources.btn_cancel+"\" onclick=\"commentlicious.hide(false);\" style=\"margin-left:20px;\" onmouseover=\"this.className='comment_btn btnhov';\" onmouseout=\"this.className='comment_btn'\" />"+ "</div>"+ "</div></div> ")); new (Insertion.After)(ele,  _proxy_jslib_handle(popcont, 'innerHTML', '', 0, 0));  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("ajax_comment").onkeyup= function() {showCharsRemaining("ajax_comment","ajax_comment_length",250);}; this._hasForm = true;}, getCoords: function(me) { var e = me; this.posLeft= 0; this.posTop = 0; while(e){ this.posLeft+=e.offsetLeft; this.posTop+=e.offsetTop; e=e.offsetParent;}
}, showForm: function( placement, me, elementId ) { if(!elementId) { this.getCoords(me); if ((placement == CommentPlacement.ViewVideoTop) || (placement == CommentPlacement.ViewVideoBottom) || (placement == CommentPlacement.Video_Video)){ this.posTop += 10; this.posLeft += 15;} else if (placement == CommentPlacement.ViewVideoChannelTop){ this.posTop += 70; this.posLeft += 15;} else if (placement == CommentPlacement.Channel_Channel){ this.posTop = this.posTop + ((this.posTop < 250)?10:-80); this.posLeft -= 410;} else if (placement == CommentPlacement.Channel_ChannelBeFirst){ this.posTop = this.posTop + ((this.posTop < 250)?-40:-170); this.posLeft += 15;}
return this.show(this.posTop,this.posLeft);} else { var ele = $("comments_header"); return this.showEmbeddedForm(ele);}
}, show: function(top,left) { if (!this._hasForm) this.addForm(); $("commentArea").style.display = "block"; var h =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("comment_form"); h.style.position = "absolute";  _proxy_jslib_assign('', h.style, 'top', '=', (  _proxy_jslib_handle(null, 'top', top, 0, 0)+"px")); h.style.left = left+"px"; h.style.display = "block";  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("ajax_comment").focus(); this.getCaptchaData(); return false;}, showEmbeddedForm: function(element) { if (!this._hasForm) { this.addEmbeddedForm(element);} else { $("comment_embedded_inner0").show();}
$("commentArea").show();  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("ajax_comment").focus(); this.getCaptchaData(); return false;}, hide: function() { var embeddedForm = $("comment_embedded_inner0"); if(embeddedForm) { embeddedForm.hide(); $("comment_embedded_captcha").hide();} else { var theBody =  _proxy_jslib_handle(document, 'getElementsByTagName', '', 1, 0)("BODY")[0]; theBody.style.overflow = ""; $("popupMask").style.display = "none"; $("comment_form").style.display = "none"; $("comment_form_captcha").hide();}
 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("ajax_comment"), 'value', '=', ( ""));  _proxy_jslib_assign('', $("ajax_comment_length"), 'innerHTML', '=', ( "250")); $("addcomment").onclick = function onclick(event) { commentlicious.commentSubmitClick();};  _proxy_jslib_assign('', $("captcha_text"), 'value', '=', ( ""));  _proxy_jslib_assign('', $("captchaImg"), 'src', '=', ( "")); this.captchaURL = ""; this.captchaGuid = ""; return false;}, commentSubmitClick: function() { var commentBody =  _proxy_jslib_handle($("ajax_comment"), 'value', '', 0, 0); if ($("posterId"))
lastCommentAuthorId =  _proxy_jslib_handle($("posterId"), 'innerHTML', '', 0, 0); if (commentBody.length === 0)
{ alert(Resources.comment_error1); $("ajax_comment").focus(); return false;}
if (commentBody.length > 250)
{ alert(Resources.comment_error2); $("ajax_comment").focus(); return false;}
if (this.captchaURL === "")
{ AddCommentWithCaptchaClick(commentBody, "", "");}
else
{ $("addcomment").onclick = function onclick(event) { commentlicious.captchaSubmitClick();}; this.showCaptcha();}
}, captchaSubmitClick: function() { var userCaptchaValue =  _proxy_jslib_handle($("captcha_text"), 'value', '', 0, 0); if (userCaptchaValue === "" || userCaptchaValue.length === 0)
{ alert(Resources.captcha_not_valid ); $("captcha_text").focus();}
else
{ AddCommentWithCaptchaClick( _proxy_jslib_handle($("ajax_comment"), 'value', '', 0, 0), userCaptchaValue, this.captchaGuid);}
}, showCaptcha: function() { $("commentArea").hide(); if($("comment_form_captcha"))
$("comment_form_captcha").style.display = "block"; if($("comment_embedded_captcha"))
$("comment_embedded_captcha").show();  _proxy_jslib_assign('', $("captchaImg"), 'src', '=', ( this.captchaURL));  _proxy_jslib_assign('', $("captcha_text"), 'value', '=', ( "")); $("captcha_text").focus();}, refreshCaptcha: function() { this.getCaptchaData(); this.showCaptcha(); return false;}, getCaptchaData: function() { var uidValue = new (Date)().getMilliseconds(); new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: captchaTypeCheck, uid: uidValue}, onComplete: function(transport) { this.setCaptchaData(transport);}.bind(this)

});}, setCaptchaData: function(transport) { var json = transport.responseText.evalJSON(); this.captchaURL = json.ServerResponse.CaptchaUrl; this.captchaGuid = json.ServerResponse.CaptchaGuid;}
}; function ShowCommentForm(placement, me, element) { return commentlicious.showForm(placement, me, element);}
function DeleteComment(commentId) { getPageType(); if (confirm(Resources.Comments_DeleteConfirm))
{ new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: deleteCommentAction, id: pageTypeId, commentid: commentId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); if (json.ServerResponse.IsRequestSuccessful)
{ CommentsPageClick(PagingContext.currentPage); PagingContext.totalRows = PagingContext.totalRows - 1;}
else
{ alert(json.ServerResponse.DisplayText);}
}
});}
}
function MarkAsSpam(commentId) { getPageType(); if (confirm(Resources.Comments_ConfirmMarkAsSpam))
{ new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: markAsSpamAction, id: pageTypeId, commentid: commentId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); alert(json.ServerResponse.DisplayText); controlToHide =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(commentId).getElementsByClassName('markAsSpam'); controlToHide[0].style.visibility = 'hidden';}
});}
}
function AddCommentWithCaptchaClick(commentBody, captcha, guid) { new (Ajax.Request)(url, { method: defaultMethod, parameters: {fuseaction: defaultFuseAction, action: addCommentsAction, id: pageTypeId, body: commentBody, ctext: captcha, cguid: guid, lcaid: lastCommentAuthorId}, onSuccess: function(transport) { var json = transport.responseText.evalJSON(); if (json.ServerResponse.IsRequestSuccessful)
{ commentlicious.hide(); CommentsPageClick(0); PagingContext.totalRows = PagingContext.totalRows + 1; if ($('hypFirstComment') !== null)
$('hypFirstComment').style.display = "none"; if ($("firstCommentRow") !== null)
$("firstCommentRow").style.display = "none";}
else
{ if (json.ServerResponse.CaptchaUrl !== null)
{ commentlicious.captchaURL = json.ServerResponse.CaptchaUrl; commentlicious.captchaGuid = json.ServerResponse.CaptchaGuid; alert(json.ServerResponse.DisplayText); commentlicious.showCaptcha();}
else
{ commentlicious.hide(); alert(json.ServerResponse.DisplayText);}
}
}
});}
function getPageType() { try
{ pageTypeId = ChannelID; commentsAction = "GETCHANNELCOMMENTS"; addCommentsAction = "ADDCHANNELCOMMENTWITHCAPTCHA"; deleteCommentAction = "DELETECHANNELCOMMENT"; captchaTypeCheck = "CHECKWHETHERTODISPLAYCAPTCHAFORCHANNEL"; markAsSpamAction = "MARKCHANNELCOMMENTASSPAM";}
catch(e)
{ pageTypeId = videoID; commentsAction = "GETVIDEOCOMMENTS"; addCommentsAction = "ADDVIDEOCOMMENTWITHCAPTCHA"; deleteCommentAction = "DELETEVIDEOCOMMENT"; captchaTypeCheck = "CHECKWHETHERTODISPLAYCAPTCHA"; markAsSpamAction = "MARKVIDEOCOMMENTASSPAM";}
}
function CommentsPageClick(p) { getPageType(); new (commentsData)(p); return false;}
var commentsData = Class.create(); commentsData.prototype = { requestedPageNumber: 1, currentPageNumber: 2, lastCommentId: 1, firstCommentId: 1, pageSize: 10, commentsTable: 1, initialize: function(p) { this.currentPageNumber = p + 1; this.requestedPageNumber = PagingContext.currentPage + 1; this.commentsTable = $("tblComments").tBodies[0]; this.getNewData();}, getNewData: function() { if (this.commentsTable.rows.length > 0)
{ this.firstCommentId = this.commentsTable.rows[0].id; this.lastCommentId =  _proxy_jslib_handle(this.commentsTable.rows, ((this.commentsTable.rows.length) - 1), 0, 0).id;}
var showNewData = this.showNewData.bind(this); new (Ajax.Request)(url, { method: defaultMethod, parameters:
{ fuseaction: defaultFuseAction, action: commentsAction, id: pageTypeId, rpn: this.requestedPageNumber, cpn: this.currentPageNumber, lcid: this.lastCommentId, fcid: this.firstCommentId, ps: this.pageSize

}, onSuccess: showNewData

});}, showNewData: function(transport) { var json = transport.responseText.evalJSON(); this.clearExistingData(this.commentsTable); this.makePaging(); for (var i = 0; i < json.Comments.length; i++)
{ this.insertComment( _proxy_jslib_handle(json.Comments, (i), 0, 0), json.HasCommentOptions);}
wordBreakerDoComments();}, clearExistingData: function(tbody) { while (tbody.rows.length > 0)
{ tbody.deleteRow(0);}
}, makePaging: function() { PagingContext.currentPage = this.currentPageNumber - 1; PagingContext.startRow = 1 + PagingContext.currentPage * PagingContext.pageSize; var outStr = makePaging();  _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("PagingHeader"), 'innerHTML', '=', ( outStr));  _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("PagingFooter"), 'innerHTML', '=', ( outStr));}, insertComment: function(obj, hasCommentOptions) { if ($("firstCommentRow")){ $("firstCommentRow").style.display = "none";}
{var _proxy_jslib_with_objs= [] ;with (_proxy_jslib_with_objs[_proxy_jslib_with_objs.length]= (obj.Comment))
{ var cells = ""; var opts = ""; var tblRow = document.createElement("TR"); var tdFriend = document.createElement("TD"); var tdComment = document.createElement("TD"); if (hasCommentOptions){ opts = String.format( "<ul class=\"commentTools\">"+ "<li><a class=\"deleteComment\" href=\"javascript:DeleteComment({0});\" title=\"{1}\">{2}</a></li>"+ "<li><a class=\"postBackComment\" href=\"#\" title=\"{3}\">{4}</a></li>"+ "<li><a class=\"sendMessage\" href=\"#\" title=\"{5}\">{6}</a></li>"+ "</ul>", CommentID, Resources.tooltip_DeleteComment, Resources.link_DeleteComment, Resources.tooltip_PostBackComment, Resources.link_PostBackComment, Resources.tooltip_SendMessage, Resources.link_SendMessage );} else if (commentTool_EnableDeleteMine && (MySpace.ClientContext.UserId == AuthorID)){ opts = String.format( "<ul class=\"commentTools\">"+ "<li><a class=\"deleteComment\" href=\"javascript:DeleteComment({0});\" title=\"{1}\">{2}</a></li>"+ "</ul>", CommentID, Resources.tooltip_DeleteComment, Resources.link_DeleteComment );} else if (MySpace.ClientContext.IsLoggedIn && commentTool_EnableMarkAsSpam){ opts = String.format( "<ul class=\"commentTools\">"+ "<li><a class=\"markAsSpam\" href=\"javascript:MarkAsSpam({0});\" title=\"{1}\">{2}</a></li>"+ "</ul>", CommentID, Resources.tooltip_MarkAsSpam, Resources.link_MarkAsSpam );}
tdFriend.className = "poster";  _proxy_jslib_assign('', tdFriend, 'innerHTML', '=', ( String.format( "<a href=\"{0}\"><div class=\"friendName\">{1}</div><img src=\"{2}\" class=\"friendPicture\" /></a>", ChannelURL, DisplayName, PicSrc ))); tdComment.className = "comment";  _proxy_jslib_assign('', tdComment, 'innerHTML', '=', ( String.format( "<p class=\"posting_date\">{0}</p><div>{1}</div>{2}", PostingDate, Body, opts ))); tblRow.id = CommentID; tblRow.appendChild(tdFriend); tblRow.appendChild(tdComment); this.commentsTable.appendChild(tblRow);}; _proxy_jslib_with_objs.length-- ;}
}
}; function SortedVideosClick(cid, sb, objLink) { new (videosData)(cid, sb, objLink); return false;}
var videosData = Class.create(); videosData.prototype = { channelId: 1, startPage: 1, numOfRecords: 20, sortBy: 5, dateTimePeriod: "all", videosTable: 1, selectedLink: "", initialize: function(cid, sb, objLink) { this.channelId = cid; this.sortBy = sb; this.selectedLink = objLink; this.videosTable = $("myVideosList").tBodies[0]; this.getNewData();}, getNewData: function() { var showNewData = this.showNewData.bind(this); new (Ajax.Request)(url, { method: defaultMethod, parameters:
{ fuseaction: defaultFuseAction, action: "GETSORTEDVIDEOS", channelid: this.channelId, sp: this.startPage, nor: this.numOfRecords, sb: this.sortBy, f: this.dateTimePeriod

}, onSuccess: showNewData

});}, showNewData: function(transport) { var json = transport.responseText.evalJSON(); this.clearExistingData(this.videosTable); for (var i = 0; i < json.Videos.length; i++)
{ this.insertVideoRow( _proxy_jslib_handle(json.Videos, (i), 0, 0), i);}
this.setLinksStyle(); wordBreakerVideoDescription();}, clearExistingData: function(tbody) { while (tbody.rows.length > 0)
{ tbody.deleteRow(0);}
}, setLinksStyle: function() { var sortedLinksCollection =  _proxy_jslib_handle($('myVideosSortingLinks'), 'getElementsByTagName', '', 1, 0)('a'); for (var i = 0; i < sortedLinksCollection.length; i++)
{ {var _proxy_jslib_with_objs= [] ;with (_proxy_jslib_with_objs[_proxy_jslib_with_objs.length]= ( _proxy_jslib_handle(sortedLinksCollection, (i), 0, 0).style))
{ color = ''; textDecoration = 'underline';  cursor= _proxy_jslib_with_assign_rval(_proxy_jslib_with_objs, '', 'cursor', '=', ( 'pointer'), cursor);}; _proxy_jslib_with_objs.length-- ;}
}
{var _proxy_jslib_with_objs= [] ;with (_proxy_jslib_with_objs[_proxy_jslib_with_objs.length]= (this.selectedLink.style))
{ color = '#000000'; textDecoration = 'none';  cursor= _proxy_jslib_with_assign_rval(_proxy_jslib_with_objs, '', 'cursor', '=', ( 'text'), cursor);}; _proxy_jslib_with_objs.length-- ;}
}, insertVideoRow: function(obj, counter) { if (counter % 2 === 0)
{ this.insertVideoCell(true, obj, counter);}
else
{ this.insertVideoCell(false, obj, counter);}
}, insertVideoCell: function(isNewRow, obj, counter) { var tdCell1 = document.createElement("TD"); var tdCell2 = document.createElement("TD"); var divTag1 = document.createElement("DIV"); var divTag2 = document.createElement("DIV"); var divTag3 = document.createElement("DIV"); var divTag4 = document.createElement("DIV"); var aTag = document.createElement("A"); var aTag2 = document.createElement("A"); var h2Tag = document.createElement("H2"); {var _proxy_jslib_with_objs= [] ;with(_proxy_jslib_with_objs[_proxy_jslib_with_objs.length]= (obj.Video))
{ aTag.className = "video_picture";  _proxy_jslib_assign('', aTag, 'href', '=', ( VideoURL));  _proxy_jslib_assign('', aTag, 'innerHTML', '=', ( "<img src='" + PicSrc + "' />"));  _proxy_jslib_assign('', aTag2, 'innerHTML', '=', ( Title));  _proxy_jslib_assign('', aTag2, 'href', '=', ( VideoURL)); tdCell1.className = "video_still"; tdCell1.appendChild(aTag); tdCell2.className = "video_info"; h2Tag.className = "title"; h2Tag.appendChild(aTag2); divTag1.className = "text";  _proxy_jslib_assign('', divTag1, 'innerHTML', '=', ( "<strong>" + Runtime + "</strong>")); divTag2.className = "description";  _proxy_jslib_assign('', divTag2, 'innerHTML', '=', ( Description)); divTag3.className = "rating";  _proxy_jslib_assign('', divTag3, 'innerHTML', '=', ( Resources.rating + ": <strong>" + Rating + "%</strong>")); divTag4.className = "text";  _proxy_jslib_assign('', divTag4, 'innerHTML', '=', ( "<span>" + Resources.added + ": " + DateAdded + "</span>"));  _proxy_jslib_assign('', divTag4, 'innerHTML', '+=', ( "<br /><span>" + Resources.plays + ": " + Plays + "</span>"));  _proxy_jslib_assign('', divTag4, 'innerHTML', '+=', ( "<br /><span>" + Resources.comments + ": " + Comments + "</span>"));}; _proxy_jslib_with_objs.length-- ;}
tdCell2.appendChild(h2Tag); tdCell2.appendChild(divTag1); tdCell2.appendChild(divTag2); tdCell2.appendChild(divTag3); tdCell2.appendChild(divTag4); if (isNewRow)
{ var tblRow = document.createElement("TR"); tblRow.appendChild(tdCell1); tblRow.appendChild(tdCell2); this.videosTable.appendChild(tblRow);}
else
{ var tblRow =  _proxy_jslib_handle(this.videosTable.rows, ((this.videosTable.rows.length) - 1), 0, 0); tblRow.appendChild(tdCell1); tblRow.appendChild(tdCell2);}
if (counter % 2 === 0)
this.videosTable.appendChild(tblRow);}
};  ;
_proxy_jslib_flush_write_buffers() ;