var bWindowLoading = true;
var bIsPermalink = false;
function BuildURL(l_bVideo, l_sUsername, l_bPopped, l_bCommented, l_bCIF, l_sFolder, l_bTIF, l_bSearchMix, l_bPopular, l_sKeywords, l_iSortType, l_sClipGUID, l_iFilter, l_bFullText) {
var sURL = '/';
if (l_sUsername != '') {
sURL += 'clipper/' + escape(l_sUsername).replace(/%20/mig, '+') + '/';
if (l_bCIF) {
sURL += 'clippers/';
if (l_bSearchMix) {
sURL += 'mix/';
}
}
if (l_sFolder != '') {
sURL += 'collection/' + escape(l_sFolder) + '/';
} else if (l_bPopped) {
sURL += 'pops/';
} else if (l_bCommented) {
sURL += 'comments/';
} else if (l_bTIF) {
sURL += 'all-tags/';
}
}
if (l_bPopular) {
sURL += 'popular/';
}
if (l_sKeywords != '') {
if (l_bFullText) {
sURL += 'search/';
} else {
sURL += 'tags/';
}
sURL += escape(l_sKeywords).replace(/%20/mig, '+') + '/';
}
if (!l_bCIF) {
sURL += 'sort/';
switch (l_iSortType) {
case 1:
sURL += 'newest-clips/';
break;
case 2:
sURL += 'latest-pops/';
break;
case 3:
sURL += 'newest-clips+latest-pops/';
break;
case 4:
sURL += 'latest-comments/';
break;
case 5:
sURL += 'newest-clips+latest-comments/';
break;
case 6:
sURL += 'latest-pops+latest-comments/';
break;
case 7:
sURL += 'newest-clips+latest-pops+latest-comments/';
break;
case 8:
sURL += 'most-pops/';
break;
case 64:
sURL += 'today/';
break;
case 128:
sURL += 'this-week/';
break;
case 256:
sURL += 'this-month/';
break;
case 512:
sURL += 'all-time/';
break;
case 1024:
sURL += 'now/';
break;
case 2048:
sURL += 'first-pops/';
break;
}
}
if (l_iSortType == 1024) {
sURL = '/popular/';
}
if (l_iSortType < 8) {
switch (l_iFilter) {
case 0:
if (l_sUsername == '' && l_sKeywords == '') {
sURL += 'filter/all/';
}
break;
case 1:
sURL += 'filter/clipped/';
break;
case 2:
sURL += 'filter/added/';
break;
case 7:
sURL += 'filter/clips/';
break;
case 8:
sURL += 'filter/videos/';
break;
case 9:
sURL += 'filter/private/';
break;
case 10:
sURL += 'filter/public/';
break;
}
}
if (l_sClipGUID != '') {
sURL += 'clip/' + l_sClipGUID + '/';
}
return sURL;
}
function ExchangeUrl(bRelative) {
var sURL = window.location.href;
var sHost = window.location.host;
if (bNestedFrame) {
var sRegex = '/^http\\:\\/\\/' + sHost + '/';
sURL = sURL.replace(eval(sRegex),'http://clipmarks.com');
}
if (bRelative) {
var sRegex = '/^http\\:\\/\\/' + sHost + '/';
if (bNestedFrame) {
sRegex = '/^http\\:\\/\\/clipmarks\.com/';
}
sURL = sURL.replace(eval(sRegex),'');
}
sURL = sURL.replace(/\/clip\/[^\/]+\/?$/, '');
sURL = sURL.replace(/\/$/, '');
if (sActiveClipGUID && !bRelative) { sURL += '/clip/' + sActiveClipGUID; }
sURL += '/';
return sURL;
}
function GoLogin() {
window.location='/login.aspx?url=' + ExchangeUrl();
}
function FeatureUrl(sFeature, sCCUrl) {
//var sPath = ExchangeUrl(true);
var sPath = BuildURL(bSearchVideo, sSearchUser, bSearchPopped, bSearchCommented, bSearchCIF, sSearchFolder, bSearchTIF, bSearchMix, bSearchPopular, sSearchTags, iSearchSortType, '', iSearchFilter, bFullText);
if (sFeature == 'cliproll') {
var popW = 660;
var popH = 680;
if (is_safari) { popW = 660; popH = 674; }
window.open('/feed_clips.aspx?rs=' + escape(sPath), 'Feed_Clips', 'width=' + popW + ',height=' + popH + ',resizable=yes');
} else if (sFeature == 'print') {
var popW = 740;
var popH = 590;
window.open('/print_clips.aspx?mode=results&print=true&path=' + escape(sPath), 'Print_Clips', 'width=' + popW + ',height=' + popH + ',resizable=yes');
} else if (sFeature == 'save') {
var popW = 740;
var popH = 590;
window.open('/save_clips.aspx?mode=results&save=true&path=' + escape(sPath), 'Save_Clips', 'width=' + popW + ',height=' + popH + ',resizable=yes');
} else if (sFeature == 'rss') {
window.open('http://rss.clipmarks.com' + sPath);
} else if (sFeature == 'clipcast') {
window.open('http://' + sCCUrl);
} else if (sFeature == 'mobile') {
ShowDialog('
MOBILE CLIPS
Get these clips on your mobile device at:
m.clipmarks.com' + sPath + '', null, null, null, null, 480, 140);
}
}
var dvClipListHeader = null;
var dvClipList = null;
var dvClipListFooter = null;
var dvContent = null;
var dvContentScroll = null;
var dvBackground = null;
var dvClipListSizer = null;
var dvClipListBG = null;
var dvContentSizer = null;
var tdClipCount = null;
var dvFooter = null;
var dvClipmark = null;
var dvInnerScroll = null;
var dvHome = null;
var dvTagHome = null;
var cssClipList = null;
// old: 74
var lHeaderHeight = 40;
var lSpacing = 6;
var lListHeaderHeight = 70;
var lListFooterHeight = 48;
var lListMinWidth = 375;
var lClipListWidth = 0;
var lClipListHeight = 0;
var lContentHeight = 500;
var lContentWidth = 500;
var lFooterHeight = 10;
var dtmLoad = new Date();
var lViewCount = 0;
var bIsNav = true;
var bScrollProfile = false;
var bShowFDFooter = false;
function window_load() {
if (bAuth) {
settings_open();
}
if (!!document.styleSheets) {
cssClipList = document.styleSheets[1];
}
dvClipListHeader = document.getElementById('dvClipListHeader');
dvClipList = document.getElementById('dvClipList');
dvClipListFooter = document.getElementById('dvClipListFooter');
dvContent = document.getElementById('dvContent');
dvContentScroll = document.getElementById('dvContentScroll');
dvBackground = document.getElementById('dvBackground');
dvClipListSizer = document.getElementById('dvClipListSizer');
dvContentSizer = document.getElementById('dvContentSizer');
dvClipListBG = document.getElementById('dvClipListBG');
tdClipCount = document.getElementById('tdClipCount');
if (lRecordCount != '50' && !bIsLanding) {
cliplist_update_recordcount();
}
dvClipmark = document.getElementById('dvClipmark');
dvHome = document.getElementById('dvHome');
dvTagHome = document.getElementById('dvTagHome');
objMoving = document.getElementById('dvDialogBox');
txtSearch = document.getElementById('txtTags');
if (!!txtSearch) {
setTimeout('tags_open()', 1000);
}
if (is_ie && !is_ie7up && !!document.getElementById('aButton_ClipListFilter')) {
if (document.getElementById('aButton_ClipListFilter')) {
document.getElementById('aButton_ClipListFilter').style.marginRight = '40px';
}
}
if (!(sActiveClipGUID.length > 0) && ((sSearchUser != '' && sSearchTags == '') && !bIsLanding && bIsProfile)) {
bScrollProfile = true;
}
if (bAuth && sSearchUser == sAuthName && !bSearchCIF && !!txtSearch && sSearchTags == '') {
txtSearch.value = 'search my clips';
SearchFocus(txtSearch, false);
} else if (sSearchTags != '' && !!txtSearch) {
txtSearch.value = sSearchTags;
txtSearch.focus();
}
bWindowLoading = false;
if (bIsLanding) {
landing_resize();
} else {
window_resize();
cliplist_load();
}
}
function window_unload() {
comments_unload();
if (!bNestedFrame) {
tags_unload();
}
cliplist_unload();
}
function window_resize() {
if (bWindowLoading) {
return;
}
if (bIsLanding) { landing_resize(); }
if (bNestedFrame) {
lHeaderHeight = 0;
lFooterHeight = 0;
}
var lClientHeight = document.body.clientHeight;
var lClientWidth = document.body.clientWidth;
var lRuleCount = 0;
var cssRule = null;
var lBaseTop = lHeaderHeight + lSpacing;
var lBaseLeft = lSpacing + 7;
var lTemp = 0;
var i = 0;
if (is_ie && !is_ie7up && !!document.getElementById('aButton_ClipListFilter')) {
document.getElementById('aButton_ClipListFilter').style.marginRight = '60px';
}
if (is_fx) {
document.getElementById('tblHdBar').style.width = (lClientWidth) + 'px';
}
lContentWidth = parseInt(lClientWidth * 0.45);
if (lClientWidth < 900 || lClientHeight < 500) {
document.body.style.overflow = 'auto';
} else {
document.body.style.overflow = 'hidden';
}
if (lClientWidth < 900) {
lContentWidth = 360;
}
if (!!document.getElementById('aSortCollections')) {
if (lClientWidth < 1057) {
document.getElementById('aSortCollections').innerHTML = '
';
} else {
document.getElementById('aSortCollections').innerHTML = '
Folders';
}
}
if (!!document.getElementById('aSortTags')) {
if (lClientWidth < 982) {
document.getElementById('aSortTags').innerHTML = '
';
} else {
document.getElementById('aSortTags').innerHTML = '
Tags';
}
}
if (!!document.getElementById('aSortCalendar')) {
if (lClientWidth < 1057 || (lClientWidth < 1100 && is_ie)) {
// or ic_calendar.png
document.getElementById('aSortCalendar').innerHTML = '
';
} else {
document.getElementById('aSortCalendar').innerHTML = '
Date';
}
}
lClientWidth -= lSpacing * 2;
lClientHeight -= lBaseTop + lSpacing;
lClipListWidth = (lClientWidth - (lBaseLeft + 10 + lContentWidth));
if (lClipListWidth < lListMinWidth || lClientWidth < 900) {
lClipListWidth = lListMinWidth;
}
/* BEGIN BACKGROUND SIZING */
dvBackground.style.left = lBaseLeft + 'px';
dvBackground.style.top = lBaseTop + 'px';
dvBackground.style.width = (lClientWidth - (lBaseLeft - lSpacing)) + 'px';
dvBackground.style.height = (lClientHeight) + 'px';
dvClipListSizer.style.width = (lClipListWidth - 42) + 'px';
dvClipListSizer.style.height = (lClientHeight - lFooterHeight - 68) + 'px';
dvContentSizer.style.width = (lContentWidth - 10) + 'px';
if (sActiveClipGUID.length > 0) {
if (!!dvHome) {
dvHome.style.display = 'none';
}
if (!!dvTagHome) {
dvTagHome.style.display = 'none';
}
} else {
}
/* END BACKGROUND SIZING */
/* BEGIN MIDDLE COLUMN SIZING */
lClipListHeight = lClientHeight;
lClipListHeight -= lFooterHeight + lSpacing;
lClipListHeight -= lListHeaderHeight;
lClipListHeight -= lListFooterHeight;
dvClipListHeader.style.left = (lBaseLeft + 10) + 'px';
dvClipListHeader.style.top = lBaseTop + 'px';
dvClipListHeader.style.width = lClipListWidth + 'px';
dvClipListHeader.style.height = lListHeaderHeight + 'px';
dvClipListBG.style.left = (lBaseLeft + 14) + 'px';
dvClipListBG.style.top = ((lBaseTop + lListHeaderHeight) - 4) + 'px';
dvClipListBG.style.width = (lClipListWidth - (is_ie ? 29 : 31)) + 'px';
dvClipListBG.style.height = (lClipListHeight + (is_ie ? 5 : 3)) + 'px';
dvClipList.style.left = (lBaseLeft + 14) + 'px';
dvClipList.style.top = (lBaseTop + lListHeaderHeight) + 'px';
dvClipList.style.width = (lClipListWidth - 28) + 'px';
dvClipList.style.height = lClipListHeight + 'px';
dvClipListFooter.style.left = lBaseLeft + 'px';
dvClipListFooter.style.top = (lBaseTop + lListHeaderHeight + lClipListHeight) + 'px';
dvClipListFooter.style.width = lClipListWidth + 'px';
dvClipListFooter.style.height = lListFooterHeight + 'px';
if (!bNestedFrame) {
dvFooter = document.getElementById('dvFooter');
dvFooter.style.left = lBaseLeft + 'px';
dvFooter.style.top = (lBaseTop + (lClientHeight - lFooterHeight)) + 'px';
dvFooter.style.width = lClipListWidth + 'px';
dvFooter.style.height = lFooterHeight + 'px';
}
/* END MIDDLE COLUMN SIZING */
lBaseLeft += lClipListWidth + lSpacing;
/* BEGIN RIGHT COLUMN SIZING */
dvContent.style.left = (lBaseLeft - 6) + 'px';
dvContent.style.top = (lBaseTop + 10) + 'px';
dvContent.style.width = (lContentWidth + 4) + 'px';
dvContent.style.height = lClientHeight + 'px';
if (!!document.getElementById('tblCpWrap')) {
document.getElementById('tblCpWrap').style.width = (lContentWidth - 8) + 'px';
document.getElementById('tblCpWrap').style.height = (lClientHeight - 62) + 'px';
dvContent.style.left = (lBaseLeft - 6) + 'px';
dvContent.style.width = lContentWidth + 'px';
}
if (!!document.getElementById('dvCal')) {
if (sSearchUser != '') {
if (lClientHeight < 674 ) {
document.getElementById('dvCal').style.display = 'none';
} else {
document.getElementById('dvCal').style.display = 'block';
}
}
}
dvClipmark.style.display = 'block';
dvClipmark.style.overflow = 'scroll';
if (sActiveClipGUID.length > 0 || ((sSearchUser != '' && sSearchTags == '') && !bIsLanding && bIsProfile)) {
dvContentScroll.style.width = (lContentWidth + 16) + 'px';
dvContentScroll.style.height = '100px';
if (bNestedFrame) {
dvContentScroll.style.top = (lClientHeight - 36) + 'px';
} else {
dvContentScroll.style.top = (lClientHeight - 6) + 'px';
}
dvContentScroll.style.left = (lBaseLeft - 11) + 'px';
dvInnerScroll = document.getElementById('dvInnerScroll');
dvInnerScroll.style.width = (lContentWidth - 18) + 'px';
dvInnerScroll.align = 'left';
if (!(sActiveClipGUID.length > 0)) {
document.getElementById('dvProfileWrap').style.height = (lClientHeight + 25) + 'px';
document.getElementById('dvProfileWrap').style.width = (lContentWidth + 205) + 'px';
document.getElementById('dvProfileWrap').align='left';
dvInnerScroll.align = 'center';
document.getElementById('dvHome').style.overflow='hidden';
}
ShowScroller();
}
if (!!document.getElementById('fraClip')) {
if (lContentWidth <= 360) {
document.getElementById('fraClip').style.height = '200px';
} else {
document.getElementById('fraClip').style.height = parseInt(lContentWidth * 0.55) + 'px';
}
}
if (!!document.getElementById('dvTagDiv')) {
document.getElementById('dvTagDiv').style.width = lContentWidth - 51;
}
dvClipmark.style.height = (lClientHeight + 25) + 'px';
dvClipmark.style.width = (lContentWidth + 205) + 'px';
if (is_mac) {
dvClipmark.style.overflow = 'hidden';
}
if (dvHome) {
dvHome.style.height = (lClientHeight - 20) + 'px';
dvHome.style.width = (lContentWidth) + 'px';
}
if (dvTagHome) {
dvTagHome.style.height = (lContentHeight - 20) + 'px';
dvTagHome.style.width = (lContentWidth) + 'px';
}
lBaseLeft += lContentWidth + lSpacing + 10;
/* RECALCULATE WIDTH BASED ON FINAL DIMENSIONS IN CASE WIDER THAN CLIENT AREA */
lClientWidth = lSpacing + lClipListWidth + lSpacing + lContentWidth + lSpacing;
if (!document.styleSheets) {
return;
}
lRuleCount = (is_ie ? cssClipList.rules.length : cssClipList.cssRules.length);
for (i = 0; i < lRuleCount; i++) {
if (is_ie) {
cssRule = cssClipList.rules[i];
} else {
cssRule = cssClipList.cssRules[i];
}
switch (cssRule.selectorText.toLowerCase()) {
case '.listitem a.title':
case '.listitemviewed a.title':
case '.listitemactive a.title':
case '.listitemhover a.title':
case '.listitem a.title, .listitemviewed a.title, .listitemactive a.title, .listitemhover a.title':
cssRule.style.width = (lClipListWidth - 67) + 'px';
break;
case '.listitem .description':
case '.listitemviewed .description':
case '.listitemactive .description':
case '.listitemhover .description':
case '.listitem .description, .listitemviewed .description, .listitemactive .description, .listitemhover .description':
cssRule.style.width = (lClipListWidth - 145) + 'px';
break;
}
}
}
function landing_resize() {
document.body.className='FixedWidth';
}
// Calendar Functions
var xmlCalendarHTTP = null;
var xmlCal = null;
function GetCalendar(sType, iYear, iMonth, iDay, bReturn, sUrlParam) {
var sURL = '/feed_calendar.aspx?type=' + sType + '&yy=' + iYear + '&mm=' + iMonth + '&dd=' + iDay + '¶m=' + escape(sUrlParam);
xmlCalendarHTTP = CreateXMLHTTP();
xmlCalendarHTTP.open('GET', sURL, true);
xmlCalendarHTTP.onreadystatechange = Calendar_XMLStateChange;
xmlCalendarHTTP.send(null);
document.getElementById('dvInnerCal').innerHTML = '
';
if (bReturn) {
return false;
}
}
function Calendar_XMLStateChange() {
var dvCal = document.getElementById('dvInnerCal');
if (xmlCalendarHTTP.readyState != 4) {
return;
}
if (!xmlCalendarHTTP.responseXML || !xmlCalendarHTTP.responseXML.documentElement) {
return;
}
var xmlCal = xmlCalendarHTTP.responseXML.documentElement;
var oDiv = CloneNode(xmlCal.childNodes[0], true);
dvCal.removeChild(dvCal.firstChild);
dvCal.style.visibility='hidden';
dvCal.appendChild(oDiv);
var sText = dvCal.innerHTML;
sText = sText.replace(/\&\;/mig, '&');
dvCal.innerHTML = sText;
dvCal.style.visibility='visible';
}
var xmlListHTTP = null;
var xmlNextHTTP = null;
var dvListItemOver = null;
var bLiveTimeoutSet = false;
var lLiveTimeout = 0;
var aryFadeItems = new Array();
var lFadeTimeout = 0;
function cliplist_load() {
cliplist_set_live_timeout(5000);
}
function cliplist_update_next_link() {
if (lRecordCount < lTotalRecordCount) {
var lNextCount = (lTotalRecordCount - lRecordCount);
if (lNextCount > 40) {
lNextCount = 40;
}
document.getElementById('tdNextResults').innerHTML = 'Next ' + lNextCount + '';
} else {
document.getElementById('tdNextResults').innerHTML = '';
}
}
function cliplist_unload() {
if (lLiveTimeout != 0) {
clearTimeout(lLiveTimeout);
lLiveTimeout = 0;
}
if (!!xmlNextHTTP && xmlNextHTTP.readyState != 4) {
xmlNextHTTP.abort();
xmlNextHTTP = null;
}
if (!!xmlListHTTP && xmlListHTTP.readyState != 4) {
xmlListHTTP.abort();
xmlListHTTP = null;
}
}
function cliplist_live_click() {
if (bSearchPopular) {
alert('Live results are not available while in Popular Clips');
return;
} else if (iSearchSortType & 8) {
alert('Live results are not available while sorting by Most Pops');
return;
}
var aLive = document.getElementById('aLive');
bLiveResults = !bLiveResults;
aLive.innerHTML = '
' + (bLiveResults ? 'Turn off live update' : 'Turn on live update');
setting_set('live_results', bLiveResults);
if (bAuth) {
if (setting_get('user_hide_postlive', '0') != '1') {
PostLiveResults();
}
} else {
PostLiveResults();
}
if (bLiveResults) {
cliplist_open_live();
} else if (lLiveTimeout != 0) {
clearTimeout(lLiveTimeout);
}
}
function cliplist_open_live() {
var sURL = '/feed_clipmarks.aspx?path=' + window.location.pathname;
lLiveTimeout = 0;
xmlListHTTP = CreateXMLHTTP();
if (!xmlListHTTP) {
return;
}
if (sURL.lastIndexOf('/') != sURL.length - 1) {
sURL += '/';
}
sURL += 'live/';
xmlListHTTP.open('GET', sURL, true);
xmlListHTTP.onreadystatechange = cliplist_live_XMLStateChange;
xmlListHTTP.send(null);
}
function cliplist_live_XMLStateChange() {
if (xmlListHTTP.readyState != 4) {
return;
}
if (xmlListHTTP.responseXML && xmlListHTTP.responseXML.documentElement) {
var xmlLive = xmlListHTTP.responseXML.documentElement;
var i = 0;
for (i = xmlLive.childNodes.length - 1; i >= 0; i--) {
if (xmlLive.childNodes[i].nodeType == 1) {
var oDiv = CloneNode(xmlLive.childNodes[i], true);
dvClipList.insertBefore(oDiv, dvClipList.firstChild);
if (is_ie) {
oDiv.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=5)';
} else {
oDiv.style.opacity = 0.05;
oDiv.style.Mozopacity = 0.05;
}
cliplist_item_fadein(oDiv);
if (oDiv.getAttribute('clip-guid') == sActiveClipGUID) {
oDiv.className = 'ListItemActive';
}
}
}
lRecordCount += xmlLive.childNodes.length;
if (lRecordCount > 0 && document.getElementById('dvNoResults')) {
document.getElementById('dvNoResults').parentNode.parentNode.removeChild(document.getElementById('dvNoResults').parentNode);
}
cliplist_update_recordcount();
cliplist_set_live_timeout();
} else {
cliplist_set_live_timeout(60000);
}
}
function cliplist_update_recordcount() {
document.getElementById('tdClipCountTitle').innerHTML = 'showing';
tdClipCount.innerHTML = lRecordCount;
//document.getElementById('tdClipCountTitle2').innerHTML = 'clips';
if (iSearchSortType == 1 || iSearchSortType == 2 || iSearchSortType == 3 || iSearchSortType == 4 || iSearchSortType == 16 || iSearchSortType == 32 || iSearchSortType == 2048) {
cliplist_update_next_link();
}
}
function cliplist_next_100_click() {
var sURL = '/feed_next_100.aspx?last-guid=' + dvClipList.lastChild.previousSibling.getAttribute('clip-guid') + '&path=' + BuildURL(bSearchVideo, sSearchUser, bSearchPopped, bSearchCommented, bSearchCIF, sSearchFolder, bSearchTIF, bSearchMix, bSearchPopular, sSearchTags, iSearchSortType, '', iSearchFilter, bFullText);
xmlNextHTTP = CreateXMLHTTP();
xmlNextHTTP.open('GET', sURL, true);
xmlNextHTTP.onreadystatechange = cliplist_next_100_XMLStateChange;
xmlNextHTTP.send(null);
document.getElementById('tdNextResults').innerHTML = '
';
}
function cliplist_next_100_XMLStateChange() {
if (xmlNextHTTP.readyState != 4) {
return;
}
if (!xmlNextHTTP.responseXML || !xmlNextHTTP.responseXML.documentElement) {
return;
}
var xmlLive = xmlNextHTTP.responseXML.documentElement;
var i = 0;
var dvEndOfList = document.getElementById('dvEndOfList');
if (!!dvEndOfList) {
dvEndOfList.parentNode.parentNode.removeChild(dvEndOfList.parentNode);
}
lTotalRecordCount = lRecordCount + parseInt(xmlLive.getAttribute('record-count'));
for (i = 0; i < xmlLive.childNodes.length; i++) {
if (xmlLive.childNodes[i].nodeType == 1) {
var oDiv = CloneNode(xmlLive.childNodes[i], true);
dvClipList.appendChild(oDiv);
if (oDiv.getAttribute('clip-guid') == sActiveClipGUID) {
oDiv.className = 'ListItemActive';
}
}
}
lRecordCount += (i - 1);
cliplist_update_recordcount();
}
function cliplist_set_live_timeout(iTimeout) {
if (!bLiveResults) {
return;
}
if (!iTimeout) {
if (sSearchUser == '' && sSearchTags == '') {
iTimeout = 20000;
} else {
iTimeout = 120000;
}
}
cliplist_clear_update_timeout();
lLiveTimeout = setTimeout('cliplist_open_live()', iTimeout);
}
function cliplist_item_fadein(dvItem) {
aryFadeItems[aryFadeItems.length] = dvItem;
if (lFadeTimeout == 0) {
cliplist_item_fadein_interval();
}
}
function cliplist_item_fadein_interval() {
var dvItem = null;
var i = 0;
var lOpacity = 0;
var aryNewItems = new Array();
for (i = 0; i < aryFadeItems.length; i++) {
dvItem = aryFadeItems[i];
lOpacity = parseInt(GetAttribute(dvItem, 'opacity', 0));
lOpacity += 9;
if (lOpacity > 92) {
lOpacity = 100;
}
if (is_ie) {
dvItem.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + lOpacity + ')';
} else {
dvItem.style.opacity = lOpacity / 100;
dvItem.style.Mozopacity = lOpacity / 100;
}
dvItem.setAttribute('opacity', lOpacity);
if (lOpacity < 100) {
aryNewItems[aryNewItems.length] = dvItem;
}
}
aryFadeItems = aryNewItems;
if (aryFadeItems.length > 0) {
lFadeTimeout = setTimeout('cliplist_item_fadein_interval()', 50);
} else {
lFadeTimeout = 0;
}
}
function cliplist_clear_update_timeout() {
if (lLiveTimeout != 0) {
clearTimeout(lLiveTimeout);
lLiveTimeout = 0;
}
}
function cliplist_click(oClip, event) {
var sClipGUID = oClip.getAttribute('clip-guid');
while (!sClipGUID) {
oClip = oClip.parentNode;
sClipGUID = oClip.getAttribute('clip-guid');
}
for (i = 0; i < dvClipList.childNodes.length; i++) {
if (GetAttribute(dvClipList.childNodes[i], 'id', '') != 'dvEndOfListContainer') {
if (GetAttribute(dvClipList.childNodes[i], 'clip-guid', '') == sClipGUID) {
dvClipList.childNodes[i].className = 'ListItemActive';
} else {
dvClipList.childNodes[i].className = 'ListItem';
}
}
}
//if (is_ie) {
StopPropagation(event, true);
//}
setTimeout('clip_load(\'' + sClipGUID + '\')', 100);
/*if (bForbes) {
loadAds(0);
}*/
return false;
}
function cliplist_click_callback() {
if (bWindowLoading) {
setTimeout('cliplist_click_callback()', 50);
return;
}
for (i = 0; i < dvClipList.childNodes.length; i++) {
if (GetAttribute(dvClipList.childNodes[i], 'id', '') != 'dvEndOfListContainer') {
if (GetAttribute(dvClipList.childNodes[i], 'clip-guid', '') == sActiveClipGUID) {
dvClipList.childNodes[i].className = 'ListItemActive';
} else {
dvClipList.childNodes[i].className = 'ListItem';
}
}
}
document.getElementById('fraClip').src = 'http://content' + (Math.floor(Math.random() * 5) + 1) + '.clipmarks.com/content/' + sActiveClipGUID + '/' + (bFullText ? escape(sSearchTags) : '');
document.getElementById('dvClipTitle').childNodes[0].target = '_top';
lViewCount++;
Comment_Init();
}
function cliplist_mouseover(oClip) {
if (oClip.className == 'ListItemActive' || oClip.className == 'ListItemHover') {
return;
}
if (!!dvListItemOver) {
cliplist_mouseout(dvListItemOver);
}
oClip.setAttribute('previousClass', oClip.className);
oClip.className = 'ListItemHover';
dvListItemOver = oClip;
}
function cliplist_mouseout(oClip) {
if (oClip.className != 'ListItemHover') {
return;
}
oClip.className = oClip.getAttribute('previousClass');
dvListItemOver = null;
}
function cliplist_unpoppable(lOverlimit) {
ShowDialog('This clip is too big to pop!
This clip can not be popped because it exceeds the pop-able character limit of 2000 by ' + lOverlimit + ' characters.
The pop-able character limit was put into affect in August, 2006. Some clips that were popped before then are no longer pop-able.', 0, 0, false,null, null,200);
}
function cliplist_scroll(iPos) {
if (iPos > 2) { iPos--; }
var iAmount = (iPos * 52);
setTimeout('cliplist_scrollList(' + iAmount + ')', 700);
}
function cliplist_scrollList(iAmount) {
dvClipList.scrollTop = iAmount;
}
var bContentMoving = false;
var lMoveContentTimeout = null;
var iMoveTimeout = 40;
var bProfileExpanded = false;
var sClipOwner = '';
var sClipOwnerGUID = '';
var bClipOwnerHasPhoto = false;
function clip_load(sClipGUID) {
bScrollProfile = false;
if (sSearchUser && sSearchUser != '' && document.getElementById('dvProfileLink')) {
document.getElementById('dvProfileLink').style.display='block';
}
dvContent.style.backgroundImage = 'url(/images/blue-load.gif)';
if (bFullText) {
window.frames['fraClipLoad'].location.href = '/clip_load.aspx?guid=' + sClipGUID + '&user=' + sSearchUser + '&highlight=' + escape(sSearchTags);
} else {
window.frames['fraClipLoad'].location.href = '/clip_load.aspx?guid=' + sClipGUID + '&user=' + sSearchUser;
}
dvClipmark.style.visibility = 'hidden';
if (!!document.getElementById('dvTagHome')) {
document.getElementById('dvTagHome').style.display = 'none';
}
if (!!document.getElementById('dvHome')) {
document.getElementById('dvHome').style.display = 'none';
}
ScrollToTop();
window_resize();
}
function ShowScroller() {
if (bScrollProfile) {
document.getElementById('aScrollPermalink').style.visibility = 'hidden';
} else {
document.getElementById('aScrollPermalink').style.visibility = 'visible';
document.getElementById('aScrollPermalink').href = 'http://clipmarks.com/clipmark/' + sActiveClipGUID + '/';
}
dvContentScroll.style.display = 'block';
}
function ScrollToTop() {
if (bScrollProfile) {
document.getElementById('dvProfileWrap').scrollTop = 0;
} else {
dvClipmark.scrollTop = 0;
}
}
function ScrollToBottom() {
if (bScrollProfile) {
document.getElementById('dvProfileWrap').scrollTop = 100000;
} else {
dvClipmark.scrollTop = 100000;
}
}
function ScrollStart(iAmount) {
if (!bContentMoving) {
bContentMoving = true;
// fix scroll prob in mac ff
if (is_mac && is_gecko && !bScrollProfile) {
document.getElementById('fraClip').style.overflow='hidden';
}
ScrollMove(iAmount);
}
return false;
}
function ScrollMove(iAmount) {
if (bContentMoving) {
if (bScrollProfile) {
document.getElementById('dvProfileWrap').scrollTop += iAmount;
} else {
dvClipmark.scrollTop += iAmount;
}
lMoveContentTimeout = setTimeout('ScrollMove(' + iAmount + ')', iMoveTimeout);
}
}
function ScrollStop() {
if (bContentMoving) {
clearTimeout(lMoveContentTimeout);
if (is_mac && is_gecko && !bScrollProfile) {
document.getElementById('fraClip').style.overflow='auto';
}
lMoveContentTimeout = null;
bContentMoving = false;
}
}
function EditRefresh() {
window.location.href = ExchangeUrl();
}
function ExpandProfile() {
if (bProfileExpanded) {
document.getElementById('dvExpandProfile').style.display='none';
document.getElementById('lnkExpandProfile').innerHTML='Show Full Profile';
bProfileExpanded = false;
} else {
document.getElementById('dvExpandProfile').style.display='block';
document.getElementById('lnkExpandProfile').innerHTML='Hide Full Profile';
bProfileExpanded = true;
}
}
var sActCpTab = 'Profile';
function CpOpenTab(sAct, sInAct) {
var oAct, oInAct;
if (sActCpTab == sAct) {
return;
} else {
sActCpTab = sAct;
}
oAct = document.getElementById('dvCp' + sAct);
oInAct = document.getElementById('dvCp' + sInAct);
oAct.style.display = 'block';
document.getElementById('tdCpLnk' + sAct).className = 'CpTabAct';
oInAct.style.display = 'none';
document.getElementById('tdCpLnk' + sInAct).className = 'CpTab';
}