var COMMENT_CLASS_NAME_ROWCOMMENTS="rowComments";var COMMENT_CLASS_NAME_HEADER="header";var COMMENT_CLASS_NAME_HEADERUSER="headerUser";var COMMENT_CLASS_NAME_HEADERDATE="headerDate";var COMMENT_CLASS_NAME_USERTEXT="userText";var COMMENT_CLASS_NAME_DATETEXT="dateText";var COMMENT_CLASS_NAME_DELETE_COMMENT="deleteComment";var COMMENT_CLASS_NAME_COMMENTTEXT="contentText";var TEXT_COMMENT="Comments";var TEXT_ADD_COMMENT_CONTENT="Write a comment.";var TEXT_ADD_COMMENT_USER_LOGGED="You need to be logged.";var ELEMENT_DISPLAY_NONE_PROPERTY="none";var HTML_ELEMENT_B="b";var HTML_ELEMENT_A="a";var HTML_ELEMENT_IMG="img";function allComments(){var h;var f;var g;var k;var a;var n;var e;var l;var d;var b;var j;var m;var c}allComments.prototype.start=function(a){this.pPageNumber=1;this.pReferId=a;this.pAllComment=this;this.LoadComments()};allComments.prototype.LoadComments=function(){var c=$get(this.pAllComment._DIV_COMMENTS);var b=document.createElement("div");b.className="loadingChannel";var h=document.createElement("img");h.src="img/progress.gif";b.appendChild(h);c.appendChild(b);this.pAllComment.CreateAddCommentButton();var d=parseInt(this.pAllComment._COMMENTS_BY_PAGE);this.pAllComment.pageSelected=this.pPageNumber;if(this.pUsedButton!=undefined){this.pAllComment.pUsedButton=this.pUsedButton}if(this.pAllComment._COMMENTS_TYPE_ID>0){var f;var j=-1;if(this.pAllComment._CMB_AVERAGE_VOTE){f=$get(this.pAllComment._CMB_AVERAGE_VOTE);if(f){j=parseInt(f.value)}}SBR.TV.Website.WebServices.WebServiceProxy.GetComments(this.pAllComment.pReferId,this.pAllComment._COMMENTS_TYPE_ID,d,this.pPageNumber,this.pAllComment._PROVIDE_USER_KEY,j,g,e,this.pAllComment)}function g(l,t){var m=$get(t._DIV_COMMENTS);var x=$get(t._LABEL_QUANTITY);var o=$get(t._DIV_PAGES_COMMENTS);var D=$get(t._DIV_QUERY_VOTE);var y;var z;var k;var v;var q;var u;var H;var r=true;var A=0;var n=0;var E=0;var G=0;var F=0;if(m&&x){m.innerHTML=STRING_EMPTY;if(l.length>0){D.style.display="block";F=l.length-1;n=parseInt(l[0].Total);E=parseInt(t._COMMENTS_BY_PAGE);G=Math.ceil(n/E);if(G<=1){m.style.height=""}for(var B=0;B<=F;B++){y=l[B];z=document.createElement(HTML_ELEMENT_DIV);z.className=COMMENT_CLASS_NAME_ROWCOMMENTS;k=document.createElement(HTML_ELEMENT_DIV);k.className=COMMENT_CLASS_NAME_HEADER;v=document.createElement(HTML_ELEMENT_DIV);v.className=COMMENT_CLASS_NAME_HEADERUSER;q=document.createElement(HTML_ELEMENT_DIV);q.className=COMMENT_CLASS_NAME_HEADERDATE;objB=document.createElement(HTML_ELEMENT_B);objB.className=COMMENT_CLASS_NAME_USERTEXT;if(y.Owner&&y.Owner.UserName){objB.innerHTML+='<a class="userText" href="channel-'+y.Owner.ForumUserId+"-"+y.Owner.UserName+'.html">'+y.Owner.UserName+"</a> <br />"}else{objB.innerHTML=STRING_EMPTY}v.appendChild(objB);k.appendChild(v);objB=document.createElement(HTML_ELEMENT_B);objB.className=COMMENT_CLASS_NAME_DATETEXT;if(y.CreateDate){objB.innerHTML=t.getDateCommentFormat(y.CreateDate)}else{objB.innerHTML=STRING_EMPTY}q.appendChild(objB);k.appendChild(q);objDivHands=document.createElement(HTML_ELEMENT_DIV);objDivHands.className="channelHandsOption";t.CreateHands(objDivHands,t,y);k.appendChild(objDivHands);if(t._SHOW_ADMIN_OPTIONS){u=document.createElement(HTML_ELEMENT_DIV);u.className="channelCommentOption";btnEliminateComment=document.createElement(HTML_ELEMENT_A);btnEliminateComment.className=COMMENT_CLASS_NAME_DELETE_COMMENT;btnEliminateComment.innerHTML="Delete";btnEliminateComment.onclick=a;btnEliminateComment.pCommentId=parseInt(y.CommentId);btnEliminateComment.pAllComment=t;u.appendChild(btnEliminateComment);k.appendChild(u)}else{if(t._PROVIDE_USER_KEY&&t._PROVIDE_USER_KEY.length>0&&t._PROVIDE_USER_KEY==y.Owner.UserId){u=document.createElement(HTML_ELEMENT_DIV);u.className="channelCommentOption";btnEliminateComment=document.createElement(HTML_ELEMENT_A);btnEliminateComment.className=COMMENT_CLASS_NAME_DELETE_COMMENT;btnEliminateComment.innerHTML="Delete";btnEliminateComment.onclick=a;btnEliminateComment.pCommentId=parseInt(y.CommentId);btnEliminateComment.pAllComment=t;u.appendChild(btnEliminateComment);k.appendChild(u)}}z.appendChild(k);H=document.createElement(HTML_ELEMENT_DIV);H.className="commentContent";objP=document.createElement(HTML_ELEMENT_P);objP.className=COMMENT_CLASS_NAME_COMMENTTEXT;if(y.Content){objP.innerHTML=y.Content}else{objP.innerHTML=STRING_EMPTY}H.appendChild(objP);z.appendChild(H);m.appendChild(z);A++}}else{var C;var w=-1;if(t._CMB_AVERAGE_VOTE){C=$get(t._CMB_AVERAGE_VOTE);if(C){w=parseInt(C.value)}}if(w==-1){D.style.display="none"}}if(m.style.height==""){m.style.height=m.offsetHeight+"px"}x.innerHTML=TEXT_COMMENT+"("+n+")";o.innerHTML=STRING_EMPTY;if(n>parseInt(t._COMMENTS_BY_PAGE)){o.style.display="block";if(t._LAST_INDEX_PAGE==-1){if(parseInt(t._PAGES_TO_SHOW)<G){t._LAST_INDEX_PAGE=parseInt(t._PAGES_TO_SHOW)}else{t._LAST_INDEX_PAGE=G}}else{if(t.pUsedButton!=undefined){switch(t.pUsedButton){case 1:if((t._FIRST_INDEX_PAGE-parseInt(t._PAGES_TO_SHOW))>=1){t._FIRST_INDEX_PAGE=t._FIRST_INDEX_PAGE-parseInt(t._PAGES_TO_SHOW);t._LAST_INDEX_PAGE=t._LAST_INDEX_PAGE-parseInt(t._PAGES_TO_SHOW)}else{t._FIRST_INDEX_PAGE=1;if(parseInt(t._PAGES_TO_SHOW)<G){t._LAST_INDEX_PAGE=parseInt(t._PAGES_TO_SHOW)}else{t._LAST_INDEX_PAGE=G}}break;case 2:if((t._LAST_INDEX_PAGE+parseInt(t._PAGES_TO_SHOW))<=G){t._FIRST_INDEX_PAGE=t._FIRST_INDEX_PAGE+parseInt(t._PAGES_TO_SHOW);t._LAST_INDEX_PAGE=t._LAST_INDEX_PAGE+parseInt(t._PAGES_TO_SHOW)}else{t._FIRST_INDEX_PAGE=(G-parseInt(t._PAGES_TO_SHOW))+1;t._LAST_INDEX_PAGE=G}break}}}t.CreatePages(t._FIRST_INDEX_PAGE,t._LAST_INDEX_PAGE,G,t.pageSelected)}else{m.style.height="";o.style.display="none"}}}allComments.prototype.CreateHands=function(k,l,m){objDivDownHand=document.createElement(HTML_ELEMENT_DIV);objDivUpHand=document.createElement(HTML_ELEMENT_DIV);objDivHandMsg=document.createElement(HTML_ELEMENT_DIV);objDivPointsDownHand=document.createElement(HTML_ELEMENT_DIV);objDivPointsDownHand.className="pointdownHand";objDivPointsDownHand.innerHTML=m.PoorComment;objDivDownHand.className="downHandOut";if(l._PROVIDE_USER_KEY&&l._PROVIDE_USER_KEY.length>0&&m.UserVoted==0){objDivDownHand.onmouseover=l.downHandMouseOver;objDivDownHand.onmouseout=l.downHandMouseOut;objDivDownHand.onclick=l.downHandMouseClick;objDivDownHand.handUp=objDivUpHand;objDivDownHand.pCommentId=parseInt(m.CommentId);objDivDownHand.divMsg=objDivHandMsg;objDivDownHand.divPoint=objDivPointsDownHand;objDivDownHand.createdBy=l._PROVIDE_USER_KEY}objDivPointsUpHand=document.createElement(HTML_ELEMENT_DIV);objDivPointsUpHand.className="pointUpHand";if(m.GoodComment==0){objDivPointsUpHand.innerHTML=m.GoodComment}else{objDivPointsUpHand.innerHTML="+"+m.GoodComment}objDivUpHand.className="upHandOut";if(l._PROVIDE_USER_KEY&&l._PROVIDE_USER_KEY.length>0&&m.UserVoted==0){objDivUpHand.onmouseover=l.upHandMouseOver;objDivUpHand.onmouseout=l.upHandMouseOut;objDivUpHand.onclick=l.upHandMouseClick;objDivUpHand.handDown=objDivDownHand;objDivUpHand.pCommentId=parseInt(m.CommentId);objDivUpHand.divMsg=objDivHandMsg;objDivUpHand.divPoint=objDivPointsUpHand;objDivUpHand.createdBy=l._PROVIDE_USER_KEY}objDivHandMsg.className="msgHand";objDivHandMsg.innerHTML="";if(l._PROVIDE_USER_KEY&&l._PROVIDE_USER_KEY.length>0){if(m.UserVoted==1){k.onmouseover=l.handSingInMsg;k.onmouseout=l.handClearMsg;k.divMgs=objDivHandMsg;k.msgToDisplay="You have already voted"}}else{k.onmouseover=l.handSingInMsg;k.onmouseout=l.handClearMsg;k.divMgs=objDivHandMsg;k.msgToDisplay="Please sign in"}k.appendChild(objDivPointsDownHand);k.appendChild(objDivDownHand);k.appendChild(objDivPointsUpHand);k.appendChild(objDivUpHand);k.appendChild(objDivHandMsg)};allComments.prototype.handSingInMsg=function(){if(this.divMgs){this.divMgs.innerHTML=this.msgToDisplay}};allComments.prototype.handClearMsg=function(){if(this.divMgs){this.divMgs.innerHTML=""}};allComments.prototype.downHandMouseOver=function(){this.className="downHandMouserOver";this.title="Poor comment";return false};allComments.prototype.downHandMouseOut=function(){this.className="downHandOut";this.title="";return false};allComments.prototype.downHandMouseClick=function(){var k;this.className="downHandMouserOver";this.divMsg.innerHTML="Thanks for voting";this.style.cursor="default";k=parseInt(this.divPoint.innerHTML);this.divPoint.innerHTML=k+-1;this.onmouseover=null;this.onmouseout=null;this.onclick=null;if(this.handUp){this.handUp.onmouseover=null;this.handUp.onmouseout=null;this.handUp.onclick=null}SBR.TV.Website.WebServices.WebServiceProxy.InsertVote(1,0,this.pCommentId,this.createdBy);return false};allComments.prototype.upHandMouseOver=function(){this.className="upHandOver";this.title="Good comment";return false};allComments.prototype.upHandMouseOut=function(){this.className="upHandOut";this.title="";return false};allComments.prototype.upHandMouseClick=function(){var k;this.className="upHandOver";this.divMsg.innerHTML="Thanks for voting";this.style.cursor="default";k=parseInt(this.divPoint.innerHTML);this.divPoint.innerHTML="+"+(k+1);this.onmouseover=null;this.onmouseout=null;this.onclick=null;if(this.handDown){this.handDown.onmouseover=null;this.handDown.onmouseout=null;this.handDown.onclick=null}SBR.TV.Website.WebServices.WebServiceProxy.InsertVote(1,1,this.pCommentId,this.createdBy);return false};function a(){var k=0;if(this.pCommentId&&this.pAllComment){var l=new Array(DeleteComment,this.pCommentId,this.pAllComment);sbrAlertShow("Delete","Are you sure you wish to delete this comment?",300,SBR.TV.Communication.Objects.AlertType.CONFIRM,l,null,null)}return false}allComments.prototype.getDateCommentFormat=function(n){var l=new Date();diff=new Date();diff.setTime(Math.abs(l.getTime()-n.getTime()));var m=diff.getTime();var k="";years=Math.floor(m/(1000*60*60*24*7*4*12));m-=years*(1000*60*60*24*7*4*12);months=Math.floor(m/(1000*60*60*24*7*4));m-=months*(1000*60*60*24*7*4);weeks=Math.floor(m/(1000*60*60*24*7));m-=weeks*(1000*60*60*24*7);days=Math.floor(m/(1000*60*60*24));m-=days*(1000*60*60*24);hours=Math.floor(m/(1000*60*60));m-=hours*(1000*60*60);mins=Math.floor(m/(1000*60));m-=mins*(1000*60);secs=Math.floor(m/1000);m-=secs*1000;if(years>0){k=years+" years ago"}else{if(months>0){k=months+" months ago"}else{if(weeks>0){k=weeks+" weeks ago"}else{if(days>0){k=days+" days ago"}else{if(hours>0){k=hours+" hours ago"}else{if(mins>0){k=mins+" mins ago"}else{if(secs>0){k=secs+" secs ago"}else{k="Last comment"}}}}}}}return"("+k+")"};allComments.prototype.CreatePages=function(r,m,q,o){var n=$get(this._DIV_PAGES_COMMENTS);var l;var k;if(n){if(r>1){k=document.createElement(HTML_ELEMENT_A);k.className="previusPages";k.innerHTML="&nbsp;&nbsp;";k.onclick=this.LoadComments;k.pPageNumber=r-1;k.pReferId=parseInt(this.pReferId);k.pUsedButton=1;k.pAllComment=this;n.appendChild(k)}for(l=r;l<=m;l++){k=document.createElement(HTML_ELEMENT_A);k.innerHTML=l;if(l==o){k.className="pageSelected"}else{k.className="page"}k.onclick=this.LoadComments;k.onmousedown=False;k.pPageNumber=l;k.pReferId=parseInt(this.pReferId);k.pUsedButton=-1;k.pAllComment=this;n.appendChild(k)}if(m<q){k=document.createElement(HTML_ELEMENT_A);k.className="nextPages";k.innerHTML="&nbsp;&nbsp;";k.onclick=this.LoadComments;k.pPageNumber=m+1;k.pReferId=parseInt(this.pReferId);k.pUsedButton=2;k.pAllComment=this;n.appendChild(k)}}};function e(l,k){alert("The process failure (Load comments)... please try again later.")}};function DeleteComment(d,a){var c=0;if(d){c=parseInt(d);SBR.TV.Website.WebServices.WebServiceProxy.DeleteComment(c,b,e,a)}function b(g,f){f.pAllComment=f;f.pPageNumber=1;f.pReferId=parseInt(f.pReferId);f.LoadComments()}function e(f){alert("The process failure (delete comment)... please try again later.")}return false}allComments.prototype.CreateAddCommentButton=function(){var b=$get(this._DIV_ADD_COMMENT);var a=$get(this._TEXTBOX_NEW_COMMENT);var c;if(b){b.innerHTML=STRING_EMPTY;c=document.createElement(HTML_ELEMENT_A);c.innerHTML="Add |";c.onclick=AddNewComment;c.pAllComment=this;c.href="#";b.appendChild(c)}if(this._PROVIDE_USER_KEY.length==0){a.disabled=true;a.value=TEXT_ADD_COMMENT_USER_LOGGED;c.style.display=ELEMENT_DISPLAY_NONE_PROPERTY}else{a.disabled=false}return false};function AddNewComment(){var f=STRING_EMPTY;var d;var c;var b=$get(this.pAllComment._TEXTBOX_NEW_COMMENT);if(b&&this.pAllComment.pReferId&&this.pAllComment._PROVIDE_USER_KEY.length>0){c=this.pAllComment.pReferId;d=this.pAllComment._PROVIDE_USER_KEY;if(b.value.length>0){f=b.value}else{b.value=TEXT_ADD_COMMENT_CONTENT}if(f.length>0&&this.pAllComment._COMMENTS_TYPE_ID>0){b.value=STRING_EMPTY;SBR.TV.Website.WebServices.WebServiceProxy.InsertComment(c,f,d,this.pAllComment._COMMENTS_TYPE_ID,e,a,this.pAllComment)}}return false;function e(h,g){g.pAllComment=g;g.pPageNumber=1;g.pReferId=parseInt(g.pReferId);g.LoadComments()}function a(g){alert("The process failure (Insert comment)... please try again later.")}}function selectAverage(c){var b=0;if(c!=undefined){if(c.pReferId!=undefined){c.start(c.pReferId)}}}function CategoryList(){var f;var d=EMPTY_STRING;var b=-1;var c=590;var a=EMPTY_STRING;var e=EMPTY_STRING}CategoryList.prototype.init=function(){this._CategoriesListDiv=$get(this._CategoryListControlDivId);if(this._Height>=0){this._CategoriesListDiv.style.height=this._Height}if(this._Width>=0){this._CategoriesListDiv.style.width=this._Width}this.populate_category_list()};CategoryList.prototype.populate_category_list=function(){if(this._CategoryTypeId>0){SBR.TV.Website.WebServices.WebServiceProxy.GetCategoriesByType(this._CategoryTypeId,b,a,this)}function b(l,k){var d;var f;var c;var h;var g;var j;Categories=l;k.clean_categories_from_list();j=document.createElement("span");g=document.createElement("h1");g.innerHTML=k._CategoryListTitle;j.appendChild(g);k._CategoriesListDiv.appendChild(j);d=document.createElement("div");d.className="div_item";anchor=document.createElement("a");anchor.href="#";anchor.id="Category_0";anchor.objId=0;anchor.className="category_item category_item_selected";anchor.control=k;anchor.onclick=DisplayVideos;anchor.innerHTML="All";anchor.Category=c;d.appendChild(anchor);k._CategoriesListDiv.appendChild(d);for(var e=0;e<l.length;e++){c=l[e];d=document.createElement("div");d.className="div_item";anchor=document.createElement("a");anchor.href="#";anchor.id="Category_"+c.CategoryId;anchor.objId=c.CategoryId;anchor.obj=k;anchor.className="category_item";anchor.control=k;anchor.onclick=DisplayVideos;anchor.innerHTML=c.Description;anchor.Category=c;d.appendChild(anchor);k._CategoriesListDiv.appendChild(d)}}function a(d,c){pCategoryList._CategoriesListDiv.innerHtml="error loading categories ..."}};CategoryList.prototype.select_category_item=function(){var a=this.parent};CategoryList.prototype.clean_categories_from_list=function(){if(this._CategoriesListDiv){while(this._CategoriesListDiv.lastChild!=null){this._CategoriesListDiv.removeChild(this._CategoriesListDiv.lastChild,this._CategoriesListDiv)}}};function DisplayVideos(){if(this.control){var i=0;var categoryLinks=this.control._CategoriesListDiv.getElementsByTagName("a");for(i;i<categoryLinks.length;i++){categoryLinks[i].className="category_item"}this.className=String.format("{0} category_item_selected",this.className);try{eval("var videoListControl = "+this.control._VideoListName);if(videoListControl!=undefined){if(this.objId>0){videoListControl._RequestType=SBR.TV.Communication.Objects.RequestType.CATEGORY;videoListControl._FilterId=this.objId;videoListControl._FirstIndexPage=1;videoListControl._EndIndexPage=-1;videoListControl._DefaultPageNumber=1;videoListControl.init()}else{videoListControl._RequestType=SBR.TV.Communication.Objects.RequestType.SUBMITED_POSTS;videoListControl._FilterId=this.objId;videoListControl._FirstIndexPage=1;videoListControl._EndIndexPage=-1;videoListControl._DefaultPageNumber=1;videoListControl.init()}}}catch(err){}}return false}var STRING_EMPTY="";var VIDEO_EMPLY=-1;var HTML_ELEMENT_DIV="div";var HTML_ELEMENT_P="p";var HTML_ELEMENT_TABLE="table";var HTML_ELEMENT_TBODY="tbody";var HTML_ELEMENT_TR="tr";var HTML_ELEMENT_TD="td";var HTML_ELEMENT_SPAN="span";var COMMENT_CLASS_NAME_ROWCOMMENTS="rowComments";var COMMENT_CLASS_NAME_HEADER="header";var COMMENT_CLASS_NAME_HEADERUSER="headerUser";var COMMENT_CLASS_NAME_HEADERDATE="headerDate";var COMMENT_CLASS_NAME_USERTEXT="userText";var COMMENT_CLASS_NAME_DATETEXT="dateText";var COMMENT_CLASS_NAME_DELETE_COMMENT="deleteComment";var COMMENT_CLASS_NAME_COMMENTTEXT="contentText";var TEXT_COMMENT="Comments";var TEXT_ADD_COMMENT_CONTENT="Write a comment.";var TEXT_ADD_COMMENT_USER_LOGGED="You need to be logged.";var ELEMENT_DISPLAY_NONE_PROPERTY="none";var HTML_ELEMENT_B="b";var HTML_ELEMENT_A="a";var HTML_ELEMENT_IMG="img";var HTML_ELEMENT_SELECT="select";var HTML_ELEMENT_OPTION="option";var HTML_ELEMENT_INPUT="input";var URL_PROGRESS_IMG="img/progress.gif";var PROVIDE_USER_KEY;function Channel(){var Q;var O;var a;var T;var j;var l;var k;var M;var B;var S;var c;var J;var P;var v;var e;var g;var E;var z;var x=false;var A;var o=false;var t=false;var h=false;var U=false;var R=true;var f=false;var G=false;var y;var I=false;var H;var u;var q;var L;var b;var N=false;var C;var n;var d;var w;var F;var K;var r;var m;var D}Channel.prototype.PlayRequestVideo=function(){var b=SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(SBR.TV.Communication.Objects.RequestType.POST,this._PLAY_POST_ID,"",0,0,"DESC",false,false,c,a,this);function c(d,e){if(d.length>0){var f=d[0];e._CURRENT_POST=f;e.PlayVideo(f)}}function a(e,d){alert("The process failure (The postId does not exists).")}};Channel.prototype.PlayVideo=function(pObjPost,pAutoPlay){var divPlayerRef=$get(this._DIV_TO_PLAY);if(divPlayerRef){var embedScript;var profileId;var videoId;profileId=parseInt(this._ENCODING_PROFILE_PLAYER);videoId=this.GetFileIdByEncodingId(pObjPost);this._FIRST_INDEX_PAGE=1;this._LAST_INDEX_PAGE=-1;this._VideoId=videoId;this._ProfileId=profileId;var videoIdImage=0;if(pObjPost.Files.length>=4){videoIdImage=pObjPost.Files[2].FileId;this._VideoImageId=videoIdImage}if(pAutoPlay!=undefined){this._AUTO_PLAY=pAutoPlay}if(videoId!=VIDEO_EMPLY){try{this.LoadTitle(pObjPost);if(this._SHOW_RATING){this.LoadFromRating(pObjPost)}if(this._SHOW_RATING_VIEWS){this.LoadRatingViews(pObjPost)}if(this._Show_Ranging_Views){this.LoadRatingByPost()}this.pPost=pObjPost;this.pPostId=pObjPost.PostId;this._PLAY_POST_ID=pObjPost.PostId;this.pChannel=this;if(this._SHOW_COMMENTS){if(this._Comments_Component_Name.length>0){eval("var objCommentRef="+this._Comments_Component_Name);if(objCommentRef!=undefined){objCommentRef.start(pObjPost.PostId)}}}if(this._SHOW_ADMIN_OPTIONS){this.CreateAdminButtons()}var flashvars={};var params={};params.wmode="transparent";params.quality="high";params.allowFullScreen="true";params.allowScriptAccess="sameDomain";var attributes={};swfobject.embedSWF(String.format("swf/sbrtv.swf?postId={0}&ap={1}&currentURL={2}&type={3}&userId={4}&showAds={5}&timeToShow={6}",this.pPostId,this._AUTO_PLAY,String.format("{0}//{1}",window.location.protocol,window.location.host),this._RelatedVideosDisplayType,this._PROVIDE_USER_KEY,this._ShowAds,this._ShowAdsTime),this._DIV_TO_PLAY,this._PLAYER_WIDTH,this._PLAYER_HEIGHT,"9.0.0","expressInstall.swf",flashvars,params,attributes)}catch(e){alert(e)}}}};Channel.prototype.LoadTitle=function(b){var a=$get(this._DIV_TITLE);if(a){if(b.Title!=undefined){if(this._FULL_TITLE){a.innerHTML="<h1>"+b.Title+"</h1>"}else{a.style.width=this._PLAYER_WIDTH+"px";a.innerHTML="<h1>"+b.Title+"</h1>"}}else{a.innerHTML=STRING_EMPTY}}};Channel.prototype.CreateAdminButtons=function(){var b=$get(this._DIV_ADMIN_BUTTONS);var c;var a;if(b){switch(this.pPost.Status){case SBR.TV.Communication.Objects.PostStatusType.NOT_VISIBLE:a="Delete";break;case SBR.TV.Communication.Objects.PostStatusType.APPROVED:a="Approved";break;case SBR.TV.Communication.Objects.PostStatusType.PENDING_APPROVAL:a="Pending to approved";break;case SBR.TV.Communication.Objects.PostStatusType.UPLOADING_PROCESS:a="Uploading Process";break}b.innerHTML=STRING_EMPTY;c=document.createElement(HTML_ELEMENT_A);c.innerHTML="Delete This Video";c.onclick=ChangeStatusVideo;c.pPost=this.pPost;c.pChannel=this.pChannel;c.pNewStatus=SBR.TV.Communication.Objects.PostStatusType.NOT_VISIBLE;c.className="button";b.appendChild(c)}};function ChangeStatusVideo(){if(this.pChannel&&this.pPost){var a=new Array(ChangeStatusVideoContinue,this.pChannel,this.pPost,this.pNewStatus);sbrAlertShow("Delete","Are you sure you wish to delete this video?",300,SBR.TV.Communication.Objects.AlertType.DELETE,a,null,this.pPost)}return false}function ChangeStatusVideoContinue(c,f,j){var d;var b;var g=-1;var e;if(c&&f){d=f;b=c;g=j}if(g!=-1){d.Status=g;e=b._PROVIDE_USER_KEY;SBR.TV.Website.WebServices.WebServiceProxy.UpdatePostStatus(b.pPostId,g,e,a,h,b)}function a(l,k){k.CreateAdminButtons(k)}function h(m,l,k){alert("The process failure (Change the status)... please try again later.")}}Channel.prototype.GetFileIdByEncodingId=function(b){var c=this._ENCODING_PROFILE_PLAYER;var a=VIDEO_EMPLY;if(b!=undefined){for(var d in b.Files){objFile=b.Files[d];if(c==objFile.EncodeProfileId){a=objFile.FileId;break}}}return a};Channel.prototype.LoadFromRating=function(b){SBR.TV.Website.WebServices.WebServiceProxy.GetChannels(b.User.ChannelId,null,1,1,0,a,c,this);function a(e,g){var d=$get(g._DIV_RATING);if(d){var f=e[0];if(f.User.UserName!=undefined){d.innerHTML="<span>From: <a href = users.aspx?us="+e[0].User.ForumUserId+">"+f.Name+"</a></span>"}d.innerHTML+='<span> SBR Rating: <b class="rating">'+g._BookRating+"</b></span><p></p>";d.innerHTML+="<div id='moreBookInfo'><b>More Info: <b></div><div id='moreBookInfoDescription'>"+g._MoreBookInfo+"</div>"}}function c(e){var d=$get(this._DivVideosId);d.innerHTML="The process failure (Load the channel rating)... please try again later."}};Channel.prototype.LoadRatingByPost=function(){var a=0;eval("var objRating="+this._Rating_Component_Name);if(objRating){objRating.run()}};Channel.prototype.LoadRatingViews=function(b){var a=$get(this._DIV_RATING_VIEWS);if(a){}};SelectAll=function(a){a.focus();a.select();return false};Channel.prototype.RegisterRate=function(e,a){var b=new SBR.TV.Communication.Objects.Rating();b.PostId=this._PLAY_POST_ID;b.Rate=e;b.CreateBy=a;SBR.TV.Website.WebServices.WebServiceProxy.InsertPostsRatings(b,c,d);function c(f){}function d(f){}};Channel.prototype.GetObjectIdRating=function(){return this._PLAY_POST_ID};Channel.prototype.AddToFavorites=function(d){var a=$get(d._DivAddUserListsResultId);a.style.display="";a.innerHTML="";if(d._PROVIDE_USER_KEY.length>0){d.ShowProgressImg(a);SBR.TV.Website.WebServices.WebServiceProxy.InsertFavoritePost(d._CURRENT_POST.PostId,d._PROVIDE_USER_KEY,c,b,d)}else{if(d._CURRENT_POST.Title.length>0){d.AddSingleMessageAlertDiv(d,a,String.format('Sign in to add "{0}" to your favorites.',d._CURRENT_POST.Title))}else{d.AddSingleMessageAlertDiv(d,a,"Sign in to add this video to your favorites.")}}function c(g,f){var e=$get(f._DivAddUserListsResultId);e.innerHTML="";if(parseInt(g)>0){var j;var h;if(f._CURRENT_POST.Title.length>0){f.AddSingleMessageAlertDiv(f,e,String.format('"{0}" has been added to your favorites.',f._CURRENT_POST.Title))}else{f.AddSingleMessageAlertDiv(f,e,"Sign in to add this video to your favorites.")}h=document.createElement(HTML_ELEMENT_DIV);j=document.createElement(HTML_ELEMENT_A);j.href="#";j.alt="";j.innerHTML="Remove from favorites";j.onclick=f.DeleteFromFavorites;j.currObj=f;j.favoritePostId=parseInt(g);h.appendChild(j);e.appendChild(h)}else{e.style.display="none"}}function b(e){alert("Favorite error:"+e)}};Channel.prototype.DeleteFromFavorites=function(){var a=$get(this.currObj._DivAddUserListsResultId);a.style.display="";this.currObj.ShowProgressImg(a);SBR.TV.Website.WebServices.WebServiceProxy.DeleteFavoritePost(this.favoritePostId,b,c,this.currObj);function b(f,e){var d=$get(e._DivAddUserListsResultId);d.innerHTML="";if(f){if(e._CURRENT_POST.Title.length>0){e.AddSingleMessageAlertDiv(e,d,String.format('"{0}" has been removed from your favorites.',e._CURRENT_POST.Title))}else{e.AddSingleMessageAlertDiv(e,d,"This video has been removed from your favorites.")}}else{d.style.display="none"}}function c(d){alert("Favorite error:"+d)}return false};Channel.prototype.ShowPlaylists=function(b){var a=$get(b._DivAddUserListsResultId);a.style.display="";a.innerHTML="";if(b._PROVIDE_USER_KEY.length>0){SBR.TV.Website.WebServices.WebServiceProxy.GetUserPlayLists(b._PROVIDE_USER_KEY,c,d,b)}else{if(b._CURRENT_POST.Title.length>0){b.AddSingleMessageAlertDiv(b,a,String.format('Sign in to add "{0}" to your playlists.',b._CURRENT_POST.Title))}else{b.AddSingleMessageAlertDiv(b,a,"Sign in to add this video to your playlists.")}}function c(n,g){var h=0;var f;var e;var l;var k;var j;var m=$get(g._DivAddUserListsResultId);m.style.display="";k=document.createElement(HTML_ELEMENT_SELECT);j=document.createElement(HTML_ELEMENT_OPTION);j.text=" - Select Playlist - ";j.value=0;k.options.add(j);for(h;h<n.length;h++){j=document.createElement(HTML_ELEMENT_OPTION);j.text=n[h].Name;j.value=n[h].PlayListId;k.options.add(j)}e=document.createElement(HTML_ELEMENT_DIV);l=document.createElement(HTML_ELEMENT_SPAN);l.innerHTML="Add to your Playlist";e.appendChild(l);m.appendChild(e);e=document.createElement(HTML_ELEMENT_DIV);e.appendChild(k);lnk=document.createElement(HTML_ELEMENT_A);lnk.href="#";lnk.alt="";lnk.innerHTML="Add";lnk.onclick=g.AddToPlaylist;lnk.currObj=g;lnk.select=k;e.appendChild(lnk);m.appendChild(e);e=document.createElement(HTML_ELEMENT_DIV);e.appendChild(k);lnk=document.createElement(HTML_ELEMENT_A);lnk.href="#";lnk.alt="";lnk.innerHTML="New Playlist";lnk.onclick=g.ShowNewPlaylist;lnk.currObj=g;e.appendChild(lnk);m.appendChild(e);e=document.createElement(HTML_ELEMENT_DIV);lnk=document.createElement(HTML_ELEMENT_A);lnk.href="#";lnk.alt="";lnk.innerHTML="Close";lnk.Clear=true;lnk.onclick=g.CloseUserListsConfirmationDiv;lnk.Div=m;e.appendChild(lnk);m.appendChild(e)}function d(e){alert("Favorite error:"+e)}};Channel.prototype.AddToPlaylist=function(){var a=this.select;if(parseInt(this.select.options[this.select.selectedIndex].value)>0){var e=this.currObj;var d=$get(e._DivAddUserListsResultId);d.style.display="";e.ShowProgressImg(d);SBR.TV.Website.WebServices.WebServiceProxy.InsertPostToPlayList(parseInt(a.options[a.selectedIndex].value),e._CURRENT_POST.PostId,c,b,e)}function c(h,g){var f=$get(g._DivAddUserListsResultId);f.innerHTML="";if(h){if(g._CURRENT_POST.Title.length>0){g.AddSingleMessageAlertDiv(g,f,String.format('"{0}" has been added to "{1}" playlist.',g._CURRENT_POST.Title,a.options[a.selectedIndex].text))}else{g.AddSingleMessageAlertDiv(g,f,String.format('This video has been added to "{0}" playlist.',a.options[a.selectedIndex].text))}}else{f.style.display="none"}}function b(f){alert("Favorite error:"+f)}return false};Channel.prototype.ShowNewPlaylist=function(){var f;var d;var a;var e;var c=this.currObj;var b=$get(c._DivAddUserListsResultId);f=document.createElement(HTML_ELEMENT_DIV);d=document.createElement(HTML_ELEMENT_SPAN);d.innerHTML="Playlist title: ";f.appendChild(d);a=document.createElement(HTML_ELEMENT_INPUT);a.type="text";f.appendChild(a);e=document.createElement(HTML_ELEMENT_A);e.innerHTML="Add";e.alt="";e.href="#";e.onclick=c.AddNewPlaylist;e.currObj=c;e.titleInput=a;e.Container=f;f.appendChild(e);e=document.createElement(HTML_ELEMENT_A);e.innerHTML="Close";e.alt="";e.href="#";e.onclick=c.RemoveUserListsContainer;e.Container=f;f.appendChild(e);b.appendChild(f);return false};Channel.prototype.AddNewPlaylist=function(){var d=this.currObj;var e=this.titleInput;var c=this.Container;if(e.value.length>0){d.ShowProgressImg(c);SBR.TV.Website.WebServices.WebServiceProxy.InsertUserPlayList(e.value,d._PROVIDE_USER_KEY,b,a,d)}function b(j,h){if(j){var g=$get(h._DivAddUserListsResultId);var k=g.getElementsByTagName(HTML_ELEMENT_SELECT);if(k.length>0){var f=document.createElement(HTML_ELEMENT_OPTION);f.text=j.Name;f.value=j.PlayListId;k[0].options.add(f);k[0].selectedIndex=k[0].options.length-1}}c.parentNode.removeChild(c)}function a(f){alert("Favorite error:"+f)}return false};Channel.prototype.AddSingleMessageAlertDiv=function(c,a,d){var f;var e;var b;f=document.createElement(HTML_ELEMENT_DIV);b=document.createElement(HTML_ELEMENT_SPAN);f.appendChild(b);b.innerHTML=d;a.appendChild(f);f=document.createElement(HTML_ELEMENT_DIV);e=document.createElement(HTML_ELEMENT_A);e.href="#";e.alt="";e.innerHTML="Close";e.Clear=true;e.onclick=c.CloseUserListsConfirmationDiv;e.Div=a;f.appendChild(e);a.appendChild(f);return false};Channel.prototype.CloseUserListsConfirmationDiv=function(){if(this.Clear){this.Div.innerHTML=""}this.Div.style.display="none";return false};Channel.prototype.RemoveUserListsContainer=function(){this.Container.parentNode.removeChild(this.Container);return false};Channel.prototype.ShowProgressImg=function(f){var d=document.createElement(HTML_ELEMENT_TABLE);var c=document.createElement(HTML_ELEMENT_TBODY);var e=document.createElement(HTML_ELEMENT_TR);var a;var b=document.createElement(HTML_ELEMENT_IMG);b.src=URL_PROGRESS_IMG;b.alt="";a=document.createElement(HTML_ELEMENT_TD);a.appendChild(b);e.appendChild(a);a=document.createElement(HTML_ELEMENT_TD);a.innerHTML="&nbsp;Adding...";e.appendChild(a);c.appendChild(e);d.appendChild(c);f.innerHTML="";f.appendChild(d)};var cssdropdown={disappeardelay:550,disablemenuclick:false,enableswipe:1,enableiframeshim:1,dropmenuobj:null,ie:document.all,firefox:document.getElementById&&!document.all,swipetimer:undefined,bottomclip:0,getposOffset:function(d,c){var b=(c=="left")?d.offsetLeft:d.offsetTop;var a=d.offsetParent;while(a!=null){b=(c=="left")?b+a.offsetLeft:b+a.offsetTop;a=a.offsetParent}return b},swipeeffect:function(){if(this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){this.bottomclip+=10+(this.bottomclip/10);this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)"}else{return}this.swipetimer=setTimeout("cssdropdown.swipeeffect()",10)},showhide:function(b,a){if(this.ie||this.firefox){this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"}if(a.type=="click"&&b.visibility==hidden||a.type=="mouseover"){if(this.enableswipe==1){if(typeof this.swipetimer!="undefined"){clearTimeout(this.swipetimer)}b.clip="rect(0 auto 0 0)";this.bottomclip=0;this.swipeeffect()}b.visibility="visible"}else{if(a.type=="click"){b.visibility="hidden"}}},iecompattest:function(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body},clearbrowseredge:function(e,c){var b=0;if(c=="rightedge"){var d=this.ie&&!window.opera?this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15:window.pageXOffset+window.innerWidth-15;this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth;if(d-this.dropmenuobj.x<this.dropmenuobj.contentmeasure){b=this.dropmenuobj.contentmeasure-e.offsetWidth}}else{var a=this.ie&&!window.opera?this.iecompattest().scrollTop:window.pageYOffset;var d=this.ie&&!window.opera?this.iecompattest().scrollTop+this.iecompattest().clientHeight-15:window.pageYOffset+window.innerHeight-18;this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight;if(d-this.dropmenuobj.y<this.dropmenuobj.contentmeasure){b=this.dropmenuobj.contentmeasure+e.offsetHeight;if((this.dropmenuobj.y-a)<this.dropmenuobj.contentmeasure){b=this.dropmenuobj.y+e.offsetHeight-a}}}return b},dropit:function(c,b,a){if(this.dropmenuobj!=null){this.dropmenuobj.style.visibility="hidden"}this.clearhidemenu();if(this.ie||this.firefox){c.onmouseout=function(){cssdropdown.delayhidemenu()};c.onclick=function(){return !cssdropdown.disablemenuclick};this.dropmenuobj=document.getElementById(a);this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()};this.dropmenuobj.onmouseout=function(d){cssdropdown.dynamichide(d)};this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()};this.showhide(this.dropmenuobj.style,b);this.dropmenuobj.x=this.getposOffset(c,"left");this.dropmenuobj.y=this.getposOffset(c,"top");this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(c,"rightedge")+"px";this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(c,"bottomedge")+c.offsetHeight+1+"px";this.positionshim()}},positionshim:function(){if(this.enableiframeshim&&typeof this.shimobject!="undefined"){if(this.dropmenuobj.style.visibility=="visible"){this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px";this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px";this.shimobject.style.left=this.dropmenuobj.style.left;this.shimobject.style.top=this.dropmenuobj.style.top}this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")?"block":"none"}},hideshim:function(){if(this.enableiframeshim&&typeof this.shimobject!="undefined"){this.shimobject.style.display="none"}},contains_firefox:function(d,c){while(c.parentNode){if((c=c.parentNode)==d){return true}}return false},dynamichide:function(b){var a=window.event?window.event:b;if(this.ie&&!this.dropmenuobj.contains(a.toElement)){this.delayhidemenu()}else{if(this.firefox&&b.currentTarget!=a.relatedTarget&&!this.contains_firefox(a.currentTarget,a.relatedTarget)){this.delayhidemenu()}}},delayhidemenu:function(){this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'; cssdropdown.hideshim()",this.disappeardelay)},clearhidemenu:function(){if(this.delayhide!="undefined"){clearTimeout(this.delayhide)}},startchrome:function(){for(var c=0;c<arguments.length;c++){var d=document.getElementById(arguments[c]).getElementsByTagName("a");for(var b=0;b<d.length;b++){if(d[b].getAttribute("rel")){var a=d[b].getAttribute("rel");d[b].onmouseover=function(g){var f=typeof g!="undefined"?g:window.event;cssdropdown.dropit(this,f,this.getAttribute("rel"))}}}}if(window.createPopup&&!window.XmlHttpRequest){document.write('<IFRAME id="iframeshim"  src="" style="display: none; left: 0; top: 0; z-index: 90; position: absolute; filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>');this.shimobject=document.getElementById("iframeshim")}}};Array.prototype.inArray=function(b){for(var a in this){if(this[a]===b){return a}}return -1};function addClass(a,b){myClass=a.className;myClass+=" "+b;a.className=myClass}function removeClass(a,b){myClass=a.className;myClassAry=myClass.split(" ");for(i=0;i<myClassAry.length;i++){if(myClassAry[i]==b){myClassAry.splice(i,1)}}myClass=myClassAry.join(" ");a.className=myClass}function getParent(a,b){while(b){if(b.nodeName==a.toUpperCase()){return b}b=b.parentNode}return false}function Deserializer(c){var a="";a="<SerializableDictionaryOfStringCategory><item><value>";for(var b in c){if(c[b]&&c[b].CategoryId!=undefined){a+="<Category><CategoryId>";a+=c[b].CategoryId;a+="</CategoryId></Category>"}}a+="</value></item></SerializableDictionaryOfStringCategory>";return a}function CategoriesByComma(c){var a="";a="";for(var b in c){if(c[b]&&c[b].CategoryId!=undefined){a+=c[b].CategoryId;a+=","}}return a}function CreateRatingStars(e,h,j,b,k,d){var c=b.split(",");var a;for(index=0;index<j;index++){a=document.createElement(HTML_ANCHOR_TAG);a.title=c[index];if(a.value){a.name=index}else{var g=document.createAttribute("value");g.value=index+1;a.attributes.setNamedItem(g)}if(k){if(index<h){if((index+1)<=h){a.className="ratingEnabled"}else{var f=h-parseInt(h);if(f<=QUARTER_UNIT){a.className="ratingEnabled_quarter"}else{if(f>QUARTER_UNIT&&f<=HALF_UNIT){a.className="ratingEnabled_half"}else{if(f>HALF_UNIT&&f<=THREE_QUARTERS_UNIT){a.className="ratingEnabled_three_quarters"}else{a.className="ratingEnabled"}}}}}else{a.className="ratingDisable"}}else{a.className="ratingDisable";if(d){a.id=d._Name_Rating+"_"+index;a.onclick=d.rateIt;a.onmouseout=d.offStar;a.onmouseover=d.rating;a.objRanting=d;a.thisAnchor=a}}e.appendChild(a)}}function AvoidEnterKey(a){var b=0;if(a.keyCode){b=a.keyCode}if(b==ENTER_KEY_CODE){return true}else{return false}}function FindElmtListBoxByTxt(c,d){var b;var a=false;for(b=0;b<d.options.length;b++){if(d.options[b].text==c){a=true;break}}return a}function FindElmtListBoxByValue(c,d){var b;var a=false;for(b=0;b<d.options.length;b++){if(d.options[b].value==c){a=true;break}}return a}var EMPTY_STRING="";var HTML_DIV_TAG="div";var HTML_IMAGE_TAG="img";var HTML_ANCHOR_TAG="a";var HTML_ELEMENT_B="b";var ELEMENT_DISPLAY_NONE_PROPERTY="none";var ELEMENT_DISPLAY_BLOCK_PROPERTY="block";var ELEMENT_DISPLAY_INLINE_PROPERTY="inline";var ELEMENT_DISPLAY_HIDDEN_PROPERTY="hidden";var HTML_ELEMENT_TABLE="table";var HTML_ELEMENT_TBODY="tbody";var HTML_ELEMENT_TR="tr";var HTML_ELEMENT_TD="td";var FORMAT_DATE="MMMM dd,  yyyy";var HTML_ELEMENT_P="p";var ENTER_KEY_CODE=13;var QUARTER_UNIT=0.25;var HALF_UNIT=0.5;var THREE_QUARTERS_UNIT=0.75;var STRING_EMPTY="";var STRING_MSG_NEW_ARTICLE="The article was created.";var STRING_MSG_UPDATE_ARTICLE="The article was modified.";var PROCESSOS_FAILURE="The proccess failure, try again later.";var REQUEIRED_FIELD="Fields are required.";var ARTICLE_UPDATE_ID;function loadValues(e){var g=$get(ARTICLE_MANAGE_TITLE);var c=$get(ARTICLE_MANAGE_SUMMARY);var d=$get(ARTICLE_MANAGE_CONTENT);var f=STRING_EMPTY;var b=STRING_EMPTY;var a=STRING_EMPTY;if(g){f=g.value}if(c){b=tinyMCE.get(ARTICLE_MANAGE_SUMMARY).getContent()}if(d){a=tinyMCE.get(ARTICLE_MANAGE_CONTENT).getContent()}if(f.length>0&&b.length>0&&a.length>0){if(e==1){ApplySave(f,b,a)}else{ApplyUpdate(f,b,a)}}else{alert(REQUEIRED_FIELD)}return false}function ApplySave(d,c,e){var a=new SBR.TV.Communication.Objects.Article();var b=new Date();a.Title=d;a.Summary=c;a.Content=e;a.PublishDate=b;SBR.TV.Website.WebServices.WebServiceProxy.InsertArticle(a,successFullInsert,processFailure)}function ApplyUpdate(d,c,e){var a=new SBR.TV.Communication.Objects.Article();var b=new Date();if(ARTICLE_UPDATE_ID){a.ArticleId=parseInt(ARTICLE_UPDATE_ID);a.Title=d;a.Summary=c;a.Content=e;a.PublishDate=b;SBR.TV.Website.WebServices.WebServiceProxy.UpdateArticle(a,successFullUpdate,processFailure)}}function successFullInsert(b){var a=$get(ARTICLE_MANAGE_BTN_SAVE);var c=$get(ARTICLE_MANAGE_BTN_UPDATE);ARTICLE_UPDATE_ID=b.ArticleId;if(a!=null){a.disabled=true}if(c!=null){c.disabled=false}alert(STRING_MSG_NEW_ARTICLE)}function successFullUpdate(){alert(STRING_MSG_UPDATE_ARTICLE)}function processFailure(a){alert(PROCESSOS_FAILURE)}function EditVideoInformation(){var b;var g;var r;var q;var a;var h;var f;var o;var j;var n;var m;var c;var e;var l;var k;var t;var d;var u}EditVideoInformation.prototype.LoadPost=function(d,b,f){this.DIVPOSTCONTAINER=b;this.IsExternalWebSite=f;if(!this.ISFINALPRESENTATION){var c=document.getElementById(this.DIV_EDITINFOMATION);if(c){c.style.display="block"}}SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(SBR.TV.Communication.Objects.RequestType.POST,d,"",0,0,"DESC",false,false,e,a,this);function e(g,h){if(g.length>0){h.POST=g[0];if(h.ISFINALPRESENTATION){h.LoadFinalInformation()}else{h.LoadInformation()}}}function a(h,g){alert("The process failure (The postId does not exists).")}return false};EditVideoInformation.prototype.LoadFinalInformation=function(){var b=document.getElementById(this.TITLE);var a=document.getElementById(this.DESCRIPTION);var h=document.getElementById(this.TAGS);var l=document.getElementById(this.DIV_THUMBNAIL);var j=document.getElementById(this.BTNYOURVIDEOS);var d=document.createElement("a");var k=GetHostName();var g=new RegExp(/[^A-Za-z0-9]+/g);var f=this.POST.Title.replace(g,"-");if(f.length>0){url=k+"video-"+this.POST.PostId+"-"+f+".html"}else{url=k+"video-"+this.POST.PostId+"-NoTitle.html"}j.href=k+"channel-"+this.POST.User.ForumUserId+"-"+this.POST.User.UserName+".html";d.href=url;if(!this.IsExternalWebSite){d.target="_blank";j.target="_blank"}if(b&&a&&h&&l&&this.POST){l.innerHTML="";videoThumbnail=document.createElement("img");videoThumbnail.alt="";videoThumbnail.src=this.SERVER_DOMAIN+this.POST.Thumbnail;videoThumbnail.style.width="80px";videoThumbnail.style.height="60px";d.appendChild(videoThumbnail);l.appendChild(d);b.innerHTML=this.POST.Title;a.innerHTML=this.POST.Content;h.innerHTML=this.POST.Tags;SBR.TV.Website.WebServices.WebServiceProxy.GetCategoriesByPost(this.POST.PostId,e,c,this)}function e(q,o){var n=document.getElementById(o.CATEGORIES);if(n){var r="";var m=q.length-1;for(categoryIndex=0;categoryIndex<=m;categoryIndex++){objCategory=q[categoryIndex];if(r.length>0){r=r+","+objCategory.Description}else{r=objCategory.Description}}if(r.length>0){n.innerHTML=r+"."}}return false}function c(m,n){alert("The process failure (error louding the categories).");return false}return false};EditVideoInformation.prototype.LoadInformation=function(){var c;var a=document.getElementById(this.TITLE);var d=document.getElementById(this.DESCRIPTION);var b=document.getElementById(this.TAGS);if(this.POST){a.value=this.POST.Title;d.value=this.POST.Content;b.value=this.POST.Tags;if(this.ISADMIN){var e=$get(this.RELATED_PAGE_URL);e.value=this.POST.OnClickEventPage}this.LoadCategories()}};EditVideoInformation.prototype.LoadCategories=function(){var c=document.getElementById(this.CATEGORIES);if(c){var b=this.CATEGORIESITEMS;var a=null;for(i=0;i<b;i++){a=document.getElementById(this.CATEGORIES+"_"+i.toString());if(this.POST.Categories[a.parentNode.parentNode.firstChild.attributes.categoryId.value]!=undefined){a.checked=true}else{a.checked=false}}}};function SaveEditInformation(pEditInfoControl){if(pEditInfoControl&&pEditInfoControl.POST&&pEditInfoControl.POST.PostId){var TITLE_REF=document.getElementById(pEditInfoControl.TITLE);var DESCRIPTION_REF=document.getElementById(pEditInfoControl.DESCRIPTION);var TAGS_REF=document.getElementById(pEditInfoControl.TAGS);var RELATED_PAGE_URL_REF=document.getElementById(pEditInfoControl.RELATED_PAGE_URL);var CATEGORIES_REF=pEditInfoControl.GetEditInformationCategoriesSelected();var pageToRedirect="";if(pEditInfoControl.ISADMIN){pageToRedirect=RELATED_PAGE_URL_REF.value}SBR.TV.Website.WebServices.jsLocalServices.SavePostDetails(pEditInfoControl.POST.PostId,TITLE_REF.value,DESCRIPTION_REF.value,CATEGORIES_REF,"",TAGS_REF.value,pageToRedirect,pEditInfoControl.POST.User.UserId,saveInformationSuccessfull,saveInformationFailure,pEditInfoControl)}function saveInformationSuccessfull(pResult,pEditInfoControl){if(pEditInfoControl&&pEditInfoControl.POST&&pEditInfoControl.POST.PostId){var TITLE_REF=document.getElementById(pEditInfoControl.TITLE);var DESCRIPTION_REF=document.getElementById(pEditInfoControl.DESCRIPTION);var TAGS_REF=document.getElementById(pEditInfoControl.TAGS);pEditInfoControl.POST.Title=TITLE_REF.value;pEditInfoControl.POST.Content=DESCRIPTION_REF.value;pEditInfoControl.POST.Tags=TAGS_REF.value;if(pEditInfoControl.DIVPOSTCONTAINER){var divPostContainer=pEditInfoControl.DIVPOSTCONTAINER;var divTitle;var anchorsList;var limit;var textTitle=(pEditInfoControl.POST.Title==EMPTY_STRING?"No Title":pEditInfoControl.POST.Title);if(divPostContainer.getElementsByTagName("A")!=null){anchorsList=divPostContainer.getElementsByTagName("A");limit=anchorsList.length;for(counter=0;counter<limit;counter++){if(anchorsList[counter].getAttribute("id")=="anchorTitle"){anchorsList[counter].innerHTML="<b>"+textTitle+"</b>";break}}}}if(pEditInfoControl.PLAYERNAME.length>0){eval("var objectPlayerRef = "+pEditInfoControl.PLAYERNAME);if(objectPlayerRef){if(objectPlayerRef._PLAY_POST_ID==pEditInfoControl.POST.PostId){objectPlayerRef.LoadTitle(pEditInfoControl.POST);if(objectPlayerRef._SHOW_DESCRIPTION){objectPlayerRef.LoadFromRow(pEditInfoControl.POST);objectPlayerRef.LoadAddRow(pEditInfoControl.POST);objectPlayerRef.LoadAddInformation(pEditInfoControl.POST);objectPlayerRef.LoadAddTags(pEditInfoControl.POST)}}}}}sbrAlertShow("Upload","Your information was updated.",300,SBR.TV.Communication.Objects.AlertType.DONE,null,null,null);return false}function saveInformationFailure(objectResult,pEditInfoControl){alert("The process failure (error saving the video's information).");return false}return false}EditVideoInformation.prototype.GetEditInformationCategoriesSelected=function(){var d=document.getElementById(this.CATEGORIES);var a="";if(d){var c=this.CATEGORIESITEMS;var b=null;for(i=0;i<c;i++){b=document.getElementById(this.CATEGORIES+"_"+i.toString());if(b.checked){if(a.length==0){a=b.parentNode.parentNode.firstChild.attributes.categoryId.value}else{a+=",";a+=b.parentNode.parentNode.firstChild.attributes.categoryId.value}}}if(a.length>0){a=this.GetXmlEditInformationCategories(a)}}return a};EditVideoInformation.prototype.GetXmlEditInformationCategories=function(c){var b=c.split(",");var d;var a=b.length-1;d="<SerializableDictionaryOfStringCategory><item><value>";for(i=0;i<=a;i++){d=d+"<Category><CategoryId>";d=d+b[i];d=d+"</CategoryId></Category>"}d=d+"</value></item></SerializableDictionaryOfStringCategory>";return d};function CloseInformation(d){var c=document.getElementById(d.DIV_EDITINFOMATION);if(c){c.style.display="none";var a=document.getElementById(d.TITLE);var e=document.getElementById(d.DESCRIPTION);var b=document.getElementById(d.TAGS);if(a&&e&&b){a.value="";e="";b=""}}return false}EditVideoInformation.prototype.CloseInformationSinceOut=function(c){if(c&&this.POST&&c.PostId==this.POST.PostId){var d=document.getElementById(this.DIV_EDITINFOMATION);if(d){d.style.display="none";var a=document.getElementById(this.TITLE);var e=document.getElementById(this.DESCRIPTION);var b=document.getElementById(this.TAGS);if(a&&e&&b){a.value="";e="";b=""}}}return false};function GoToUserPage(b){if(b&&b.POST&&b.POST.User&&b.POST.User.ForumUserId){var c=GetHostName();var a=c+"channel-"+b.POST.User.ForumUserId+"-"+b.POST.User.UserName+".html";window.location=a}return false}function GetHostName(){var c=new RegExp("^(http[s]?://.*/)(.*)?$");var a=c.exec(document.URL);var b=a[1];return b}var gaJsHost=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");document.write(unescape("%3Cscript src='"+gaJsHost+"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));try{var pageTracker=_gat._getTracker("UA-1446389-9");pageTracker._trackPageview();var secondTracker=_gat._getTracker("UA-1446389-11");secondTracker._setDomainName("none");secondTracker._setAllowLinker(true);secondTracker._initData();secondTracker._trackPageview()}catch(err){}function ListPosts(){}ListPosts.prototype.AddPostToList=function(d){var c=document.getElementById(this._lbPostsByType);var a=d.getAttribute("PostInfo");var e=a.split(",");if(FindElmtListBoxByValue(e[0],c)==false){var b=document.createElement("OPTION");b.text=e[1];b.value=e[0];c.options.add(b)}else{alert("Post is already in the list.")}return false};ListPosts.prototype.RemovePostToList=function(){var a=document.getElementById(this._lbPostsByType);a.remove(a.selectedIndex);return false};ListPosts.prototype.SavePosts=function(d){var c=document.getElementById(this._lbPostsByType);var e=document.getElementById(this._hfXML);var b=0;var a="<ListPostByType>";for(b=0;b<=c.length-1;b++){a=a+"<PostID>"+c.options[b].value+"</PostID>"}a=a+"</ListPostByType>";e.value=a};ListPosts.prototype.ValidateFields=function(){var c=document.getElementById(this._txtBoxNameList);var b=document.getElementById(this._txtBoxDescription);var a=document.getElementById(this._ddlTypePost);var d="";if(c.value==""){d=d+"\n -Name."}if(b.value==""){d=d+"\n -Description."}else{if(FindElmtListBoxByTxt(c.value,a)==true){alert("This name already exists.");return false}}if(d!=""){alert("You have to enter: "+d);return false}else{return true}};function ChangeHeaderAsNeeded(){if(CheckBoxIDs!=null){for(var b=1;b<CheckBoxIDs.length;b++){var a=document.getElementById(CheckBoxIDs[b]);if(!a.checked){ChangeCheckBoxState(CheckBoxIDs[0],false);return}}ChangeCheckBoxState(CheckBoxIDs[0],true)}}function ChangeCheckBoxState(c,b){var a=document.getElementById(c);if(a!=null){a.checked=b}}function ChangeAllCheckBoxStates(b){if(CheckBoxIDs!=null){for(var a=0;a<CheckBoxIDs.length;a++){ChangeCheckBoxState(CheckBoxIDs[a],b)}}}var lpMTagConfig={lpServer:"server.iad.liveperson.net",lpNumber:"7667915",lpProtocol:"http"};function lpAddMonitorTag(b){if(typeof(b)=="undefined"||typeof(b)=="object"){b=lpMTagConfig.lpMTagSrc?lpMTagConfig.lpMTagSrc:"/hcp/html/mTag.js"}if(b.indexOf("http")!=0){b=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+b+"?site="+lpMTagConfig.lpNumber}else{if(b.indexOf("site=")<0){if(b.indexOf("?")<0){b=b+"?"}else{b=b+"&"}b=b+"site="+lpMTagConfig.lpNumber}}var a=document.createElement("script");a.setAttribute("type","text/javascript");a.setAttribute("charset","iso-8859-1");a.setAttribute("src",b);document.getElementsByTagName("head").item(0).appendChild(a)}if(window.attachEvent){window.attachEvent("onload",lpAddMonitorTag)}else{window.addEventListener("load",lpAddMonitorTag,false)}function setFocusLoginButtonEnterKey(b){var c=0;if(b.keyCode){c=b.keyCode}if(c==ENTER_KEY_CODE){if(LOGIN_BUTTON){var a=$get(LOGIN_BUTTON);if(a){a.focus()}}}}function setFocusLoginButton(){if(LOGIN_BUTTON){var a=$get(LOGIN_BUTTON);if(a){a.focus()}}}function changeExternalIframe(a){if(a){if(window&&window.parent&&window.parent.changeIframeUploadSize){window.parent.changeIframeUploadSize()}}else{if(window&&window.parent&&window.parent.changeIframeLoginSize){window.parent.changeIframeLoginSize()}}}var MY_CONTESTS_NO_CONTESTS_SHOW="No SBRContests to show.";var MY_CONTESTS_DATE_FORMAT="MM/dd/yyyy";var MY_CONTESTS_WS_FAILURE_ERROR="The process failure (Load {0} SBRContests)... please try again later.";var MY_CONTESTS_SBRCONTESTSCOM_TEXT="SBRContests.com";var MY_CONTESTS_TABLE_COL_ONE="Contest";var MY_CONTESTS_TABLE_COL_TWO="Joined date";var MY_CONTESTS_TABLE_COL_THREE="Final date";function MyContests(){var e;var b;var d;var f;var c;var a}MyContests.prototype.LoadMyContests=function(){SBR.TV.Website.WebServices.WebServiceProxy.MyContests(this._ContestsUserName,this._ContestsToShow,b,a,this);function b(l,g){var m;var j;var h;var d;var k;var c;var f=$get(g._DivHeaderId);var n=$get(g._DivListId);if(f&&n){k=document.createElement("span");k.innerHTML=g._Title;f.appendChild(k);m=document.createElement("table");j=document.createElement("tbody");h=document.createElement("tr");d=document.createElement("td");d.innerHTML=MY_CONTESTS_TABLE_COL_ONE;d.className="myContestsListHeader width50";h.appendChild(d);d=document.createElement("td");d.innerHTML=MY_CONTESTS_TABLE_COL_TWO;d.className="myContestsListHeader width25";h.appendChild(d);d=document.createElement("td");d.innerHTML=MY_CONTESTS_TABLE_COL_THREE;d.className="myContestsListHeader width30";h.appendChild(d);j.appendChild(h);if(l&&l.length>0){for(var e=0;e<l.length;e++){h=document.createElement("tr");d=document.createElement("td");d.className="width50 borderbuttom";c=document.createElement("a");c.href=l[e].PageDir;c.innerHTML=l[e].Name;c.target="_blank";d.appendChild(c);h.appendChild(d);d=document.createElement("td");d.className="width25 textCenter borderbuttom";d.innerHTML=l[e].JoinedDate.format(MY_CONTESTS_DATE_FORMAT);h.appendChild(d);d=document.createElement("td");d.className="width25 textCenter borderbuttom";d.innerHTML=l[e].EndDate.format(MY_CONTESTS_DATE_FORMAT);h.appendChild(d);j.appendChild(h)}}else{h=document.createElement("tr");d=document.createElement("td");d.colSpan=3;d.className="borderbuttom textCenter";d.innerHTML=MY_CONTESTS_NO_CONTESTS_SHOW;h.appendChild(d);j.appendChild(h)}h=document.createElement("tr");d=document.createElement("td");d.colSpan=3;d.className="myContestsFooter";c=document.createElement("a");c.href=g._UrlSBRContests;c.innerHTML=MY_CONTESTS_SBRCONTESTSCOM_TEXT;c.target="_blank";d.appendChild(c);h.appendChild(d);j.appendChild(h);m.appendChild(j);n.appendChild(m)}}function a(d,c){}};var MY_SBRF_WS_ERROR="The process failure (Load {0} SBRForum posts)... please try again later. {1}";var MY_SBRF_SBRFORUMCOM_TEXT="SBRForum.com";var MY_SBRF_NO_POSTS_SHOW="No SBRForum threads to show.";var MY_SBRF_REG_EXP="(\\s(a|an|and|are|as|at|be|by|for|from|in|is|it|of|on|or|to|that|the|this|too|was|which|with)\\s+|[^\\d\\w]+)";var MY_SBRF_DATE_FORMAT="MM/dd/yyyy";var MY_SBRF_TABLE_COL_ONE="Thread";var MY_SBRF_TABLE_COL_TWO="Publicated at";function MySBRForumPosts(){var d;var b;var c;var e;var a;var g;var h;var f}MySBRForumPosts.prototype.LoadMySBRForumPosts=function(){SBR.TV.Website.WebServices.WebServiceProxy.MySBRForumPosts(this._ForumUserName,this._ForumUserId,this._ShowOnlyPosts,this._PostsToDisplay,b,a,this);function b(d,k){var q;var m;var l;var f;var n;var e;var j=$get(k._DivHeaderId);var t=$get(k._DivListId);if(j&&t){n=document.createElement("span");n.innerHTML=k._Title;j.appendChild(n);q=document.createElement("table");m=document.createElement("tbody");l=document.createElement("tr");f=document.createElement("td");f.innerHTML=MY_SBRF_TABLE_COL_ONE;f.className="mySBRForumPostsListHeader";l.appendChild(f);f=document.createElement("td");f.innerHTML=MY_SBRF_TABLE_COL_TWO;f.className="mySBRForumPostsListHeader";l.appendChild(f);m.appendChild(l);if(d.firstChild&&d.firstChild.childNodes&&d.firstChild.childNodes.length>0){for(var h=0;h<d.firstChild.childNodes.length;h++){var o=d.firstChild.childNodes[h];l=document.createElement("tr");f=document.createElement("td");f.className="width70 borderbuttom";var g=new RegExp(MY_SBRF_REG_EXP,"gi");var c=o.attributes.title.value.toLowerCase().replace(g,"-");var r=o.attributes.forumName.value.toLowerCase().replace(g,"-");e=document.createElement("a");e.href=String.format("{0}{1}/{2}-{3}.html",k._UrlSBRForum,r,o.attributes.id.value,c);e.innerHTML=o.attributes.title.value;e.target="_blank";f.appendChild(e);l.appendChild(f);f=document.createElement("td");f.className="width30 textCenter borderbuttom";f.innerHTML=(new Date(o.attributes.pubdate.value)).format(MY_SBRF_DATE_FORMAT);l.appendChild(f);m.appendChild(l)}}else{l=document.createElement("tr");f=document.createElement("td");f.colSpan=2;f.className="borderbuttom textCenter";f.innerHTML=MY_SBRF_NO_POSTS_SHOW;l.appendChild(f);m.appendChild(l)}l=document.createElement("tr");f=document.createElement("td");f.colSpan=2;f.className="mySBRForumPostsFooter";e=document.createElement("a");e.href=k._UrlSBRForum;e.target="_blank";e.innerHTML=MY_SBRF_SBRFORUMCOM_TEXT;f.appendChild(e);l.appendChild(f);m.appendChild(l);q.appendChild(m);t.appendChild(q)}}function a(d,c){}};function Profile(){var a;var b;var c}Profile.prototype.ProfileInit=function(){var b=0;SBR.TV.Website.WebServices.WebServiceProxy.GetChannels(this._PROFILEID,null,1,1,1,c,d,this);function c(a,e){e._CURRENT_CHANNEL=a;e.DisplayProfile()}function d(e){var a=$get(this._DivVideosId);a.innerHTML="The process failure (Load the channel) ... please try again later."}};Profile.prototype.DisplayProfile=function(){var d=$get(this._DIV_PROFILE_CONTAINER);if(this._CURRENT_CHANNEL.length>0){var f=this._CURRENT_CHANNEL[0];var l=document.createElement("table");var c=document.createElement("tbody");var n=document.createElement("tr");var k=document.createElement("td");var h=document.createElement(HTML_ANCHOR_TAG);h.className="Title";h.innerHTML="<b>"+(f.Name==EMPTY_STRING?"No Name":f.Name)+"</b>";k.colSpan=2;k.appendChild(h);n.appendChild(k);c.appendChild(n);l.appendChild(c);n=document.createElement("tr");k=document.createElement("td");var g=document.createElement(HTML_DIV_TAG);g.className="video_thumbnail";k.appendChild(g);n.appendChild(k);var a=document.createElement(HTML_DIV_TAG);a.className="image";var b=document.createElement(HTML_IMAGE_TAG);b.alt=f.Name;b.src=f.AvatarUrl;b.control=this;b.style.width="149px";b.style.height="149px";b.onerror=function(o){this.src=this.control._DEFAULT_IMG;this.onerror="";return true};a.appendChild(b);g.appendChild(a);k=document.createElement("td");var m=document.createElement(HTML_DIV_TAG);m.className="details";if(f&&f.User&&f.User.JoinDate){var j=document.createElement(HTML_DIV_TAG);j.className="item";j.innerHTML=String.format("<span><b>Added: </b>{0}</span>",f.User.JoinDate.format("MMMM dd, yyyy"));m.appendChild(j)}if(f&&f.User&&f.User.LastLogin){var j=document.createElement(HTML_DIV_TAG);j.className="item";j.innerHTML=String.format("<span><b>Last Sign in: </b>{0}</span>",f.User.LastLogin.format("MMMM dd, yyyy"));m.appendChild(j)}if(f&&f.User&&f.User.VideosOnline){var e=document.createElement(HTML_DIV_TAG);e.className="item";e.innerHTML=String.format("<span><b>Videos online: </b>{0}</span>",f.User.VideosOnline);m.appendChild(e)}if(f&&f.User&&f.User.VideosWatched){var e=document.createElement(HTML_DIV_TAG);e.className="item";e.innerHTML=String.format("<span><b>Videos Watched: </b>{0}</span>",f.User.VideosWatched);m.appendChild(e)}else{var e=document.createElement(HTML_DIV_TAG);e.className="item";e.innerHTML="<span><b>Videos Watched: </b>0</span>";m.appendChild(e)}k.appendChild(m);n.appendChild(k);c.appendChild(n);l.appendChild(c);d.appendChild(l);if(f&&f.User&&f.User.UserName){document.title="SBR.TV - "+f.User.UserName+"'s Channel"}}};var QUICKLIST_TEXT="Quicklist [{0}]";var QUICKLIST_ADDED_TEXT="Added";var QUICKLIST_ADDED_CLASS="quickListAdded";function QuickList(){var d;var b;var c;var a}QuickList.prototype.LoadQuickList=function(){if(document.cookie.length>0){var a=document.cookie.indexOf(this._LoggedUserName+"=");if(a>-1){a=a+this._LoggedUserName.length+1;var c=document.cookie.indexOf(";",a);if(c==-1){c=document.cookie.length}if(document.cookie.substring(a,c).length>0){this._UserQuickVideos=document.cookie.substring(a,c).split(",")}}}if(!this._UserQuickVideos){this._UserQuickVideos=new Array()}var b=$get(this._LnkUserListCtlId);b.innerHTML=String.format(QUICKLIST_TEXT,this._UserQuickVideos.length);b.href=this._UserListMngUrl};QuickList.prototype.AddToQuickList=function(b){b.innerHTML=QUICKLIST_ADDED_TEXT;b.className=QUICKLIST_ADDED_CLASS;if(Array.contains(this._UserQuickVideos,b.PostId.toString())){return false}Array.add(this._UserQuickVideos,b.PostId.toString());document.cookie=this._LoggedUserName+"="+this._UserQuickVideos.toString();var a=$get(this._LnkUserListCtlId);a.innerHTML=String.format(QUICKLIST_TEXT,this._UserQuickVideos.length);return false};QuickList.prototype.RemoveFromQuickList=function(a){if(Array.contains(this._UserQuickVideos,a.PostId.toString())){Array.remove(this._UserQuickVideos,a.PostId.toString());document.cookie=this._LoggedUserName+"="+this._UserQuickVideos.toString()}else{return false}return true};QuickList.prototype.GetQuickList=function(){return _QuickList._UserQuickVideos};QuickList.prototype.GetXMLQuickList=function(){var a="<PostsList>";var b=0;for(b;b<_QuickList._UserQuickVideos.length;b++){if(_QuickList._UserQuickVideos[b].length>0){a+=String.format("<PostId>{0}</PostId>",_QuickList._UserQuickVideos[b])}}a+="</PostsList>"};function EncodeVideo(){var b=$get("TBPostId").value;var c=$get("post_progress");if(c){div_element=document.createElement("div");div_element.className="progress";c.appendChild(div_element)}SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(SBR.TV.Communication.Objects.RequestType.POST,b,"",1,1,"ASC",false,false,e,d);function e(f){var g=0;for(var h in f){g++}if(g>0){SBR.TV.Website.WebServices.jsLocalServices.GetEncodingProfiles(a,d,f)}else{alert("Post not found")}}function a(j,g){var l=0;var q=0;var n="";var f="";var r;var m=",";for(var k in j){try{r=j[l];f="DefaultParams_"+r.Id;q++}catch(h){}l++}for(l=0;l<q;l++){r=j[l];f="DefaultParams_"+r.Id;if((l+1)>=q){m=""}n+=$get(f).value+m}if(l>0){SBR.TV.Website.WebServices.jsLocalServices.EncodeVideo(g[0].PostId,n,o,d)}function o(t){if(t){alert("Video Encode")}else{alert("Video Encode Not")}var u=$get("post_progress");if(u){while(u.lastChild!=null){u.removeChild(u.lastChild,u)}}}}function d(f){alert("error ...\n"+f._stackTrace)}}var divSbrAlert;var divSbrAlertBackGround;function sbrAlertShow(e,g,b,f,c,a,d){if(divSbrAlert==undefined&&divSbrAlertBackGround==undefined){window.onresize=DoResize;window.pWidth=b;divSbrAlertBackGround=document.createElement("div");divSbrAlertBackGround.className="sbrAlertBackground";divSbrAlert=document.createElement("div");divSbrAlert.className="sbrAlert";DoResize();divMainTop=document.createElement("div");divMainTop.className="mainTop";divCornerTopLeft=document.createElement("div");divCornerTopLeft.className="cornerTopLeft";divTop=document.createElement("div");divTop.className="top";divCornerTopRight=document.createElement("div");divCornerTopRight.className="cornerTopRight";divMainMiddleContentTitle=document.createElement("div");divMainMiddleContentTitle.className="mainMiddle";divLeftContentTitle=document.createElement("div");divLeftContentTitle.className="leftTitle";divTitle=document.createElement("div");pElement=document.createElement("p");divTitle.className="TitleAlert";pElement.innerHTML=e;divTitle.appendChild(pElement);divRightContentTitle=document.createElement("div");divRightContentTitle.className="rightTitle";divMainMiddleContent=document.createElement("div");divMainMiddleContent.className="mainMiddle";divBox=document.createElement("div");divBox.className="box";divContent=document.createElement("div");divContent.className="Content";divThumbnailBox=document.createElement("img");divThumbnailBox.className="Thumbnail";divThumbnailBox.alt="";if(d!=null&&d!=undefined&&d.Thumbnail){divThumbnailBox.src=d.Thumbnail}divThumbnailBox.style.display="none";divThumbnailBox.style.width="80px";divThumbnailBox.style.height="60px";divMsgBox=document.createElement("div");divMsgBox.className="msgBox";divMainMiddleButtoms=document.createElement("div");divMainMiddleButtoms.className="mainMiddle";divLeftButtons=document.createElement("div");divLeftButtons.className="leftButtons";divButtoms=document.createElement("div");divButtoms.className="buttoms";divButtomsContainer=document.createElement("div");divButtomsContainer.className="buttomsContainer";divRightButtons=document.createElement("div");divRightButtons.className="rightButtons";divMainBottom=document.createElement("div");divMainBottom.className="mainBottom";divCornerBottomLeft=document.createElement("div");divCornerBottomLeft.className="cornerBottomLeft";divBottom=document.createElement("div");divBottom.className="bottom";divCornerBottomRight=document.createElement("div");divCornerBottomRight.className="cornerBottomRight";divMainTop.appendChild(divCornerTopLeft);divMainTop.appendChild(divTop);divMainTop.appendChild(divCornerTopRight);divSbrAlert.appendChild(divMainTop);divMainMiddleContentTitle.appendChild(divLeftContentTitle);divMainMiddleContentTitle.appendChild(divTitle);divMainMiddleContentTitle.appendChild(divRightContentTitle);divSbrAlert.appendChild(divMainMiddleContentTitle);divMainMiddleContent.appendChild(divBox);divSbrAlert.appendChild(divMainMiddleContent);divMainMiddleButtoms.appendChild(divLeftButtons);divMainMiddleButtoms.appendChild(divButtoms);divButtoms.appendChild(divButtomsContainer);divMainMiddleButtoms.appendChild(divRightButtons);divSbrAlert.appendChild(divMainMiddleButtoms);divMainBottom.appendChild(divCornerBottomLeft);divMainBottom.appendChild(divBottom);divMainBottom.appendChild(divCornerBottomRight);divSbrAlert.appendChild(divMainBottom);if(b){divSbrAlert.style.width=b+20+"px";divBox.style.width=b+"px";divTop.style.width=b+"px";divBottom.style.width=b+"px";divTitle.style.width=b+"px";divButtoms.style.width=b+"px"}if(g){divMsgBox.innerHTML=g}else{divMsgBox.innerHTML=""}divContent.appendChild(divThumbnailBox);divContent.appendChild(divMsgBox);divBox.appendChild(divContent);switch(f){case 0:CreateDoneButtons(divButtomsContainer,c);break;case 1:CreateConfirmButtons(divButtomsContainer,c,a);break;case 2:divThumbnailBox.style.display="block";divMsgBox.className="msgBoxDelete";CreateDeleteButtons(divButtomsContainer,c,a);break;case SBR.TV.Communication.Objects.AlertType.DONE:CreateDoneButtons(divButtomsContainer,c);break;case SBR.TV.Communication.Objects.AlertType.CONFIRM:CreateConfirmButtons(divButtomsContainer,c,a);break;case SBR.TV.Communication.Objects.AlertType.DELETE:divThumbnailBox.style.display="block";divMsgBox.className="msgBoxDelete";CreateDeleteButtons(divButtomsContainer,c,a);break}document.body.appendChild(divSbrAlertBackGround);document.body.appendChild(divSbrAlert)}return false}function CreateDoneButtons(b,a){doneButtom=document.createElement("a");doneButtom.href="#";doneButtom.innerHTML="Close";doneButtom.className="buttom";doneButtom.onmousedown=ExecuteAction;doneButtom.callBack=a;b.appendChild(doneButtom);return}function CreateConfirmButtons(c,b,a){yesButtom=document.createElement("a");yesButtom.href="#";yesButtom.innerHTML="Yes";yesButtom.className="buttom";yesButtom.onmousedown=ExecuteAction;yesButtom.callBack=b;c.appendChild(yesButtom);noButtom=document.createElement("a");noButtom.href="#";noButtom.innerHTML="No";noButtom.className="buttom";noButtom.onmousedown=ExecuteAction;noButtom.callBack=a;c.appendChild(noButtom);return false}function CreateDeleteButtons(c,b,a){deleteButtom=document.createElement("a");deleteButtom.href="#";deleteButtom.innerHTML="Delete";deleteButtom.className="buttom";deleteButtom.onmousedown=ExecuteAction;deleteButtom.callBack=b;c.appendChild(deleteButtom);cancelButtom=document.createElement("a");cancelButtom.href="#";cancelButtom.innerHTML="Cancel";cancelButtom.className="buttom";cancelButtom.onmousedown=ExecuteAction;cancelButtom.callBack=a;c.appendChild(cancelButtom);return false}function ExecuteAction(){CloseDiv();if(this.callBack&&this.callBack!=null&&this.callBack!=undefined){var params=this.callBack;var call;call="params[0](";for(i=1;i<params.length-1;i++){call+="params["+i+"],"}call+="params["+(params.length-1)+"]);";if(call.length>0){return eval(call)}}}function CloseDiv(){if(divSbrAlert&&divSbrAlertBackGround){var b=divSbrAlert.parentNode;b.removeChild(divSbrAlert);divSbrAlert=undefined;var a=divSbrAlertBackGround.parentNode;a.removeChild(divSbrAlertBackGround);divSbrAlertBackGround=undefined;document.body.style.cursor="default"}return false}function DoResize(){if(divSbrAlert!=undefined&&divSbrAlertBackGround!=undefined&&window.pWidth){if(document&&document.body&&document.body.clientWidth&&window.screen.height&&window.screen&&window.screen.height&&window.screen.width){divSbrAlertBackGround.style.height=window.screen.height+"px";divSbrAlertBackGround.style.width=window.screen.width+"px";divSbrAlert.style.left=(document.documentElement.clientWidth/2)-(window.pWidth/2)+"px";divSbrAlert.style.top=(((document.documentElement.clientHeight/2)-100)+document.documentElement.scrollTop)+"px"}}}function Rating(){var g="";var a=5;var c="";var j;var d;var k;var e;var h;var f;var b;var l=0}Rating.prototype.run=function(){var divRatingContainer=$get(this._Rating_Container);eval("var objRef = "+this._Obj_Name_To_Rate);if(this._Provide_User_Key.length>0){if(objRef&&objRef._CURRENT_POST&&divRatingContainer){CreateRatingStars(divRatingContainer,objRef._CURRENT_POST.AverageRating,this._Max_Rating,this._Titles,false,this);var objRating=new SBR.TV.Communication.Objects.Rating();objRating.PostId=objRef._PLAY_POST_ID;objRating.CreateBy=this._Provide_User_Key;SBR.TV.Website.WebServices.WebServiceProxy.GetPostsRatingsByUserId(objRating,NumberOfRatingSuccess,NumberOfRatingFailed,this)}}else{if(divRatingContainer){CreateRatingStars(divRatingContainer,objRef._CURRENT_POST.AverageRating,this._Max_Rating,this._Titles,false,this)}this._Rated=1;this.loadRatings()}function NumberOfRatingSuccess(pNumber,pObjRating){pObjRating._numberOfRate=pNumber;if(pNumber==0){pObjRating._PreSet=undefined;pObjRating._Rated=undefined;pObjRating.loadRatings()}else{var divRatingContainer=$get(pObjRating._Rating_Container);if(divRatingContainer){divRatingContainer.title="You have already rated. "}pObjRating._Rated=1;pObjRating.loadRatings()}}function NumberOfRatingFailed(pError,pObjRating){pObjRating._PreSet=undefined;pObjRating._Rated=undefined;pObjRating.loadRatings()}return false};Rating.prototype.rating=function(){var e=this.thisAnchor;var a=this.objRanting;a._star=true;if(!a._Rated&&a._Name_Rating){var c=a._Name_Rating+"_";s=e.id.replace(c,"");var b=$get(a._Rating_Status);for(i=0;i<a._Max_Rating;i++){if(i<=s){b.innerHTML=e.title;if(this._numberOfRate==0&&a._Provide_User_Key.length>0){document.getElementById(c+i).className="onRatingEnabled"}else{document.getElementById(c+i).className="onRatingDisable"}}else{document.getElementById(c+i).className=""}}}else{var b=$get(a._Rating_Status);if(b){b.innerHTML=e.parentNode.title}if(!a._PreSet){var d="var objectRatingRef = "+a._Name_Rating+"; if (objectRatingRef){ objectRatingRef.loadRatings();}";setTimeout(d,1000)}}};Rating.prototype.OnStarContainer=function(a){if(!this._Rated&&!this._star){this.loadRatings()}};Rating.prototype.offStar=function(){var a=this.objRanting;if(a._star){a._star=undefined}};Rating.prototype.off=function(e){var b=0;e=this.thisAnchor;var c=$get(this._Rating_Status);if(!this._Rated&&this._Name_Rating){var d=this._Name_Rating+"_";if(!this._PreSet){for(i=0;i<this._Max_Rating;i++){document.getElementById(d+i).className=""}}else{this.rating(this._PreSet);c.innerHTML=""}}else{this.loadRatings()}};Rating.prototype.loadRatings=function(){var divRatingStatusRef=$get(this._Rating_Status);if(this._Obj_Name_To_Rate.length>0&&divRatingStatusRef){eval("var objRef = "+this._Obj_Name_To_Rate);if(objRef&&objRef.GetObjectIdRating){var id=objRef.GetObjectIdRating();if(id){if(this.Average==undefined&&this.TotalRating==undefined){SBR.TV.Website.WebServices.WebServiceProxy.GetPostsRatingsByPostId(id,RatingInformationSuccess,RatingInformationFailed,this)}else{divRatingStatusRef.innerHTML=this.TotalRating+" ratings.";this.setAverage(this.Average)}}else{divRatingStatusRef.innerHTML=""}}}function RatingInformationSuccess(pRating,pObjRating){var divRatingStatusRef=$get(pObjRating._Rating_Status);if(divRatingStatusRef&&pRating){pObjRating.TotalRating=pRating.TotalRating;pObjRating.Average=pRating.Average;divRatingStatusRef.innerHTML=pRating.TotalRating+" ratings.";pObjRating.setAverage(pRating.Average)}else{divRatingStatusRef.innerHTML=""}}function RatingInformationFailed(pError){}};Rating.prototype.setAverage=function(d){var b=this._Name_Rating+"_";for(i=0;i<this._Max_Rating;i++){if(i<d){if((i+1)<=d){c="onRatingEnabled";e="onRatingDisable"}else{var a=d-parseInt(d);var c="";var e="";if(a<=QUARTER_UNIT){c="onRatingEnabled_quarter";e="onRatingDisable_quarter"}else{if(a>QUARTER_UNIT&&a<=HALF_UNIT){c="onRatingEnabled_half";e="onRatingDisable_half"}else{if(a>HALF_UNIT&&a<=THREE_QUARTERS_UNIT){c="onRatingEnabled_three_quarters";e="onRatingDisable_three_quarters"}else{c="onRatingEnabled";e="onRatingDisable"}}}}if(this._numberOfRate==0&&this._Provide_User_Key.length>0){document.getElementById(b+i).className=c}else{document.getElementById(b+i).className=e}}else{document.getElementById(b+i).className=""}}};Rating.prototype.rateIt=function(b){var b=this.thisAnchor;var a=this.objRanting;if(!a._Rated){a._PreSet=b;a._Rated=1;a.sendRate(b);a.VoteApplied(b.getAttribute("value"));a._numberOfRate=1;document.body.style.cursor="default"}return false};Rating.prototype.VoteApplied=function(a){var b=this._Name_Rating+"_";for(i=0;i<this._Max_Rating;i++){if(i<a){document.getElementById(b+i).className="onRatingDisable"}else{document.getElementById(b+i).className=""}}};Rating.prototype.sendRate=function(pAnchor){var divRatingStatusRef=$get(this._Rating_Status);var divRatingContainer=$get(this._Rating_Container);if(this._Obj_Name_To_Rate.length>0&&divRatingStatusRef){eval("var objRef = "+this._Obj_Name_To_Rate);if(objRef&&objRef.RegisterRate){divRatingContainer.title=" Thanks for rating!";divRatingStatusRef.innerHTML=" Thanks for rating!";objRef.RegisterRate(pAnchor.getAttribute("value"),this._Provide_User_Key)}}return false};var STRING_EMPLY="";var ENTER_KEY_CODE=13;var SEARCHDIV_HEIGHT=40;var SEARCHDIV_WIDTH=230;var LI=false;function changeMaskSearchTvFocus(a,b){if(a.value==TEXT_DEFAULT_VALUE_SEARCH){a.defaultValue=STRING_EMPLY;a.value=STRING_EMPLY}a.className=b}function changeMaskSearchTvBlur(a,b){if(a.value.length==0){a.value=TEXT_DEFAULT_VALUE_SEARCH}a.className=b}function setFocusSearchButtonEnterKey(a){var c=0;if(a.keyCode){c=a.keyCode}if(c==ENTER_KEY_CODE){var b=$get(SEARCH_BUTTON);if(b){b.focus()}}}function SearchTypeSelected(b){if(SEARCH_TYPE){var a=$get(SEARCH_TYPE);if(a){a.value=b}}HiddenOptions()}function DisplayOptions(){if(SEARCH_OPTIONS){var a=$get(SEARCH_OPTIONS);if(a){a.style.display="block"}}}function HiddenOptions(){if(SEARCH_OPTIONS){var a=$get(SEARCH_OPTIONS);if(a){a.style.display="none"}}}function ULOut(c){var b=c.clientX;var h=c.clientY;var a;var g;var f=c.currentTarget;if(!f){f=c.srcElement}g=parseInt(f.clientHeight);a=parseInt(f.clientWidth);var d=f.offsetLeft;var e=f.offsetTop;if(f.offsetParent){f=f.offsetParent;while(f){d+=f.offsetLeft;e+=f.offsetTop;f=f.offsetParent}}if(h<e||h>(e+SEARCHDIV_HEIGHT)||b<d||b>(d+SEARCHDIV_WIDTH)){HiddenOptions()}}var config=new Object();var tt_Debug=true;var tt_Enabled=true;var TagsToTip=true;config.Above=false;config.BgColor="#E2E7FF";config.BgImg="";config.BorderColor="#003099";config.BorderStyle="solid";config.BorderWidth=1;config.CenterMouse=false;config.ClickClose=false;config.ClickSticky=false;config.CloseBtn=false;config.CloseBtnColors=["#990000","#FFFFFF","#DD3333","#FFFFFF"];config.CloseBtnText="&nbsp;X&nbsp;";config.CopyContent=true;config.Delay=400;config.Duration=0;config.Exclusive=false;config.FadeIn=100;config.FadeOut=100;config.FadeInterval=30;config.Fix=null;config.FollowMouse=true;config.FontColor="#000044";config.FontFace="Verdana,Geneva,sans-serif";config.FontSize="8pt";config.FontWeight="normal";config.Height=0;config.JumpHorz=false;config.JumpVert=true;config.Left=false;config.OffsetX=14;config.OffsetY=8;config.Opacity=100;config.Padding=3;config.Shadow=false;config.ShadowColor="#C0C0C0";config.ShadowWidth=5;config.Sticky=false;config.TextAlign="left";config.Title="";config.TitleAlign="left";config.TitleBgColor="";config.TitleFontColor="#FFFFFF";config.TitleFontFace="";config.TitleFontSize="";config.TitlePadding=2;config.Width=0;function DynamicTip(){if(this.parameters){var dynamicArguments="";var parameters=parseInt(this.parameters);for(index=0;index<=parameters;index++){var expression="var value=this.p"+index;eval(expression);if(dynamicArguments.length==0){dynamicArguments=value}else{dynamicArguments+=","+value}}}if(dynamicArguments.length>0){return eval("Tip("+dynamicArguments+")")}}function DynamicTipServer(obj){if(obj.getAttribute("parameters")){var dynamicArguments="";var parameters=parseInt(obj.getAttribute("parameters"));for(index=0;index<=parameters;index++){var expression="var value=obj.getAttribute('p"+index+"')";eval(expression);if(dynamicArguments.length==0){dynamicArguments=value}else{dynamicArguments+=","+value}}}if(dynamicArguments.length>0){return eval("Tip("+dynamicArguments+")")}}function Tip(){var b=0;tt_Tip(arguments,null)}function TagToTip(){var a=tt_GetElt(arguments[0]);if(a){tt_Tip(arguments,a)}}function UnTip(){tt_OpReHref();if(tt_aV[DURATION]<0&&(tt_iState&2)){tt_tDurt.Timer("tt_HideInit()",-tt_aV[DURATION],true)}else{if(!(tt_aV[STICKY]&&(tt_iState&2))){tt_HideInit()}}}var tt_aElt=new Array(10),tt_aV=new Array(),tt_sContent,tt_t2t,tt_t2tDad,tt_musX,tt_musY,tt_over,tt_x,tt_y,tt_w,tt_h;function tt_Extension(){tt_ExtCmdEnum();tt_aExt[tt_aExt.length]=this;return this}function tt_SetTipPos(b,d){var c=tt_aElt[0].style;tt_x=b;tt_y=d;c.left=b+"px";c.top=d+"px";if(tt_ie56){var a=tt_aElt[tt_aElt.length-1];if(a){a.style.left=c.left;a.style.top=c.top}}}function tt_HideInit(){if(tt_iState){tt_ExtCallFncs(0,"HideInit");tt_iState&=~(4|8);if(tt_flagOpa&&tt_aV[FADEOUT]){tt_tFade.EndTimer();if(tt_opa){var a=Math.round(tt_aV[FADEOUT]/(tt_aV[FADEINTERVAL]*(tt_aV[OPACITY]/tt_opa)));tt_Fade(tt_opa,tt_opa,0,a);return}}tt_tHide.Timer("tt_Hide();",1,false)}}function tt_Hide(){if(tt_db&&tt_iState){tt_OpReHref();if(tt_iState&2){tt_aElt[0].style.visibility="hidden";tt_ExtCallFncs(0,"Hide")}tt_tShow.EndTimer();tt_tHide.EndTimer();tt_tDurt.EndTimer();tt_tFade.EndTimer();if(!tt_op&&!tt_ie){tt_tWaitMov.EndTimer();tt_bWait=false}if(tt_aV[CLICKCLOSE]||tt_aV[CLICKSTICKY]){tt_RemEvtFnc(document,"mouseup",tt_OnLClick)}tt_ExtCallFncs(0,"Kill");if(tt_t2t&&!tt_aV[COPYCONTENT]){tt_UnEl2Tip()}tt_iState=0;tt_over=null;tt_ResetMainDiv();if(tt_aElt[tt_aElt.length-1]){tt_aElt[tt_aElt.length-1].style.display="none"}}}function tt_GetElt(a){return(document.getElementById?document.getElementById(a):document.all?document.all[a]:null)}function tt_GetDivW(a){return(a?(a.offsetWidth||a.style.pixelWidth||0):0)}function tt_GetDivH(a){return(a?(a.offsetHeight||a.style.pixelHeight||0):0)}function tt_GetScrollX(){return(window.pageXOffset||(tt_db?(tt_db.scrollLeft||0):0))}function tt_GetScrollY(){return(window.pageYOffset||(tt_db?(tt_db.scrollTop||0):0))}function tt_GetClientW(){return tt_GetWndCliSiz("Width")}function tt_GetClientH(){return tt_GetWndCliSiz("Height")}function tt_GetEvtX(a){return(a?((typeof(a.pageX)!=tt_u)?a.pageX:(a.clientX+tt_GetScrollX())):0)}function tt_GetEvtY(a){return(a?((typeof(a.pageY)!=tt_u)?a.pageY:(a.clientY+tt_GetScrollY())):0)}function tt_AddEvtFnc(b,a,c){if(b){if(b.addEventListener){b.addEventListener(a,c,false)}else{b.attachEvent("on"+a,c)}}}function tt_RemEvtFnc(b,a,c){if(b){if(b.removeEventListener){b.removeEventListener(a,c,false)}else{b.detachEvent("on"+a,c)}}}function tt_GetDad(a){return(a.parentNode||a.parentElement||a.offsetParent)}function tt_MovDomNode(b,a,c){if(a){a.removeChild(b)}if(c){c.appendChild(b)}}var tt_aExt=new Array(),tt_db,tt_op,tt_ie,tt_ie56,tt_bBoxOld,tt_body,tt_ovr_,tt_flagOpa,tt_maxPosX,tt_maxPosY,tt_iState=0,tt_opa,tt_bJmpVert,tt_bJmpHorz,tt_elDeHref,tt_tShow=new Number(0),tt_tHide=new Number(0),tt_tDurt=new Number(0),tt_tFade=new Number(0),tt_tWaitMov=new Number(0),tt_bWait=false,tt_u="undefined";function tt_Init(){tt_MkCmdEnum();if(!tt_Browser()||!tt_MkMainDiv()){return}tt_IsW3cBox();tt_OpaSupport();tt_AddEvtFnc(document,"mousemove",tt_Move);if(TagsToTip||tt_Debug){tt_SetOnloadFnc()}tt_AddEvtFnc(window,"unload",tt_Hide)}function tt_MkCmdEnum(){var n=0;for(var i in config){eval("window."+i.toString().toUpperCase()+" = "+n++)}tt_aV.length=n}function tt_Browser(){var n,nv,n6,w3c;n=navigator.userAgent.toLowerCase(),nv=navigator.appVersion;tt_op=(document.defaultView&&typeof(eval("window.opera"))!=tt_u);tt_ie=n.indexOf("msie")!=-1&&document.all&&!tt_op;if(tt_ie){var ieOld=(!document.compatMode||document.compatMode=="BackCompat");tt_db=!ieOld?document.documentElement:(document.body||null);if(tt_db){tt_ie56=parseFloat(nv.substring(nv.indexOf("MSIE")+5))>=5.5&&typeof document.body.style.maxHeight==tt_u}}else{tt_db=document.documentElement||document.body||(document.getElementsByTagName?document.getElementsByTagName("body")[0]:null);if(!tt_op){n6=document.defaultView&&typeof document.defaultView.getComputedStyle!=tt_u;w3c=!n6&&document.getElementById}}tt_body=(document.getElementsByTagName?document.getElementsByTagName("body")[0]:(document.body||null));if(tt_ie||n6||tt_op||w3c){if(tt_body&&tt_db){if(document.attachEvent||document.addEventListener){return true}}else{tt_Err("wz_tooltip.js must be included INSIDE the body section, immediately after the opening <body> tag.",false)}}tt_db=null;return false}function tt_MkMainDiv(){if(tt_body.insertAdjacentHTML){tt_body.insertAdjacentHTML("afterBegin",tt_MkMainDivHtm())}else{if(typeof tt_body.innerHTML!=tt_u&&document.createElement&&tt_body.appendChild){tt_body.appendChild(tt_MkMainDivDom())}}if(window.tt_GetMainDivRefs&&tt_GetMainDivRefs()){return true}tt_db=null;return false}function tt_MkMainDivHtm(){return('<div id="WzTtDiV"></div>'+(tt_ie56?('<iframe id="WzTtIfRm" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"></iframe>'):""))}function tt_MkMainDivDom(){var a=document.createElement("div");if(a){a.id="WzTtDiV"}return a}function tt_GetMainDivRefs(){tt_aElt[0]=tt_GetElt("WzTtDiV");if(tt_ie56&&tt_aElt[0]){tt_aElt[tt_aElt.length-1]=tt_GetElt("WzTtIfRm");if(!tt_aElt[tt_aElt.length-1]){tt_aElt[0]=null}}if(tt_aElt[0]){var a=tt_aElt[0].style;a.visibility="hidden";a.position="absolute";a.overflow="hidden";return true}return false}function tt_ResetMainDiv(){tt_SetTipPos(0,0);tt_aElt[0].innerHTML="";tt_aElt[0].style.width="0px";tt_h=0}function tt_IsW3cBox(){var a=tt_aElt[0].style;a.padding="10px";a.width="40px";tt_bBoxOld=(tt_GetDivW(tt_aElt[0])==40);a.padding="0px";tt_ResetMainDiv()}function tt_OpaSupport(){var a=tt_body.style;tt_flagOpa=(typeof(a.KhtmlOpacity)!=tt_u)?2:(typeof(a.KHTMLOpacity)!=tt_u)?3:(typeof(a.MozOpacity)!=tt_u)?4:(typeof(a.opacity)!=tt_u)?5:(typeof(a.filter)!=tt_u)?1:0}function tt_SetOnloadFnc(){tt_AddEvtFnc(document,"DOMContentLoaded",tt_HideSrcTags);tt_AddEvtFnc(window,"load",tt_HideSrcTags);if(tt_body.attachEvent){tt_body.attachEvent("onreadystatechange",function(){if(tt_body.readyState=="complete"){tt_HideSrcTags()}})}if(/WebKit|KHTML/i.test(navigator.userAgent)){var a=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(a);tt_HideSrcTags()}},10)}}function tt_HideSrcTags(){if(!window.tt_HideSrcTags||window.tt_HideSrcTags.done){return}window.tt_HideSrcTags.done=true;if(!tt_HideSrcTagsRecurs(tt_body)){tt_Err("There are HTML elements to be converted to tooltips.\nIf you want these HTML elements to be automatically hidden, you must edit wz_tooltip.js, and set TagsToTip in the global tooltip configuration to true.",true)}}function tt_HideSrcTagsRecurs(c){var f,e;var b=c.childNodes||c.children||null;for(var d=b?b.length:0;d;){--d;if(!tt_HideSrcTagsRecurs(b[d])){return false}f=b[d].getAttribute?(b[d].getAttribute("onmouseover")||b[d].getAttribute("onclick")):(typeof b[d].onmouseover=="function")?(b[d].onmouseover||b[d].onclick):null;if(f){e=f.toString().match(/TagToTip\s*\(\s*'[^'.]+'\s*[\),]/);if(e&&e.length){if(!tt_HideSrcTag(e[0])){return false}}}}return true}function tt_HideSrcTag(b){var c,a;c=b.replace(/.+'([^'.]+)'.+/,"$1");a=tt_GetElt(c);if(a){if(tt_Debug&&!TagsToTip){return false}else{a.style.display="none"}}else{tt_Err("Invalid ID\n'"+c+"'\npassed to TagToTip(). There exists no HTML element with that ID.",true)}return true}function tt_Tip(a,b){if(!tt_db||(tt_iState&8)){return}if(tt_iState){tt_Hide()}if(!tt_Enabled){return}tt_t2t=b;if(!tt_ReadCmds(a)){return}tt_iState=1|4;tt_AdaptConfig1();tt_MkTipContent(a);tt_MkTipSubDivs();tt_FormatTip();tt_bJmpVert=false;tt_bJmpHorz=false;tt_maxPosX=tt_GetClientW()+tt_GetScrollX()-tt_w-1;tt_maxPosY=tt_GetClientH()+tt_GetScrollY()-tt_h-1;tt_AdaptConfig2();tt_OverInit();tt_ShowInit();tt_Move()}function tt_ReadCmds(b){var d;d=0;for(var c in config){tt_aV[d++]=config[c]}if(b.length&1){for(d=b.length-1;d>0;d-=2){tt_aV[b[d-1]]=b[d]}return true}tt_Err("Incorrect call of Tip() or TagToTip().\nEach command must be followed by a value.",true);return false}function tt_AdaptConfig1(){tt_ExtCallFncs(0,"LoadConfig");if(!tt_aV[TITLEBGCOLOR].length){tt_aV[TITLEBGCOLOR]=tt_aV[BORDERCOLOR]}if(!tt_aV[TITLEFONTCOLOR].length){tt_aV[TITLEFONTCOLOR]=tt_aV[BGCOLOR]}if(!tt_aV[TITLEFONTFACE].length){tt_aV[TITLEFONTFACE]=tt_aV[FONTFACE]}if(!tt_aV[TITLEFONTSIZE].length){tt_aV[TITLEFONTSIZE]=tt_aV[FONTSIZE]}if(tt_aV[CLOSEBTN]){if(!tt_aV[CLOSEBTNCOLORS]){tt_aV[CLOSEBTNCOLORS]=new Array("","","","")}for(var a=4;a;){--a;if(!tt_aV[CLOSEBTNCOLORS][a].length){tt_aV[CLOSEBTNCOLORS][a]=(a&1)?tt_aV[TITLEFONTCOLOR]:tt_aV[TITLEBGCOLOR]}}if(!tt_aV[TITLE].length){tt_aV[TITLE]=" "}}if(tt_aV[OPACITY]==100&&typeof tt_aElt[0].style.MozOpacity!=tt_u&&!Array.every){tt_aV[OPACITY]=99}if(tt_aV[FADEIN]&&tt_flagOpa&&tt_aV[DELAY]>100){tt_aV[DELAY]=Math.max(tt_aV[DELAY]-tt_aV[FADEIN],100)}}function tt_AdaptConfig2(){if(tt_aV[CENTERMOUSE]){tt_aV[OFFSETX]-=((tt_w-(tt_aV[SHADOW]?tt_aV[SHADOWWIDTH]:0))>>1);tt_aV[JUMPHORZ]=false}}function tt_MkTipContent(b){if(tt_t2t){if(tt_aV[COPYCONTENT]){tt_sContent=tt_t2t.innerHTML}else{tt_sContent=""}}else{tt_sContent=b[0]}tt_ExtCallFncs(0,"CreateContentString")}function tt_MkTipSubDivs(){var b="position:relative;margin:0px;padding:0px;border-width:0px;left:0px;top:0px;line-height:normal;width:auto;",a=' cellspacing="0" cellpadding="0" border="0" style="'+b+'"><tbody style="'+b+'"><tr><td ';tt_aElt[0].style.width=tt_GetClientW()+"px";tt_aElt[0].innerHTML=(""+(tt_aV[TITLE].length?('<div id="WzTiTl" style="position:relative;z-index:1;"><table id="WzTiTlTb"'+a+'id="WzTiTlI" style="'+b+'">'+tt_aV[TITLE]+"</td>"+(tt_aV[CLOSEBTN]?('<td align="right" style="'+b+'text-align:right;"><span id="WzClOsE" style="position:relative;left:2px;padding-left:2px;padding-right:2px;cursor:'+(tt_ie?"hand":"pointer")+';" onmouseover="tt_OnCloseBtnOver(1)" onmouseout="tt_OnCloseBtnOver(0)" onclick="tt_HideInit()">'+tt_aV[CLOSEBTNTEXT]+"</span></td>"):"")+"</tr></tbody></table></div>"):"")+'<div id="WzBoDy" style="position:relative;z-index:0;"><table'+a+'id="WzBoDyI" style="'+b+'">'+tt_sContent+"</td></tr></tbody></table></div>"+(tt_aV[SHADOW]?('<div id="WzTtShDwR" style="position:absolute;overflow:hidden;"></div><div id="WzTtShDwB" style="position:relative;overflow:hidden;"></div>'):""));tt_GetSubDivRefs();if(tt_t2t&&!tt_aV[COPYCONTENT]){tt_El2Tip()}tt_ExtCallFncs(0,"SubDivsCreated")}function tt_GetSubDivRefs(){var b=new Array("WzTiTl","WzTiTlTb","WzTiTlI","WzClOsE","WzBoDy","WzBoDyI","WzTtShDwB","WzTtShDwR");for(var a=b.length;a;--a){tt_aElt[a]=tt_GetElt(b[a-1])}}function tt_FormatTip(){var f,k,e,b=tt_aV[PADDING],d,c=tt_aV[BORDERWIDTH],a,g,j=(b+c)<<1;if(tt_aV[TITLE].length){d=tt_aV[TITLEPADDING];f=tt_aElt[1].style;f.background=tt_aV[TITLEBGCOLOR];f.paddingTop=f.paddingBottom=d+"px";f.paddingLeft=f.paddingRight=(d+2)+"px";f=tt_aElt[3].style;f.color=tt_aV[TITLEFONTCOLOR];if(tt_aV[WIDTH]==-1){f.whiteSpace="nowrap"}f.fontFamily=tt_aV[TITLEFONTFACE];f.fontSize=tt_aV[TITLEFONTSIZE];f.fontWeight="bold";f.textAlign=tt_aV[TITLEALIGN];if(tt_aElt[4]){f=tt_aElt[4].style;f.background=tt_aV[CLOSEBTNCOLORS][0];f.color=tt_aV[CLOSEBTNCOLORS][1];f.fontFamily=tt_aV[TITLEFONTFACE];f.fontSize=tt_aV[TITLEFONTSIZE];f.fontWeight="bold"}if(tt_aV[WIDTH]>0){tt_w=tt_aV[WIDTH]}else{tt_w=tt_GetDivW(tt_aElt[3])+tt_GetDivW(tt_aElt[4]);if(tt_aElt[4]){tt_w+=b}if(tt_aV[WIDTH]<-1&&tt_w>-tt_aV[WIDTH]){tt_w=-tt_aV[WIDTH]}}a=-c}else{tt_w=0;a=0}f=tt_aElt[5].style;f.top=a+"px";if(c){f.borderColor=tt_aV[BORDERCOLOR];f.borderStyle=tt_aV[BORDERSTYLE];f.borderWidth=c+"px"}if(tt_aV[BGCOLOR].length){f.background=tt_aV[BGCOLOR]}if(tt_aV[BGIMG].length){f.backgroundImage="url("+tt_aV[BGIMG]+")"}f.padding=b+"px";f.textAlign=tt_aV[TEXTALIGN];if(tt_aV[HEIGHT]){f.overflow="auto";if(tt_aV[HEIGHT]>0){f.height=(tt_aV[HEIGHT]+j)+"px"}else{tt_h=j-tt_aV[HEIGHT]}}f=tt_aElt[6].style;f.color=tt_aV[FONTCOLOR];f.fontFamily=tt_aV[FONTFACE];f.fontSize=tt_aV[FONTSIZE];f.fontWeight=tt_aV[FONTWEIGHT];f.textAlign=tt_aV[TEXTALIGN];if(tt_aV[WIDTH]>0){k=tt_aV[WIDTH]}else{if(tt_aV[WIDTH]==-1&&tt_w){k=tt_w}else{k=tt_GetDivW(tt_aElt[6]);if(tt_aV[WIDTH]<-1&&k>-tt_aV[WIDTH]){k=-tt_aV[WIDTH]}}}if(k>tt_w){tt_w=k}tt_w+=j;if(tt_aV[SHADOW]){tt_w+=tt_aV[SHADOWWIDTH];g=Math.floor((tt_aV[SHADOWWIDTH]*4)/3);f=tt_aElt[7].style;f.top=a+"px";f.left=g+"px";f.width=(tt_w-g-tt_aV[SHADOWWIDTH])+"px";f.height=tt_aV[SHADOWWIDTH]+"px";f.background=tt_aV[SHADOWCOLOR];f=tt_aElt[8].style;f.top=g+"px";f.left=(tt_w-tt_aV[SHADOWWIDTH])+"px";f.width=tt_aV[SHADOWWIDTH]+"px";f.background=tt_aV[SHADOWCOLOR]}else{g=0}tt_SetTipOpa(tt_aV[FADEIN]?0:tt_aV[OPACITY]);tt_FixSize(a,g)}function tt_FixSize(a,g){var j,d,f,k,b=tt_aV[PADDING],c=tt_aV[BORDERWIDTH],e;tt_aElt[0].style.width=tt_w+"px";tt_aElt[0].style.pixelWidth=tt_w;d=tt_w-((tt_aV[SHADOW])?tt_aV[SHADOWWIDTH]:0);j=d;if(!tt_bBoxOld){j-=(b+c)<<1}tt_aElt[5].style.width=j+"px";if(tt_aElt[1]){j=d-((tt_aV[TITLEPADDING]+2)<<1);if(!tt_bBoxOld){d=j}tt_aElt[1].style.width=d+"px";tt_aElt[2].style.width=j+"px"}if(tt_h){f=tt_GetDivH(tt_aElt[5]);if(f>tt_h){if(!tt_bBoxOld){tt_h-=(b+c)<<1}tt_aElt[5].style.height=tt_h+"px"}}tt_h=tt_GetDivH(tt_aElt[0])+a;if(tt_aElt[8]){tt_aElt[8].style.height=(tt_h-g)+"px"}e=tt_aElt.length-1;if(tt_aElt[e]){tt_aElt[e].style.width=tt_w+"px";tt_aElt[e].style.height=tt_h+"px"}}function tt_DeAlt(c){var a;if(c){if(c.alt){c.alt=""}if(c.title){c.title=""}a=c.childNodes||c.children||null;if(a){for(var b=a.length;b;){tt_DeAlt(a[--b])}}}}function tt_OpDeHref(a){if(!tt_op){return}if(tt_elDeHref){tt_OpReHref()}while(a){if(a.hasAttribute&&a.hasAttribute("href")){a.t_href=a.getAttribute("href");a.t_stats=window.status;a.removeAttribute("href");a.style.cursor="hand";tt_AddEvtFnc(a,"mousedown",tt_OpReHref);window.status=a.t_href;tt_elDeHref=a;break}a=tt_GetDad(a)}}function tt_OpReHref(){if(tt_elDeHref){tt_elDeHref.setAttribute("href",tt_elDeHref.t_href);tt_RemEvtFnc(tt_elDeHref,"mousedown",tt_OpReHref);window.status=tt_elDeHref.t_stats;tt_elDeHref=null}}function tt_El2Tip(){var a=tt_t2t.style;tt_t2t.t_cp=a.position;tt_t2t.t_cl=a.left;tt_t2t.t_ct=a.top;tt_t2t.t_cd=a.display;tt_t2tDad=tt_GetDad(tt_t2t);tt_MovDomNode(tt_t2t,tt_t2tDad,tt_aElt[6]);a.display="block";a.position="static";a.left=a.top=a.marginLeft=a.marginTop="0px"}function tt_UnEl2Tip(){var a=tt_t2t.style;a.display=tt_t2t.t_cd;tt_MovDomNode(tt_t2t,tt_GetDad(tt_t2t),tt_t2tDad);a.position=tt_t2t.t_cp;a.left=tt_t2t.t_cl;a.top=tt_t2t.t_ct;tt_t2tDad=null}function tt_OverInit(){if(window.event){tt_over=window.event.target||window.event.srcElement}else{tt_over=tt_ovr_}tt_DeAlt(tt_over);tt_OpDeHref(tt_over)}function tt_ShowInit(){tt_tShow.Timer("tt_Show()",tt_aV[DELAY],true);if(tt_aV[CLICKCLOSE]||tt_aV[CLICKSTICKY]){tt_AddEvtFnc(document,"mouseup",tt_OnLClick)}}function tt_Show(){var a=tt_aElt[0].style;a.zIndex=Math.max((window.dd&&dd.z)?(dd.z+2):0,1010);if(tt_aV[STICKY]||!tt_aV[FOLLOWMOUSE]){tt_iState&=~4}if(tt_aV[EXCLUSIVE]){tt_iState|=8}if(tt_aV[DURATION]>0){tt_tDurt.Timer("tt_HideInit()",tt_aV[DURATION],true)}tt_ExtCallFncs(0,"Show");a.visibility="visible";tt_iState|=2;if(tt_aV[FADEIN]){tt_Fade(0,0,tt_aV[OPACITY],Math.round(tt_aV[FADEIN]/tt_aV[FADEINTERVAL]))}tt_ShowIfrm()}function tt_ShowIfrm(){if(tt_ie56){var a=tt_aElt[tt_aElt.length-1];if(a){var b=a.style;b.zIndex=tt_aElt[0].style.zIndex-1;b.display="block"}}}function tt_Move(a){if(a){tt_ovr_=a.target||a.srcElement}a=a||window.event;if(a){tt_musX=tt_GetEvtX(a);tt_musY=tt_GetEvtY(a)}if(tt_iState&4){if(!tt_op&&!tt_ie){if(tt_bWait){return}tt_bWait=true;tt_tWaitMov.Timer("tt_bWait = false;",1,true)}if(tt_aV[FIX]){tt_iState&=~4;tt_PosFix()}else{if(!tt_ExtCallFncs(a,"MoveBefore")){tt_SetTipPos(tt_Pos(0),tt_Pos(1))}}tt_ExtCallFncs([tt_musX,tt_musY],"MoveAfter")}}function tt_Pos(b){var h,k,c,a,d,f,e,g,j;if(b){k=tt_aV[JUMPVERT];c=ABOVE;a=OFFSETY;d=tt_h;f=tt_maxPosY;e=tt_GetScrollY();g=tt_musY;j=tt_bJmpVert}else{k=tt_aV[JUMPHORZ];c=LEFT;a=OFFSETX;d=tt_w;f=tt_maxPosX;e=tt_GetScrollX();g=tt_musX;j=tt_bJmpHorz}if(k){if(tt_aV[c]&&(!j||tt_CalcPosAlt(b)>=e+16)){h=tt_PosAlt(b)}else{if(!tt_aV[c]&&j&&tt_CalcPosDef(b)>f-16){h=tt_PosAlt(b)}else{h=tt_PosDef(b)}}}else{h=g;if(tt_aV[c]){h-=d+tt_aV[a]-(tt_aV[SHADOW]?tt_aV[SHADOWWIDTH]:0)}else{h+=tt_aV[a]}}if(h>f){h=k?tt_PosAlt(b):f}if(h<e){h=k?tt_PosDef(b):e}return h}function tt_PosDef(a){if(a){tt_bJmpVert=tt_aV[ABOVE]}else{tt_bJmpHorz=tt_aV[LEFT]}return tt_CalcPosDef(a)}function tt_PosAlt(a){if(a){tt_bJmpVert=!tt_aV[ABOVE]}else{tt_bJmpHorz=!tt_aV[LEFT]}return tt_CalcPosAlt(a)}function tt_CalcPosDef(a){return a?(tt_musY+tt_aV[OFFSETY]):(tt_musX+tt_aV[OFFSETX])}function tt_CalcPosAlt(b){var c=b?OFFSETY:OFFSETX;var a=tt_aV[c]-(tt_aV[SHADOW]?tt_aV[SHADOWWIDTH]:0);if(tt_aV[c]>0&&a<=0){a=1}return((b?(tt_musY-tt_h):(tt_musX-tt_w))-a)}function tt_PosFix(){var a,b;if(typeof(tt_aV[FIX][0])=="number"){a=tt_aV[FIX][0];b=tt_aV[FIX][1]}else{if(typeof(tt_aV[FIX][0])=="string"){el=tt_GetElt(tt_aV[FIX][0])}else{el=tt_aV[FIX][0]}a=tt_aV[FIX][1];b=tt_aV[FIX][2];if(!tt_aV[ABOVE]&&el){b+=tt_GetDivH(el)}for(;el;el=el.offsetParent){a+=el.offsetLeft||0;b+=el.offsetTop||0}}if(tt_aV[ABOVE]){b-=tt_h}tt_SetTipPos(a,b)}function tt_Fade(b,c,d,e){if(e){c+=Math.round((d-c)/e);if((d>b)?(c>=d):(c<=d)){c=d}else{tt_tFade.Timer("tt_Fade("+b+","+c+","+d+","+(e-1)+")",tt_aV[FADEINTERVAL],true)}}c?tt_SetTipOpa(c):tt_Hide()}function tt_SetTipOpa(a){tt_SetOpa(tt_aElt[5],a);if(tt_aElt[1]){tt_SetOpa(tt_aElt[1],a)}if(tt_aV[SHADOW]){a=Math.round(a*0.8);tt_SetOpa(tt_aElt[7],a);tt_SetOpa(tt_aElt[8],a)}}function tt_OnCloseBtnOver(b){var a=tt_aElt[4].style;b<<=1;a.background=tt_aV[CLOSEBTNCOLORS][b];a.color=tt_aV[CLOSEBTNCOLORS][b+1]}function tt_OnLClick(a){a=a||window.event;if(!((a.button&&a.button&2)||(a.which&&a.which==3))){if(tt_aV[CLICKSTICKY]&&(tt_iState&4)){tt_aV[STICKY]=true;tt_iState&=~4}else{if(tt_aV[CLICKCLOSE]){tt_HideInit()}}}}function tt_Int(a){var b;return(isNaN(b=parseInt(a))?0:b)}Number.prototype.Timer=function(c,b,a){if(!this.value||a){this.value=window.setTimeout(c,b)}};Number.prototype.EndTimer=function(){if(this.value){window.clearTimeout(this.value);this.value=0}};function tt_GetWndCliSiz(c){var a,f=window["inner"+c],e="client"+c,d="number";if(typeof f==d){var b;return(((a=document.body)&&typeof(b=a[e])==d&&b&&b<=f)?b:((a=document.documentElement)&&typeof(b=a[e])==d&&b&&b<=f)?b:f)}return(((a=document.documentElement)&&(f=a[e]))?f:document.body[e])}function tt_SetOpa(c,a){var b=c.style;tt_opa=a;if(tt_flagOpa==1){if(a<100){if(typeof(c.filtNo)==tt_u){c.filtNo=b.filter}var d=b.visibility!="hidden";b.zoom="100%";if(!d){b.visibility="visible"}b.filter="alpha(opacity="+a+")";if(!d){b.visibility="hidden"}}else{if(typeof(c.filtNo)!=tt_u){b.filter=c.filtNo}}}else{a/=100;switch(tt_flagOpa){case 2:b.KhtmlOpacity=a;break;case 3:b.KHTMLOpacity=a;break;case 4:b.MozOpacity=a;break;case 5:b.opacity=a;break}}}function tt_Err(b,a){if(tt_Debug||!a){alert("Tooltip Script Error Message:\n\n"+b)}}function tt_ExtCmdEnum(){var s;for(var i in config){s="window."+i.toString().toUpperCase();if(eval("typeof("+s+") == tt_u")){eval(s+" = "+tt_aV.length);tt_aV[tt_aV.length]=null}}}function tt_ExtCallFncs(c,d){var a=false;for(var e=tt_aExt.length;e;){--e;var f=tt_aExt[e]["On"+d];if(f&&f(c)){a=true}}return a}tt_Init();if(typeof config=="undefined"){alert("Error:\nThe core tooltip script file 'wz_tooltip.js' must be included first, before the plugin files!")}config.CenterWindow=false;config.CenterAlways=false;var ctrwnd=new tt_Extension();ctrwnd.OnLoadConfig=function(){if(tt_aV[CENTERWINDOW]){if(tt_aV[STICKY]){if(tt_aV[CENTERALWAYS]){if(tt_ie){tt_AddEvtFnc(window,"scroll",Ctrwnd_DoCenter)}else{tt_aElt[0].style.position="fixed"}tt_AddEvtFnc(window,"resize",Ctrwnd_DoCenter)}return true}tt_aV[CENTERWINDOW]=false}return false};ctrwnd.OnMoveBefore=Ctrwnd_DoCenter;ctrwnd.OnKill=function(){if(tt_aV[CENTERWINDOW]&&tt_aV[CENTERALWAYS]){tt_RemEvtFnc(window,"resize",Ctrwnd_DoCenter);if(tt_ie){tt_RemEvtFnc(window,"scroll",Ctrwnd_DoCenter)}else{tt_aElt[0].style.position="absolute"}}return false};function Ctrwnd_DoCenter(){if(tt_aV[CENTERWINDOW]){var a,d,c,b;if(tt_ie||!tt_aV[CENTERALWAYS]){c=tt_GetScrollX();b=tt_GetScrollY()}else{c=0;b=0}a=(tt_GetClientW()-tt_w)/2+c+tt_aV[OFFSETX];d=(tt_GetClientH()-tt_h)/2+b+tt_aV[OFFSETY];tt_SetTipPos(a,d);return true}return false}if(typeof config=="undefined"){alert("Error:\nThe core tooltip script file 'wz_tooltip.js' must be included first, before the plugin files!")}config.FollowScroll=false;var fscrl=new tt_Extension();fscrl.OnShow=function(){if(tt_aV[FOLLOWSCROLL]){if(tt_aV[STICKY]){var a=tt_x-tt_GetScrollX(),b=tt_y-tt_GetScrollY();if(tt_ie){fscrl.MoveOnScrl.offX=a;fscrl.MoveOnScrl.offY=b;fscrl.AddRemEvtFncs(tt_AddEvtFnc)}else{tt_SetTipPos(a,b);tt_aElt[0].style.position="fixed"}return true}tt_aV[FOLLOWSCROLL]=false}return false};fscrl.OnHide=function(){if(tt_aV[FOLLOWSCROLL]){if(tt_ie){fscrl.AddRemEvtFncs(tt_RemEvtFnc)}else{tt_aElt[0].style.position="absolute"}}};fscrl.MoveOnScrl=function(){tt_SetTipPos(fscrl.MoveOnScrl.offX+tt_GetScrollX(),fscrl.MoveOnScrl.offY+tt_GetScrollY())};fscrl.AddRemEvtFncs=function(a){a(window,"resize",fscrl.MoveOnScrl);a(window,"scroll",fscrl.MoveOnScrl)};if(typeof config=="undefined"){alert("Error:\nThe core tooltip script file 'wz_tooltip.js' must be included first, before the plugin files!")}config.Balloon=false;config.BalloonImgPath="img/toolTip/";config.BalloonEdgeSize=6;config.BalloonStemWidth=15;config.BalloonStemHeight=19;config.BalloonStemOffset=-7;config.BalloonImgExt="gif";var balloon=new tt_Extension();balloon.OnLoadConfig=function(){if(tt_aV[BALLOON]){balloon.padding=Math.max(tt_aV[PADDING]-tt_aV[BALLOONEDGESIZE],0);balloon.width=tt_aV[WIDTH];tt_aV[BORDERWIDTH]=0;tt_aV[WIDTH]=0;tt_aV[PADDING]=0;tt_aV[BGCOLOR]="";tt_aV[BGIMG]="";tt_aV[SHADOW]=false;if(tt_aV[BALLOONIMGPATH].charAt(tt_aV[BALLOONIMGPATH].length-1)!="/"){tt_aV[BALLOONIMGPATH]+="/"}return true}return false};balloon.OnCreateContentString=function(){if(!tt_aV[BALLOON]){return false}var d,e,b,c,f,a;if(tt_aV[BALLOONIMGPATH]==config.BalloonImgPath){d=balloon.aDefImg}else{d=Balloon_CacheImgs(tt_aV[BALLOONIMGPATH],tt_aV[BALLOONIMGEXT])}a="padding:0;margin:0;border:0;line-height:0;overflow:hidden;";b=' style="position:relative;width:'+tt_aV[BALLOONEDGESIZE]+"px;"+a+"overflow:hidden;";c='vertical-align:top;" valign="top"';f='vertical-align:bottom;" valign="bottom"';e='" style="'+a+'" />';tt_sContent='<table border="0" cellpadding="0" cellspacing="0" style="width:auto;padding:0;margin:0;left:0;top:0;"><tr><td'+b+f+'><img src="'+d[1].src+'" width="'+tt_aV[BALLOONEDGESIZE]+'" height="'+tt_aV[BALLOONEDGESIZE]+e+'</td><td valign="bottom" style="position:relative;'+a+'"><img id="bALlOOnT" style="position:relative;top:1px;z-index:1;display:none;'+a+'" src="'+d[9].src+'" width="'+tt_aV[BALLOONSTEMWIDTH]+'" height="'+tt_aV[BALLOONSTEMHEIGHT]+'" /><div style="position:relative;z-index:0;top:0;'+a+"width:auto;height:"+tt_aV[BALLOONEDGESIZE]+"px;background-image:url("+d[2].src+');"></div></td><td'+b+f+'><img src="'+d[3].src+'" width="'+tt_aV[BALLOONEDGESIZE]+'" height="'+tt_aV[BALLOONEDGESIZE]+e+'</td></tr><tr><td style="position:relative;background-repeat:repeat;'+a+"width:"+tt_aV[BALLOONEDGESIZE]+"px;background-image:url("+d[8].src+');"><img width="'+tt_aV[BALLOONEDGESIZE]+'" height="100%" src="'+d[8].src+e+'</td><td id="bALlO0nBdY" style="position:relative;line-height:normal;background-repeat:repeat;;background-image:url('+d[0].src+");color:"+tt_aV[FONTCOLOR]+";font-family:"+tt_aV[FONTFACE]+";font-size:"+tt_aV[FONTSIZE]+";font-weight:"+tt_aV[FONTWEIGHT]+";text-align:"+tt_aV[TEXTALIGN]+";padding:"+balloon.padding+"px;width:"+((balloon.width>0)?(balloon.width+"px"):"auto")+';">'+tt_sContent+'</td><td style="position:relative;background-repeat:repeat;'+a+"width:"+tt_aV[BALLOONEDGESIZE]+"px;background-image:url("+d[4].src+');"><img width="'+tt_aV[BALLOONEDGESIZE]+'" height="100%" src="'+d[4].src+e+"</td></tr><tr><td"+b+c+'><img src="'+d[7].src+'" width="'+tt_aV[BALLOONEDGESIZE]+'" height="'+tt_aV[BALLOONEDGESIZE]+e+'</td><td valign="top" style="position:relative;'+a+'"><div style="position:relative;left:0;top:0;'+a+"width:auto;height:"+tt_aV[BALLOONEDGESIZE]+"px;background-image:url("+d[6].src+');"></div><img id="bALlOOnB" style="position:relative;top:-1px;left:2px;z-index:1;display:none;'+a+'" src="'+d[10].src+'" width="'+tt_aV[BALLOONSTEMWIDTH]+'" height="'+tt_aV[BALLOONSTEMHEIGHT]+'" /></td><td'+b+c+'><img src="'+d[5].src+'" width="'+tt_aV[BALLOONEDGESIZE]+'" height="'+tt_aV[BALLOONEDGESIZE]+e+"</td></tr></table>";return true};balloon.OnSubDivsCreated=function(){if(tt_aV[BALLOON]){var a=tt_GetElt("bALlO0nBdY");if(tt_t2t&&!tt_aV[COPYCONTENT]&&a){tt_MovDomNode(tt_t2t,tt_GetDad(tt_t2t),a)}balloon.iStem=tt_aV[ABOVE]*1;balloon.aStem=[tt_GetElt("bALlOOnT"),tt_GetElt("bALlOOnB")];balloon.aStem[balloon.iStem].style.display="inline";if(balloon.width<-1){Balloon_MaxW(a)}return true}return false};balloon.OnMoveAfter=function(){if(tt_aV[BALLOON]){var a=(tt_aV[ABOVE]!=tt_bJmpVert)*1;if(a!=balloon.iStem){balloon.aStem[balloon.iStem].style.display="none";balloon.aStem[a].style.display="inline";balloon.iStem=a}balloon.aStem[a].style.left=Balloon_CalcStemX()+"px";return true}return false};function Balloon_CalcStemX(){var a=tt_musX-tt_x+tt_aV[BALLOONSTEMOFFSET]-tt_aV[BALLOONEDGESIZE];return Math.max(Math.min(a,tt_w-tt_aV[BALLOONSTEMWIDTH]-(tt_aV[BALLOONEDGESIZE]<<1)-2),2)}function Balloon_CacheImgs(b,e){var d=["background","lt","t","rt","r","rb","b","lb","l","stemt","stemb"],f=d.length,c=new Array(f),a;while(f){--f;a=c[f]=new Image();a.src=b+d[f]+"."+e}return c}function Balloon_MaxW(b){if(b){var c=tt_bBoxOld?(balloon.padding<<1):0,a=tt_GetDivW(b);if(a>-balloon.width+c){b.style.width=(-balloon.width+c)+"px"}}}function Balloon_PreCacheDefImgs(){if(config.BalloonImgPath.charAt(config.BalloonImgPath.length-1)!="/"){config.BalloonImgPath+="/"}balloon.aDefImg=Balloon_CacheImgs(config.BalloonImgPath,config.BalloonImgExt)}Balloon_PreCacheDefImgs();var toolTipDiv;function ShowTooltip(){var e=this.offsetLeft;var d=this.offsetTop;var b=this.scrollLeft;var a=this.scrollTop;if(toolTipDiv==undefined){toolTipDiv=document.createElement("div");toolTipDiv.className="ToolTip";divContent=document.createElement("div");divContent.className="Content";if(this.pTitle&&this.pTitle.length>0){divTitle=document.createElement("div");divTitle.className="Title";divTitle.innerHTML=this.pTitle;toolTipDiv.appendChild(divTitle)}if(this.pToolTipWidth){toolTipDiv.style.width=this.pToolTipWidth+"px"}else{toolTipDiv.style.width="100px"}if(this.pContent){divContent.innerHTML=this.pContent}else{divContent.innerHTML=""}toolTipDiv.appendChild(divContent);if(this.offsetParent){var c=this.offsetParent;e+=this.offsetWidth}if(e&&d){toolTipDiv.style.left=(e-b)+"px";toolTipDiv.style.top=(d-a)+"px"}this.appendChild(toolTipDiv)}return false}function CloseTooltip(){if(toolTipDiv){var a=toolTipDiv.parentNode;a.removeChild(toolTipDiv);toolTipDiv=undefined}}function TopUsers(){var c;var h;var e;var b="h1";var a="table";var g="tbody";var f="td";var d="tr"}TopUsers.prototype.LoadTopUsers=function(){SBR.TV.Website.WebServices.WebServiceProxy.GetTopUsers(this._Top,b,a,this);function b(l,k){if(l){var h;var m;var e;var n;var j;var f;var c=$get(k._DivTopMembersId);var g=new RegExp(/[^A-Za-z0-9]+/g);h=document.createElement(k.HTML_TITLE);h.innerHTML=k._Title;c.appendChild(h);m=document.createElement(k.HTML_TABLE);m.cellPadding="3px";m.cellSpacing="2px";e=document.createElement(k.HTML_TBODY);n=document.createElement(k.HTML_TR);j=document.createElement(k.HTML_TD);j.innerHTML="#";n.appendChild(j);j=document.createElement(k.HTML_TD);j.innerHTML="SBR.TV User";n.appendChild(j);j=document.createElement(k.HTML_TD);j.innerHTML="Videos";n.appendChild(j);e.appendChild(n);var d=0;for(d;d<l.length;d++){n=document.createElement(k.HTML_TR);f=document.createElement(HTML_ANCHOR_TAG);j=document.createElement(k.HTML_TD);j.innerHTML=d+1;n.appendChild(j);j=document.createElement(k.HTML_TD);f.href="channel-"+l[d].ForumUserId+"-"+l[d].UserName.replace(g,"-")+".html";f.innerHTML=l[d].UserName;j.appendChild(f);n.appendChild(j);j=document.createElement(k.HTML_TD);j.innerHTML=l[d].PostedVideos;n.appendChild(j);e.appendChild(n)}m.appendChild(e);c.appendChild(m)}}function a(d,c){}};var uploadObjects=new Array();var intervalID=0;var painting=false;var requestInterval=3000;function UploadControl(){var z;var D;var P;var o;var n;var t;var c;var e;var G;var w;var T;var B;var q;var a;var k;var K;var W;var r;var j;var m;var E;var y;var C;var d;var R;var h;var H;var M;var x;var O;var b;var b;var g;var u;var v;var S;var A;var Q;var F;var N;var I;var l;var L;var V;var U;var f;var J}UploadControl.prototype.StartUpload=function(){var g="";var a=false;var h=document.getElementById(this.DIV_UPLOADERRORPROCESS);var f=document.getElementById(this.DIV_UPLOADERRORSHOWMESSAGE);var e=document.getElementById(this.DIV_UPLOADERRORPROCESSTITLE);var b=document.getElementById(this.UPFILE);var d=document.getElementById(this.YOUTUBE);if(b){var c=b.form;if(b.value.length!=0){if(!this.CheckFileExtension(b.value)){g="<b>Invalid extension file!!</b>";a=true}}else{if(d.value.length!=0){}else{g="<b>You must select a file!! or provide a YouTube Reference</b>";a=true}}}if(a){if(h&&f&&e){h.style.display="block";h.style.height="246px";f.style.display="block";e.innerHTML=g;__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"")}}else{if(this.SHOWCATCHAIMAGE){this.CheckCaptchaImage()}else{this.ShootUpload()}}return a};UploadControl.prototype.CheckFileExtension=function(c){var a="";var b=0;b=c.lastIndexOf(".");if(b!=-1){a=c.substr(b,c.length).toLowerCase();if(this.VALIDEXTENSIONS.toLowerCase().indexOf(a)!=-1){return true}else{return false}}else{return false}};UploadControl.prototype.CheckCaptchaImage=function(){var b=document.getElementById(CAPTCHA_IMAGE_TXT_RESULT_IMAGE);if(b&&b.value&&b.value.length>0){SBR.TV.Website.WebServices.jsLocalServices.SubmitVideoIsValid(b.value,a,e,this)}else{var f=document.getElementById(this.DIV_UPLOADERRORPROCESS);var d=document.getElementById(this.DIV_UPLOADERRORSHOWMESSAGE);var c=document.getElementById(this.DIV_UPLOADERRORPROCESSTITLE);if(f&&d&&c){f.style.height="246px";f.style.display="block";d.style.display="block";c.innerHTML="<b>Invalid image code!!</b>"}__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"");return false}function a(h,g){if(h){g.ShootUpload()}else{var j=document.getElementById(CAPTCHA_IMAGE_TXT_RESULT_IMAGE);var m=document.getElementById(g.DIV_UPLOADERRORPROCESS);var l=document.getElementById(g.DIV_UPLOADERRORSHOWMESSAGE);var k=document.getElementById(g.DIV_UPLOADERRORPROCESSTITLE);if(m&&l&&k){m.style.height="246px";m.style.display="block";l.style.display="block";k.innerHTML="<b>Invalid image code!!</b>"}j.value="";__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"");return false}}function e(h,g){alert("The process failure (error checking the captchaImage).");__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"")}};UploadControl.prototype.ShootUpload=function(){var a=document.getElementById(this.UPFILE);var b=document.getElementById(this.YOUTUBE);if(a&&a.form&&a.value){this.SelectCategories(this.CATEGORIES,this.SBR_EXCLUSIVE_CATS);if(a.form.action.indexOf("?objUploadId=")==-1){this.FORM_ACTION=a.form.action;a.form.action=this.FORM_ACTION+"?objUploadId="+this.NAME+"&guid="+this.USERID+"&filename="+a.value}else{a.form.action=this.FORM_ACTION+"?objUploadId="+this.NAME+"&guid="+this.USERID+"&filename="+a.value}a.form.submit();this.ShowUploadProgress()}else{if(b&&b.form&&b.value){b.form.action=b.form.action+"?objUploadId="+this.NAME+"&guid="+this.USERID+"&YouTubeReference="+b.value;b.form.submit();this.ShowUploadProgress()}}return false};UploadControl.prototype.ShowUploadProgress=function(){this.TabStatus(2);var b=document.getElementById(this.DIV_UPLOADSHOWINFORMATION);var f=document.getElementById(this.DIV_UPLOADCONTAINER);var a=document.getElementById(this.DIV_UPLOADPROGRESSCONTAINER);var c=document.getElementById(this.DIV_PROGRESS);var d=document.getElementById(this.DIV_PROGRESSBAR);var e=document.getElementById(this.DIV_UPLOADSUCCESSFULL);if(f&&a&&c&&e&&b){b.style.display="none";f.style.display="none";a.style.display="block";c.style.display="block";d.style.display="block";e.style.display="none"}this.CheckFileSize();return false};UploadControl.prototype.CheckFileSize=function(){SBR.TV.Website.WebServices.WebServiceProxy.StatusProcess(this.NAME,b,a,this);function b(f,c){if(f){var d=document.getElementById(c.DIV_UPLOAD_SUCCESS_BUTTONS);switch(f.Status){case SBR.TV.Communication.Objects.UploadStatus.INVALIDSIZE:if(d){d.style.display="block"}c.ShowFileSizeError();break;case SBR.TV.Communication.Objects.UploadStatus.UPLOAD:c.ShootIntervalRequest();break}}else{var e=document.getElementById(c.DIV_MEGASTRANSFERED);if(e){e.innerHTML="Reading file: Please wait.."}c.CheckFileSize()}return false}function a(d,c){alert("The process failure (Checking the file size).");return false}return false};UploadControl.prototype.ShowFileSizeError=function(){var d=document.getElementById(this.DIV_PROGRESS);var e=document.getElementById(this.DIV_UPLOADSUCCESSFULL);var b=document.getElementById(this.DIV_UPLOADSUCCESSFULLTITLE);var a=document.getElementById(this.DIV_UPLOADSUCCESSFULLTEXT);var c=document.getElementById(this.DIV_VIDEOINFORMATION);SBR.TV.Website.WebServices.WebServiceProxy.ClearKey(this.NAME);if(c&&d&&e&&b&&a){Array.remove(uploadObjects,this);CloseLoadInformation();d.style.display="none";e.style.display="block";b.innerHTML="<b>File Size Invalid!!</b>";a.innerHTML="";c.style.display="none"}};UploadControl.prototype.ShootIntervalRequest=function(){uploadObjects.push(this);if(!painting){intervalID=setInterval(DisplayProgress,requestInterval)}};function DisplayProgress(){painting=true;var a=0;for(a=0;a<=uploadObjects.length-1;a++){LoadInformation(uploadObjects[a])}CloseLoadInformation()}function CloseLoadInformation(){if(uploadObjects.length==0){clearInterval(intervalID);painting=false}}function LoadInformation(b){if(b){SBR.TV.Website.WebServices.WebServiceProxy.StatusProcess(b.NAME,a,c,b)}function a(d,n){var h=document.getElementById(n.DIV_PROGRESS);var g=document.getElementById(n.DIV_PROGRESSBAR);var m=document.getElementById(n.DIV_MEGASTRANSFERED);var j=document.getElementById(n.DIV_FILESIZE);var l=document.getElementById(n.BTN_SAVE_INFO);var k=document.getElementById(n.DIV_VIDEOINFORMATION);var f=document.getElementById(n.BTN_CANCEL);if(d){if(g&&m&&j&&l&&k&&f){switch(d.Status){case SBR.TV.Communication.Objects.UploadStatus.ENCODE:m.innerHTML="Encoding video: Please wait..";g.style.width="98%";j.innerHTML="";f.disabled=true;break;case SBR.TV.Communication.Objects.UploadStatus.UPLOAD:g.style.width=d.PercentLoaded+"%";m.innerHTML=Math.round(d.MegasTransfered*100)/100+"&nbsp;Mb&nbsp;of&nbsp;";j.innerHTML=Math.round(d.TotalFileSize*100)/100+"&nbsp;Mb&nbsp;for&nbsp;"+Math.round(d.PercentLoaded)+"%";f.disabled=false;break;case SBR.TV.Communication.Objects.UploadStatus.FINISH:n.FINISH_OPERATION=true;f.disabled=false;g.style.width="100%";m.innerHTML=d.TotalFileSize;j.innerHTML="&nbsp;Mb&nbsp;for&nbsp;100%";Array.remove(uploadObjects,n);CloseLoadInformation();n.GetCurrentPost();var e="FinishProcess('"+n.NAME+"');";setTimeout(e,1500);break}}}}function c(e,d){}}function FinishProcess(pObjectName){eval("var objectUploadRef = "+pObjectName);if(objectUploadRef){SBR.TV.Website.WebServices.WebServiceProxy.ClearKey(objectUploadRef.NAME);var DIVPROGRESS=document.getElementById(objectUploadRef.DIV_PROGRESS);var DIVUPLOADSUCCESSFULL=document.getElementById(objectUploadRef.DIV_UPLOADSUCCESSFULL);var DIVUPLOADSUCCESSFULLTITLE=document.getElementById(objectUploadRef.DIV_UPLOADSUCCESSFULLTITLE);var DIVUPLOADSUCCESSFULLTEXT=document.getElementById(objectUploadRef.DIV_UPLOADSUCCESSFULLTEXT);var DIVUPLOADSUCCESSBUTTONS=document.getElementById(objectUploadRef.DIV_UPLOAD_SUCCESS_BUTTONS);if(DIVPROGRESS&&DIVUPLOADSUCCESSFULL&&DIVUPLOADSUCCESSFULLTITLE&&DIVUPLOADSUCCESSFULLTEXT){DIVPROGRESS.style.display="none";DIVUPLOADSUCCESSFULL.style.display="block";DIVUPLOADSUCCESSBUTTONS.style.display="none";if(!objectUploadRef.SAVE_ACTION){DIVUPLOADSUCCESSFULLTITLE.innerHTML="<b>Upload Successful</b>";DIVUPLOADSUCCESSFULLTEXT.innerHTML='After you finish editing your video data, click "Save Info" to continue.'}else{DIVUPLOADSUCCESSFULLTITLE.innerHTML="<b>Upload Successful</b>";DIVUPLOADSUCCESSFULLTEXT.innerHTML="";var command="var objectUploadRef = "+pObjectName+"; if (objectUploadRef){ objectUploadRef.TabStatus(3);}";setTimeout(command,2000)}}}}UploadControl.prototype.GetCurrentPost=function(){if(!this.POST){SBR.TV.Website.WebServices.WebServiceProxy.GetPost(this.NAME,a,b,this)}else{if(this&&this.POST&&this.POST.PostId){this.InvokeExternalFunction(this.POST.PostId)}}function a(d,c){c.POST=d;if(c&&c.POST&&c.POST.PostId){c.InvokeExternalFunction(c.POST.PostId)}}function b(d,c){alert("The process failure (error getting the new Post).")}return false};function CancelUpload(a){var b=new Array(CancelUploadContinue,a);sbrAlertShow("Cancel","Are you sure you want to cancel this video upload?",300,SBR.TV.Communication.Objects.AlertType.CONFIRM,b,null,null);return false}function CancelUploadContinue(b){SBR.TV.Website.WebServices.WebServiceProxy.CancelOperation(b.NAME,c,a,b);function c(e,d){Array.remove(uploadObjects,d);CloseLoadInformation();ResetForm(d);return true}function a(e,d){sbrAlertShow("Error","The process failure (error in the cancel process).",300,SBR.TV.Communication.Objects.AlertType.DONE,null,null,null);return false}return false}function CloseErrorMessageUpload(a){if(a){var d=document.getElementById(a.DIV_UPLOADERRORPROCESS);var c=document.getElementById(a.DIV_UPLOADERRORSHOWMESSAGE);var b=document.getElementById(a.DIV_UPLOADERRORPROCESSTITLE);if(d&&b&&c){d.style.display="none";c.style.display="none";b.innerHTML=""}}return false}function CheckInformation(b,e,d){var c=document.getElementById(b.TITLE);var a=b.GetCategoriesSelected();if(c.value.trim().length>=b.MIN_TITLE_CHARACTERS){if(a.length>0){return SaveInformation(b,e,d)}else{sbrAlertShow("Message",String.format("You must choose at least one category.",b.MIN_TITLE_CHARACTERS),300,SBR.TV.Communication.Objects.AlertType.DONE,null,null,null);return false}}else{sbrAlertShow("Message",String.format("Title is required, it must have at least {0} characters.",b.MIN_TITLE_CHARACTERS),300,SBR.TV.Communication.Objects.AlertType.DONE,null,null,null);return false}}function SaveInformation(l,a,h){l.CATEGORIESITEMS=a;l.TYPELISTITEMS=h;if(l&&l.POST&&l.POST.PostId){var d=document.getElementById(l.TITLE);var b=document.getElementById(l.DESCRIPTION);var k=document.getElementById(l.TAGS);var g=l.GetCategoriesSelected();var j=l.GetTypesSelected();SBR.TV.Website.WebServices.jsLocalServices.SavePostDetails(l.POST.PostId,d.value,b.value,g,j,k.value,"",l.USERID,e,f,l)}else{l.GetNewPost()}function e(o,m){var n=new Array(c,o,m);sbrAlertShow("Message","Your information was updated.",300,SBR.TV.Communication.Objects.AlertType.DONE,n,null,null);return false}function c(o,m){m.SAVE_ACTION=true;if(m.FINISH_OPERATION){m.TabStatus(3)}else{var n=document.getElementById(m.DIV_VIDEOINFORMATION);if(n){n.style.display="none"}}return false}function f(n,m){sbrAlertShow("Error","The process failure (error saving the video's information).",300,SBR.TV.Communication.Objects.AlertType.DONE,null,null,null);return false}return false}UploadControl.prototype.GetNewPost=function(){if(this.NAME){SBR.TV.Website.WebServices.WebServiceProxy.GetPost(this.NAME,b,a,this)}function b(k,g){if(k){g.POST=k;var h=document.getElementById(g.TITLE);var l=document.getElementById(g.DESCRIPTION);var j=document.getElementById(g.TAGS);var f=g.GetCategoriesSelected();var m=g.GetTypesSelected();SBR.TV.Website.WebServices.jsLocalServices.SavePostDetails(g.POST.PostId,h.value,l.value,f,m,j.value,"",g.USERID,e,d,g)}}function a(g,f){alert("The process failure (error getting the new Post).");return false}function e(h,f){var g=new Array(c,h,f);sbrAlertShow("Message","Your information was updated.",300,SBR.TV.Communication.Objects.AlertType.DONE,g,null,null);return false}function c(h,f){f.SAVE_ACTION=true;if(f.FINISH_OPERATION){f.TabStatus(3)}else{var g=document.getElementById(f.DIV_VIDEOINFORMATION);if(g){g.style.display="none"}}return false}function d(g,f){sbrAlertShow("Error","The process failure (error saving the video's information).",300,SBR.TV.Communication.Objects.AlertType.DONE,null,null,null);return false}return false};UploadControl.prototype.GetCategoriesSelected=function(){var d=document.getElementById(this.CATEGORIES);var a="";if(d){var c=this.CATEGORIESITEMS;var b=null;for(i=0;i<c;i++){b=document.getElementById(this.CATEGORIES+"_"+i.toString());if(b.checked){if(a.length==0){a=b.parentNode.parentNode.firstChild.attributes.categoryId.value}else{a+=",";a+=b.parentNode.parentNode.firstChild.attributes.categoryId.value}}}if(a.length>0){a=this.GetXmlCategories(a)}}return a};UploadControl.prototype.GetTypesSelected=function(){var d=document.getElementById(this.TYPELIST);var a="";if(d){var c=this.TYPELISTITEMS;var b=null;for(i=0;i<c;i++){b=document.getElementById(this.TYPELIST+"_"+i.toString());if(b.checked){if(a.length==0){a=b.parentNode.parentNode.firstChild.attributes.listTypeId.value}else{a+=",";a+=b.parentNode.parentNode.firstChild.attributes.listTypeId.value}}}if(a.length>0){a=this.GetXmlTypeList(a)}}return a};UploadControl.prototype.GetXmlCategories=function(c){var b=c.split(",");var d;var a=b.length-1;d="<SerializableDictionaryOfStringCategory><item><value>";for(i=0;i<=a;i++){d=d+"<Category><CategoryId>";d=d+b[i];d=d+"</CategoryId></Category>"}d=d+"</value></item></SerializableDictionaryOfStringCategory>";return d};UploadControl.prototype.GetXmlTypeList=function(b){var d=b.split(",");var c;var a=d.length-1;c="<SerializableDictionaryOfStringType><item><value>";for(i=0;i<=a;i++){c=c+"<Types><ListTypeId>";c=c+d[i];c=c+"</ListTypeId></Types>"}c=c+"</value></item></SerializableDictionaryOfStringType>";return c};function ResetForm(t){t.SAVE_ACTION=false;t.FINISH_OPERATION=false;t.POST=null;var f=document.getElementById(t.DIV_UPLOADCONTAINER);var k=document.getElementById(t.UPFILE);var e=document.getElementById(CAPTCHA_IMAGE_TXT_RESULT_IMAGE);k.value="";e.value="";__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"");if(f){f.style.display="block"}var r=document.getElementById(t.DIV_UPLOADPROGRESSCONTAINER);var m=document.getElementById(t.DIV_PROGRESS);var b=document.getElementById(t.DIV_PROGRESSBAR);var g=document.getElementById(t.BTN_CANCEL);var l=document.getElementById(t.DIV_MEGASTRANSFERED);var a=document.getElementById(t.DIV_FILESIZE);var c=document.getElementById(t.DIV_UPLOADSUCCESSFULL);var w=document.getElementById(t.DIV_UPLOADSUCCESSFULLTITLE);var j=document.getElementById(t.DIV_UPLOADSUCCESSFULLTEXT);var n=document.getElementById(t.DIV_VIDEOINFORMATION);var v=document.getElementById(t.DIV_UPLOADERRORPROCESS);var q=document.getElementById(t.TITLE);var u=document.getElementById(t.DESCRIPTION);var h=document.getElementById(t.TAGS);q.value="";u.value="";h.value="";t.ClearCategoriesSelected();if(r&&m&&b&&l&&a&&c&&w&&j&&n&&v){r.style.display="none";m.style.display="block";b.style.display="block";b.style.width="0%";g.disabled=false;l.innerHTML="";a.innerHTML="";c.style.display="none";w.innerHTML="";j.innerHTML="";n.style.display="block";v.style.display="none"}var o=document.getElementById(t.DIV_UPLOADSHOWINFORMATION);var d=document.getElementById(t.EMBEDTEXTFIELD);if(o){o.style.display="none"}if(d){d.value=""}t.TabStatus(1);return false}UploadControl.prototype.ClearCategoriesSelected=function(){var c=document.getElementById(this.CATEGORIES);if(c){var b=this.CATEGORIESITEMS;var a=null;for(i=0;i<b;i++){a=document.getElementById(this.CATEGORIES+"_"+i.toString());if(a.checked){a.checked=false}}}};UploadControl.prototype.InvokeExternalFunction=function(a){if(window&&window.parent){if((!this.ISINTERNALWEBSITE)&&(this.EXTERNALDOMAIN.length>0)){var b=document.getElementById(this.IFRAME_CROSSDOMAIN);if(b){b.src=this.EXTERNALDOMAIN+"?postid="+a}}}};UploadControl.prototype.TabStatus=function(pStatus){var DIVSTEPONE=document.getElementById(this.DIV_STEPONE);var DIVTEPTWO=document.getElementById(this.DIV_STEPTWO);var DIVSTEPTHREE=document.getElementById(this.DIV_STEPTHREE);var DIVANOTHERVIDEO=document.getElementById(this.DIV_ANOTHERVIDEO);var BTNANOTHERVIDEO=document.getElementById(this.BTN_ANOTHER_VIDEO);var DIVUPLOADSHOWINFORMATION=document.getElementById(this.DIV_UPLOADSHOWINFORMATION);var DIVUPLOADPROGRESSCONTAINER=document.getElementById(this.DIV_UPLOADPROGRESSCONTAINER);if(DIVSTEPONE&&DIVTEPTWO&&DIVSTEPTHREE&&DIVANOTHERVIDEO&&BTNANOTHERVIDEO){switch(pStatus){case 1:DIVSTEPONE.className="step-upload current-step";DIVTEPTWO.className="step-upload future-step";DIVSTEPTHREE.className="step-upload future-step";DIVANOTHERVIDEO.className="step-upload upload-step future-step";BTNANOTHERVIDEO.disabled=true;break;case 2:DIVSTEPONE.className="step-upload future-step";DIVTEPTWO.className="step-upload current-step";DIVSTEPTHREE.className="step-upload future-step";DIVANOTHERVIDEO.className="step-upload upload-step future-step";BTNANOTHERVIDEO.disabled=true;break;case 3:DIVUPLOADSHOWINFORMATION.style.display="block";DIVUPLOADPROGRESSCONTAINER.style.display="none";DIVSTEPONE.className="step-upload future-step";DIVTEPTWO.className="step-upload future-step";DIVSTEPTHREE.className="step-upload current-step";DIVANOTHERVIDEO.className="step-upload upload-step";BTNANOTHERVIDEO.disabled=false;this.LoadEmbed();if(this.EDIT_INFO_OBJECT){eval("var objectInfoRef = "+this.EDIT_INFO_OBJECT);if(this.POST&&this.POST.PostId&&objectInfoRef&&objectInfoRef.LoadPost){objectInfoRef.LoadPost(this.POST.PostId,null,this.ISINTERNALWEBSITE)}}break}}return false};UploadControl.prototype.LoadEmbed=function(){var c=document.getElementById(this.EMBEDTEXTFIELD);var b=document.getElementById(this.TITLE);var h=b.value?b.value:"";var g=new RegExp(/[^A-Za-z0-9]+/g);h=h.replace(g,"-");var f=new RegExp("^(http[s]?://.*/)(.*)?$");var a=f.exec(document.URL);var e=this.SERVER_DOMAIN;if(h.length>0){varUrl=e+"video-"+this.POST.PostId+"-"+h+".html"}else{varUrl=e+"video-"+this.POST.PostId+"-NoTitle.html"}if(c){var d='<object width="320" height="280">';d+='<param name="movie" value="'+e+"swf/sbrtv.swf?postId="+this.POST.PostId+'"></param>';d+='<param name="allowFullScreen" value="true"></param>';d+='<param name="vmode" value="transparent"></param>';d+='<embed src="'+e+"swf/sbrtv.swf?postId="+this.POST.PostId+'" ';d+='type="application/x-shockwave-flash" allowfullscreen="true" wmode="transparent" width="320" 		height="280"></embed></object> ';c.value=d}};function BeginProcess(a){if(a&&a.StartUpload){a.StartUpload()}return false}SelectAll=function(a){a.focus();a.select();return false};UploadControl.prototype.SelectCategories=function(g,a){var d=a.split(",");var h=$get(g);if(h){for(var f=0;f<d.length;f++){var c=this.CATEGORIESITEMS;var b=null;for(var e=0;e<c;e++){b=document.getElementById(this.CATEGORIES+"_"+e.toString());if(b.parentNode.textContent){if(b.parentNode.textContent==d[f]){b.checked=true}continue}if(b.parentNode.innerText){if(b.parentNode.innerText==d[f]){b.checked=true}continue}b=null}}}h=null};function InvokeCheckCaptcha(){eval("var uploadComponent = "+UPLOAD_OBJECT_REF);var txtValidationReference;var textValue="";if(CAPTCHA_IMAGE_TXT_RESULT_IMAGE){txtValidationReference=document.getElementById(CAPTCHA_IMAGE_TXT_RESULT_IMAGE)}if(txtValidationReference){textValue=txtValidationReference.value}if(uploadComponent&&uploadComponent.CheckCaptchaImage){uploadComponent.TXTCAPTCHAVALIDATION=textValue;if(UPLOAD_FILE){uploadComponent.UPFILE=document.getElementById(UPLOAD_FILE).value}if(typeof uploadComponent.CheckCaptchaImage=="function"){uploadComponent.CheckCaptchaImage()}}}function InvokeProgressUpload(){eval("var uploadComponent = "+UPLOAD_OBJECT_REF);if(uploadComponent&&uploadComponent.CheckStatusProcess){if(typeof uploadComponent.CheckStatusProcess=="function"){if(UPLOAD_FILE){uploadComponent.UPFILE=document.getElementById(UPLOAD_FILE).value}uploadComponent.CheckStatusProcess()}}}post_ITEMS_PER_PAGE=14;var Categories;var Uploading_Flag=false;var Uploading_Post;var User;var posts_USER_ONLINE;var PageNumber=1;var validationStatus=false;var mode="upload";function post_manager_init(e,d,c){var b=0;if(User!==undefined){get_total_post(User);populate_post_list(e,c,false);populate_category_list(d)}}function get_total_post(b){SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPosts(SBR.TV.Communication.Objects.RequestType.USER,0,b.UserId,a,c);function a(d){posts_USER_ONLINE=d}function c(d){alert("error getting total amount of post...\n"+d._stackTrace)}}function populate_post_list(a,d,c){var f=c;PageNumber=d;SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(SBR.TV.Communication.Objects.RequestType.USER,0,User.UserId,d,post_ITEMS_PER_PAGE,"ASC",true,false,e,b,a);function e(h,g){g.obj=h;add_posts_from_list(g);if(f==true){div_element=document.createElement("div");div_element.className="progress";g.appendChild(div_element)}}function b(j,h,g){alert("error loading videos ...\n"+j._stackTrace)}}function add_posts_from_list(a){var j;var m;var f;var l;clear_list(a);function b(){PlayVideo(this.obj.PostId)}function h(){set_mode("update");var n;n=$get("post_list");clear_all_selected(n);addClass(this,"selected");this.className="selected";$get("TicketId").value="0";$get("Title").value=this.obj.Title;$get("Content").value=this.obj.Content;$get("Tags").value=this.obj.Tags;$get("PostId").value=this.obj.PostId;if((Uploading_Flag==true)&&(!Uploading_Post)){Uploading_Post=n.current_item}n.current_item=this.obj;uncheck_category_list(Categories);var n=$get("post_list");update_category_list(n.current_item);return false}function g(){var r=confirm("Are you sure you wish to delete this video?");if(r){var t;var q=this.obj;t=$get("post_list");q.Status=0;SBR.TV.Website.WebServices.jsLocalServices.DeletePost(q.PostId,q.User.UserId,o,n)}function o(){var u=$get("post_list");posts_USER_ONLINE--;populate_post_list(u,PageNumber,false);return false}function n(u){alert("error deleting post ...\n"+u._stackTrace)}}if(!a.current_page){a.current_page=0}for(var e=a.current_page*post_ITEMS_PER_PAGE;e<(a.current_page+1)*post_ITEMS_PER_PAGE&&e<a.obj.length;e++){my_post=a.obj[e];var c=new Date(my_post.CreatedDate);var d=c.format("MMM dd, yyyy hh:mm:ss");delete_link=document.createElement("a");delete_link.href="#";delete_link.title="Delete This Video";delete_link.innerHTML="Delete This Video";delete_link.onclick=g;delete_link.obj=my_post;separator_link=document.createElement("span");separator_link.innerHTML="&nbsp;|&nbsp;";edit_link=document.createElement("a");edit_link.href="#";edit_link.title="Edit Title / Description";edit_link.innerHTML="Edit Title / Description";edit_link.onclick=h;edit_link.obj=my_post;edit_controls_div=document.createElement("div");edit_controls_div.className="edit_controls_post";edit_controls_div.appendChild(edit_link);edit_controls_div.appendChild(separator_link);edit_controls_div.appendChild(delete_link);video_brief_description_div=document.createElement("div");video_brief_description_div.className="video_brief_description";video_title_link=document.createElement("a");video_title_link.href="#";video_brief_description_div.appendChild(video_title_link);var k=(my_post.Title===undefined)||(my_post.Title=="")?"No Title":my_post.Title;video_title_link.title=k+" - Go to Watch Video";video_summary_description_div=document.createElement("div");video_summary_description_div.innerHTML='<a class="Title" href="#" onClick="PlayVideo(\''+my_post.PostId+"');\">"+k+"</a><br/>Added: "+d+"<br/>Views: "+my_post.Views+"<br/>Length: <b>"+my_post.Files[0].Length+"</b>";video_brief_description_div.appendChild(video_summary_description_div);j=document.createElement("img");j.src=my_post.Thumbnail;j.alt="Go to Watch Video";j.obj=my_post;j.onclick=b;if(a.current_item&&my_post.PostId==a.current_item.PostId){addClass("selected",j)}video_brief_div=document.createElement("div");if((e%2)>0){video_brief_div.className="video_brief gray"}else{video_brief_div.className="video_brief"}video_brief_div.appendChild(j);video_brief_div.appendChild(video_brief_description_div);video_brief_div.appendChild(edit_controls_div);a.appendChild(video_brief_div)}add_post_list_controls(a)}function clear_all_selected(a){var c=a.getElementsByTagName("div");for(var b=0;b<c.length;b++){removeClass(c[b],"selected")}}function add_post_list_controls(f){var c;var b;c=document.createElement("div");c.className="controlsVM";function e(){var g;var h;h=$get("post_list");g=parseInt(this.innerHTML)-1;if(PageNumber!=g+1){populate_post_list(h,(g+1),false);this.className="selectedpage"}return false}var a;a=Math.ceil(posts_USER_ONLINE/post_ITEMS_PER_PAGE);for(var d=0;d<a;d++){b=document.createElement("a");b.innerHTML=d+1;b.href="#";b.onclick=e;if(PageNumber==d+1){b.className="selectedpage"}c.appendChild(b)}f.appendChild(c)}function add_or_remove_category(){var a;a=$get("post_list");if((!a.current_item)||(!a.current_item.Categories)){a.current_item=new SBR.TV.Communication.Objects.Post();a.current_item.Categories=new Array()}if(this.checked){a.current_item.Categories[this.Category.CategoryId.toString()]=this.Category}else{a.current_item.Categories[this.Category.CategoryId.toString()]=null}}function uncheck_category_list(d){if(d){for(var a in Categories){var b=Categories[a];if(b){var c=$get("Category_"+b.CategoryId);if(c){c.checked=false}}}}}function update_category_list(a){if(a&&a.Categories){for(var b in a.Categories){var c=a.Categories[b];if(c!=null){var d=$get("Category_"+c.CategoryId);if(d){d.checked=true}}}}}function update_current_post(a){var b=$get("post_list");b.current_item.PostId=a.PostId}function populate_category_list(e){var b=0;SBR.TV.Website.WebServices.WebServiceProxy.GetCategoriesByType(_categoryTypeId,d,c,e);function d(l,a){var k;var j;var h;var f;Categories=l;clean_categories_from_list(a);for(var g=0;g<l.length;g++){h=l[g];k=document.createElement("div");k.className="div_item";j=document.createElement("input");j.type="checkbox";j.id="Category_"+h.CategoryId;j.className="checkbox_item";j.onclick=add_or_remove_category;j.Category=h;f=document.createElement("div");f.innerHTML=h.Description;f.className="label_item";k.appendChild(j);k.appendChild(f);a.appendChild(k)}}function c(f,a){a.innerHtml="error loading categories ..."}}function clean_categories_from_list(a){if(a){while(a.lastChild!=null){a.removeChild(a.lastChild,a)}}}function show_add_post_form(){if(Uploading_Flag==false){if(document.forms.post_uploader_form.style.display=="none"){document.forms.post_uploader_form.PostBrowse.value="";document.forms.post_uploader_form.style.display="block";$get("PostId").value="0";$get("Title").value="";$get("Tags").value="";$get("Content").value="";uncheck_category_list(Categories);__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"")}else{document.forms.post_uploader_form.style.display="none"}}else{alert("Uploading in progress, please wait ...")}return false}function clear_list(a){while(a.lastChild!=null){a.removeChild(a.lastChild,a)}}function startUpload(j,h){var c=0;if(Uploading_Flag==false){$get("HCategories").value=h;var g=$get(CAPTCHA_IMAGE_TXT_RESULT_IMAGE);if(g){SBR.TV.Website.WebServices.jsLocalServices.SubmitVideoIsValid(g.value,f,d,j)}}else{alert("Uploading in process, please wait ...")}function f(a){if(a==true){SBR.TV.Website.WebServices.WebServiceProxy.GetPostFileFormats(b,e)}else{__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"");alert("Invalid Verification Code\n")}}function b(r){Uploading_Flag=true;var o=$get("TicketId");var t=$get("post_list");var m;var l=r;var k=j.value.substr(j.value.lastIndexOf(".")+1);k=k.toLowerCase();var a=new Date();o.value=a.getTime();if(l.inArray(k)!=-1){if(t){if(t.obj){var n=Math.ceil((posts_USER_ONLINE/post_ITEMS_PER_PAGE));var q=((posts_USER_ONLINE)%post_ITEMS_PER_PAGE);if(q==0){n++}t.current_page=0;posts_USER_ONLINE++;populate_post_list(t,n,true)}div_element=document.createElement("div");div_element.className="progress";t.appendChild(div_element);t.current_item.TicketId=o.value;j.form.submit()}}else{alert("The file doesn't seem to be a valid post file");j.form.reset();Uploading_Flag=false}}function e(){alert("error getting formats\n"+pError._stackTrace)}function d(a){alert("error checking valid code\n"+a._stackTrace)}}function finishUpload(b){var d=$get("post_list");var f;var g;var c;if(d.current_item){var e=d.current_item;if(b.TicketId==e.TicketId){b.Title=e.Title;b.Content=e.Content;b.Tags=e.Tags;b.Categories=e.Categories}else{if(Uploading_Flag==true){var e=Uploading_Post;b.Title=e.Title;b.Content=e.Content;b.Tags=e.Tags;b.Categories=e.Categories}}}if(b&&b.PostId){InvokeExternalFunction(b.PostId)}b.Title=(b.Title==undefined)?"":b.Title;b.Content=(b.Content==undefined)?"":b.Content;b.Tags=(b.Tags==undefined)?"":b.Tags;d.obj[d.obj.length]=b;add_posts_from_list(d);if(c){d.current_item=c}SBR.TV.Website.WebServices.jsLocalServices.PendingPost(b.PostId,b.User.UserId,h,a,b);function h(m,k){SBR.TV.Website.WebServices.jsLocalServices.PendingPost(k.PostId,k.User.UserId,l,j,k);function l(o,n){document.forms.post_uploader_form.reset();__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"");Uploading_Flag=false;Uploading_Post=null}function j(n){document.forms.post_uploader_form.reset();Uploading_Flag=false;Uploading_Post=null;alert(n._message);__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"")}}function a(j){document.forms.post_uploader_form.reset();Uploading_Flag=false;Uploading_Post=null;alert(j._message);__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"")}}function errorUpload(b){var a=$get("post_list");add_posts_from_list(a);document.forms.post_uploader_form.reset();Uploading_Flag=false;Uploading_Post=null;__doPostBack(CAPTCHA_IMAGE_BTN_REFRESH,"")}function save_post_details(c){var d;d=$get("post_list");if(mode=="update"){if(d){if(d.current_item){d.current_item.Title=$get("Title").value;d.current_item.Content=$get("Content").value;d.current_item.Tags=$get("Tags").value;if(d.current_item.PostId>0){SBR.TV.Website.WebServices.jsLocalServices.SavePostDetails(d.current_item.PostId,d.current_item.Title,d.current_item.Content,Deserializer(d.current_item.Categories),"",d.current_item.Tags,"",d.current_item.User.UserId,b,a,d)}}else{alert("No selected video")}}else{alert("post_list not found")}}else{if(mode=="upload"){if(Uploading_Flag==false){if((!d.current_item)||(!d.current_item.Categories)){var d;d=$get("post_list");d.current_item=new SBR.TV.Communication.Objects.Post();d.current_item.Categories=new Array()}d.current_item.Title=$get("Title").value;d.current_item.Content=$get("Content").value;d.current_item.Tags=$get("Tags").value;startUpload($get("PostBrowse"),CategoriesByComma(d.current_item.Categories))}else{alert("Uploading in progress, please wait ...")}}}function b(f,e){add_posts_from_list(e);alert("Save successful!!")}function a(e){alert("error saving post ...\n"+e._stackTrace)}}function cancelUpload(){document.forms.post_uploader_form.reset();Uploading_Flag=false;Uploading_Post=null;alert("Cancel upload unexpected error")}function PlayVideo(a){window.location="WatchVideo.aspx?postId="+a}function set_mode(a){a=a.toLowerCase();mode=a;if(a=="upload"){$get("post_details_submit_button").value="UPLOAD NOW";$get("VerificationImage").style.display="block";$get("verification_tr").style.visibility="visible"}else{if(a=="update"){$get("post_details_submit_button").value="SAVE";$get("VerificationImage").style.display="none";$get("verification_tr").style.visibility="hidden"}else{if(a=="uploadinprogress"){$get("post_details_submit_button").disabled=true}}}}function ConfirmReset(b){var a=confirm("Are you sure you wish to reset the form data?");if(a){b.form.reset()}}function loadImageInformation(c,b,d,a){c.pContent=d;c.pTitle=b;c.pToolTipWidth=a;c.onmouseover=ShowTooltip;c.onmouseout=CloseTooltip}function InvokeExternalFunction(a){if(window&&window.parent&&window.parent.LoadVideoReference){window.parent.LoadVideoReference(a)}}function VideoDescription(){}VideoDescription.prototype.LoadFromRow=function(e){var b=0;SBR.TV.Website.WebServices.WebServiceProxy.GetChannels(e.User.ChannelId,null,1,1,0,d,c,this);function d(a,h){var g=$get(h._DIV_FROM);if(g){g.innerHTML="";var f=a[0];if(f&&f.User){if(e.Title){g.innerHTML+=String.format("<p><b>{0}</b></p>",e.Title)}if(f.User.UserName!=undefined){if(!h._ModeRewrite){g.innerHTML+=String.format("<p><b>From: </b><a href=users.aspx?us={0}&ch={1}>{1}</a></p>",f.User.ForumUserId,f.Name)}else{g.innerHTML+=String.format("<p><b>From: </b><a href=channel-{0}-{1}.html>{2}</a></p>",f.User.ForumUserId,f.User.UserName,f.Name.trim())}}if(f.User.JoinDate!=undefined){g.innerHTML+=String.format("<p><b>Member Since: </b>{0}</p>",f.User.JoinDate.format(h._FORMAT_DATE))}if(f.User.VideosOnline!=undefined){g.innerHTML+=String.format("<p><b>Videos Online: </b>{0}</p>",f.User.VideosOnline)}if(e.CreatedDate!=undefined){g.innerHTML+=String.format("<p><b>Added: </b>{0}<br><b>Views:</b> {1}</p>",e.CreatedDate.format(h._FORMAT_DATE),e.Views)}g.innerHTML+='<p class="informationHeader"><b>Description:</b></p>'}}}function c(f){var a=$get(this._DivVideosId);a.innerHTML="The process failure (Load the channel)... please try again later."}};VideoDescription.prototype.LoadAddInformation=function(o){var d;var h;var n;var l=$get(this._DIV_INFORMATION);var e=$get(this._FULL_COMMENT_CONTAINER);var b;if(l){if(o.Content!=undefined&&o.Content.length>0){var j=o.Content;j=j.replace(/^\s+|\s+$/g,"");var q=j.match(/<\s*\w.*?>[\s | \w ]*<\s*\/\s*\w*\s*.*?>/g);var g=0;if(q!=null){g=q.length}var m="";var a=new Array(g);var k=-1;var c=false;if(g>=1){for(i=0;i<g;i++){m=q[i];k=j.indexOf(m);if(k!=-1){a[i]=k}k=-1}for(i=0;i<g;i++){m=q[i];k=j.indexOf(m);if(k!=-1){j=j.replace(m,"")}k=-1}if(j.length>this._MAX_CHARACTER){d=j.substring(0,this._MAX_CHARACTER);h=d.lastIndexOf(this._CHARACTER_TO_FIND);d=j.substring(0,h);n=j.substring(h);var f=d.length}else{var d=j;var f=d.length}for(p=0;p<g;p++){if(a[p]<=f){d=this.InsertString(d,q[p],a[p]);f=d.length}else{n=this.InsertString(n,q[p],a[p]-f)}}if(j.length<this._MAX_CHARACTER){l.innerHTML=d}}else{if(j.length>this._MAX_CHARACTER){d=j.substring(0,this._MAX_CHARACTER);h=d.lastIndexOf(this._CHARACTER_TO_FIND);d=j.substring(0,h);n=j.substring(h+1,j.length)}else{l.innerHTML=j}}if(j.length>this._MAX_CHARACTER){l.innerHTML=d+"&nbsp;";b=document.createElement(this._HTML_ELEMENT_A);b.onclick=this.MoreInfo;b.innerHTML="More&raquo;&raquo;";b.style.display="inline";b.className="button";objHideInfo=document.createElement(this._HTML_ELEMENT_A);objHideInfo.onclick=this.HideInfo;objHideInfo.innerHTML="&laquo;&laquo;Hide";objHideInfo.style.display="inline";objHideInfo.className="button";b.HideInfo=objHideInfo;b.objChannel=this;objHideInfo.MoreInfo=b;objHideInfo.objChannel=this;l.appendChild(b);e.innerHTML=n+"&nbsp;"}}}};VideoDescription.prototype.InsertString=function(d,c,b){var f="";var e="";var a;f=d.substring(0,b);e=d.substring(b);a=f+c+e;return a};VideoDescription.prototype.ContaintHtmlTags=function(a){var b=a.match(/<\s*\w.*?>[\s | \w ]*<\s*\/\s*\w*\s*.*?>/g);var c=b.length;if(c>=1){return true}else{return false}};VideoDescription.prototype.MoreInfo=function(c){var b=$get(c._DIV_INFORMATION);var a=$get(c._FULL_COMMENT_CONTAINER);if(b&&a){b.style.display="none";a.style.display=""}return false};VideoDescription.prototype.HideInfo=function(c){var b=$get(c._DIV_INFORMATION);var a=$get(c._FULL_COMMENT_CONTAINER);if(b&&a){b.style.display="";a.style.display="none"}return false};VideoDescription.prototype.LoadAddTags=function(a){var b=$get(this._DIV_TAGS);if(b){if(a.Tags!=undefined){if(a.Tags.lenght>0){b.innerHTML="Tags: "+a.Tags}else{b.style.display="none"}}}};VideoDescription.prototype.LoadFieldValues=function(e){var c=$get(this._FIELD_URL);var d=$get(this._FIELD_EMBED);var j=e.Title?e.Title:"";var f=new RegExp("^(http[s]?://.*/)(.*)?$");var a=new RegExp(/[^A-Za-z0-9]+/g);j=j.replace(a,"-");var h=f.exec(document.URL);var b=h[1];if(c){if(!this._ModeRewrite){if(j.length>0){varUrl=b+"WatchVideo.aspx?postId="+e.PostId+"&title="+j}else{varUrl=b+"WatchVideo.aspx?postId="+e.PostId}}else{if(j.length>0){varUrl=b+"video-"+e.PostId+"-"+j+".html"}else{varUrl=b+"video-"+e.PostId+"-NoTitle.html"}}c.value=varUrl}if(d){var g='<object width="320" height="280">';g+='<param name="movie" value="'+b+"swf/sbrtv.swf?postId="+e.PostId+'"></param>';g+='<param name="allowFullScreen" value="true"></param>';g+='<param name="allowScriptAccess" value="always"></param>';g+='<param name="vmode" value="transparent"></param>';g+='<embed src="'+b+"swf/sbrtv.swf?postId="+e.PostId+'" ';g+='type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" wmode="transparent" width="320" height="280"></embed></object> ';d.value=g}};function VideosChannel(){var a=EMPTY_STRING;var k=EMPTY_STRING;var G=EMPTY_STRING;var C=EMPTY_STRING;var E=EMPTY_STRING;var q=EMPTY_STRING;var n="Vertical";var B=500;var j=590;var f;var z;var F=true;var d=true;var r=true;var c="";var y="";var g="";var b=1;var D=10;var x=5;var l=1;var w=1;var e=1;var A=-1;var u="";var v="";var t;var m=true;var o="";var h}VideosChannel.prototype.init=function(){var d=$get(this._VideoListControlDivId);d.style.width=this._Width+"px";if(this._ShowTitle){var e=$get(this._DivTitle);if(this._BackGroundColorTitle.length>0){e.style.background=this._BackGroundColorTitle}if(this._ShowLeftTitle){var b=$get(this._LblLeftTitleId);b.style.display="block";b.style.color=this._ForeColorTitle;b.innerHTML=this._ListTitle}else{var b=$get(this._LblLeftTitleId);b.style.display="none"}if(this._ShowUpLoadVideoLink){var c=$get(this._AnchorRightTitle);c.style.display="block"}else{var c=$get(this._AnchorRightTitle);c.style.display="none"}if(this._RightTitle.length>0){var a=$get(this._LblOrderId);a.style.display="block";a.style.color=this._ForeColorTitle;a.innerHTML="<b>"+this._RightTitle+"</b>"}else{var a=$get(this._LblOrderId);a.style.display="none"}}else{var e=$get(this._DivTitle);e.style.visible="hidden";e.style.display="none"}this.LoadChannels()};VideosChannel.prototype.LoadChannels=function(){var a=$get(this._DivVideosId);a.innerHTML=EMPTY_STRING;var e=document.createElement(HTML_DIV_TAG);e.className="loading";e.style.width=this._Width+"px";var b=document.createElement(HTML_IMAGE_TAG);b.src="img/progress.gif";e.appendChild(b);a.appendChild(e);if(this._SearchTerm.length>0){SBR.TV.Website.WebServices.WebServiceProxy.GetChannelsBySearch(this._SearchTerm,this._ElementsByPage,this._DefaultPageNumber,1,c,d,this)}else{SBR.TV.Website.WebServices.WebServiceProxy.GetChannels(-1,null,this._ElementsByPage,this._DefaultPageNumber,1,c,d,this)}function c(g,f){f._ChannelList=g;f.DisplayChannels(f._ChannelList)}function d(g){var f=$get(this._DivVideosId);f.innerHTML="The process failure (Load the channel) ... please try again later."}};VideosChannel.prototype.DisplayChannels=function(o){var r=$get(this._LblLeftTitleId);r.innetText=this._ListTitle;var a=$get(this._DivVideosScroll);var g=$get(this._DivVideosId);g.className="videos_container";if(this._Width>=0){g.style.width=this._Width+"px"}if(this._Height>=0){a.style.height=this._Height+"px"}if(this._Align=="Vertical"){if(this._Height>=0){g.style.height=this._Height+"px"}}else{g.style.width=(this._ElementsByPage*(this._AvatarWidth+(this._MarginHorizontalList*2)));g.style.overflowX="hidden";g.style.overflowY="hidden";a.style.overflowX="auto";a.style.overflowY="hidden"}if(o){var c=new RegExp(/[^A-Za-z0-9]+/g);var q=o.length;if(q>0){g.innerHTML=EMPTY_STRING;this._TotalPosts=o[0].Total;for(var f=0;f<q;f++){var t=o[f];if(t){var k=document.createElement(HTML_DIV_TAG);k.className="video";k.style.width=this._AvatarWidth+"px";var m=document.createElement(HTML_ANCHOR_TAG);m.href="channel-"+t.User.ForumUserId+"-"+t.User.UserName.replace(c,"-")+".html";m.className="Title";m.innerHTML="<b>"+(t.Name==EMPTY_STRING?"No Name":t.Name)+"</b>";k.appendChild(m);var e=document.createElement(HTML_DIV_TAG);e.className="video_thumbnail";k.appendChild(e);var u=document.createElement(HTML_DIV_TAG);u.className="image";u.style.width=this._AvatarWidth+"px";u.style.height=this._AvatarHeight+"px";var l=document.createElement(HTML_ANCHOR_TAG);l.href="channel-"+t.User.ForumUserId+"-"+t.User.UserName.replace(c,"-")+".html";var j=document.createElement(HTML_IMAGE_TAG);j.src=t.AvatarUrl;var h=document.createElement(HTML_IMAGE_TAG);h.defaultImg=this._DefaultImage;h.alt=t.Name;h.src=t.AvatarUrl;h.style.width=this._AvatarWidth+"px";h.style.height=this._AvatarHeight+"px";h.onerror=function(v){this.src=this.defaultImg;this.onerror="";return true};l.appendChild(h);u.appendChild(l);e.appendChild(u);var d=document.createElement(HTML_DIV_TAG);d.className="details";var n=document.createElement(HTML_DIV_TAG);n.className="item";n.innerHTML="<span>added: <b>"+t.User.JoinDate.format("MMMM dd, yyyy")+"</b> </span>";d.appendChild(n);var b=document.createElement(HTML_DIV_TAG);b.className="item";b.innerHTML="<span>Videos online: <b>"+t.User.VideosOnline+"</b> </span>";d.appendChild(b);k.appendChild(d);k.style.margin=this._MarginHorizontalList+"px";g.appendChild(k)}}if(this._Paging){this.AddPageControls()}if(g.style.height==""&&this._Align=="Vertical"){g.style.height=g.offsetHeight+"px"}}else{g.innerHTML=this._TextToShowEmptyList}}};VideosChannel.prototype.AddPageControls=function(){if(this._TotalPosts>0){var b;var g;var a=$get(this._DivVideosId);b=document.createElement("div");b.className="controls";var k=$get(this._DIV_CONTAINER_TOP_PAGES);if(k){k.innerHTML="";k.className="controls"}function d(){var l;if(this.useButtom){switch(this.useButtom){case 1:if((this.obj._FirstIndexPage-this.obj._PagesNumberByBlock)>=1){this.obj._FirstIndexPage=this.obj._FirstIndexPage-this.obj._PagesNumberByBlock;this.obj._EndIndexPage=this.obj._EndIndexPage-this.obj._PagesNumberByBlock}else{this.obj._FirstIndexPage=1;if(this.obj._PagesNumberByBlock<this.totalPage){this.obj._EndIndexPage=parseInt(this.obj._PagesNumberByBlock)}else{this.obj._EndIndexPage=this.totalPage}}break;case 2:if((this.obj._EndIndexPage+this.obj._PagesNumberByBlock)<=this.totalPage){this.obj._FirstIndexPage=this.obj._FirstIndexPage+parseInt(this.obj._PagesNumberByBlock);this.obj._EndIndexPage=this.obj._EndIndexPage+parseInt(this.obj._PagesNumberByBlock)}else{this.obj._FirstIndexPage=(this.totalPage-this.obj._PagesNumberByBlock)+1;this.obj._EndIndexPage=this.totalPage}break}}l=parseInt(this.numberPage)-1;if(this.obj._DefaultPageNumber!=l+1){this.obj._DefaultPageNumber=l+1;this.obj.LoadChannels()}return false}var j;var h;var e;j=Math.ceil(this._TotalPosts/this._ElementsByPage);h=this._PagesNumberByBlock;if(this._EndIndexPage==-1){if(this._PagesNumberByBlock<j){this._EndIndexPage=this._PagesNumberByBlock;this._FirstIndexPage=this._DefaultPageNumber}else{this._EndIndexPage=j}}if(this._FirstIndexPage>1){g=document.createElement("a");g.innerHTML="&nbsp;&nbsp;";g.className="previusPages";g.href="#";g.onclick=d;g.onmousedown=False;g.numberPage=this._FirstIndexPage-1;g.obj=this;g.useButtom=1;g.totalPage=j;b.appendChild(g);if(k){if(this._Align.toLowerCase()=="vertical"){var c=document.createElement("a");c.innerHTML="&nbsp;&nbsp;";c.className="previusPages";c.onclick=d;c.onmousedown=False;c.numberPage=this._FirstIndexPage-1;c.obj=this;c.useButtom=1;c.totalPage=j;k.appendChild(c)}}}for(var f=this._FirstIndexPage;f<=this._EndIndexPage;f++){g=document.createElement("a");g.innerHTML=f;g.href="#";g.onclick=d;g.onmousedown=False;g.obj=this;g.numberPage=f;g.totalPage=j;if(this._DefaultPageNumber==f){g.className="selectedpage"}b.appendChild(g);if(k){var c=document.createElement("a");c.innerHTML=f;if(this._DefaultPageNumber==f){c.className="selectedpage"}c.onclick=d;c.onmousedown=False;c.obj=this;c.numberPage=f;c.totalPage=j;k.appendChild(c)}}if(this._EndIndexPage<j){g=document.createElement("a");g.innerHTML="&nbsp;&nbsp;";g.className="nextPages";g.href="#";g.onclick=d;g.onmousedown=False;g.numberPage=this._EndIndexPage+1;g.obj=this;g.useButtom=2;g.totalPage=j;b.appendChild(g);if(k){if(this._Align.toLowerCase()=="vertical"){var c=document.createElement("a");c.innerHTML="&nbsp;&nbsp;";c.className="nextPages";c.onclick=d;c.onmousedown=False;c.numberPage=this._EndIndexPage+1;c.obj=this;c.useButtom=2;c.totalPage=j;k.appendChild(c)}}}a.appendChild(b)}};var MAX_LENGHT_LIST_VIEW=200;var MAX_CHARACTER=180;var CHARACTER_TO_FIND=" ";var CHARACTER_TO_FIND1=",";var CHARACTER_TO_FIND2=".";var MAX_CHARACTER_TAGS=15;var MAX_CHARACTER_TITLE=17;function VideoList(){var ak;var E=EMPTY_STRING;var C=EMPTY_STRING;var z=EMPTY_STRING;var j;var au;var U=EMPTY_STRING;var V=EMPTY_STRING;var az=EMPTY_STRING;var e=EMPTY_STRING;var l=EMPTY_STRING;var ap=true;var D=true;var f=true;var ae=SBR.TV.Communication.Objects.RequestType.NONE;var q=-1;var A=EMPTY_STRING;var al=new Array();var ai="vertical";var x=500;var X=590;var g=212;var K=212;var ar=645;var T=5;var W=true;var b=true;var ad=true;var ac=true;var a=true;var aj="";var y="";var Q="";var Z="";var ag=1;var h=10;var Y=5;var F=1;var G=1;var am=1;var v=1;var ah=-1;var d=this.LoadPosts;var J="";var r="POST";var at="ASC";var o="";var S=-1;var n=false;var ay="";var av="";var L;var aa;var t;var R;var ao;var k="grid";var an=false;var aq;var M;var O;var I;var c;var N;var af;var P;var ax;var H;var u;var ab;var aw;var w;var B;var m}VideoList.prototype.init=function(){var e=$get(this._VideoListControlDivId);e.style.width=this._Width+"px";if(this._ShowTitle){var f=$get(this._DivTitle);if(this._BackGroundColorTitle.length>0){f.style.background=this._BackGroundColorTitle}if(this._ShowTabsInVideoList&&this._VideoListTabs.length>0){this.DisplayListTabs(f)}if(this._ShowLeftTitle){var c=$get(this._LblLeftTitleId);c.style.display="block";c.style.color=this._ForeColorTitle;if(this._RequestType==SBR.TV.Communication.Objects.RequestType.RELATED_POSTS||this._RequestType==SBR.TV.Communication.Objects.RequestType.SEARCH){c.innerHTML=String.format("{0} ({1})",this._ListTitle,this._TotalPosts)}else{c.innerHTML=this._ListTitle}}else{var c=$get(this._LblLeftTitleId);c.style.display="none"}if(this._ShowUpLoadVideoLink){var d=$get(this._AnchorRightTitle);d.style.display="block"}else{var d=$get(this._AnchorRightTitle);d.style.display="none"}if(this._ShowRightTitle){var b=$get(this._LblOrderId);b.style.display="block";b.style.color=this._ForeColorTitle;b.innerHTML="<b>"+this._RightTitle+"</b>"}else{var b=$get(this._LblOrderId);b.style.display="none"}if(this._ShowViewOrder){this.DisplayViewButtons()}else{var a=$get(this._DivDisplayOrder);a.style.display="none"}}else{var f=$get(this._DivTitle);f.style.visible="hidden";f.style.display="none"}if(this._DivVideosId){var g=$get(this._DivVideosId);g.style.height=g.offsetHeight+"px"}if(this._IsFromServer!=true){this.SetRequestType()}this._IsFromServer=false};VideoList.prototype.DisplayViewButtons=function(){var c=$get(this._DivDisplayOrder);c.innerHTML="";c.style.display="block";var d=document.createElement(HTML_DIV_TAG);d.className="text";d.innerHTML="Display:";var b=document.createElement(HTML_DIV_TAG);b.className="buttoms";var e=document.createElement(HTML_DIV_TAG);if(this._DefaultView=="grid"){e.className="gridViewSelected"}else{e.className="gridView"}e.title="Grid View";e.onclick=GridView;e.objList=this;var a=document.createElement(HTML_DIV_TAG);if(this._DefaultView=="list"){a.className="listViewSelected"}else{a.className="listView"}a.title="List View";a.onclick=ListView;a.objList=this;b.appendChild(e);b.appendChild(a);c.appendChild(d);c.appendChild(b)};function GridView(){if(this.objList){var a=this.objList;var b=$get(a._DivVideosId);if(b){b.style.height=""}if(a._Align.toLowerCase()=="vertical"&&a._DefaultView.toLowerCase()!="grid"){a._VideoWidth=a._VideoWidthGridView;a._DefaultView="grid";videoList=document.getElementsByName(a._VideoListName+"_videoBrief");limit=videoList.length;for(counter=0;counter<limit;counter++){if(videoList[counter].getAttribute("Name")==a._VideoListName+"_videoBrief"){videoList[counter].style.width=a._VideoWidth+"px"}}titlesList=document.getElementsByName(a._VideoListName+"_listTitleElement");limit=titlesList.length;for(counter=0;counter<limit;counter++){if(titlesList[counter].getAttribute("id")==a._VideoListName+"_listTitleElement"){titlesList[counter].style.display="none"}}anchorList=document.getElementsByName(a._VideoListName+"_anchorTitle");limit=anchorList.length;for(counter=0;counter<limit;counter++){if(anchorList[counter].getAttribute("id")==a._VideoListName+"_anchorTitle"){anchorList[counter].style.display="block"}}a.DisplayViewButtons()}}}function ListView(){if(this.objList){var a=this.objList;var b=$get(a._DivVideosId);if(b){b.style.height=""}if(a._Align.toLowerCase()=="vertical"&&a._DefaultView.toLowerCase()!="list"){a._VideoWidth=a._VideoWidthListView;a._DefaultView="list";videoList=document.getElementsByName(a._VideoListName+"_videoBrief");limit=videoList.length;for(counter=0;counter<limit;counter++){if(videoList[counter].getAttribute("Name")==a._VideoListName+"_videoBrief"){videoList[counter].style.width=a._VideoWidth+"px"}}titlesList=document.getElementsByName(a._VideoListName+"_listTitleElement");limit=titlesList.length;for(counter=0;counter<limit;counter++){if(titlesList[counter].getAttribute("id")==a._VideoListName+"_listTitleElement"){titlesList[counter].style.display="block"}}anchorList=document.getElementsByName(a._VideoListName+"_anchorTitle");limit=anchorList.length;for(counter=0;counter<limit;counter++){if(anchorList[counter].getAttribute("id")==a._VideoListName+"_anchorTitle"){anchorList[counter].style.display="none"}}a.DisplayViewButtons()}}return false}VideoList.prototype.DisplayListTabs=function(b){var d=this._VideoListTabs.split("[+]");var c=$get(this._DivHeaderTabsId);c.innerHTML="";if(d.length>0){var a=true;for(i=0;i<d.length;i++){a=this.AddSingleTab(b,d[i],c,a)}}};VideoList.prototype.AddSingleTab=function(e,b,g,d){var a=b.split(",");g.style.display="";var c=document.createElement(HTML_DIV_TAG);var f=document.createElement(HTML_ANCHOR_TAG);c.className="singleHeaderTab";f.innerHTML=a[0];f.onclick=this.ChangeTab;f.displayType=a[1];f.videoList=this;f.href="#";if(a[1]==SBR.TV.Communication.Objects.RequestType.TYPE_POST){f.displayData=a[2]}else{if(a[1]==SBR.TV.Communication.Objects.RequestType.USER){f.displayData=a[2]}else{if(a[1]==SBR.TV.Communication.Objects.RequestType.CATEGORY){f.displayData=a[2]}}}if(d){this._RequestType=a[1];if(a[1]==SBR.TV.Communication.Objects.RequestType.TYPE_POST){this._ListTypeID=a[2]}else{if(a[1]==SBR.TV.Communication.Objects.RequestType.USER){this._UserId=a[2]}else{if(a[1]==SBR.TV.Communication.Objects.RequestType.CATEGORY){f.displayData=a[2]}}}d=false;c.className+=" singleHeaderTabSelected"}else{c.className+=" singleHeaderTabNotSelected"}c.appendChild(f);g.appendChild(c);return d};VideoList.prototype.ChangeTab=function(){this.videoList._RequestType=this.displayType;if(this.displayType==SBR.TV.Communication.Objects.RequestType.TYPE_POST){this.videoList._ListTypeID=this.displayData}else{if(this.displayType==SBR.TV.Communication.Objects.RequestType.USER){this.videoList._UserId=this.displayData}else{if(this.displayType==SBR.TV.Communication.Objects.RequestType.CATEGORY){this.videoList._FilterId=this.displayData}}}this.videoList._DefaultPageNumber=1;this.videoList._EndIndexPage=-1;this.videoList._FirstIndexPage=1;this.videoList.SetRequestType();var a=this.parentNode.parentNode.getElementsByTagName(HTML_DIV_TAG);for(i=0;i<a.length;i++){a[i].className="singleHeaderTab singleHeaderTabNotSelected"}this.parentNode.className="singleHeaderTab singleHeaderTabSelected";a=null;return false};VideoList.prototype.SetRequestType=function(){if(this._RequestType==SBR.TV.Communication.Objects.RequestType.NONE){this.DisplayPosts(this._PostsList)}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.SEARCH){this.LoadBySearch()}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.RELATED_POSTS){this.LoadByRelatedPost()}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.SUBMITED_POSTS){this.LoadBySumitedPost()}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.PENDING_APPROVAL_POSTS){this.LoadPendingApprovePosts()}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.FAVORITE_POSTS){this.LoadFavoritePosts()}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.QUICK_LIST){this.LoadQuickListPosts()}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.PLAY_LIST){this.LoadPlayListPosts()}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.TYPE_POST){this.LoadTypePosts()}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.BEING_WATCHED){this.LoadBeingWatchedPosts()}else{this.LoadPosts()}}}}}}}}}}};VideoList.prototype.GoToChannel=function(a){this._FilterId=a;this._RequestType=SBR.TV.Communication.Objects.RequestType.CHANNEL;this.LoadPosts()};VideoList.prototype.GoToCategory=function(a){this._FilterId=a;this._RequestType=SBR.TV.Communication.Objects.RequestType.CATEGORY;this.LoadPosts()};VideoList.prototype.GoToUser=function(a){this._UserId=a;this._RequestType=SBR.TV.Communication.Objects.RequestType.USER;this.LoadPosts()};VideoList.prototype.LoadPostsLists=function(a){this._RequestType=SBR.TV.Communication.Objects.RequestType.NONE;this._FilterId=-1;this._PostsList=a;this.DisplayPosts(this._PostsList)};VideoList.prototype.LoadPosts=function(){if(this._RequestType==SBR.TV.Communication.Objects.RequestType.NONE){this.DisplayPosts(this._PostsList);return}if((this._RequestType==SBR.TV.Communication.Objects.RequestType.USER)&&(this._UserId=="")){try{eval("var playerPostRef = "+this._PlayerName);this._UserId=playerPostRef._OWNER_VIDEO;if(this._ShowLeftTitle){var lblLeftTitle=$get(this._LblLeftTitleId);if(playerPostRef._OWNERNAME_VIDEO.length>0){lblLeftTitle.innerHTML+=" by "+playerPostRef._OWNERNAME_VIDEO}}}catch(err){alert("Error associating the list to the player...")}}var container=$get(this._DivVideosId);container.innerHTML=EMPTY_STRING;var divLoading=document.createElement(HTML_DIV_TAG);divLoading.className="loading";var imgLoading=document.createElement(HTML_IMAGE_TAG);imgLoading.src="img/progress.gif";divLoading.appendChild(imgLoading);container.appendChild(divLoading);if(this._PagingFlag){SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPosts(this._RequestType,this._FilterId,this._UserId,GetTotalPostsAux,Error,this)}else{SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(this._RequestType,this._FilterId,this._UserId,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,GetPostsAuxWithOutPage,ErrorWithOutPage,this)}function GetTotalPostsAux(pPost,pVideoList){pVideoList._TotalPosts=pPost;SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(pVideoList._RequestType,pVideoList._FilterId,pVideoList._UserId,pVideoList._DefaultPageNumber,pVideoList._ElementsByPage,pVideoList._OrderBy,pVideoList._PagingFlag,pVideoList._TopFlag,GetPostsAuxByPage,ErrorByPage,pVideoList);function GetPostsAuxByPage(pPost,pVideoList){pVideoList._PostsList=pPost;pVideoList.DisplayPosts(pVideoList._PostsList)}function ErrorByPage(pError){var container=$get(this._DivVideosId);container.innerHTML="Error loading videos... please try again later."}}function GetPostsAuxWithOutPage(pPost,pVideoList){pVideoList._PostsList=pPost;pVideoList.DisplayPosts(pVideoList._PostsList)}function ErrorWithOutPage(pError){alert("Error loading videos... please try again later. "+pError._stackTrace)}};VideoList.prototype.LoadBySearch=function(){var b=$get(this._DivVideosId);b.innerHTML=EMPTY_STRING;var d=document.createElement(HTML_DIV_TAG);d.className="loading";var c=document.createElement(HTML_IMAGE_TAG);c.src="img/progress.gif";d.appendChild(c);b.appendChild(d);SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPostsSearchResults(this._SearchTerm,a,e,this);function a(h,f){f._TotalPosts=h;var g=$get(f._LblLeftTitleId);if(g){g.innerHTML=f._ListTitle+" ("+h+")"}f.GetPostsSearchResults()}function e(f){alert("Error loading videos... please try again later.: "+f.message)}};VideoList.prototype.LoadByRelatedPost=function(){if(this._RequestType!=SBR.TV.Communication.Objects.RequestType.RELATED_POSTS){return}if(this._FilterId>0){var a=$get(this._DivVideosId);a.innerHTML=EMPTY_STRING;var c=document.createElement(HTML_DIV_TAG);c.className="loading";var b=document.createElement(HTML_IMAGE_TAG);b.src="img/progress.gif";c.appendChild(b);a.appendChild(c)}SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(SBR.TV.Communication.Objects.RequestType.POST,this._FilterId,this._UserId,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,false,false,e,d,this);function e(h,g){var f="";if(h.length>0){if(h[0].Tags===undefined||h[0].Tags==null||h[0].Tags==""){g._SearchTerm=h[0].Title}else{g._SearchTerm=h[0].Tags}g._SearchType="POST";g.LoadBySearch()}}function d(g){var f=$get(this._DivVideosId);f.innerHTML="Error loading videos... please try again later."}};VideoList.prototype.LoadBySumitedPost=function(){if(this._RequestType!=SBR.TV.Communication.Objects.RequestType.SUBMITED_POSTS){return}var c=$get(this._DivVideosId);c.innerHTML=EMPTY_STRING;var f=document.createElement(HTML_DIV_TAG);f.className="loading";var d=document.createElement(HTML_IMAGE_TAG);d.src="img/progress.gif";f.appendChild(d);c.appendChild(f);if(this._PagingFlag){SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPosts(this._RequestType,this._FilterId,this._UserId,b,Error,this)}else{SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(this._RequestType,this._FilterId,this._UserId,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,e,a,this)}function b(h,g){g._TotalPosts=h;SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(g._RequestType,g._FilterId,g._UserId,g._DefaultPageNumber,g._ElementsByPage,g._OrderBy,g._PagingFlag,g._TopFlag,k,j,g);function k(m,l){l._PostsList=m;l.DisplayPosts(l._PostsList)}function j(m){var l=$get(this._DivVideosId);l.innerHTML="Error loading videos... please try again later."}}function e(h,g){g._PostsList=h;g.DisplayPosts(g._PostsList)}function a(g){alert("Error loading videos... please try again later. "+g._stackTrace)}};VideoList.prototype.LoadPendingApprovePosts=function(){if(this._RequestType!=SBR.TV.Communication.Objects.RequestType.PENDING_APPROVAL_POSTS){return}var b=$get(this._DivVideosId);b.innerHTML=EMPTY_STRING;var d=document.createElement(HTML_DIV_TAG);d.className="loading";var c=document.createElement(HTML_IMAGE_TAG);c.src="img/progress.gif";d.appendChild(c);b.appendChild(d);SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPosts(this._RequestType,this._FilterId,this._UserId,a,e,this);function a(g,f){f._TotalPosts=g;f.GetPendingApprovePosts()}function e(g){var f=$get(this._DivVideosId);f.innerHTML="Error loading videos... please try again later."}};VideoList.prototype.GetPendingApprovePosts=function(){if(this._RequestType!=SBR.TV.Communication.Objects.RequestType.PENDING_APPROVAL_POSTS){return}var a=$get(this._DivVideosId);a.innerHTML=EMPTY_STRING;var c=document.createElement(HTML_DIV_TAG);c.className="loading";var b=document.createElement(HTML_IMAGE_TAG);b.src="img/progress.gif";c.appendChild(b);a.appendChild(c);SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(this._RequestType,this._FilterId,this._UserId,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,e,d,this);function e(g,f){f._PostsList=g;f.DisplayPosts(f._PostsList)}function d(g){var f=$get(this._DivVideosId);f.innerHTML="Error loading videos... please try again later."}};VideoList.prototype.GetPostsSearchResults=function(){var a=0;var j=0;var e=0;var c=0;SBR.TV.Website.WebServices.WebServiceProxy.GetPostsSearchResults(this._SearchTerm,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,b,h,this);function b(f,d){d._PostsList=f;d.DisplayPosts(d._PostsList)}function h(f){var d=$get(this._DivVideosId);d.innerHTML="Error loading videos... please try again later."}};VideoList.prototype.LoadFavoritePosts=function(){if(this._RequestType!=SBR.TV.Communication.Objects.RequestType.FAVORITE_POSTS){return}var b=$get(this._DivVideosId);b.innerHTML=EMPTY_STRING;var e=document.createElement(HTML_DIV_TAG);e.className="loading";var c=document.createElement(HTML_IMAGE_TAG);c.src="img/progress.gif";e.appendChild(c);b.appendChild(e);if(this._PagingFlag){SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPosts(this._RequestType,this._FilterId,this._UserId,f,Error,this)}else{SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(this._RequestType,this._FilterId,this._UserId,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,d,a,this)}function f(h,g){g._TotalPosts=h;SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(g._RequestType,g._FilterId,g._UserId,g._DefaultPageNumber,g._ElementsByPage,g._OrderBy,g._PagingFlag,g._TopFlag,k,j,g);function k(m,l){l._PostsList=m;l.DisplayPosts(l._PostsList)}function j(m){var l=$get(this._DivVideosId);l.innerHTML="Error loading favorite videos... please try again later."}}function d(h,g){g._PostsList=h;g.DisplayPosts(g._PostsList)}function a(g){alert("Error loading favorite videos... please try again later. "+g._stackTrace)}};VideoList.prototype.LoadFeaturedPosts=function(){if(this._RequestType!=SBR.TV.Communication.Objects.RequestType.FEATURED_POSTS){return}var c=$get(this._DivVideosId);c.innerHTML=EMPTY_STRING;var f=document.createElement(HTML_DIV_TAG);f.className="loading";var d=document.createElement(HTML_IMAGE_TAG);d.src="img/progress.gif";f.appendChild(d);c.appendChild(f);if(this._PagingFlag){SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPosts(this._RequestType,this._FilterId,this._UserId,a,Error,this)}else{SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(this._RequestType,this._FilterId,this._UserId,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,e,b,this)}function a(h,g){g._TotalPosts=h;SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(g._RequestType,g._FilterId,g._UserId,g._DefaultPageNumber,g._ElementsByPage,g._OrderBy,g._PagingFlag,g._TopFlag,k,j,g);function k(m,l){l._PostsList=m;l.DisplayPosts(l._PostsList)}function j(m){var l=$get(this._DivVideosId);l.innerHTML="Error loading featured videos... please try again later."}}function e(h,g){g._PostsList=h;g.DisplayPosts(g._PostsList)}function b(g){alert("Error loading featured videos... please try again later. "+g._stackTrace)}};VideoList.prototype.LoadTypePosts=function(){var b=$get(this._DivVideosId);b.innerHTML=EMPTY_STRING;var f=document.createElement(HTML_DIV_TAG);f.className="loading";var c=document.createElement(HTML_IMAGE_TAG);c.src="img/progress.gif";f.appendChild(c);b.appendChild(f);if(this._PagingFlag){SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPostsByType(this._ListTypeID,this._FilterId,this._UserId,d,Error,this)}else{SBR.TV.Website.WebServices.WebServiceProxy.GetPostsByType(this._ListTypeID,this._FilterId,this._UserId,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,e,a,this)}function d(h,g){g._TotalPosts=h;SBR.TV.Website.WebServices.WebServiceProxy.GetPostsByType(g._ListTypeID,g._FilterId,g._UserId,g._DefaultPageNumber,g._ElementsByPage,g._OrderBy,g._PagingFlag,g._TopFlag,k,j,g);function k(m,l){l._PostsList=m;l.DisplayPosts(l._PostsList)}function j(m){var l=$get(this._DivVideosId);l.innerHTML="Error loading featured videos... please try again later."}}function e(h,g){g._PostsList=h;g.DisplayPosts(g._PostsList)}function a(g){alert("Error loading videos... please try again later. "+g._stackTrace)}};VideoList.prototype.LoadBeingWatchedPosts=function(){if(this._RequestType!=SBR.TV.Communication.Objects.RequestType.BEING_WATCHED){return}var b=$get(this._DivVideosId);b.innerHTML=EMPTY_STRING;var e=document.createElement(HTML_DIV_TAG);e.className="loading";var c=document.createElement(HTML_IMAGE_TAG);c.src="img/progress.gif";e.appendChild(c);b.appendChild(e);if(this._PagingFlag){SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPosts(this._RequestType,this._FilterId,this._UserId,f,Error,this)}else{SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(this._RequestType,this._FilterId,this._UserId,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,d,a,this)}function f(h,g){g._TotalPosts=h;SBR.TV.Website.WebServices.WebServiceProxy.GetPosts(g._RequestType,g._FilterId,g._UserId,g._DefaultPageNumber,g._ElementsByPage,g._OrderBy,g._PagingFlag,g._TopFlag,k,j,g);function k(m,l){l._PostsList=m;l.DisplayPosts(l._PostsList)}function j(m){var l=$get(this._DivVideosId);l.innerHTML="Error loading featured videos... please try again later."}}function d(h,g){g._PostsList=h;g.DisplayPosts(g._PostsList)}function a(g){alert("Error loading featured videos... please try again later. "+g._stackTrace)}};VideoList.prototype.LoadQuickListPosts=function(){if(this._RequestType!=SBR.TV.Communication.Objects.RequestType.QUICK_LIST){return}var b=$get(this._DivVideosId);b.innerHTML=EMPTY_STRING;var f=document.createElement(HTML_DIV_TAG);f.className="loading";var k=document.createElement(HTML_IMAGE_TAG);k.src="img/progress.gif";f.appendChild(k);b.appendChild(f);var a=0;var g="<PostsList>";if(document.cookie.length>0){var n=document.cookie.indexOf(this._UserLoggedName+"=");if(n>-1){n=n+this._UserLoggedName.length+1;var d=document.cookie.indexOf(";",n);if(d==-1){d=document.cookie.length}if(document.cookie.substring(n,d).length>0){var c=document.cookie.substring(n,d).split(",");a=c.length;var h=0;for(h;h<c.length;h++){if(c[h].length>0){g+=String.format("<PostId>{0}</PostId>",c[h])}}}}g+="</PostsList>"}if(this._PagingFlag){this._TotalPosts=a;SBR.TV.Website.WebServices.WebServiceProxy.GetPostsListPosts(g,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,e,l,this)}else{SBR.TV.Website.WebServices.WebServiceProxy.GetPostsListPosts(g,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,m,j,this)}function m(q,o){o._PostsList=q;o.DisplayPosts(o._PostsList)}function j(o){alert("Error loading favorite videos... please try again later. "+o._stackTrace)}function e(q,o){o._PostsList=q;o.DisplayPosts(o._PostsList)}function l(q){var o=$get(this._DivVideosId);o.innerHTML="Error loading favorite videos... please try again later."}};VideoList.prototype.LoadPlayListPosts=function(){if(this._RequestType!=SBR.TV.Communication.Objects.RequestType.PLAY_LIST){return}var b=$get(this._DivVideosId);b.innerHTML=EMPTY_STRING;var f=document.createElement(HTML_DIV_TAG);f.className="loading";var d=document.createElement(HTML_IMAGE_TAG);d.src="img/progress.gif";f.appendChild(d);b.appendChild(f);if(this._SelectedPlayListIdentity>0){if(this._PagingFlag){SBR.TV.Website.WebServices.WebServiceProxy.GetTotalPlayListPosts(this._SelectedPlayListIdentity,c,Error,this)}else{SBR.TV.Website.WebServices.WebServiceProxy.GetPlayListPosts(this._SelectedPlayListIdentity,this._DefaultPageNumber,this._ElementsByPage,this._OrderBy,this._PagingFlag,this._TopFlag,e,a,this)}}function c(h,g){g._TotalPosts=h;SBR.TV.Website.WebServices.WebServiceProxy.GetPlayListPosts(g._SelectedPlayListIdentity,g._DefaultPageNumber,g._ElementsByPage,g._OrderBy,g._PagingFlag,g._TopFlag,k,j,g);function k(m,l){l._PostsList=m;l.DisplayPosts(l._PostsList)}function j(m){var l=$get(this._DivVideosId);l.innerHTML="Error loading playlist videos... please try again later."}}function e(h,g){g._PostsList=h;g.DisplayPosts(g._PostsList)}function a(g){alert("Error loading playlist videos... please try again later. "+g._stackTrace)}};function delete_post(){var d=confirm("Are you sure you wish to delete this video?");if(d){var e=this.list;var c=this.post;c.Status=0;SBR.TV.Website.WebServices.jsLocalServices.DeletePost(c.PostId,c.User.UserId,b,a,e)}function b(g,f){f.init()}function a(f){alert("error deleting post ...\n"+f._stackTrace)}}function approve_post(){var c=confirm("Are you sure you wish to approve this video?");if(c){var d=this.list;var b=this.post;b.Status=1;SBR.TV.Website.WebServices.jsLocalServices.ApprovePost(b.PostId,e,a,d)}function e(g,f){f.init()}function a(f){alert("error approving post ...\n"+f._stackTrace)}return false}function edit_details(){var currentPost;if(this.objPost&&this.objEditInformationComponentName.length>0){currentPost=this.objPost;eval("var objEditInformation = "+this.objEditInformationComponentName);if(objEditInformation&&objEditInformation.LoadPost){objEditInformation.LoadPost(currentPost.PostId,this.divList,false)}}return false}function delete_post_Server(control){var agree=confirm("Are you sure you wish to delete this video?");if(agree){eval("var videoList = "+control.getAttribute("objList"));SBR.TV.Website.WebServices.jsLocalServices.DeletePost(control.getAttribute("postId"),control.getAttribute("userId"),delete_post_aux,error_function,videoList)}function delete_post_aux(pResult,pVideoList){pVideoList.init()}function error_function(pError){alert("error deleting post ...\n"+pError._stackTrace)}}function approve_post_Server(control){var agree=confirm("Are you sure you wish to approve this video?");if(agree){eval("var videoList = "+control.getAttribute("objList"));SBR.TV.Website.WebServices.jsLocalServices.ApprovePost(control.PostId,approve_post_aux,error_function,videoList)}function approve_post_aux(pResult,pVideoList){pVideoList.init()}function error_function(pError){alert("error approving post ...\n"+pError._stackTrace)}return false}function edit_details_Server(obj){var currentPost;divListJS=document.getElementById(obj.getAttribute("divList"));if(obj.getAttribute("postId")&&obj.getAttribute("objEditInformationComponentName").length>0){currentPost=obj.getAttribute("postId");eval("var objEditInformation = "+obj.getAttribute("objEditInformationComponentName"));if(objEditInformation&&objEditInformation.LoadPost&&divListJS){objEditInformation.LoadPost(currentPost,divListJS,false)}}return false}function Display_Dialog_Delete_Video(){if(this.objList&&this.objPost){var a=new Array(delete_video,this.objList,this.objPost);sbrAlertShow("Delete","Are you sure you wish to delete this video?",300,SBR.TV.Communication.Objects.AlertType.DELETE,a,null,this.objPost)}return false}function Display_Dialog_Delete_Video_Server(d,c){var b=new Object();b.PostId=c.getAttribute("postId");b.Thumbnail=c.getAttribute("Thumbnail");b.UserId=c.getAttribute("UserId");if(d&&b){var a=new Array(delete_video_Server,d,b);sbrAlertShow("Delete","Are you sure you wish to delete this video?",300,SBR.TV.Communication.Objects.AlertType.DELETE,a,null,b)}return false}function delete_video(b,a){if(b&&a){b.objPost=a;SBR.TV.Website.WebServices.jsLocalServices.DeletePost(a.PostId,a.User.UserId,delete_post_aux,error_function,b)}return false}function delete_video_Server(b,a){if(b&&a){b.objPost=a;SBR.TV.Website.WebServices.jsLocalServices.DeletePost(a.PostId,a.UserId,delete_post_aux,error_function,b)}return false}function delete_post_aux(pResult,pObjList){if(pObjList){eval("var objEditInformation = "+pObjList._EditInformationComponentName);if(objEditInformation&&objEditInformation.CloseInformationSinceOut&&pObjList.objPost){objEditInformation.CloseInformationSinceOut(pObjList.objPost)}if((pObjList._DefaultPageNumber==pObjList._TotalPages)&&((pObjList._TotalPostsByPage-1)==0)){pObjList._DefaultPageNumber=pObjList._DefaultPageNumber-1;if(pObjList._FirstIndexPage>1){pObjList._FirstIndexPage=pObjList._FirstIndexPage-1}pObjList._EndIndexPage=pObjList._DefaultPageNumber}else{var totalPages=Math.ceil((pObjList._TotalPosts-1)/pObjList._ElementsByPage);if(totalPages!=pObjList._TotalPages){pObjList._EndIndexPage=totalPages;if(pObjList._FirstIndexPage>1){pObjList._FirstIndexPage=pObjList._FirstIndexPage-1}}}pObjList.init()}return false}function error_function(a){alert("error deleting post ...\n"+a._stackTrace)}function Display_Dialog_Remove_Video(){if(this.objList&&this.objPost){var a=new Array(remove_video,this.objList,this.objPost);sbrAlertShow("Remove","Are you sure you wish to remove this video from the list?",300,SBR.TV.Communication.Objects.AlertType.DELETE,a,null,this.objPost)}return false}function remove_video(b,a){if(b&&a){b.objPost=a;alert("Delete it");if(this._RequestType==SBR.TV.Communication.Objects.RequestType.QUICK_LIST){}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.FAVORITE_POSTS){}else{if(this._RequestType==SBR.TV.Communication.Objects.RequestType.PLAY_LIST){}}}}}VideoList.prototype.CreateAttributeByVideo=function(b,d,a,c,f){if(!f._DisplayDescription){var e;e="<b>Title: </b>"+(c.Title==EMPTY_STRING?"No Title":c.Title);e+="<br> <b>Added: </b>"+c.CreatedDate.format("MMMM dd, yyyy");e+="<br> <b>Views: </b>"+c.Views;e+="<br> <b>Comments: </b>"+c.Comments;e+="<br> <b>Time: </b>"+(c.Files[0].Length?c.Files[0].Length:"");if(b!=undefined){b.onmouseover=DynamicTip;b.onmouseout=UnTip;b.parameters=6;b.p0='"'+e+'"';b.p1=BALLOON;b.p2=true;b.p3=ABOVE;b.p4=true;b.p5=OFFSETX;b.p6=-17}}if(f._DisplayDescription){b.className="video_brief";a.innerHTML="<li><b>Added:</b> "+c.CreatedDate.format("MMM dd,yyyy")+"</li>";if(f._DisplayUsername){if(!f._ModeRewrite){a.innerHTML+='<li><b>By:</b> <a href="users.aspx?us='+c.User.ForumUserId+"&ch="+c.User.UserName+'">'+c.User.UserName+" </a> </li>"}else{a.innerHTML+='<li><b>By:</b> <a href="channel-'+c.User.ForumUserId+"-"+c.User.UserName+'.html">'+c.User.UserName+"</a> </li>"}}a.innerHTML+="<li><b>Views:</b> "+c.Views+"</li>";a.innerHTML+="<li><b>Comments:</b> "+c.Comments+"</li>";a.innerHTML+="<li><b>Time:</b> "+(c.Files[0].Length?c.Files[0].Length:"")+"</li>";if(f._EditInformationComponentName&&f._EditInformationComponentName.length>0&&f._UserLogged&&f._UserLogged.length>0&&(c.User.UserId==f._UserLogged||f._IsAdministrator)){f.CreateClienteOption(b,c,f)}if((f._UserLogged&&f._UserLogged.length>0&&(f._RequestType==SBR.TV.Communication.Objects.RequestType.FAVORITE_POSTS||f._RequestType==SBR.TV.Communication.Objects.RequestType.QUICK_LIST||f._RequestType==SBR.TV.Communication.Objects.RequestType.PLAY_LIST))||(!f._UserLogged&&f._UserLogged.length==0)&&f._RequestType==SBR.TV.Communication.Objects.RequestType.QUICK_LIST){f.CreateClienteQuickList(b,c,f)}}else{b.style.margin=f._MarginHorizontalList+"px";b.className="video_thumbnail"}};function getTags(b){var a=EMPTY_STRING;if(b.length>0){var e=b;var d=EMPTY_STRING;var c=-1;if(e.length>=MAX_CHARACTER_TAGS){d=e.substring(0,MAX_CHARACTER_TAGS);c=d.lastIndexOf(CHARACTER_TO_FIND);if(c==-1){c=d.lastIndexOf(CHARACTER_TO_FIND1)}if(c==-1){c=d.lastIndexOf(CHARACTER_TO_FIND2)}if(c==-1){d=e}else{d=e.substring(0,c)+".."}}else{d=e}a=d}else{a=EMPTY_STRING}return a}VideoList.prototype.CreateCheckBoxButton=function(a,d){var b=document.createElement("input");var c=document.createElement("div");c.style.position="absolute";c.style.bottom="0px";c.style.right="0px";b.type="checkbox";b.name=d.POSTS_CHECK_BOX_NAME;c.appendChild(b);a.appendChild(c)};VideoList.prototype.AddToQuickList=function(){var b=0;if(typeof(_QuickList)=="undefined"||typeof(_QuickList.AddToQuickList)=="undefined"){return false}return _QuickList.AddToQuickList(this)};VideoList.prototype.CreateQuickListButton=function(b,c){var a=document.createElement(HTML_DIV_TAG);a.className="quickListRelativeCont";var d=document.createElement(HTML_DIV_TAG);d.className="quickListAddImg";d.onclick=this.AddToQuickList;d.PostId=c.PostId;d.title="Add to Quick List";a.appendChild(d);b.appendChild(a)};VideoList.prototype.CreateClienteQuickList=function(b,c,e){var d=document.createElement(HTML_DIV_TAG);d.className="ownerOptions";d.style.display="block";var a=document.createElement("a");a.href="#";a.title="Remove This Video";a.innerHTML="Remove This Video";a.onclick=Display_Dialog_Remove_Video;a.objList=e;a.objPost=c;d.appendChild(a);b.appendChild(d)};VideoList.prototype.CreateAdminDownloadOption=function(a,f,c){var h=document.createElement(HTML_DIV_TAG);h.className="downloadOptionLnk";var e=document.createElement(HTML_ANCHOR_TAG);e.innerHTML="Download";e.VideoList=c;e.href="#";if(this._OriginalVideo){var j;for(var d=0;d<f.Files.length;d++){if(f.Files[d].EncodeProfileId==1){j=f.Files[d].Location;var g=j.split("\\");var b=g.length;var k=g[b-1];e.iFrame=String.format(c.IFRAME_DOWNLOAD,c.DOWNLOAD_PAGE,String.format(c._UploadedUrl,k))}}}else{e.iFrame=String.format(c.IFRAME_DOWNLOAD,c.DOWNLOAD_PAGE,String.format(c._MainFLVUrl,f.PostId))}e.onclick=c.DownloadVideo;h.appendChild(e);a.appendChild(h)};VideoList.prototype.DownloadVideo=function(){if(confirm("Are you sure you want to download the file?")){var a=$get(this.VideoList._DivIFrameDownloadVideoId);a.innerHTML=this.iFrame}return false};VideoList.prototype.DownloadVideo_Server=function(control){if(confirm("Are you sure you want to download the file?")){eval("var videoList = "+control.getAttribute("VideoList"));var DivIFrameDownloadVideoCtl=$get(videoList._DivIFrameDownloadVideoId);DivIFrameDownloadVideoCtl.innerHTML=control.getAttribute("iFrame")}return false};VideoList.prototype.CreateClienteOption=function(a,b,d){var c=document.createElement(HTML_DIV_TAG);c.className="ownerOptions";c.style.display="block";edit_link=document.createElement("a");edit_link.href="#";edit_link.title="Edit This Video";edit_link.innerHTML="Edit This Video";edit_link.onclick=edit_details;edit_link.objPost=b;edit_link.objEditInformationComponentName=d._EditInformationComponentName;edit_link.divList=a;c.appendChild(edit_link);pipe=document.createElement("b");pipe.innerHTML="&nbsp;|&nbsp;";c.appendChild(pipe);delete_link=document.createElement("a");delete_link.href="#";delete_link.title="Delete This Video";delete_link.innerHTML="Delete This Video";delete_link.onclick=Display_Dialog_Delete_Video;delete_link.objList=d;delete_link.objPost=b;c.appendChild(delete_link);a.appendChild(c)};VideoList.prototype.CreateAdministrativeOption=function(b,a,c){delete_link=document.createElement("a");delete_link.href="#";delete_link.innerHTML="X";delete_link.onmousedown=delete_post;delete_link.onclick=False;delete_link.post=a;delete_link.list=c;delete_div=document.createElement("div");delete_div.className="edit_control";delete_div.appendChild(delete_link);approve_link=document.createElement("a");approve_link.href="#";approve_link.innerHTML="A";approve_link.onmousedown=approve_post;approve_link.onclick=False;approve_link.post=a;approve_link.list=c;approve_div=document.createElement("div");approve_div.className="edit_control";approve_div.appendChild(approve_link);edit_div=document.createElement("div");edit_div.className="edit_main_controls";edit_div.appendChild(delete_div);edit_div.appendChild(approve_div);b.appendChild(edit_div)};VideoList.prototype.CreateFullTitle=function(d,a){var k=document.createElement(HTML_DIV_TAG);k.className="detail";k.id=this._VideoListName+"_listTitleElement";if(k.name){k.name=this._VideoListName+"_listTitleElement"}else{var j=document.createAttribute("name");j.value=this._VideoListName+"_listTitleElement";k.attributes.setNamedItem(j)}var h=document.createElement(HTML_ANCHOR_TAG);var b=(d.Title==EMPTY_STRING?"No Title":d.Title);h.href=GetCurrentVideo(d,this);h.innerHTML="<b>"+b+"</b>";h.className="anchorTitle";var e=(d.Content==EMPTY_STRING?"No description":d.Content);if(e.length>MAX_LENGHT_LIST_VIEW){e=e.substring(0,MAX_LENGHT_LIST_VIEW)}var c=document.createElement(HTML_DIV_TAG);c.className="title";var g=document.createElement(HTML_DIV_TAG);g.className="content";var f=document.createElement(HTML_DIV_TAG);f.className="content";this.LoadAddInformation(d,g,f);c.appendChild(h);k.appendChild(c);k.appendChild(g);k.appendChild(f);if(this._Align=="vertical"&&this._DefaultView=="list"){k.style.display="block"}else{k.style.display="none"}a.appendChild(k);return false};VideoList.prototype.LoadAddInformation=function(m,b,o){var d;var f;var j;var c;if(b){if(m.Content!=undefined&&m.Content.length>0){var r=m.Content.match(/<\/?[a-z][a-z0-9]*[^<>]*>/g);var l=m.Content.replace(/<\/?[a-z][a-z0-9]*[^<>]*>/g,"");if(l.length>MAX_CHARACTER){var n=false;var h="";var a=0;if(r&&r.length>0){h=l.substring(0,MAX_CHARACTER);var e=0;try{for(var g=0;g<r.length;g++){var q=h.length;a=m.Content.indexOf(r[g],a);if(a>=q&&e==0){break}if(r[g].indexOf("/>")>-1&&a<q){h=String.format("{0}{1}{2}",h.substring(0,a),r[g],h.substring(a));a+=r[g].length;continue}if(r[g].indexOf("</")>-1&&e>0){if(a<q){h=String.format("{0}{1}{2}",h.substring(0,a),r[g],h.substring(a))}else{h+=r[g]}--e;a+=r[g].length;continue}h=String.format("{0}{1}{2}",h.substring(0,a),r[g],h.substring(a));a+=r[g].length;if(r[g].indexOf("</")==-1){++e}}}catch(k){n=true;h=String.format("{0}",l.substring(0,MAX_CHARACTER))}}else{h=String.format("{0}",m.Content.substring(0,MAX_CHARACTER))}b.innerHTML=h.replace(/^\s+|\s+$/g,"");c=document.createElement(HTML_ELEMENT_A);c.onclick=MoreInfoList;c.innerHTML="&nbsp;More&raquo;&raquo;";c.style.display="inline";c.className="button";c._DIV_INFORMATION=b;c._DIV_MORE_INFO=o;c._JSCALL=true;objHideInfo=document.createElement(HTML_ELEMENT_A);objHideInfo.onclick=HideInfoList;objHideInfo.innerHTML="&nbsp;&laquo;&laquo;Hide";objHideInfo.style.display="inline";objHideInfo.className="button";objHideInfo._DIV_INFORMATION=b;objHideInfo._DIV_MORE_INFO=o;objHideInfo._JSCALL=true;b.appendChild(c);o.innerHTML=n?l.replace(/^\s+|\s+$/g,""):m.Content.replace(/^\s+|\s+$/g,"");o.appendChild(objHideInfo);o.style.display="none"}else{b.innerHTML=m.Content}}}};VideoList.prototype.InsertString=function(d,c,b){var f="";var e="";var a;f=d.substring(0,b);e=d.substring(b);a=f+c+e;return a};VideoList.prototype.ContaintHtmlTags=function(a){var b=a.match(/<\s*\w.*?>[\s | \w ]*<\s*\/\s*\w*\s*.*?>/g);var c=b.length;if(c>=1){return true}else{return false}};function MoreInfoList(c){var b;var a;if(this._JSCALL){b=this._DIV_INFORMATION;a=this._DIV_MORE_INFO}else{b=$get(c.getAttribute("DIV_INFORMATION"));a=$get(c.getAttribute("DIV_MORE_INFO"))}if(b&&a){b.style.display="none";a.style.display="inline"}return false}function HideInfoList(c){var b;var a;if(this._JSCALL){b=this._DIV_INFORMATION;a=this._DIV_MORE_INFO}else{b=$get(c.getAttribute("DIV_INFORMATION"));a=$get(c.getAttribute("DIV_MORE_INFO"))}if(b&&a){b.style.display="inline";a.style.display="none"}return false}VideoList.prototype.CreateGridViewTitle=function(c,b,f){var e=document.createElement(HTML_ANCHOR_TAG);e.id=f._VideoListName+"_anchorTitle";if(e.name){e.name=f._VideoListName+"_anchorTitle"}else{var d=document.createAttribute("name");d.value=f._VideoListName+"_anchorTitle";e.attributes.setNamedItem(d)}var a=(b.Title==EMPTY_STRING?"No Title":b.Title);e.href=GetCurrentVideo(b,f);e.videoList=f;if(f._Align.toLowerCase()=="vertical"){e.innerHTML="<b>"+a+"</b>"}else{a=a.substring(0,MAX_CHARACTER_TITLE);e.innerHTML="<b>"+a+"</b>"}e.title=a;e.PostObj=b;c.appendChild(e);if(f._DefaultView=="grid"){e.style.display="block"}else{e.style.display="none"}};VideoList.prototype.DisplayPosts=function(c){var D=$get(this._LblLeftTitleId);D.innetText=this._ListTitle;var b=$get(this._DivVideosScroll);var m=$get(this._DivVideosId);m.className="videos_container";m.style.height="";if(this._Width>=0){m.style.width=this._Width+"px"}if(this._Height>=0){m.style.height=this._Height+"px"}if(this._Align.toLowerCase()=="vertical"){}else{if((!this._PagingFlag)){m.style.width=(c.length*(this._VideoWidth+(this._MarginHorizontalList*2)));m.style.overflowX="hidden";m.style.overflowY="hidden";b.style.overflowX="auto";b.style.overflowY="hidden"}}if(c){var w=c.length;this._TotalPostsByPage=w;if(w>0){var z=new RegExp("^(http[s]?://.*/)(.*)?$");var a=z.exec(document.URL);var B=a[1];var v;var q;var f;var u;var n;var h;var C;var r;var A;var y;var t=new RegExp(/(http:\/\/[^\.]*?)(\..*)(\..*)/i);if(!B.match(t)){B=B.replace(new RegExp(/(http:\/\/)(.*\..*)/i),"$1www.$2")}m.innerHTML=EMPTY_STRING;for(var k=0;k<w;k++){var x=c[k];if(x.Files.length>0){f=document.createElement(HTML_DIV_TAG);f.style.position="relative";f.id=this._VideoListName+"_videoBrief";if(f.name){f.name=this._VideoListName+"_videoBrief"}else{var l=document.createAttribute("name");l.value=this._VideoListName+"_videoBrief";f.attributes.setNamedItem(l)}f.style.width=this._VideoWidth+"px";u=document.createElement(HTML_ANCHOR_TAG);u.href=GetCurrentVideo(x,this);u.videoList=this;u.PostObj=x;n=document.createElement(HTML_IMAGE_TAG);h=d(x.PostId);B=B.replace(new RegExp(/\/$/),"");v=B.replace(new RegExp(/(http:\/\/[^\.]*?)(\..*)/i),"$1"+h+"$2");n.src=v+"/"+x.Thumbnail;u.appendChild(n);f.appendChild(u);if(this._ShowQuickListFunc&&this._RequestType!=SBR.TV.Communication.Objects.RequestType.QUICK_LIST){this.CreateQuickListButton(f,x)}var g=document.createElement(HTML_DIV_TAG);var j=document.createElement("UL");var e=document.createElement(HTML_DIV_TAG);e.className="rating";g.className=String.format("description {0}",this._VideoDescriptionFloat);g.id=this._VideoListName+"_videoDescription";this.CreateGridViewTitle(g,x,this);g.appendChild(j);g.appendChild(e);if(this._Align.toLowerCase()=="vertical"){CreateRatingStars(e,x.AverageRating,this._Max_Rating_Stars,this._Titles,true,null)}f.appendChild(g);if(g.name){g.name=this._VideoListName+"_videoDescription"}else{var l=document.createAttribute("name");l.value=this._VideoListName+"_videoDescription";g.attributes.setNamedItem(l)}this.CreateFullTitle(x,f);if(this._ShowAdministrationOptions&&this._IsAdministrator){this.CreateAdministrativeOption(g,x,this)}this.CreateAttributeByVideo(f,g,j,x,this);if(this._ShowCheckButton){this.CreateCheckBoxButton(f,this)}if(this._ShowDownloadVideoLnk&&this._IsAdministrator){this.CreateAdminDownloadOption(f,x,this)}m.appendChild(f)}}if(this._Align.toLowerCase()!="vertical"){var o;o=this._ElementsByPage-w;if(o>=1){for(countDiffe=1;countDiffe<=o;countDiffe++){var f=document.createElement(HTML_DIV_TAG);f.style.marginTop=this._MarginHorizontalList+"px";f.style.marginBottom=this._MarginHorizontalList+"px";f.style.marginLeft=(this._MarginHorizontalList*2)+"px";f.style.marginRight=(this._MarginHorizontalList*2)+"px";f.className="video_empty";m.appendChild(f)}}}if(this._PagingFlag&&!this._TopFlag){this.AddPageControls()}if(m.style.height==""){m.style.height=m.offsetHeight+"px"}}else{m.innerHTML=this._TextToShowEmptyList}}function d(F){var E="";var G=x.PostId;G=G%4;if(G>0){E+=G}return E}return false};VideoList.prototype.AddPageControls=function(){var j;if(this._TotalPosts>0){var a;var k;var f;a=document.createElement("div");if(this._Align.toLowerCase()=="vertical"){j=$get(this._DivVideosId);k=$get(this._DIV_CONTAINER_TOP_PAGES);k.style.display="block";k.innerHTML="";k.className="controls";a.className="controls"}else{j=$get(this._DivHorizontalArrows);if(j){j.innerHTML="";j.style.display="block";j.style.visibility="visible"}this._PagesNumberByBlock=1;a.className="horizontalPages"}function c(){var l;if(this.useButtom){switch(this.useButtom){case 1:if((this.obj._FirstIndexPage-this.obj._PagesNumberByBlock)>=1){this.obj._FirstIndexPage=this.obj._FirstIndexPage-this.obj._PagesNumberByBlock;this.obj._EndIndexPage=this.obj._EndIndexPage-this.obj._PagesNumberByBlock}else{this.obj._FirstIndexPage=1;if(this.obj._PagesNumberByBlock<this.totalPage){this.obj._EndIndexPage=parseInt(this.obj._PagesNumberByBlock)}else{this.obj._EndIndexPage=this.totalPage}}break;case 2:if((this.obj._EndIndexPage+this.obj._PagesNumberByBlock)<=this.totalPage){this.obj._FirstIndexPage=this.obj._FirstIndexPage+parseInt(this.obj._PagesNumberByBlock);this.obj._EndIndexPage=this.obj._EndIndexPage+parseInt(this.obj._PagesNumberByBlock)}else{this.obj._FirstIndexPage=(this.totalPage-this.obj._PagesNumberByBlock)+1;this.obj._EndIndexPage=this.totalPage}break}}l=parseInt(this.numberPage)-1;if(this.obj._DefaultPageNumber!=l+1){this.obj._DefaultPageNumber=l+1;this.obj.SetRequestType()}return false}var h;var g;var d;h=Math.ceil(this._TotalPosts/this._ElementsByPage);this._TotalPages=h;g=this._PagesNumberByBlock;if(this._EndIndexPage==-1){if(this._PagesNumberByBlock<h){this._EndIndexPage=this._PagesNumberByBlock;this._FirstIndexPage=this._DefaultPageNumber}else{this._EndIndexPage=h}}if(this._FirstIndexPage>1){f=document.createElement("a");if(this._Align.toLowerCase()=="vertical"){f.innerHTML="&nbsp;&nbsp;";f.className="previusPages"}else{f.innerHTML="&laquo; Previous";f.style.color=this._HorizontalPagesFontColor;backArrowIsShow=true}f.onclick=c;f.onmousedown=False;f.numberPage=this._FirstIndexPage-1;f.obj=this;f.useButtom=1;f.totalPage=h;a.appendChild(f);if(k){if(this._Align.toLowerCase()=="vertical"){var b=document.createElement("a");b.innerHTML="&nbsp;&nbsp;";b.className="previusPages";b.onclick=c;b.onmousedown=False;b.numberPage=this._FirstIndexPage-1;b.obj=this;b.useButtom=1;b.totalPage=h;k.appendChild(b)}}}if(this._Align.toLowerCase()=="vertical"){for(var e=this._FirstIndexPage;e<=this._EndIndexPage;e++){f=document.createElement("a");f.innerHTML=e;f.onclick=c;f.onmousedown=False;f.obj=this;f.numberPage=e;f.totalPage=h;if(this._DefaultPageNumber==e){f.className="selectedpage"}a.appendChild(f);if(k){var b=document.createElement("a");b.innerHTML=e;if(this._DefaultPageNumber==e){b.className="selectedpage"}b.onclick=c;b.onmousedown=False;b.obj=this;b.numberPage=e;b.totalPage=h;k.appendChild(b)}}}if(this._EndIndexPage<h){f=document.createElement("a");if(this._Align.toLowerCase()=="vertical"){f.innerHTML="&nbsp;&nbsp;";f.className="nextPages"}else{f.innerHTML="Next &raquo;";f.style.color=this._HorizontalPagesFontColor}f.onclick=c;f.onmousedown=False;f.numberPage=this._EndIndexPage+1;f.obj=this;f.useButtom=2;f.totalPage=h;a.appendChild(f);if(k){if(this._Align.toLowerCase()=="vertical"){var b=document.createElement("a");b.innerHTML="&nbsp;&nbsp;";b.className="nextPages";b.onclick=c;b.onmousedown=False;b.numberPage=this._EndIndexPage+1;b.obj=this;b.useButtom=2;b.totalPage=h;k.appendChild(b)}}}if(j){j.appendChild(a)}}};function show_page1(c,b){var a;if(b.getAttribute("ub")){switch(b.getAttribute("ub")){case"1":if((c._FirstIndexPage-c._PagesNumberByBlock)>=1){c._FirstIndexPage=c._FirstIndexPage-c._PagesNumberByBlock;c._EndIndexPage=c._EndIndexPage-c._PagesNumberByBlock}else{c._FirstIndexPage=1;if(c._PagesNumberByBlock<b.getAttribute("totalPage")){c._EndIndexPage=parseInt(c._PagesNumberByBlock)}else{c._EndIndexPage=b.getAttribute("totalPage")}}break;case"2":if((c._EndIndexPage+c._PagesNumberByBlock)<=b.getAttribute("totalPage")){c._FirstIndexPage=c._FirstIndexPage+parseInt(c._PagesNumberByBlock);c._EndIndexPage=c._EndIndexPage+parseInt(c._PagesNumberByBlock)}else{c._FirstIndexPage=(b.getAttribute("totalPage")-c._PagesNumberByBlock)+1;c._EndIndexPage=b.getAttribute("totalPage")}break}}a=parseInt(b.getAttribute("numberPage"))-1;if(c._DefaultPageNumber!=a+1){c._DefaultPageNumber=a+1;c.SetRequestType()}return false}VideoList.prototype.SetTotalPosts=function(a,d,c){this._TotalPosts=a;this._ElementsByPage=d;this._DefaultPageNumber=1;var b=$get(this._LblLeftTitleId);b.innerText=this._ListTitle+" ("+a.toString()+")";if(c){this._PageFunction=c}};function GetCurrentVideo(b,a){var d=this.PostObj?this.PostObj:b;var f=this.videoList?this.videoList:a;var c="";var e=new RegExp(/[^A-Za-z0-9]+/g);var g=d.Title.replace(e,"-");if(d&&d.PostId&&!a._ModeRewrite){if(g.length>0){c="WatchVideo.aspx?postId="+d.PostId+"&title="+g}else{c="WatchVideo.aspx?postId="+d.PostId}}else{if(d&&d.PostId&&a._ModeRewrite){if(g.length>0){c="video-"+d.PostId+"-"+g+".html"}else{c="video-"+d.PostId+"-NoTitle.html"}}}return c}SetCurrentPage=function(b,a){var c=this.videoList?this.videoList:a;c._DefaultPageNumber=(this.page?this.page:b);c._PageFunction(c._DefaultPageNumber,c._ElementsByPage)};function False(){return false}function colorChanged(a){a.get_element().style.color="#"+a.get_selectedColor()};