Please Sign In to place bids.
Current bid and time status does not automatically update - You must refresh your page frequently to stay updated
'); } else { $('.ButtonContainer').prepend('
'); } $('.btnSaveWatchedItems').click(function () { SaveWatchedItems(); return false; }); $('.btnPlaceBids').click(function () { if ($('#ItemListingGrid input[name="NextBidBox"]').filter(function () { return this.value > 0; }).length < 1) { $("#NoBidsPlacedDialog").dialog('open'); return false; } $('#ConfirmBidsBidList').empty(); $('#ItemListingGrid input[name="NextBidBox"]').filter(function () { return this.value > 0; }).each(function () { var BP = parseFloat($(this).attr('BuyersPremium')) * .01; var bid = parseFloat($(this).val()); var nextBid = parseFloat($(this).attr('NextBidAmount')); var bidWithBP = (bid * BP) + bid; var itemLine = '
'; itemLine = itemLine + '
' + $(this).attr('Description') + ' (' + $(this).attr('Itemcode') + ')' + '
'; itemLine = itemLine + '
'; itemLine = itemLine + 'Your Maximum Bid: ' + '' + CurrencyFormat(bid) + ''; itemLine = itemLine + ' (' + CurrencyFormat(bidWithBP) + " including Buyer's Premium" + ')'; itemLine = itemLine + '
'; if (bid < nextBid) { itemLine = itemLine + '
'; itemLine = itemLine + 'Your bid did not meet the minimum next bid for this item (' + '' + CurrencyFormat(nextBid) + '' + ').'; itemLine = itemLine + '
'; itemLine = itemLine + 'This bid will not be placed.'; itemLine = itemLine + '
'; } itemLine = itemLine + '
'; $('#ConfirmBidsBidList').append(itemLine); }); $("#ConfirmBids").dialog('open'); return false; }); } }); function LoadItemDataNow() { var t = 267; $.ajax({ type: 'POST', url: '/Auction/CategoryItemListJson', contentType: "application/json", data: JSON.stringify({ Id: t}), error: function (result) { }, success: function (result) { _rowSet = result; DisplayItemListingGrid(); } }); } function DescriptionCompareAsc(a, b) { if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } else if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } var aPrefix = a.Description; var bPrefix = b.Description; if (aPrefix > bPrefix) { return 1; } if (bPrefix > aPrefix) { return -1; } } function DescriptionCompareDesc(a, b) { if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } else if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } var aPrefix = a.Description; var bPrefix = b.Description; if (aPrefix > bPrefix) { return -1; } if (bPrefix > aPrefix) { return 1; } } function NumberBidCompareAsc(a, b) { if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } else if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } var aPrefix = parseInt(a.NumberOfBids); var bPrefix = parseInt(b.NumberOfBids); if (aPrefix > bPrefix) { return 1; } if (bPrefix > aPrefix) { return -1; } } function NumberBidCompareDesc(a, b) { if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } else if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } var aPrefix = parseInt(a.NumberOfBids); var bPrefix = parseInt(b.NumberOfBids); if (aPrefix > bPrefix) { return -1; } if (bPrefix > aPrefix) { return 1; } } function ValueCodeCompareAsc(a, b) { if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } else if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } var aPrefix = a.ValueCode; var bPrefix = b.ValueCode; if (aPrefix > bPrefix) { return 1; } if (bPrefix > aPrefix) { return -1; } } function ValueCodeCompareDesc(a, b) { if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } else if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } var aPrefix = a.ValueCode; var bPrefix = b.ValueCode; if (aPrefix > bPrefix) { return -1; } if (bPrefix > aPrefix) { return 1; } } function ItemCodeCompareAsc(a, b) { if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } else if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } var aPrefix = parseInt(a.ItemcodePrefix); var bPrefix = parseInt(b.ItemcodePrefix); if (aPrefix > bPrefix) { return 1; } if (bPrefix > aPrefix) { return -1; } if (a.Itemcode > b.Itemcode) { return 1; } if (b.Itemcode > a.Itemcode) { return -1; } } function ItemCodeCompareDesc(a, b) { if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } else if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } var aPrefix = parseInt(a.ItemcodePrefix); var bPrefix = parseInt(b.ItemcodePrefix); if (aPrefix > bPrefix) { return -1; } if (bPrefix > aPrefix) { return 1; } if (a.Itemcode > b.Itemcode) { return -1; } if (b.Itemcode > a.Itemcode) { return 1; } } function WinningBidCompareAsc(a, b) { var field = "CurrentWinningBid"; return BaseItemCompareAsc(a, b, field); } function WinningBidCompareDesc(a, b) { var field = "CurrentWinningBid"; return BaseItemCompareDesc(a, b, field); } function TimeLeftCompareAsc(a, b) { var field = "TimeLeft"; return BaseItemCompareAsc(a, b, field); } function TimeLeftCompareDesc(a, b) { var field = "TimeLeft"; return BaseItemCompareDesc(a, b, field); } function BaseItemCompareAsc(a, b, field) { if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } if (b[field] == null) return 1; if (a[field] < b[field]) return -1; if (a[field] > b[field]) return 1; if (field == "Itemcode") return 0; return ItemCodeCompareAsc(a, b); } function BaseItemCompareDesc(a, b, field) { if (a.IsBiddingActive && !b.IsBiddingActive) { return -1; } if (!a.IsBiddingActive && b.IsBiddingActive) { return 1; } if (a[field] == null) return 1; if (a[field] > b[field]) return -1; if (a[field] < b[field]) return 1; if (field == "Itemcode") return 0; return ItemCodeCompareDesc(a, b); } function DisplayItemListingGrid(itemsPerPage) { if (_fromTopList == 'Y') { $('#ItemListingGrid').DiamondGridView({ rowOrientation: 'auto', disableColumnHeadersInVerticalView: false, columns: _columnsItemListing, rows: _rowSet, rowsPerPage: 100, showPager: false, pagerPosition: 'both', startingSortCol: 'CurrentWinningBid', startingSortDir: 'desc', mobileStartingSortCol: 'CurrentWinningBid', mobileStartingSortDir: 'desc', renderCompleteCallback: ItemListingGridRenderComplete, enableBrowserPageHistory: true }); } else { $('#ItemListingGrid').DiamondGridView({ rowOrientation: 'auto', disableColumnHeadersInVerticalView: false, columns: _columnsItemListing, rows: _rowSet, rowsPerPage: itemsPerPage, showPager: true, pagerPosition: 'both', //startingSortCol: _fromRankable == 'Y' ? 'Rank' : 'Itemcode', startingSortCol: 'ItemcodeFull', startingSortDir: 'asc', mobileStartingSortCol: 'ItemcodeFull', mobileStartingSortDir: 'asc', renderCompleteCallback: ItemListingGridRenderComplete, enableBrowserPageHistory: true }); } } function ItemListingGridRenderComplete() { if (_rowSet.length < 1) { $('#ItemListingGrid tbody').empty().append('No items to show.'); } if ('N' == 'Y' && !_gridEventsMapped) { _gridEventsMapped = true; $('select.dgv-rowPageOptionSelect').change(function() { SaveItemsPerPagePreferences($('select.dgv-rowPageOptionSelect').val()); _itemListingRowsToDisplay = $('select.dgv-rowPageOptionSelect').val(); }); } if ('N' == 'Y') { $('#ItemListingGrid tfoot .FooterButtonRow').remove(); $('#ItemListingGrid thead .HeaderButtonRow').remove(); } ReToolTip(); SetUrl(); } function NumOfValidBids() { var totalValid = 0; $('#ItemListingGrid input[name="NextBidBox"]').filter(function () { return this.value > 0; }).each(function () { var bid = parseFloat($(this).val()); var nextBid = parseFloat($(this).attr('NextBidAmount')); if (bid >= nextBid) { totalValid += 1; } }); return totalValid; } function SaveWatchedItems() { var savedItems = new Array(); $('#ItemListingGrid input[name="WatchItems"]:checked').each(function () { savedItems.push($(this).val()); }); if (savedItems.length > 0) { $.ajax({ type: 'POST', url: '/Account/SaveWatchedItems', data: JSON.stringify({ items: savedItems }), contentType: "application/json", error: function (result) { NotifyError("Error saving watched items."); }, success: function (result) { if (result == "Failure") { } else { $('#ItemListingGrid input[name="WatchItems"]').attr('checked', false); NotifySuccess("Watched Items Saved."); } } }); } } function SavePlacedBids() { var bids = new Array(); $('#ItemListingGrid input[name="NextBidBox"]').filter(function () { return this.value > 0; }).each(function () { bids.push({ AuctionItemId: $(this).attr('auctionitemid'), BidAmount: $(this).val() }); }); if (bids.length > 0) { $.ajax({ type: 'POST', url: '/Auction/SaveBids', data: JSON.stringify({ Results: bids }), contentType: "application/json", error: function (result) { NotifyError("Error saving bids."); }, success: function (result) { //console.log(result); if (result == "Failure") { NotifyError("Not All Bids Were Executed. Please Check My Bids Page."); } else { var allSuccess = true; $('#ItemListingGrid input[name="NextBidBox"]').val(''); var scrollToId = ""; // Adjust the grids data model for (rs = 0; rs < _rowSet.length; rs++) { // Go over the current rowset for (br = 0; br < result.Results.length; br++) { // Go over the bid results if (_rowSet[rs].Id == result.Results[br].LineModel.Id) { _rowSet[rs].NextBidAmount = result.Results[br].LineModel.NextBidAmount; _rowSet[rs].CurrentWinningBid = result.Results[br].LineModel.CurrentWinningBid; _rowSet[rs].HasBid = result.Results[br].LineModel.HasBid; _rowSet[rs].IsWinningBidder = result.Results[br].LineModel.IsWinningBidder; if (!result.Results[br].LineModel.IsWinningBidder) { if (scrollToId == "") { scrollToId = result.Results[br].LineModel.Itemcode + ""; } allSuccess = false; } } } } $("#ItemListingGrid").DiamondGridView('refreshData', _rowSet); var resultContent = FormatBidResults(result.Results); if (allSuccess) { NotifySuccess("Bids Successfully Placed", resultContent); } else { if (scrollToId != "") { var scrollToItem = null; $(".GridListing_ItemNumberColumn").each(function () { if ($(this).text() == scrollToId) { scrollToItem = $(this); } }); if (scrollToItem != null) { $('html, body').animate({ scrollTop: scrollToItem.offset().top }, 1000); } } NotifyWarning("Bids Submitted", resultContent); } } LoadItemDataNow(); } }); } } function FormatBidResults(rows) { var winningResultSet = $("
You are now the winning bidder for these items:
"); var losingResultSet = $("
You have been outbid on these items:
"); var couldNotPlaecResultSet = $("
The follow bids could not be placed:
"); var hasWinningItems = false; var hasLosingItems = false; var hasCouldNotPlaceItems = false; for (var i = 0; i < rows.length; i++) { console.log(rows[i]) if (rows[i].LineModel.IsWinningBidder) { hasWinningItems = true; winningResultSet.append($("
").append(rows[i].LineModel.DescriptionSafe)); } else if (!rows[i].Successful) { hasCouldNotPlaceItems = true; couldNotPlaecResultSet.append($("
").append(rows[i].LineModel.DescriptionSafe)); } else { hasLosingItems = true; losingResultSet.append($("
").append(rows[i].LineModel.DescriptionSafe)); } } var resultSet = $("
"); if (hasWinningItems) { resultSet.append(winningResultSet); } if (hasLosingItems) { resultSet.append(losingResultSet); } if (hasCouldNotPlaceItems) { resultSet.append(couldNotPlaecResultSet); } return resultSet.html(); } function CurrentBidFormatter(row, cell, value, tableRow) { if (row.IsBiddingActive == false) { data = CurrencyFormatter(row, cell, row.CurrentWinningBidWithBP); } else { data = CurrencyFormatter(row, cell, value); } if (row.IsWinningBidder) { data = data + '
'; if (row.IsBiddingActive) { data = data + '[Winning]'; } else { data = data + '[Won]'; } data = data + '
'; $(tableRow).addClass('WinningRow'); } else if (row.HasBid) { data = data + '
[Outbid]
'; $(tableRow).addClass('OutbidRow'); data = data + '
'; } return data; } function IsLastBidFormatter(row, cell, value) { //console.log(row); if (row.IsWinningBidder) { return "You are winning"; } else { return null; } } function DescriptionFormatter(row, cell, value) { var data = ''; data = data + ''; data = data + ''; data = data + ''; data = data + ''; data = data + ''; data = data + row.Description; data = data + ''; data = data + '
'; data = data + ''; data = data + row.FullDescriptionBlurb; data = data + ''; return data; } function NextBidBoxFormatter(row, cell, value) { if ('N' != 'Y' || !row.IsBiddingActive || _allowedToBid == 'N' || row.CustomerIsConsignor) { return ''; } var over = ''; var under = 'Next Bid: ' + CurrencyFormatter(row, cell, value); return OverUnderDisplay(over, under); } function WatchItemFormatter(row, cell, value) { for (var i = 0; i < _watchedItems.length; i++) { if (_watchedItems[i].Id == row.Id) { return null; } } var data = ''; return data; } function TimeLeftFormatter(row, cell, value) { var data = ''; console.log(row) data = ''; //if (!row.IsBiddingActive) { // data = '
Ended
'; //} else { // if (row.AuctionEndingWarningInEffect) { // data = '
10 Minute Warning
'; // } else { // data = TimeLeftSummary(value, false); // if (value < 600) { // data = '
' + data; // } else { // data = '
' + data; // } // data = data + '
'; // } //} return data; } function SetUrl() { var url = window.location.href; var baseUrl = '' var markPos = url.indexOf("?"); if (markPos === -1) { baseUrl = url; } else { baseUrl = url.slice(0, markPos) } function GetUrlToken(key, value) { return key + "=" + value; } var params = {}; var keys = []; var parts = location.search.substring(1).split('&'); for (var i = 0; i < parts.length; i++) { var nv = parts[i].split('='); if (!nv[0]) continue; params[nv[0]] = nv[1] || true; keys.push(nv[0]); } if (keys.indexOf('dgv-rowsPerPage') == -1) { keys.push('dgv-rowsPerPage'); if ($('#PageSelection').length == 0) { params['dgv-rowsPerPage'] = $($(".dgv-rowPageOptionSelect")[0]).val(); } else { params['dgv-rowsPerPage'] = $('#PageSelection').val(); } } if (params['dgv-rowsPerPage'] == "undefined") { params['dgv-rowsPerPage'] = $($(".dgv-rowPageOptionSelect")[0]).val(); } //keys.push('Query'); //params['Query'] = data.Query; //keys.push('SearchDescriptions'); //params['SearchDescriptions'] = data.SearchDescriptions; //keys.push('Auction'); //params['Auction'] = data.Auction; var urlQuery = baseUrl + "?"; for (var i = 0; i < keys.length; i++) { if (i > 0) { urlQuery = urlQuery + "&"; } urlQuery = urlQuery + keys[i] + "=" + params[keys[i]]; } //data.hasHadStatePushed = true; window.history.pushState({}, "", urlQuery); } setInterval(function () { $('.lastBidCountdown').each(function (i, e) { var now = new Date(); var nowUTC = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds()); var startingTimeLeft = $(e).attr("timeleft"); if (startingTimeLeft != null && startingTimeLeft.indexOf("-") >= 0) { $(e).text("Ended"); } else { var LastTimeout = new Date($(e).attr('lastBidTicks') + 'Z'); var distance = LastTimeout - nowUTC + _diffTime; var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); if (distance < 0) { $(e).text('0s'); } else { var text = ''; if (days > 0) { text += days + "d "; text += hours + "h "; text += minutes + "m "; text += seconds + "s "; } else if (hours > 0) { text += hours + 'h '; text += minutes + "m "; text += seconds + "s "; } else if (minutes > 0) { text += minutes + 'm '; text += seconds + "s "; } else if (seconds > 0) { text += seconds + 's '; } if (days == 0 && hours == 0 && minutes < 20) { $(e).addClass('bidCountWarning'); } $(e).text(text); } } }) }, 500) function ButtonBoxFormatter(row, cell, value) { var data = ''; return data; }