function UpdatePlayer(crypId){scroll(0,0);var updateDiv=document.getElementById('divPlayer');updateDiv.innerHTML='<table align=center border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><img src=/images/spacer.gif width=690 height=1 border=0></td></tr><td><img src=/images/spacer.gif width=1 height=368 border=0></td><td align=center valign=middle><img src=/images/misc/loading.gif></td></tr></table>';var url="/profile/loadMediaPlayer.aspx?cid="+crypId;AjaxCall(url,updatePlayerControl);return false;}var loadingPic;if(document.images){loadingPic=new Image(64,15);loadingPic.src='/images/misc/loading.gif';}function GenericGroupListRedirect(linkUrl,ddlId){var el=document.getElementById(ddlId);var sIndex=el.selectedIndex;var UniqueId=el.options[sIndex].value;if(linkUrl.indexOf('?')==-1){location.href=linkUrl+'?gid='+UniqueId;}else{location.href=linkUrl+'&gid='+UniqueId;}}function ShowLoadingGraphic(ImageId){var image=document.getElementById(ImageId);image.src=loadingPic.src;}function UpdatePlayerEditMode(crypId){alert('Video playback links are disabled in edit mode');}function updatePlayerControl(){if(req.readyState==4){updatePlayerVideoAndTitle('divPlayer','There was an error loading the requested video.<br><br>Please try again later.');}}function updateSpreadVideo(){var crypId=document.getElementById('spreadCid').value;var url="/media/UpdateSpreadVideo.aspx?cid="+crypId;AjaxCall(url,updateSpreadVideoDiv);return false;}function updateSpreadVideoDiv(){if(req.readyState==4){updateAjaxControl('stv','');}}function UpdateSSViewer(crypId){scroll(0,0);var updateDiv=document.getElementById('divSlideshowViewer');updateDiv.innerHTML='<table align=center border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><img src=/images/spacer.gif width=690 height=1 border=0></td></tr><td><img src=/images/spacer.gif width=1 height=450 border=0></td><td align=center valign=middle><img src=/images/misc/loading.gif></td></tr></table>';var url="/profile/loadSlideShowViewer.aspx?cid="+crypId;AjaxCall(url,updateSSViewerControl);return false;}function updateSSViewerControl(){if(req.readyState==4){updateAjaxControl('divSlideshowViewer','');}}function UpdateProfileVideos(crypId,loadingId,controlId,mediaType,formatType,listType,rows,pageId,visitorType,albumId,channelType){currProfileControlId=controlId;ShowLoadingGraphic(loadingId);var url="/profile/updateControl.aspx?c="+controlId+"&r="+rows+"&crypid="+crypId+"&uid="+profileUserId+"&p="+pageId+"&mt="+mediaType+"&ft="+formatType+"&lt="+listType+"&ff="+profileFamilyFilterOn+"&vt="+visitorType+"&aid="+albumId+"&channelType="+channelType;AjaxCall(url,updateProfileControl);}function UpdatePlaylistViewer(crypId){scroll(0,0);var updateDiv=document.getElementById('divMusicPlayer');updateDiv.innerHTML='<table align=center border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><img src=/images/spacer.gif width=690 height=1 border=0></td></tr><td><img src=/images/spacer.gif width=1 height=325 border=0></td><td align=center valign=middle><img src=/images/misc/loading.gif></td></tr></table>';var url="/profile/loadPlaylistViewer.aspx?cid="+crypId;AjaxCall(url,UpdatePlaylistViewerControl);return false;}function UpdatePlaylistViewerControl(){if(req.readyState==4){updateAjaxControl('divMusicPlayer','');}}function UpdateProfileAlbum(loadingId,controlId,mediaType,formatType,listType,rows,visitorType){var el=document.getElementById('ddlAlbum_'+controlId);var albumId=el.options[el.selectedIndex].value;currProfileControlId=controlId;ShowLoadingGraphic(loadingId);var url="/profile/updateControl.aspx?c="+controlId+"&r="+rows+"&uid="+profileUserId+"&p=1&mt="+mediaType+"&ft="+formatType+"&lt="+listType+"&ff="+profileFamilyFilterOn+"&vt="+visitorType+"&aid="+albumId;AjaxCall(url,updateProfileControl);}function UpdateProfileFriends(loadingId,controlId,formatType,listType,rows,pageId){currProfileControlId=controlId;ShowLoadingGraphic(loadingId);var url="/profile/updateControl.aspx?c="+controlId+"&r="+rows+"&uid="+profileUserId+"&p="+pageId+"&ft="+formatType+"&lt="+listType;AjaxCall(url,updateProfileControl);}function InsertProfileUserComment(controlId,rows,formatType,rucid){var commentText=document.getElementById('sProfileCommentText');var ctext2=ReplaceAll(commentText.value,' ','');if(ctext2.length<=0){alert('Please enter a text comment');}else{ShowDivById('divSavingComment');HideDivById('postComment');currProfileControlId=controlId;var qs="c="+controlId+"&r="+rows+"&ft="+formatType+"&uid="+profileUserId+"&rucid="+rucid+"&t="+escape(commentText.value.substr(0,2500));AjaxPostCall("/profile/addUserComment.aspx",qs,updateProfileComments);}}function CancelProfileComment(){var ctext=document.getElementById('sProfileCommentText');ctext.value='';var charsLeftEle=document.getElementById('commentCounter');charsLeftEle.innerHTML='<b>2500</b>';HideDivById('postComment');}function updateProfileComments(){if(req.readyState==4){updateAjaxControl('dcBody_'+currProfileControlId,'There was an error loading the profile comments.<br><br>Please try again later.');}}function InsertProfileReportUserComment(commentId,divId,divLoadingId,userId,commentedBy,bDelete){var strMsg='Are you sure that you want to report this comment as containing offensive material or spam?';if(bDelete==1)strMsg='Are you sure that you want to delete this comment?';if(confirm(strMsg)){currProfileControlId=divId;if(bDelete==0)currProfileSectionStr="<b>Comment Reported</b>";else currProfileSectionStr="<b>Comment Deleted</b>";ShowDivById(divLoadingId);var url="/profile/addUserReportComment.ashx";var qs="c="+commentId+"&d="+bDelete+"&uid="+userId+"&cby="+commentedBy;AjaxPostCall(url,qs,updateProfileSection);HideDivById(divLoadingId);}}function InsertProfileBlockUser(userId,divId,divLoadingId){if(confirm('Are you sure that you want to block this user from viewing your channel, sending you messages, and commenting on your videos?\n\nNOTE: If you click OK, it will take up to 30 minutes for your block request to take effect.')){currProfileControlId=divId;currProfileSectionStr="<b>User Blocked</b>";ShowDivById(divLoadingId);var url="/profile/blockUser.ashx";var qs="uid="+userId;AjaxPostCall(url,qs,updateProfileSection);HideDivById(divLoadingId);}}function DeleteProfileBlockUser(userId,divId,divLoadingId){if(confirm('Are you sure that you want to unblock this user and allow them to once again view your channel, send you messages, and comment on your videos?\n\nNOTE: If you click OK, it will take up to 30 minutes for your unblock request to take effect.')){currProfileControlId=divId;currProfileSectionStr="<b>User Unblocked</b>";ShowDivById(divLoadingId);var url="/profile/deleteBlockUser.ashx";var qs="uid="+userId;AjaxPostCall(url,qs,updateProfileSection);HideDivById(divLoadingId);}}function showdetail(){var fullprofile=document.getElementById("fullprofile");var lnkshowdetail=document.getElementById("lnkshowdetail");if(fullprofile.style.display=='block'){fullprofile.style.display='none';lnkshowdetail.innerHTML='Show Detail';}else{fullprofile.style.display='block';lnkshowdetail.innerHTML='Hide Detail';}}function RemoveProfileVideo(divId,cid,extId,chId){if(confirm('Are you sure that you want to remove this video from your channel?')){currProfileControlId=divId;currProfileSectionStr="<b>Video Removed</b>";var rDiv=document.getElementById(divId);rDiv.innerHTML='<b>Processing...</b>';var url="/profile/removeVideo.ashx";var qs="cid="+cid+"&ext="+extId+"&chid="+chId;AjaxPostCall(url,qs,updateProfileSection);}}function UpdateProfileForumTopics(loadingId,controlId,rows,pageId){ShowLoadingGraphic(loadingId);currProfileControlId=controlId;var url="/profile/updateControl.aspx?c="+controlId+"&uid="+profileUserId+"&r="+rows+"&p="+pageId;AjaxCall(url,updateForumDiv);}function updateForumDiv(){if(req.readyState==4){var divId='dcBody_'+currProfileControlId;updateAjaxControl(divId,'Error loading forum topics.<br>Please try again later.');}}function UpdateLPPlayer(crypId){scroll(0,0);var updateDiv=document.getElementById('divLP_Player');updateDiv.innerHTML='<table align=center border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><img src=/images/spacer.gif width=445 height=1 border=0></td></tr><td><img src=/images/spacer.gif width=1 height=390 border=0></td><td align=center valign=middle><img src=/images/misc/loading.gif></td></tr></table>';var url="/landing/loadPlayerControl.ashx?cid="+crypId;AjaxCall(url,updateLPPlayerControl);document.getElementById('tellFriendsCid').value=crypId;return false;}function updateLPPlayerControl(){if(req.readyState==4){updatePlayerVideoAndTitle('divLP_Player','There was an error loading the requested video.<br><br>Please try again later.');updateTellFriends();}}function updateTellFriends(){var crypId=document.getElementById('tellFriendsCid').value;var url="/media/UpdateTellFriends.aspx?cid="+crypId;AjaxCall(url,updateTellFriendsDiv);return false;}function updateTellFriendsDiv(){if(req.readyState==4){updateAjaxControl('divTellFriends','');}}function updateFriendSuggestion(igore,pageId){var el=document.getElementById('ddlFriendSuggestionId');var sIndex=el.selectedIndex;var friendGroupId=el.options[sIndex].value;var url="/media/UpdateFriendSuggestion.aspx?grp="+friendGroupId+"&p="+pageId;AddNewSelection();AjaxCall(url,updateFriendListDiv);return false;}function updateFriendListDiv(){if(req.readyState==4){updateAjaxControl('divFriendListSuggestion','');UpdateSelection();}}function updatePlayerVideoAndTitle(divId,errorMsg){var success=false;var updateDiv=document.getElementById(divId);if(req.status==200){var rtext=req.responseText;if(rtext!=""){success=true;var tIndex=rtext.indexOf('!!!!');document.title=rtext.substr(0,tIndex);updateDiv.innerHTML=rtext.substring(tIndex+4,rtext.length);}}if(!success)updateDiv.innerHTML=errorMsg;}function UpdateMySubsVideos(loadingId,pi,ps){ShowLoadingGraphic(loadingId);var url="/user/updateSubscriptionMedia.aspx";var qs="pi="+pi+"&ps="+ps;AjaxPostCall(url,qs,UpdateMySubsVideosCallBack);return false;}function UpdateMySubsVideosCallBack(){if(req.readyState==4){updateAjaxControl('divMySubVid','');}}function CheckInvitation(){if(document.getElementById('idTextEmail').value.length>5){if(document.getElementById('txtFriend1').value.length>5){ShowDivById('divTellFriendsLoading');currProfileControlId='divAjaxResponse';currProfileSectionStr="<br /><b>Email sent out successfully</b><br />";var addresses="";var url="sn="+escape(document.getElementById('idTextName').value);url+="&se="+escape(document.getElementById('idTextEmail').value);if(document.getElementById('idTxtAreaFriends').value.length==0){addresses=GetFriendsFromList();}else{addresses=document.getElementById('idTxtAreaFriends').value;}url+="&re="+escape(addresses);url+="&msg="+escape(document.getElementById('idtxtMessage').value);if(document.getElementById('idChkCopy').checked==true){url+="&cpy=1";}else{url+="&cpy=0";}ClearAllTellFriends();document.getElementById('divIdTellFriendsListings').style.display='none';AjaxPostCall("/ajax/shared/recruitOutside.ashx",url,updateAjaxResponse);HideDivById('divTellFriendsLoading');}else{alert("Please enter a valid email address for Friend 1");}}else{alert("Please enter your valid email address");}}function Profile_SpreadSlideshow(){var cid=document.getElementById('curcryp').value;Profile_SpreadSlideshowWithCid(cid);}function Profile_SpreadSlideshowWithCid(cid){ShowDivById('divTellFriendsLoading');currProfileControlId='divAjaxResponse';var url=Profile_GetTellFriendsInfo();ClearAllTellFriends();document.getElementById('divIdTellFriendsListings').style.display='none';url+="&cid="+cid;AjaxPostCall("/slideshow/tellfriends.ashx",url,updateAjaxResponse);HideDivById('divTellFriendsLoading');}function Profile_SendEntityInvitationToFriends(divLoading,divReplace,url,moreQs){ShowDivById(divLoading);currProfileControlId=divReplace;var qs=Profile_GetTellFriendsInfo();if(moreQs.length>0){if(qs.length>0){qs+="&"+moreQs;}else{qs+="?"+moreQs;}}AjaxPostCall(url,qs,updateCurrProfileResponse);HideDivById(divLoading);}function updateCurrProfileResponse(){if(req.readyState==4){ShowDivById(currProfileControlId);updateAjaxControl(currProfileControlId,'');}}function Profile_GetTellFriendsInfo(){var url="";if(document.getElementById('idTextEmail').value.length>5){if(document.getElementById('txtFriend1').value.length>5){currProfileSectionStr="<br /><b>Email sent out successfully</b><br />";var addresses="";url="sn="+escape(document.getElementById('idTextName').value);url+="&se="+escape(document.getElementById('idTextEmail').value);if(document.getElementById('idTxtAreaFriends').value.length==0){addresses=GetFriendsFromList();}else{addresses=document.getElementById('idTxtAreaFriends').value;}url+="&re="+escape(addresses);url+="&msg="+escape(document.getElementById('idtxtMessage').value);if(document.getElementById('idChkCopy').checked==true){url+="&cpy=1";}else{url+="&cpy=0";}}else{alert("Please enter a valid email address for Friend 1");url="";}}else{alert("Please enter your valid email address");url="";}return url;}function ProfileEmailToFriends(cid,sEmailId,sNameId,msgId,rEmailId,sCopyId){if(document.getElementById(sEmailId).value.length>5){if(document.getElementById(rEmailId).value.length>5){ShowDivById('divSendingEmail');var crypId=document.getElementById('spreadCid').value;if(crypId.length<=0)crypId=cid;var url="sn="+escape(document.getElementById(sNameId).value);url+="&se="+escape(document.getElementById(sEmailId).value);url+="&re="+escape(document.getElementById(rEmailId).value);url+="&msg="+escape(document.getElementById(msgId).value);url+="&cid="+crypId;url+="&nurl=&ntitle=";if(document.getElementById(sCopyId).checked==true){url+="&cpy=1";}else{url+="&cpy=0";}AjaxPostCall("/media/tellFriends.ashx",url,updateAjaxResponse);HideDivById('divEmailToFriends');HideDivById('divSendingEmail');}else{alert("Please enter at least one valid recipient email address");}}else{alert("Please enter your valid email address");}}function People_SearchCountry(countryCode){var url="/people/default.aspx?c="+countryCode;window.location=url;}function SaveCustomCode(loadingDiv,replaceDiv,qs){var title=document.getElementById('txtCustomTitle');var code=document.getElementById('txtCustomCode');qs+="&title="+escape(title.value.substr(0,100))+"&code="+escape(code.value.substr(0,6000));GenericAjaxLink(loadingDiv,replaceDiv,'/profile/admin/updateCustomCode.aspx',qs,'','Are you sure that you want to save the custom code or widget code that you have entered?',0)}function SendReportContent(replaceDivId,qs,bCommentRequired){var bPost=true;var comment='';if(bCommentRequired=='1'){comment=document.getElementById('txtReportInfo').value;if(comment.length>0)qs+='&t='+escape(comment.substr(0,1000));else{alert('Please enter a comment describing why you think that this content is inappropriate');bPost=false;}}if(bPost==true)GenericAjaxLink('divSendReportLoading',replaceDivId,'/ajax/shared/addReportContent.ashx',qs,'Error reporting this content.<br>Please try again later.','Are you sure that you want to report that this content is inappropriate?',0);}