var bMenuShowing = new Array(); var MenuToClose = new Array(); var bSubMenuShowing = new Array(); var sMenuClicked = null; var oActiveMenu = null; var sActiveMenuKey = ''; var iScroll = 0; var bFollowedLoad = false; var bFollowedTopics = false; var bMenuDialogVisible = false; // set to true to force the menu to stay open while true function ExpandMenu(menuKey, bDynamicPosition, bAbove, bInClipmark, bNested, sNestedKey) { var oButton = document.getElementById('aButton_' + menuKey); var oMenu = document.getElementById('dvMenu_' + menuKey); var lShorten = 0; if (!!oMenu && !!GetAttribute(oMenu, 'shorten', '0')) { lShorten = parseInt(GetAttribute(oMenu, 'shorten', '0')); } sMenuClicked = menuKey; if (bNested) { oMenu = document.getElementById(sNestedKey); KeepMenuOpen(menuKey); } else { if (!!oActiveMenu) { if (oActiveMenu == oMenu) { CollapseMenu(sActiveMenuKey); return; } CollapseMenu(sActiveMenuKey); } HideScrollbars(); } if (oMenu) { //oMenu.style.height = ''; oMenu.style.display = 'block'; if (bDynamicPosition && oButton) { oMenu.style.left = oButton.offsetLeft + 'px'; if (bAbove) { if (bInClipmark && dvClipmark && !document.all) { iScroll = dvClipmark.scrollTop; } else if (document.all) { // set slight offset for IE iScroll = -7; } oMenu.style.top = (oButton.offsetTop - oMenu.offsetHeight - iScroll) + 'px'; } else { oMenu.style.top = (oButton.offsetTop + oButton.offsetHeight) + 'px'; } } if (bAbove && bInClipmark) { if (is_ie) { oMenu.style.marginTop = ((oMenu.offsetHeight * -1)) + 'px'; oMenu.style.marginLeft = '-92px'; } else { oMenu.style.marginTop = ((oMenu.offsetHeight * -1) - 20) + 'px'; } } if ((menuKey == 'SortMy' || menuKey == 'SortMine') && lShorten == 0) { lShorten = 50; } //alert(lShorten); if (GetAttribute(oMenu, 'fixed', 'none') != 'height' && ((oMenu.offsetTop + oMenu.offsetHeight + lShorten) > document.body.clientHeight || (menuKey == 'RightColl' || menuKey == 'RightClippers' || menuKey == 'CVMyClippersEX' || menuKey == 'MyFavoritesEX'))) { if (menuKey == 'RightTags' || menuKey == 'RightColl' || menuKey == 'RightClippers') { var sK = 'dvItems_' + menuKey; if (!!document.getElementById(sK)) { document.getElementById(sK).style.overflow = 'auto'; document.getElementById(sK).style.height = (document.body.clientHeight - (oMenu.offsetTop + 116)) + 'px'; } else { oMenu.style.overflow = 'auto'; } oMenu.style.height = (document.body.clientHeight - (oMenu.offsetTop + 84 + lShorten)) + 'px'; } else { oMenu.style.overflow = 'auto'; oMenu.style.height = (document.body.clientHeight - (oMenu.offsetTop + 80 + lShorten)) + 'px'; } } } /*if (is_mac && (sMenukey == '' || sMenuKey == '')) { }*/ bMenuShowing[menuKey] = true; sActiveMenuKey = menuKey; oActiveMenu = oMenu; } function CollapseMenu(sMenuKey, bNested, sNestedId) { var oMenu = document.getElementById('dvMenu_' + sMenuKey); bMenuShowing[sMenuKey] = false; oActiveMenu = null; if (oMenu) { oMenu.style.display = 'none'; } if (bNested && !!document.getElementById(sNestedId)) { if (sNestedId == 'dvMenu_MyClippers') { HideSubMenu('MyClippers'); HideSubMenu('CVMyClippersEX'); } else if (sNestedId == 'dvMenu_MyTags') { HideSubMenu('MyTags'); HideSubMenu('CVMyTags'); } } ShowScrollbars(); if (MenuToClose[sMenuKey]) { clearTimeout(MenuToClose[sMenuKey]); MenuToClose[sMenuKey] = null; } if (bInClipcast) { MacMenu(sMenuKey); } } function KeepMenuOpen(menuKey) { clearTimeout(MenuToClose[menuKey]); MenuToClose[menuKey] = null; } function CollapseMenuTimeout(menuKey, bNested, sNestedId) { if (menuKey == 'AddToCollection') { return; } if (bMenuDialogVisible) { if (bNested) { setTimeout('CollapseMenuTimeout(\'' + menuKey + '\', true, \'' + sNestedId + '\')', 500); } else { setTimeout('CollapseMenuTimeout(\'' + menuKey + '\')', 500); } } else if (!MenuToClose[menuKey]) { if (bNested) { MenuToClose[menuKey] = setTimeout('CollapseMenu(\'' + menuKey + '\', true, \'' + sNestedId + '\')', 750); } else { MenuToClose[menuKey] = setTimeout('CollapseMenu(\'' + menuKey + '\')', 750); } } } function HideOpenMenus(bForce) { if (sMenuClicked) { var oClicked = document.getElementById('dvMenu_' + sMenuClicked); if (oActiveMenu == oClicked && !bForce) { return; } } if (oActiveMenu) { if (oActiveMenu.style.display == 'block') { CollapseMenu(sActiveMenuKey); } } return; } // for header mouseovers var oHdMenuOpen = null; var bHdActive = false; function StartHdMenu(sMenuKey) { bHdActive = true; oHdMenuOpen = setTimeout('StartHdMenuGo(\'' + sMenuKey + '\')', 800); } function StartHdMenuGo(sMenuKey) { if (bMenuShowing[sActiveMenuKey]) { CollapseMenu(sActiveMenuKey); } if (bHdActive) { ExpandMenu(sMenuKey, true, false, false); sMenuClicked = sMenuKey; } } function HideHdMenu(sMenuKey) { bHdActive = false; if (sMenuKey == 'SortMy') { CollapseMenuTimeout('SortMy', true, 'dvMenu_MyClippers'); if (!!document.getElementById('spn_MyClippers')) { document.getElementById('spn_MyClippers').innerHTML = 'view my clippers'; } bSubMenuShowing['MyClippers'] = false; } else if (sMenuKey == 'SortMine') { CollapseMenuTimeout('SortMine', true, 'dvMenu_MyTags'); if (!!document.getElementById('spn_MyTags')) { document.getElementById('spn_MyTags').innerHTML = 'view my topics'; } bSubMenuShowing['MyTags'] = false; } else { CollapseMenuTimeout(sMenuKey); } } function ClickHdMenu(sMenuKey) { clearTimeout(oHdMenuOpen); oHdMenuOpen = null; if (bMenuShowing[sMenuKey]) { CollapseMenu(sMenuKey); } else { ExpandMenu(sMenuKey, true, false, false); if (bInClipcast) { MacMenu(sMenuKey); } } } function OpenSubMenu(sSubKey, sParent) { var sNoun = 'clippers'; if (!sParent) { sParent = (sSubKey == 'CVMyClippersEX' ? 'CVMyClippers' : 'SortMy'); } if (sSubKey == 'MyTags' || sSubKey == 'CVMyTags') { sNoun = 'topics'; sParent = (sSubKey == 'CVMyTags' ? 'ChooseTopic' : 'SortMine'); } if (bSubMenuShowing[sSubKey]) { document.getElementById('dvMenu_' + sSubKey).style.display = 'none'; if (!!document.getElementById('spn_' + sSubKey)) { document.getElementById('spn_' + sSubKey).innerHTML = 'view my ' + sNoun; } bSubMenuShowing[sSubKey] = false; } else { ExpandMenu(sParent, true, false, false, true, 'dvMenu_' + sSubKey); if (!!document.getElementById('spn_' + sSubKey)) { document.getElementById('spn_' + sSubKey).innerHTML = 'hide my ' + sNoun; } bSubMenuShowing[sSubKey] = true; } } function HideSubMenu(sSubKey) { var sNoun = 'clippers'; if (sSubKey == 'MyTags' || sSubKey == 'CVMyTags') { sNoun = 'topics'; } if (!!document.getElementById('dvMenu_' + sSubKey)) { document.getElementById('dvMenu_' + sSubKey).style.display = 'none'; if (!!document.getElementById('spn_' + sSubKey)) { document.getElementById('spn_' + sSubKey).innerHTML = 'view my ' + sNoun; } bSubMenuShowing[sSubKey] = false; } } // handles all ajax post requests var Action_XMLHTTP = false; var bBlockWindowOpen = false; function action_post(sMethod, sURL, sPostData, bBlocking, fCallback) { if (!Action_XMLHTTP) { Action_XMLHTTP = CreateXMLHTTP(); } Action_XMLHTTP.open(sMethod, sURL, !bBlocking); if (!!fCallback) { Action_XMLHTTP.onreadystatechange = fCallback; } Action_XMLHTTP.send(sPostData); return Action_XMLHTTP; } // POPPING function ClipPop_XMLStateChange() { if (Action_XMLHTTP.readyState != 4) { return; } if (GetAttribute(Action_XMLHTTP.responseXML.documentElement, 'error', '0') != '0') { ShowDialog('

Hold your pops

To try to maintain balance on the Clipmarks site, there are some limits on the number of clips each user can pop within certain time periods.

You will be able to pop again in ' + GetAttribute(Action_XMLHTTP.responseXML.documentElement, 'timeout-minutes', '20') + ' minutes.
', 0, 0, false, null, 300, 190); } else if (GetAttribute(Action_XMLHTTP.responseXML.documentElement, 'pop-count-1', '0') == '7') { ShowDialog('

Hold your pops

To try to maintain balance on the Clipmarks site, there are some limits on the number of clips each user can pop within certain time periods.

You will exceed this limit if you pop again to soon.
', 0, 0, false, null, 300, 190); } else if (GetAttribute(Action_XMLHTTP.responseXML.documentElement, 'pop-count-2', '0') == '15') { ShowDialog('

Hold your pops

To try to maintain balance on the Clipmarks site, there are some limits on the number of clips each user can pop within certain time periods.

You will exceed this limit if you pop again to soon.
', 0, 0, false, null, 300, 190); } else if (GetAttribute(Action_XMLHTTP.responseXML.documentElement, 'pop-count-3', '0') == '4') { ShowDialog('

Hold your pops

To try to maintain balance on the Clipmarks site, there are some limits on the number of clips each user can pop within certain time periods.

You will exceed this limit if you pop again to soon.
', 0, 0, false, null, 300, 190); } else { // pop went through.... if (setting_get('user_hide_postwpop', '0') != '1') { dialog_popped_open(sActiveClipGUID, true, true); } } } function PostClipPop() { if (!bClipPopped) { action_post('GET', '/xml_action.aspx?action=vote_clip&c=' + sActiveClipGUID, null, false, ClipPop_XMLStateChange); iTotalPops++; document.getElementById('spnTotalPops').innerHTML = iTotalPops; document.getElementById('imgPopIcon').src = '/images/tools3/popped.png'; document.getElementById('imgPopIcon').title = 'your pop has been recorded'; if (!!document.getElementById('imgPopIcon2')) { document.getElementById('imgPopIcon2').src = '/images/right/bottom-popped.jpg'; document.getElementById('imgPopIcon2').title = 'your pop has been recorded'; } bClipPopped = true; } } function PostLiveResults() { var sDesc = ''; var sHTML = '
\ \ \ \ \ \
Live Results are now '; if (bLiveResults) { sHTML += 'ON'; sDesc = '
New results will now come in without having to refresh your browser.
'; } else { sHTML += 'OFF'; sDesc = '
New results will not come in until you refresh your browser.
'; } sHTML += '
' + sDesc; if (bAuth) { sHTML += '
This setting will be remembered each time you visit the site when logged in.
'; sHTML += '\ \ \ \ \ \
Close
'; } else { sHTML += '
Close
'; } sHTML += '
'; ShowDialog(sHTML, 0, -100, true, null, 396, 150); } function ChangeCloseLabel() {} function ChangeCloseLabel2() { if (document.getElementById('chkPostLive').checked) { document.getElementById('lnkPostLiveButton').innerHTML = 'Save'; } else { document.getElementById('lnkPostLiveButton').innerHTML = 'Close'; } } function HidePostPop() { if (document.getElementById('chkPostWPop').checked) { setting_set('user_hide_postwpop', '1'); } else { setting_set('user_hide_postwpop', '0'); } CloseLayeredDialog(); } function HideLiveResults() { if (document.getElementById('chkPostLive').checked) { setting_set('user_hide_postlive', '1'); } else { setting_set('user_hide_postlive', '0'); } HideDialogBox(); } function PostFollowUser(sUser, bFromDhtml, sIsFollowed, iOptTotalFollowers, sOptUserGuid, bFromClipcast) { if (!bAuth) { //FollowUserNoLogin(); LoginPrompt('follow'); return; } var bThisFollowed = bIsFollowed; if (bFromDhtml) { if (sIsFollowed == '1') { bThisFollowed = true; } else { bThisFollowed = false; } } if (!bThisFollowed) { if (!Action_XMLHTTP) { Action_XMLHTTP = CreateXMLHTTP(); } action_post('GET', '/xml_action.aspx?action=follow_user&u=' + escape(sUser), null, false); if (document.getElementById('dvMenu_MyClippers')) { document.getElementById('dvMenu_MyClippers').setAttribute('loaded', 'false'); document.getElementById('dvMenu_MyClippers').innerHTML = ''; } var objTotal = document.getElementById('spnTotalFollowers'); if (sIsFollowed == '2') { iTotalFollowers = iOptTotalFollowers; objTotal = document.getElementById('spnTotalFollowers_' + sOptUserGuid); } iTotalFollowers++; if (objTotal) { objTotal.innerHTML = '' + iTotalFollowers + ''; if (!bFromClipcast) { objTotal.innerHTML += ' follower'; if (iTotalFollowers > 1) { objTotal.innerHTML += 's'; } } } if (sIsFollowed == '2') { document.getElementById('imgFollow_' + sOptUserGuid).src='/images/in-clippers-big.gif'; } if (!!document.getElementById('imgFollowCard')) { document.getElementById('imgFollowCard').src='/images/clipper/in-clippers-right.gif'; } if (!!document.getElementById('aFollowLnk')) { document.getElementById('aFollowLnk').innerHTML='following';document.getElementById('aFollowLnk').style.textDecoration='none'; } if (!!sSearchUser) { if (sSearchUser == sUser) { if (!!document.getElementById('imgFollowClipcast')) { document.getElementById('imgFollowClipcast').src='/images/clipper/in-clippers-right.gif'; } if (!!document.getElementById('imgFollowLeft')) { document.getElementById('imgFollowLeft').src='/images/clipper/in-clippers-right.gif'; } if (!!document.getElementById('imgFollowRight')) { document.getElementById('imgFollowRight').src='/images/clipper/in-clippers-right.gif'; } if (!!document.getElementById('imgFollowList')) { document.getElementById('imgFollowList').src='/images/clipper/following_small.png'; } if (!!document.getElementById('tdBlockUser')) { document.getElementById('tdBlockUser').innerHTML = 'unfollow'; } } } if (!bFromDhtml) { bIsFollowed = true; } iTotalClp++; var sClp = 'Guides'; if (iTotalClp == 1) { sClp = 'Guide'; } var sMessage = '
You have ' + iTotalClp + ' ' + sClp + '
'; setTimeout('OpenClippers(\'' + sUser + '\', 1, 50, \'' + sMessage + '\')', 400); } else { ShowDialog('
You are already following ' + sUser + '.
To unfollow this user, go to their page.
'); } } function RemoveUser(sUser) { if (confirm('Are you sure you want to remove ' + sUser + ' from your Guides?')) { action_post('GET', '/xml_action.aspx?action=remove_users&user=' + escape(sUser), null, false); if (document.getElementById('dvMenu_MyClippers')) { document.getElementById('dvMenu_MyClippers').setAttribute('loaded', 'false'); document.getElementById('dvMenu_MyClippers').innerHTML = ''; } var objTotal = document.getElementById('spnTotalFollowers'); iTotalFollowers--; iTotalClp--; if (objTotal) { objTotal.innerHTML = '' + iTotalFollowers + ' follower'; if (iTotalFollowers > 1) { objTotal.innerHTML += 's'; } } if (!!document.getElementById('imgFollowLeft')) { document.getElementById('imgFollowLeft').src='/images/clipper/add-clipper-right.gif'; } if (!!document.getElementById('imgFollowRight')) { document.getElementById('imgFollowRight').src='/images/clipper/add-clipper-right.gif'; } if (!!document.getElementById('imgFollowList')) { document.getElementById('imgFollowList').src='/images/clipper/follow_small.png'; } document.getElementById('tdBlockUser').innerHTML = ''; bIsFollowed = false; ShowDialog('

' + sUser + ' has been removed from
your Guides.

', 0, -100, false, null, 300, 160); } } function OpenBlockUser(sUser, sGuid) { bBlockWindowOpen = true; CollapseMenu('ClipperCard'); excluded_open(); sHTML = '
' + get_excluded_window(sUser, sGuid) + '
'; ShowLayeredDialog(sHTML); } function get_excluded_window(sUser, sGuid) { var sHTML = ''; var iExclude = exclude_get(sGuid); var sClipChecked = ''; var sCommentChecked = ''; var sCommentingChecked = ''; if ((iExclude & 1) == 1) { sClipChecked = 'checked'; } if ((iExclude & 2) == 2) { sCommentChecked = 'checked'; } if ((iExclude & 4) == 4) { sCommentingChecked = 'checked'; } sHTML += '

User Management

'; sHTML += '
'; sHTML += 'We are passionate about maintaining a positive, civil environment at Clipmarks. While the great majority of Clipmarks users treat each other with respect, there may be rare cases where you feel the need to protect yourself from malicious actions or personal attacks.

Here are a few tools you can use if you feel necessary in order to maintain a positive Clipmarks experience.'; sHTML += '
'; if (bAuth) { sHTML += '
'; //sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
This option is intended for use in cases where you recognize a pattern of malicious behavior that makes it impossible for you to enjoy your Clipmarks experience. It is not intended to prevent opposing views or as a way to personally punish someone you don\'t agree with.
'; } else { var sUrl = ExchangeUrl(); if (sUrl && sUrl != '') { sUrl = '?url=' + encodeURI(sUrl); } else { sUrl = ''; } sHTML += '


'; sHTML += '

You must log in to moderate
your interaction with this user.


'; sHTML += '
Login  or  Sign Up
'; sHTML += '
'; } sHTML += '
'; if (bAuth) { sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
savecancel
'; } else { sHTML += '
Close
'; } return sHTML; } function process_excluded(sGuid) { var iExclude = 0; iExclude = (document.getElementById('chkBlockComments').checked ? 2 : 0) + (document.getElementById('chkBlockCommenting').checked ? 4 : 0); exclude_set(sGuid, iExclude); if (iExclude != 4) { window.location.reload(true); } } function PostDeleteClipmark(bPermanent) { action_post('GET', '/xml_action.aspx?action=' + (bPermanent ? 'delete_clip' : 'remove_library_clip') + '&c=' + sActiveClipGUID, null, true); if (!!Action_XMLHTTP.responseXML && bPermanent) { if (Action_XMLHTTP.responseXML.documentElement.getAttribute('error') == '1') { alert('This clip could not be deleted because it has already had action on it in the public. To remove this clip from your own collection, please choose the "Remove from My Clips" option in the Edit menu below the clip.\n\nIf you need help, please email support@clipmarks.com'); return false; } } window.location.href = window.location.href; } function action_clip_moderate() { if (confirm('Are you sure you want to make this clip Public Limited? Doing so will keep it public on the user\'s page and in their clipcast but will remove it from all public areas of clipmarks.com. Clipmarks support will be notified about this clip and may take further action on it and/or the user who posted it.')) { action_post('GET', '/xml_action.aspx?action=clip_moderate&c=' + sActiveClipGUID, null, true); alert('This clip has been set to Public Limited. Thank you for helping to moderate the environment on Clipmarks.'); /*if (confirm('Would you like to reload the page?')) { window.location.href = window.location.href; }*/ } } function PostSubComments() { if (!!document.getElementById('chkSubComments')) { bSubComments = document.getElementById('chkSubComments').checked; action_post('GET', '/xml_action.aspx?action=sub_com&sub=' + bSubComments + '&c=' + sActiveClipGUID, null, false); if (bSubComments) { ShowDialog('
You have subscribed to receive email notifications each time this clip is commented on.
To unsubscribe, uncheck the box at the bottom of this clipmark, or click the unsubscribe link located at the bottom
of each comments email.
', 0, 0, false, null, 290, 180); } else { ShowDialog('
You will no longer receive email notifications each time this clip is commented on.
'); } } } function user_watch(sUserGUID) { action_post('GET', '/xml_action.aspx?action=user_watch&u=' + sUserGUID + '&r=' + escape(prompt('Reason for watching this user')), null, false); } function user_ban(sUserGUID, bReturn, bShowPosting, bReload) { var sReason = prompt('Reason for banning this user\nNOTE: This action can\'t be undone!') if (!!sReason && sReason != '') { if (bShowPosting) { ShowLayeredDialog('Banning user, please wait....'); } action_post('GET', '/xml_action.aspx?action=user_ban&u=' + sUserGUID + '&r=' + escape(sReason), null, false, (!!bReload ? user_ban_callback : null)); if (bReturn) { return true; } } if (bReturn) { return false; } } function user_ban_callback() { //window.location.href = window.location.href; } function user_nipsa(sUserGUID) { action_post('GET', '/xml_action.aspx?action=user_nipsa&u=' + sUserGUID + '&r=' + escape(prompt('Reason you nipsa\'d this user')), null, false); } var dtCommentLastCall = new Date(1,1,1970); var bCommentLoading = false; var bCommentPosted = false; var Comment_XMLHTTP = false; var dtCommentLastCall = new Date(1,1,1970); var iTry = 0; var lCommentTimeout = 0; var bCommentFacebook = false; var oCharsRemaining = null; Comment_Init(); function comments_unload() { if (lCommentTimeout != 0) { clearTimeout(lCommentTimeout); lCommentTimeout = 0; } if (!!Comment_XMLHTTP && Comment_XMLHTTP.readyState != 4) { Comment_XMLHTTP.abort(); Comment_XMLHTTP = null; } } function UpdateCommentCharsLeft(oCommentField) { var thisChars; var charsLeft = 2000 - oCommentField.value.length; var charStatus = ''; if (charsLeft >= 0) { charStatus = '(' + charsLeft + ' characters remaining)'; } else { charStatus = '
NOTE: You are over the 2000 character maximum. Please reduce your comment by ' + (charsLeft * -1) + ' characters.
'; } if (!oCharsRemaining) { oCharsRemaining = document.getElementById('charsRemain'); } oCharsRemaining.innerHTML = charStatus; } function SubmitComment() { if (!ValidateComment()) { return false; } setTimeout('PostComment()', 100); return true; } function PostComment() { var sComment = document.frmComment.comment.value; sComment = sComment.replace(/&/g, '&'); sComment = sComment.replace(/>/g, '>'); sComment = sComment.replace(/ ' + sTime + ''; sHTML += '' + sUsername + ''; sHTML += '
' + sComment + '
'; } else { sHTML += '
'; sHTML += '
' + sDate + ' ' + sTime + '
'; sHTML += '' + sUsername + '
'; sHTML += '
' + sComment + '
'; } oElement.innerHTML = sHTML; dvComments.appendChild(oElement); oElement = null; if (!!document.getElementById('txtComment')) { //UpdateCommentCharsLeft(document.frmComment.comment); UpdateCommentCharsLeft(document.getElementById('txtComment')); } var lCommentsBottom = dvComments.offsetTop + dvComments.offsetHeight; if (!bCommentPosted && document.body.scrollTop > 10 && lCommentsBottom > document.body.scrollTop && lCommentsBottom <= document.body.scrollTop + document.body.clientHeight) { document.body.scrollTop = document.body.scrollTop + 75; } } function InsertFbComment(sUsername, sUserImage, sDate, sTime, sComment, iFbData, iFbId) { var dvComments = document.getElementById('dvClipComments'); var spnTotalComments = document.getElementById('spnTotalComments'); var oElement = null; var sHTML = ''; iTotalComments++; spnTotalComments.innerHTML = iTotalComments; if (iTotalComments == 1) { spnTotalComments.innerHTML += " Comment" } else { spnTotalComments.innerHTML += " Comments" } oElement = document.createElement('div'); if (is_ie) { oElement.setAttribute('className', 'CommentWrap'); } else { oElement.setAttribute('class', 'CommentWrap'); } //if (bFacebookApp) { alert('Is Facebook'); } sHTML += '
'; sHTML += '
' + sDate + ' ' + sTime + '
'; sHTML += ''; if (iFbData == 1) { sHTML += '' + sUsername + ''; } else { sHTML += sUsername; } sHTML += '
' + sComment + '
'; oElement.innerHTML = sHTML; dvComments.appendChild(oElement); oElement = null; if (!!document.getElementById('txtComment')) { UpdateCommentCharsLeft(document.getElementById('txtComment')); } var lCommentsBottom = dvComments.offsetTop + dvComments.offsetHeight; if (!bCommentPosted && document.body.scrollTop > 10 && lCommentsBottom > document.body.scrollTop && lCommentsBottom <= document.body.scrollTop + document.body.clientHeight) { document.body.scrollTop = document.body.scrollTop + 75; } } function ValidateComment() { if (document.frmComment.comment.value.length == 0) { alert('Before you can submit a comment you must enter text in the comment box!'); return false; } document.frmComment.btnSubmitComment.disabled = true; return true; } function Comment_Init() { // wait 5s before feed checking if (lCommentTimeout != 0) { clearTimeout(lCommentTimeout); lCommentTimeout = 0; } lCommentTimeout = setTimeout('Comment_Update()', 10000); } function Comment_Update(sComment) { if (sActiveClipGUID == '') { return; } //alert('phase Ib'); if (lCommentTimeout != 0) { clearTimeout(lCommentTimeout); lCommentTimeout = 0; } if (bCommentLoading) { if (!!sComment) { lCommentTimeout = setTimeout('Comment_Update(\'' + sComment.replace(/\'/,'\\\'') + '\')', 500); } else { lCommentTimeout = setTimeout('Comment_Update()', 500); } return; } bCommentLoading = true; Comment_XMLHTTP = CreateXMLHTTP(); if (!Comment_XMLHTTP) { return; } Comment_XMLHTTP.onreadystatechange = Comment_XMLStateChange; if (!!sComment) { iTry = 1; try { //alert('debug2:' + bCommentFacebook); Comment_XMLHTTP.open('POST', '/comment_save.aspx?' + (bCommentFacebook ? 'o=FBK&' : '') + 'permalink=' + bIsPermalink, true); Comment_XMLHTTP.send('\n' + unescape(sComment) + '' + sActiveClipGUID + 'true'); } catch(e) { } } else { Comment_XMLHTTP.open('GET', '/comment_feed.aspx?clip=' + sActiveClipGUID, true); //window.open('/comment_feed.aspx?clip=' + sActiveClipGUID); Comment_XMLHTTP.send(null); } } function Comment_XMLStateChange() { if (Comment_XMLHTTP.readyState != 4) { return; } if (!Comment_XMLHTTP.responseXML || !Comment_XMLHTTP.responseXML.documentElement) { if (bCommentPosted && iTry == 1) { iTry = 0; Comment_XMLHTTP.abort(); Comment_XMLHTTP = null; bCommentLoading = false; document.frmComment.btnSubmitComment.disabled = false; bCommentPosted = false; alert('Whoops. Looks like a connection problem has occured. This comment was not posted. Please check your connection and try again.'); } return; } var xmlComment = Comment_XMLHTTP.responseXML.documentElement; var oComments = null; if (GetAttribute(xmlComment, 'error', '0') != '0') { ShowDialog('

Hold your comments

To try to maintain balance on the Clipmarks site, there are some limits on the number of comments each user can post within certain time periods.

You will be able to comment again in ' + GetAttribute(xmlComment, 'timeout-minutes', '30') + ' minutes.
', 0, 0, false, null, 300, 190); document.frmComment.btnSubmitComment.disabled = false; bCommentPosted = false; } if (xmlComment.childNodes.length > 0) { oComments = xmlComment.childNodes[0]; OutputComments(oComments); } Comment_XMLHTTP = null; bCommentLoading = false; if (lCommentTimeout == 0) { lCommentTimeout = setTimeout('Comment_Update()', 60000); } } function OutputComments(oComments) { var oComment = null; for (i = 0; i < oComments.childNodes.length; i++) { oComment = oComments.childNodes[i]; if (bFacebookApp) { // InsertFbComment(sUsername, sUserImage, sDate, sTime, sComment, iFbData, iFbId) { var sDisplayName = oComment.childNodes[1].childNodes[0].nodeValue; var sDisplaySrc = oComment.childNodes[4].childNodes[0].nodeValue; var iFbData = 0; var iFbId = 0; if (oComment.childNodes[1].getAttribute('fbdata') == '1') { sDisplayName = oComment.childNodes[1].getAttribute('fbname'); sDisplaySrc = oComment.childNodes[1].getAttribute('fbsrc'); if (sDisplaySrc.length == 0) { sDisplaySrc = 'http://static.ak.facebook.com/pics/q_default.gif'; } iFbData = 1; iFbId = oComment.childNodes[1].getAttribute('fbid'); } //alert(oComment.childNodes[1].getAttribute('fbdata')); InsertFbComment(sDisplayName, sDisplaySrc, oComment.childNodes[2].childNodes[0].nodeValue, oComment.childNodes[3].childNodes[0].nodeValue, oComment.childNodes[0].childNodes[0].nodeValue, iFbData, iFbId); } else { InsertComment(oComment.childNodes[1].childNodes[0].nodeValue, oComment.childNodes[4].childNodes[0].nodeValue, oComment.childNodes[2].childNodes[0].nodeValue, oComment.childNodes[3].childNodes[0].nodeValue, oComment.childNodes[0].childNodes[0].nodeValue, oComments.childNodes.length == i+1); } } if (bCommentPosted) { ScrollToBottom(); document.frmComment.comment.value = ''; document.frmComment.btnSubmitComment.disabled = false; bCommentPosted = false; } } function OpenPreview() { var popW = 410; var popH = 360; var popX = parseInt((document.body.clientWidth - popW) / 2); var popY = parseInt((document.body.clientHeight - popH) / 2); var oPreviewWindow = window.open('/comment_preview.aspx?mode=1', 'Preview_Comment', 'width=' + popW + ',height=' + popH + ',top=' + popY + ',left=' + popX + ',resizable=yes,scrollbars=no'); oPreviewWindow.focus(); } function OpenRTF(sGUID, sTitle) { var popW = 410; var popH = 356; var popX = parseInt((document.body.clientWidth - popW) / 2); var popY = parseInt((document.body.clientHeight - popH) / 2); var oRTFWindow = window.open('/rtf_popup.aspx?guid=' + sGUID + '&ttl=' + escape(sTitle), 'Popup_RTF', 'width=' + popW + ',height=' + popH + ',top=' + popY + ',left=' + popX + ',resizable=yes,scrollbars=no'); oRTFWindow.focus(); } function ShowFullText(iCommentId) { document.getElementById('dvFullComment' + iCommentId).style.display='block'; document.getElementById('dvShortComment' + iCommentId).style.display='none'; } function HideFullText(iCommentId) { document.getElementById('dvFullComment' + iCommentId).style.display='none'; document.getElementById('dvShortComment' + iCommentId).style.display='block'; } function DeleteComment(sCommentGUID, dvCommentHead, bClipper) { if (!confirm('Are you sure you want to remove this comment? Please only remove comments that appear to be spam or that you believe to be unquestionably outside the bounds of civility. Clipmarks support will be notified about this comment and may take further action on it and/or the user who posted it.')) { return; } var Action_XMLHTTP = CreateXMLHTTP(); Action_XMLHTTP.open("GET", "/xml_action.aspx?action=comment_remove&guid=" + sCommentGUID, false); Action_XMLHTTP.send(null); if (bClipper) { dvCommentHead.innerHTML = '
— Comment removed by clipper —
'; } else { dvCommentHead.innerHTML = '
— Comment removed by moderator —
'; } dvCommentHead.nextSibling.innerHTML = '
'; alert('This comment has been removed. Thank you for helping to moderate the environment on Clipmarks.'); }var xmlDialogHTTP = null; var xmlDialog = null; var oDialog = null; var bDialogLoading = true; var sPopGuid = null; var sFollowedClipper = null; var bBlockWindowOpen = false; var bNoPop = false; var bDatabaseWork = true; var bFromPop = false; var sDialogURL = ''; function dialog_load(sDialog, sParams, bNested) { ShowLayeredDialog(null, 500, 350, bNested, true); var fraDialogLoad = document.getElementById('fraDialogLoad'); if (!fraDialogLoad) { fraDialogLoad = document.createElement('IFRAME'); fraDialogLoad.id = 'fraDialogLoad'; fraDialogLoad.setAttribute('name', 'fraDialogLoad'); fraDialogLoad.style.position = 'absolute'; fraDialogLoad.style.left = '-1000px'; fraDialogLoad.style.top = '-1000px'; fraDialogLoad.style.visibility = 'hidden'; fraDialogLoad.src = '/dialogs.aspx?d=' + sDialog + (!!sParams ? '&' + sParams : ''); document.body.appendChild(fraDialogLoad) return; } window.frames['fraDialogLoad'].location.href = '/dialogs.aspx?d=' + sDialog + (!!sParams ? '&' + sParams : ''); } function dialog_popped_open(sGUID, bPop, bFromPopAction) { bDialogLoading = true; bNoPop = bPop; bFromPop = (!!bFromPopAction); dialog_load('WhoPopped', 'c=' + sGUID + '&fp=' + bFromPop.toString()); } function PopDialog() { ShowDialog('What is a Pop?

When a user pops a clip it gets sent to the top of the clipmarks home page for other visitors to see. This creates a real-time community filter for promoting interesting clips. To ensure quality information in small portions, only clips that are under 1,000 characters can be popped.
', null, null, null, null, null, 190); } function BlogOverLimit(sGuid) { ShowDialog('
Sorry, this clipmark can not be blogged because it exceeds the publishing limit of 1000 characters.
', null, null, null, null, null, 120); } function NoConnectionDialog() { var sHTML = 'A connection error has occured.

Please check your connection and try again.'; if (bDatabaseWork) { sHTML = 'We are currently doing work on the database.


Please try again in a few minutes.'; } ShowDialog(sHTML, null, null, null, null, null, 180); } function ShowLayeredDialog(sHTML, lWidth, lHeight, bNested, bShare) { HideScrollbars(); HideOpenMenus(true); bNested = !!bNested; var sDialogID = (!bNested ? 'dvDialogContent' : 'dvDialogNested'); if (!lHeight) { lHeight = 352; } if (!lWidth) { lWidth = 700; } var dvDialogBlackout = CreateIfNone('dvDialogBlackout', 'DIV'); var dvDialogContent = CreateIfNone(sDialogID, 'DIV'); dvDialogBlackout.style.height = document.body.scrollHeight + 'px'; if (!is_opera) { dvDialogBlackout.style.display = 'block'; } if (!sHTML) { sHTML = '
'; sHTML += 'Loading...
'; sHTML += '
cancel'; sHTML += '
'; } dvDialogContent.innerHTML = sHTML; dvDialogContent.style.width = lWidth + 'px'; dvDialogContent.style.height = lHeight + 'px'; dvDialogContent.style.top = parseInt((document.body.clientHeight - lHeight) / 2 - 40 + document.body.scrollTop) + 'px'; dvDialogContent.style.left = parseInt((document.body.clientWidth - lWidth) / 2) + 'px'; dvDialogContent.style.display = 'block'; if (bShare) { dvDialogContent.style.borderColor = '#999999'; } } function CloseLayeredDialog(bNested) { var sDialogID = (!bNested ? 'dvDialogContent' : 'dvDialogNested'); ShowScrollbars(); if (!bNested) { document.getElementById('dvDialogBlackout').style.display='none'; } if (!!document.getElementById(sDialogID)) { document.getElementById(sDialogID).style.display='none'; } } var iClipperMode, iClipperLimit, sClipperDialogMessage; function OpenClippers(sUser, iMode, iLimit, sMessage) { // assign globals iClipperMode = iMode; iClipperLimit = iLimit; sClipperDialogMessage = sMessage; dialog_clippers_open(sUser); } function dialog_clippers_open(sUser) { bDialogLoading = true; xmlDialogHTTP = CreateXMLHTTP(); if (!xmlDialogHTTP) { alert('Browser Not Supported'); return; } sFollowedClipper = sUser; ShowLayeredDialog(null); var sLimit = ''; if (iClipperLimit > 0) { sLimit = '&l=' + iClipperLimit; } if (iClipperMode == 1) { // followers xmlDialogHTTP.open('GET', '/feed_dialog.aspx?clippers=1' + sLimit + '&u=' + sUser, true); } else if (iClipperMode == 2) { // clipper list xmlDialogHTTP.open('GET', '/feed_dialog.aspx?clippers=2' + sLimit + '&u=' + sUser, true); } xmlDialogHTTP.onreadystatechange = dialog_clippers_XMLStateChange; xmlDialogHTTP.send(null); } function dialog_clippers_XMLStateChange() { if (xmlDialogHTTP.readyState != 4) { return; } if (!xmlDialogHTTP.responseXML) { return; } if (xmlDialogHTTP.responseXML && xmlDialogHTTP.responseXML.documentElement) { xmlDialog = xmlDialogHTTP.responseXML.documentElement; dialog_clippers_load(); bDialogLoading = false; } else { //xmlDialogHTTP.abort(); } } function dialog_clippers_load() { var oChannel; oChannel = xmlDialog.childNodes[0]; var oClipper; var oTag; var sTopTagString = ''; var sTopTags; var oClippers = oChannel.getElementsByTagName('clipper'); var ct = 0; var sClippers = ''; var objMessage = CreateIfNone('dvDialogContent', 'DIV'); var bShowMore = false; var iTotal = 0; bKeepDialogOpen = true; sClippers += ''; sClippers += '
'; // card here var sLocation = 'unknown'; var sUser = oChannel.getAttribute("username"); var sPoppedAverage = ''; var sPopsAverage = ''; var fPopped = 0; var fPops = 0; iTotal = oChannel.getAttribute('clippers-' + iClipperMode + '-total'); if (parseInt(oChannel.getAttribute('clippers-' + iClipperMode + '-total')) > parseInt(oChannel.getAttribute("clippers-limit"))) { bShowMore = true; } if (oChannel.getAttribute("location") != '') { sLocation = oChannel.getAttribute("location"); } var sImg = '/images/user-no-photo-small-trans.gif'; if (oChannel.getAttribute('has-photo') == 1) { sImg = '/profile/small/' + oChannel.getAttribute('guid') + '.png'; } sClippers += '
'; sClippers += ''; sClippers += '
'; sClippers += 'Location: ' + sLocation + '
'; sClippers += 'Joined: ' + oChannel.getAttribute("date-created") + '
'; sClippers += '
'; var sAbout = trim(oChannel.getAttribute("about-me")); sClippers += '
'; if (sAbout.length > 0) { sClippers += '
About ' + sUser + ':
'; sClippers += sAbout; } sClippers += '
'; sClippers += '
'; sClippers += ''; sClippers += '
'; var sFollowUrl = 'PostFollowUser(\'' + sUser + '\', true, \'' + oChannel.getAttribute("is-followed") + '\');'; var sFollowImg = 'add-clipper-big.png'; var sFollowLabel = 'Add to'; if (oChannel.getAttribute("is-followed") == '1') { sFollowUrl = 'ShowDialog(\'
You are already following ' + sUser + '.\')'; sFollowImg = 'in-my-clippers-big.png'; sFollowLabel = 'In'; } else if (!bAuth) { sFollowUrl = 'CloseLayeredDialog();LoginPrompt(\'follow\', ExchangeUrl())'; sFollowLabel = 'Login to add to'; } if (sUser != sAuthName) { sClippers += ''; } sClippers += '
'; if (sClipperDialogMessage) { sClippers += '
' + sClipperDialogMessage + '
'; } else { if (bAuth) { sClippers += ''; } else { sClippers += ''; } } // end card sClippers += '
'; var sLinkClass1 = 'TabAct'; var sLinkClass2 = 'Tab'; if (iClipperMode == 2) { sLinkClass1 = 'Tab'; sLinkClass2 = 'TabAct'; } var sC1 = ''; var sC2 = ''; if (parseInt(oChannel.getAttribute("clippers-1-total")) > 0) { sC1 = '(' + oChannel.getAttribute("clippers-1-total") + ')'; } if (parseInt(oChannel.getAttribute("clippers-2-total")) > 0) { sC2 = '(' + oChannel.getAttribute("clippers-2-total") + ')'; } sClippers += '
'; sClippers += '
'; sClippers += 'Followers ' + sC1 + ''; sClippers += ''; sClippers += 'Guides ' + sC2+ ''; sClippers += '
'; sClippers += '
'; sClippers += '
'; if (oClippers.length == 0) { if (iClipperMode == 1) { sClippers += '




No one is yet following ' + sUser + '\'s clips...


Be the First
'; } else if (iClipperMode == 2) { sClippers += '




No one has yet been added to
' + sUser + '\'s Guides.

'; } } else { sClippers += ''; for (i = 0; i < oClippers.length; i++) { if (oClippers[i]) { oClipper = oClippers[i]; sClippers += ''; var sSrc = ''; if (oClipper.getAttribute('has-photo') == 1) { sSrc = '/profile/small/' + oClipper.getAttribute('guid') + '.png'; } else { sSrc = '/images/user-no-photo-small-trans.gif'; } var sPos = (iTotal - i) + '.'; sClippers += ''; sClippers += ''; sClippers += ''; sClippers += ''; sClippers += ''; ct++; } } sClippers += '
' + sPos + ''; sClippers += '' + oClipper.getAttribute('name') + ''; if (oClipper.getAttribute('friend') == 1) { sClippers += ''; } sClippers += '' + oClipper.getAttribute('date') + '
'; if (bShowMore) { sClippers += ''; } } sClippers += '
'; var sPerson = 'users are'; if (oClippers.length == 1) { sPerson = 'user is'; } var sHTML = '
'; sHTML += '
' + sClippers + '
'; sHTML += '
close
'; sHTML += '
'; objMessage.innerHTML = sHTML; objMessage.style.background = '#fafafa'; } function ShareDialog(bEdit, sClipGuid, sTtl, bUnderLimit, sOwner){ sTtl = sTtl.replace(/\'/g,'\\\''); var sPerm = 'http://clipmarks.com/clipmark/' + sClipGuid; var sParams = unescape('\'' + stripUnsafe(sPerm, 1) + '\',\'' + stripUnsafe(sTtl, 1) + '\',\'\',\'\''); var sHTML = '
'; sHTML += ''; sHTML += '

Share this clip

'; sHTML += '
'; sHTML += 'DIGG'; sHTML += 'FACEBOOK'; sHTML += 'MIXX'; sHTML += 'TWITTER'; sHTML += ''; sHTML += 'STUMBLE'; sHTML += 'DEL.ICIO.US'; sHTML += 'FRIENDFEED'; sHTML += 'PERMALINK'; sHTML += '
'; sHTML += 'more'; sHTML += '
'; sHTML += '
More actions:
'; sHTML += 'Emailemail'; if (bUnderLimit) { sHTML += 'Blogblog'; } sHTML += 'Printprint'; if (bAuth) { sHTML += 'Foldersadd to folder'; } sHTML += '
'; sHTML += '
close
'; ShowLayeredDialog(sHTML, 440, 224, false, true); } function OpenFolderWindow(bEdit, sClipGuid){ var sPerm = 'http://clipmarks.com/clipmark/' + sClipGuid; var sHTML = '
'; sHTML += '
Add this clip to a folder
'; if (bAuth) { sCollectionsURL = '/feed_collections.aspx?root=true&clip=' + sClipGuid; collections_open(); sHTML += '
' + collections_get_all(false) + '
'; sHTML += '
New FolderNew folder
'; sHTML += '
'; sHTML += '  '; sHTML += '  '; sHTML += '
'; } sHTML += '
'; ShowLayeredDialog(sHTML, 440, 224, false, true); } function share_save_collections() { var sCollectionID = ''; var bOneChecked = false; for (i = 0; i < oCollections.length; i++) { sCollectionID = oCollections[i].getAttribute('id'); if (document.getElementById('aClipCollection' + sCollectionID).getAttribute('checked') == 'true') { bOneChecked = true; } } if (!bOneChecked) { if (!confirm('Are you sure you don\'t want this clip included in any of your folders?')) { return false; } } else if (document.getElementById('aClipCollectionfldr').getAttribute('checked') != 'true' && setting_get('show_main_clipcast_hint', '1') == '1') { dialog_load('RemoveMainClipCast', null, true); return; } collection_all_save(); } var bMovingObj = false; var objMoving = null; var mouseX = 0; var mouseY = 0; var offsetX = 0; var offsetY = 0; if (!is_ie) document.captureEvents(Event.MOUSEMOVE) document.onmousemove = getMouseXY; document.onmouseup = function() { moveOff(document.getElementById('dvDialogBox')); } function getMouseXY(e) { if (is_ie) { mouseX = event.clientX + document.body.scrollLeft; mouseY = event.clientY + document.body.scrollTop; } else { mouseX = e.pageX; mouseY = e.pageY; } if (mouseX < 0){mouseX = 0} if (mouseY < 0){mouseY = 0} if (bMovingObj) { objMoving.style.left = mouseX - offsetX; objMoving.style.top = mouseY - offsetY; } return true } function movePrompt() { if (document.getElementById('dvDragBar')) { document.getElementById('dvDragBar').style.cursor = 'move'; } } function moveRest() { } function moveOn() { offsetX = mouseX - objMoving.offsetLeft; offsetY = mouseY - objMoving.offsetTop; bMovingObj = true; if (document.getElementById('dvDragBar')) { document.getElementById('dvDragBar').className = 'Ready'; } } function moveOff() { bMovingObj = false; if (document.getElementById('dvDragBar')) { document.getElementById('dvDragBar').className = 'Rest'; } } var xmlTags = null; var xmlTagsHTTP = null; var bTagsLoading = true; var aryTags = new Array(); var KEY_ENTER = 13; var KEY_ESC = 27; var KEY_DOWN = 40; var KEY_UP = 38; var KEY_LEFT = 37; var KEY_RIGHT = 39; var KEY_TAB = 9; var bCancelNextKey = false; var dvActiveSuggestion = null; var sTagsCallbackID = ''; var txtSearch = null; function tags_unload() { if (!!xmlTagsHTTP&& xmlTagsHTTP.readyState != 4) { xmlTagsHTTP.abort(); xmlTagsHTTP = null; } } function tags_init_textbox(txtTags) { if (!!document.getElementById('txtTags')) { if (document.attachEvent) { txtTags.attachEvent('onkeydown', txtTags_keypress); txtTags.attachEvent('onkeyup', txtTags_keyup); txtTags.attachEvent('onfocus', txtTags_focus); txtTags.attachEvent('onblur', txtTags_blur); } else { txtTags.addEventListener('keypress', txtTags_keypress, true); txtTags.addEventListener('keyup', txtTags_keyup, true); txtTags.addEventListener('focus', txtTags_focus, true); txtTags.addEventListener('blur', txtTags_blur, false); } } } function tags_open() { xmlTagsHTTP = CreateXMLHTTP(); if (!xmlTagsHTTP) { return; } xmlTagsHTTP.open('GET', '/feed_tags.aspx', true); xmlTagsHTTP.onreadystatechange = tags_XMLStateChange; xmlTagsHTTP.send(null); } function tags_XMLStateChange() { if (xmlTagsHTTP.readyState != 4) { return; } if (!xmlTagsHTTP.responseXML || !xmlTagsHTTP.responseXML.documentElement) { return; } xmlTags = xmlTagsHTTP.responseXML.documentElement; var i = 0; var sTags = ''; for (i = 0; i < xmlTags.childNodes.length; i++) { sTags += xmlTags.childNodes[i].nodeValue; } aryTags = sTags.split(','); tags_init_textbox(txtSearch); bTagsLoading = false; } function txtTags_selection_change(dvNewSelection) { if (dvNewSelection) { if (dvActiveSuggestion) { dvActiveSuggestion.className = ''; } dvActiveSuggestion = dvNewSelection; dvActiveSuggestion.className = 'Active'; } } function txtTags_selection_use(txtTags, dvSelection) { var iStartIndex = 0; var i = 0; for (i = 0; i < txtTags.value.length; i++) { if (txtTags.value.substr(i, 1) == ',') { iStartIndex = i + 1; } } if (iStartIndex == 0) { txtTags.value = dvSelection.getAttribute('tag'); } else { txtTags.value = txtTags.value.substr(0, iStartIndex) + ' ' + dvSelection.getAttribute('tag'); } suggestions_reset(document.getElementById(txtTags.getAttribute('suggestions-id'))); } function txtTags_focus(e) { txtTags_keyup(e); } function txtTags_blur(e) { var txtTags = null; if (e.srcElement) { txtTags = e.srcElement; } else { txtTags = e.target; } sTagsCallbackID = txtTags.id; setTimeout(txtTags_blur_callback, 100); } function txtTags_blur_callback() { suggestions_reset(document.getElementById(document.getElementById(sTagsCallbackID).getAttribute('suggestions-id'))); } function suggestions_reset(dvSuggestions) { dvSuggestions.style.display = 'none'; dvActiveSuggestion = null; dvSuggestions.innerHTML = ''; } function txtTags_keypress(e) { e = e||window.event; var key = e.keyCode || e.which; var txtTags = null; if (e.srcElement) { txtTags = e.srcElement; } else { txtTags = e.target; } if (!dvActiveSuggestion && key != KEY_DOWN && key != KEY_ESC) { if (key == KEY_ENTER) { suggestions_reset(document.getElementById(txtTags.getAttribute('suggestions-id'))); bCancelNextKey = true; } return true; } switch (key) { case KEY_TAB: case KEY_ENTER: txtTags_selection_use(txtTags, dvActiveSuggestion); break; case KEY_DOWN: if (!dvActiveSuggestion) { txtTags_selection_change(document.getElementById(txtTags.getAttribute('suggestions-id')).firstChild); } else { txtTags_selection_change(dvActiveSuggestion.nextSibling); } dvActiveSuggestion.parentNode.scrollTop = dvActiveSuggestion.offsetTop; break; case KEY_UP: txtTags_selection_change(dvActiveSuggestion.previousSibling); dvActiveSuggestion.parentNode.scrollTop = dvActiveSuggestion.offsetTop; break; case KEY_ESC: suggestions_reset(document.getElementById(txtTags.getAttribute('suggestions-id'))); break; default: return true; break; } bCancelNextKey = true; StopPropagation(e, true); return false; } function txtTags_keyup(e) { var txtTags = null; e = e||window.event; if (e.srcElement) { txtTags = e.srcElement; } else { txtTags = e.target; } var dvSuggestions = document.getElementById(txtTags.getAttribute('suggestions-id')); if (bTagsLoading || bCancelNextKey) { bCancelNextKey = false; if (txtTags.value.length == 0) { suggestions_reset(dvSuggestions); } return; } if (GetAttribute(txtTags, 'last-tags', '') == txtTags.value) { return; } else { txtTags.setAttribute('last-tags', txtTags.value); } var i = 0; var lTagMatchCount = 0; var sHTML = ''; var iStartIndex = 0; var sMatch = ''; for (i = 0; i < txtTags.value.length; i++) { if (txtTags.value.substr(i, 1) == ',') { iStartIndex = i + 1; } } sMatch = trim(txtTags.value.substr(iStartIndex, txtTags.value.length - iStartIndex)); if (sMatch.length > 0) { for (i = 0; i < aryTags.length; i++) { if (aryTags[i].substr(0, sMatch.length) == sMatch) { sHTML += '
' + aryTags[i] + '
' lTagMatchCount++; } } } if (lTagMatchCount > 0) { dvSuggestions.innerHTML = sHTML; dvSuggestions.style.display = 'block'; } else { suggestions_reset(dvSuggestions); } } var iCCWidth = 310; var iCCHeight = 228; var bCC = false; var bCCActive = false; var sContentClass; var oCCClosing = null; var oCCStarting = null; var bCCUnload = false; var bMacDhtml = false; function OpenCC(sUser, bRight, bFromDhtml) { // uses mousex and mousey set in layer_mover.js if (bCC) { CloseCCDone(); } bCC = true; if (!bRight) { bRight = false; } if (bFromDhtml) { bMacDhtml = true; } else { bMacDhtml = false; } oCCStarting = setTimeout('StartCC(\'' + sUser + '\', ' + bRight + ')', 700); } function StartCC(sUser, bRight) { var oCC = document.getElementById('dvCCPanel'); var iLeft = mouseX - iCCWidth; var iTop = mouseY - iCCHeight; if (iTop < 4) { iTop = 4; } oCC.style.background='url(/images/cc/bg-left.png)'; sContentClass = 'ContentL'; if (bRight) { iLeft = mouseX + 30; oCC.style.background='url(/images/cc/bg-right.png)'; sContentClass = 'ContentR'; } if (is_ie && is_major < 7) { oCC.style.background='url(/images/cc/spacer.gif)'; sContentClass += 'IE'; } if (bCC && !bCCUnload) { if (!bMacDhtml && !is_ie) { HideScrollbars(); } oCC.style.top = iTop + 'px'; oCC.style.left = iLeft + 'px'; oCC.style.display = 'block'; oCC.innerHTML = '

Loading clipper: ' + sUser + '...
'; cc_open(sUser); } else { if (!bMacDhtml && !is_ie) { ShowScrollbars(); } oCC.style.display = 'none'; } } function cc_open(sUser) { bDialogLoading = true; xmlDialogHTTP = CreateXMLHTTP(); if (!xmlDialogHTTP) { alert('Browser Not Supported'); return; } xmlDialogHTTP.open('GET', '/feed_card.aspx?u=' + sUser, true); xmlDialogHTTP.onreadystatechange = cc_XMLStateChange; xmlDialogHTTP.send(null); } function cc_XMLStateChange() { if (xmlDialogHTTP.readyState != 4) { return; } if (!xmlDialogHTTP.responseXML) { return; } if (xmlDialogHTTP.responseXML && xmlDialogHTTP.responseXML.documentElement) { xmlDialog = xmlDialogHTTP.responseXML.documentElement; cc_load(); bDialogLoading = false; } else { } } function cc_load() { var oCC = document.getElementById('dvCCPanel'); var oChannel = xmlDialog; var oClipper; var sHTML = ''; bKeepDialogOpen = true; var sLocation = 'unknown'; var sUser = oChannel.getAttribute("username"); var sFollowUrl = 'PostFollowUser(\'' + sUser + '\', true, \'' + oChannel.getAttribute("is-followed") + '\');'; var sFollowImg = 'add-clipper-right.gif'; var sFollowLabel = 'Add to'; if (oChannel.getAttribute("is-followed") == '1') { sFollowUrl = 'ShowDialog(\'
You are already following ' + sUser + '.\')'; sFollowImg = 'in-clippers-right.gif'; sFollowLabel = 'In'; } else if (!bAuth) { sFollowUrl = 'CloseCC();LoginPrompt(\'follow\', ExchangeUrl())'; sFollowLabel = 'Login to add to'; } if (oChannel.getAttribute("location") != '') { sLocation = oChannel.getAttribute("location"); } var sImg = '/images/user-no-photo-small-trans.gif'; if (oChannel.getAttribute('has-photo') == 1) { sImg = '/profile/small/' + oChannel.getAttribute('guid') + '.png'; } sHTML += '
'; sHTML += '
'; sHTML += '
' + sUser + ''; if (oChannel.getAttribute('auth-allow-watch') == 1) { sHTML += '
nipsa - ban - admin'; } sHTML += '
'; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
Real Name:' + (oChannel.getAttribute('name-full') == '' ? 'n/a' : oChannel.getAttribute('name-full')) + '
Location:' + sLocation + '
Last action:'; if (oChannel.getAttribute("action-type") == '1' || oChannel.getAttribute("action-type") == '2' || oChannel.getAttribute("action-type") == '3') { if (oChannel.getAttribute("action-type") == '1') { sHTML += 'clip'; sHTML += '' + oChannel.getAttribute("action-title") + ''; } else if (oChannel.getAttribute("action-type") == '2') { sHTML += 'pop'; sHTML += '' + oChannel.getAttribute("action-title") + ''; } else if (oChannel.getAttribute("action-type") == '3') { sHTML += 'comment'; sHTML += '' + oChannel.getAttribute("action-title") + ''; } } else { sHTML += 'N/A'; } sHTML += '
'; sHTML += '
'; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
' + oChannel.getAttribute("clip-count-total") + ' clips created
' + oChannel.getAttribute("pops-total") + ' pops
' + oChannel.getAttribute("comments-total") + ' comments
'; sHTML += '
'; if (oChannel.getAttribute("followers") > 0) { sHTML += ''; } else { sHTML += '
 
'; } if (sUser != sAuthName) { sHTML += ''; } sHTML += '
'; sHTML += '
'; oCC.innerHTML = '
' + sHTML + '
'; } function CloseCC() { bCC = false; oCCClosing = setTimeout('CloseCCDone()', 750); } function CloseCCDone() { if (!bCCActive) { var oCC = document.getElementById('dvCCPanel'); oCC.style.display = 'none'; oCC.innerHTML = ''; if (oCCClosing) { clearTimeout(oCCClosing); oCCClosing = null; } if (!bMacDhtml && !is_ie) { ShowScrollbars(); } } } function UnloadCC() { var oCC = document.getElementById('dvCCPanel'); oCC.style.display = 'none'; bCCUnload = true; if (oCCStarting) { clearTimeout(oCCStarting); oCCStarting = null; } return true; }