var DmdNTWSettings_0f72a49944354d978bbeca086522bebf = { pageItems : [[{"DiamdNo":"JUN212284","StockNo":"STL195110","Title":"MARVEL COMIC VENOM BUST","Publisher":"DIAMOND SELECT TOYS LLC","IsAllowed":true,"IsCustom":false,"Category":"10 "}],[]], dates : ["Wednesday, May 18, 2022","Wednesday, May 11, 2022"], numOfColumns : 5, primaryColor : '#b31313', secondaryColor : '#c4ea31', bgColor : '#77b5d9', itemWidthPer : 100 / 5, numPrevWeeks : 1, nextWeeksDate : '', curWeekDate : 'Wednesday, May 18, 2022', rowsPerPage: 0, curPage: 0, currentIndex: 0 }; function DmdNTW_0f72a49944354d978bbeca086522bebf() { var settings = DmdNTWSettings_0f72a49944354d978bbeca086522bebf; document.write('
'); for (var i = 0; i < settings.dates.length; i++) { if (settings.dates[i] == settings.curWeekDate) { DmdNTW_ChangeDate_0f72a49944354d978bbeca086522bebf(i); settings.currentIndex = i; } } } function DmdNTW_ChangeDate_0f72a49944354d978bbeca086522bebf(index) { var settings = DmdNTWSettings_0f72a49944354d978bbeca086522bebf; settings.currentIndex = index; settings.curPage = 0; document.getElementById("dmdNewReleasesWidget_0f72a49944354d978bbeca086522bebf").innerHTML = DmdNTW_SetDisplayMarkup_0f72a49944354d978bbeca086522bebf(settings.pageItems[index], settings.dates[index]); } function DmdNTW_NextPage_0f72a49944354d978bbeca086522bebf() { var settings = DmdNTWSettings_0f72a49944354d978bbeca086522bebf; settings.curPage += 1; document.getElementById("dmdNewReleasesWidget_0f72a49944354d978bbeca086522bebf").innerHTML = DmdNTW_SetDisplayMarkup_0f72a49944354d978bbeca086522bebf(settings.pageItems[settings.currentIndex], settings.dates[settings.currentIndex]); } function DmdNTW_PrevPage_0f72a49944354d978bbeca086522bebf() { var settings = DmdNTWSettings_0f72a49944354d978bbeca086522bebf; settings.curPage -= 1; document.getElementById("dmdNewReleasesWidget_0f72a49944354d978bbeca086522bebf").innerHTML = DmdNTW_SetDisplayMarkup_0f72a49944354d978bbeca086522bebf(settings.pageItems[settings.currentIndex], settings.dates[settings.currentIndex]); } function DmdNTW_SetDisplayMarkup_0f72a49944354d978bbeca086522bebf(collection, displayDate) { var settings = DmdNTWSettings_0f72a49944354d978bbeca086522bebf; var markup = ''; markup += '

New Releases - ' + displayDate + '

'; markup += '
'; var curWeekIndex = 0; markup += '
'; markup += 'Upcoming Releases'; if (settings.dates.length > 1) { markup += ' - '; for(var j = 0; j < settings.dates.length; j++) { var dateText = '' if (settings.dates[j] == settings.curWeekDate) { dateText = "This Week"; curWeekIndex = j; } else if (settings.dates[j] == settings.nextWeeksDate) { dateText = "Next Week"; } else { if (j - curWeekIndex == 1) { dateText = "Last Week"; } else { dateText = (j - curWeekIndex) + " Weeks Previous"; } } markup += '' + dateText + ''; if (j != settings.dates.length -1) { markup += ' - '; } } } markup += '
'; var startingIndex = settings.curPage * (settings.rowsPerPage) * settings.numOfColumns; var endingIndex = (settings.curPage + 1) * (settings.rowsPerPage) * settings.numOfColumns; var hasMore = true; var isFirstPage = settings.curPage == 0; if (endingIndex >= collection.length || settings.rowsPerPage == 0) { endingIndex = collection.length; hasMore = false; } if (settings.rowsPerPage != 0) { markup += '
'; if (!isFirstPage) { markup += '<< PREV PAGE'; } if (!isFirstPage && hasMore) { markup += ' '; } if (hasMore) { markup += 'NEXT PAGE >>'; } markup += '
'; } for(var i = startingIndex; i < endingIndex; i++) { markup += '
'; markup += ''; markup += '
' + collection[i].Title + '
'; markup += '
' + collection[i].Publisher + '
'; markup += '
'; } if (settings.rowsPerPage != 0) { markup += '
'; markup += '
'; if (!isFirstPage) { markup += '<< PREV PAGE'; } if (!isFirstPage && hasMore) { markup += ' '; } if (hasMore) { markup += 'NEXT PAGE >>'; } markup += '
'; } markup += '
'; return markup; } DmdNTW_0f72a49944354d978bbeca086522bebf();