<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/auction-status.png" alt="" /> <?php echo $heading_title; ?></h1>
    </div>
    <div class="content">
      <div class="vtabs"><a href="#tab-auction"><?php echo $tab_auction_detail; ?></a><a href="#tab-setting"><?php echo $tab_auction_setting; ?></a>
        <a href="#tab-history"><?php echo $tab_bid_history; ?></a><a href="#tab-similar"><?php echo $tab_similar_auction; ?></a>
      </div>
      <div id="tab-auction" class="vtabs-content">
        <table class="form">
          <tr>
            <td><?php echo $text_auction_id; ?></td>
            <td>#<?php echo $auction_id; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_auction_name; ?></td>
            <td><?php echo $auction_name; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_auction_status; ?></td>
            <td><span id="auction-status"><?php echo $auction_status; ?></span></td>
          </tr>
          <tr>
            <td><?php echo $text_real_ending_time; ?></td>
            <td><span id="real-ending-time"><?php echo $real_ending_time_text; ?></span></td>
          </tr>
          <?php if ($active) { ?>
          <tr>
            <td><?php echo $text_time_left; ?></td>
            <td><span id="auction-timeleft" style="color: #B00000; font-weight: bold;"></span></td>
          </tr>
          <?php } else { ?>
          <tr>
            <td><?php echo $text_actual_duration; ?></td>
            <td><?php echo $actual_duration; ?></td>
          </tr>
          <?php } ?>
          <tr>
            <td><?php echo $text_highest_bid_amount; ?></td>
            <td><span id="highest-bid"><?php echo $highest_bid_amount_text; ?></span></td>
          </tr>
          <?php if ($highest_bidder_id) { ?>
          <tr>
            <td><?php echo $text_highest_bidder; ?></td>
            <td><a href="<?php echo $customer_href; ?>" id="highest-bidder"><?php echo $highest_bidder_masked; ?></a></td>
          </tr>
		  <?php } else { ?>
          <tr>
            <td><?php echo $text_highest_bidder; ?></td>
            <td><span id="highest-bidder"><?php echo $highest_bidder_masked; ?></span></td>
          </tr>
          <?php } ?>
          <tr>
            <td><?php echo $text_highest_bidder_ip; ?></td>
            <td><span id="highest-bidder-ip"><?php echo $highest_bidder_ip; ?></span></td>
          </tr>
          <tr>
            <td><?php echo $text_last_bid_time; ?></td>
            <td><span id="last-bid-time"><?php echo $last_bid_time_text; ?></span></td>
          </tr>
          <tr>
            <td><?php echo $text_total_no_of_bid; ?></td>
            <td><span id="total-bid"><?php echo $total_no_of_bid; ?></span></td>
          </tr>
          <tr>
            <td><?php echo $text_total_auto_bid; ?></td>
            <td><span id="total-auto-bid"><?php echo $total_auto_bid; ?></span></td>
          </tr>
          <tr>
            <td><?php echo $text_reserve_met; ?></td>
            <td><span id="reserve-met"><?php echo $reserve_met_text; ?></span></td>
          </tr>
          <tr>
            <td><?php echo $text_buyout_made; ?></td>
            <td><span id="buyout-made"><?php echo $buyout_made_text; ?></span></td>
          </tr>
          <tr>
            <td><?php echo $text_extension_count; ?></td>
            <td><span id="extension-count"><?php echo $extension_count; ?></span></td>
          </tr>
          <tr>
            <td><?php echo $text_relisting_count; ?></td>
            <td><?php echo $relisting_count; ?></td>
          </tr>
          <?php if ($order_id) { ?>
          <tr>
            <td><?php echo $text_link_order_id; ?></td>
            <td><a href="<?php echo $order_href; ?>"><?php echo $order_text . ' #' . $order_id; ?></a></td>
          </tr>
		  <?php } else { ?>
          <tr>
            <td><?php echo $text_link_order_id; ?></td>
            <td><?php echo $order_text; ?></td>
          </tr>
		  <?php } ?>
          <tr>
            <td><?php echo $text_date_added; ?></td>
            <td><?php echo $date_added_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_date_modified; ?></td>
            <td><?php echo $date_modified_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_date_closed; ?></td>
            <td><?php echo $date_closed_text; ?></td>
          </tr>
        </table>
      </div>
      <div id="tab-setting" class="vtabs-content">
        <table class="form">
          <tr>
            <td><?php echo $text_product_image; ?></td>
            <td><img src="<?php echo $product_image; ?>" alt="<?php echo $product_name; ?>" title="<?php echo $product_name; ?>" style="padding: 1px; border: 1px solid #DDDDDD;" /></td>
          </tr>
          <tr>
            <td><?php echo $text_product_name; ?></td>
            <td><a href="<?php echo $product_href; ?>"><?php echo $product_name; ?></a></td>
          </tr>
          <tr>
            <td><?php echo $text_reserved_quantity; ?></td>
            <td><?php echo $reserved_quantity; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_starting_time; ?></td>
            <td><?php echo $starting_time_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_ending_time; ?></td>
            <td><?php echo $ending_time_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_starting_price; ?></td>
            <td><?php echo $starting_price_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_reserve_price; ?></td>
            <td><?php echo $reserve_price_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_buyout_price; ?></td>
            <td><?php echo $buyout_price_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_min_increment; ?></td>
            <td><?php echo $min_increment_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_allow_auto_bid; ?></td>
            <td><?php echo $allow_auto_bid_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_fast_fwd_auto_bids; ?></td>
            <td><?php echo $fast_fwd_auto_bids_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_allow_auto_extend; ?></td>
            <td><?php echo $allow_extension_text; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_extension_duration; ?></td>
            <td><?php echo $extension_duration; ?></td>
          </tr>
          <tr>
            <td><?php echo $text_extension_window; ?></td>
            <td><?php echo $extension_window; ?></td>
          </tr>
        </table>
      </div>
      <div id="tab-history" class="vtabs-content">
        <div id="history"></div>
      </div>
      <div id="tab-similar" class="vtabs-content">
        <div id="similar"></div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
$('#history .pagination a').live('click', function() {
	$('#history').load(this.href);
	return false;
});

$('#similar .pagination a').live('click', function() {
	$('#similar').load(this.href);
	return false;
});

$('#history').load('index.php?route=sale/auction/history&token=<?php echo $token; ?>&auction_id=<?php echo $auction_id; ?>');
$('#similar').load('index.php?route=sale/auction/similar&token=<?php echo $token; ?>&product_id=<?php echo $product_id; ?>&auction_id=<?php echo $auction_id; ?>');
//--></script> 
<script type="text/javascript"><!--
$('.vtabs a').tabs();
//--></script> 
<script src="view/javascript/sha1.hash.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript"><!--
var defaultCurrencyPrefix        = '<?php echo $symbol_left; ?>';
var defaultCurrencySuffix        = '<?php echo $symbol_right; ?>';
var defaultCurrencyDecimalPlace  = parseInt(<?php echo $decimal_place; ?>);
var defaultCurrencyDecimalPoint  = '<?php echo $decimal_point; ?>';
var defaultCurrencyThousandPoint = '<?php echo $thousand_point; ?>';
var statusAuctionStarting   = parseInt(<?php echo $auction_status_ids['starting']; ?>);
var statusAuctionRelisting  = parseInt(<?php echo $auction_status_ids['relisting']; ?>);
var statusAuctionInProgress = parseInt(<?php echo $auction_status_ids['inprogress']; ?>);
var statusAuctionExtended   = parseInt(<?php echo $auction_status_ids['extended']; ?>);
var statusAuctionWon        = parseInt(<?php echo $auction_status_ids['won']; ?>);
var statusAuctionExpired    = parseInt(<?php echo $auction_status_ids['expired']; ?>);
var statusAuctionSold       = parseInt(<?php echo $auction_status_ids['sold']; ?>);
var statusAuctionVoided     = parseInt(<?php echo $auction_status_ids['voided']; ?>);
var textYes                 = '<?php echo $text_yes; ?>';
var textNo                  = '<?php echo $text_no; ?>';
var textAuctionDay          = '<?php echo $text_day; ?>';
var textAuctionHour         = '<?php echo $text_hour; ?>';
var textAuctionMinute       = '<?php echo $text_minute; ?>';
var textAuctionSecond       = '<?php echo $text_second; ?>';
var textAuctionStarting     = '<?php echo $text_auction_statuses['starting']; ?>';
var textAuctionRelisting    = '<?php echo $text_auction_statuses['relisting']; ?>';
var textAuctionInProgress   = '<?php echo $text_auction_statuses['inprogress']; ?>';
var textAuctionExtended     = '<?php echo $text_auction_statuses['extended']; ?>';
var textAuctionWon          = '<?php echo $text_auction_statuses['won']; ?>';
var textAuctionExpired      = '<?php echo $text_auction_statuses['expired']; ?>';
var textAuctionSold         = '<?php echo $text_auction_statuses['sold']; ?>';
var textAuctionVoided       = '<?php echo $text_auction_statuses['voided']; ?>';
var textAuctionGetStarted   = '<?php echo $text_getstarted; ?>';
var textAuctionGoingGoing   = '<?php echo $text_goinggoing; ?>';
var serverTimeNow           = parseInt(<?php echo time(); ?>);
var clientTimeNow           = parseInt(Math.floor(new Date().getTime() / 1000));
var serverClientTimeDiff    = parseInt(serverTimeNow - clientTimeNow);
var lastPollingTime         = parseInt(clientTimeNow + serverClientTimeDiff);
var countDownTimer          = new Array();
var lastSetInterval         = new Array();
var pollAuctionData         = new Array();
var defaultPollingInterval  = 1000;
var defaultPollingTimeout   = 300000;
var defaultIntervalTime     = 1000;
var defaultRecallTime       = 500;
var defaultAnimationTime    = 1000;
var defaultAnimationFast    = 500;
var defaultCountDownTime    = 15;
var defaultCountDownFast    = 3;
function setDateTimeFormatShort(no_of_seconds) {
	var no_of_milliseconds = parseInt(no_of_seconds) * 1000;
	var ms_convert_to_date = new Date();
	if (no_of_milliseconds > 0) {
		ms_convert_to_date.setTime(no_of_milliseconds);
		// 20/10/2012 12:00:00 AM
		return Right('0' + String(ms_convert_to_date.getDate()), 2) + '/' + Right('0' + String(ms_convert_to_date.getMonth() + 1), 2) + '/' + Right('0' + String(ms_convert_to_date.getFullYear()), 4) + ' ' + Right('0' + String(ms_convert_to_date.getHours() > 12 ? ms_convert_to_date.getHours() - 12 : ms_convert_to_date.getHours() == 0 ? 12 : ms_convert_to_date.getHours()), 2) + ':' + Right('0' + String(ms_convert_to_date.getMinutes()), 2) + ':' + Right('0' + String(ms_convert_to_date.getSeconds()), 2) + ' ' + Right(String(ms_convert_to_date.toLocaleString()), 2);
	}
}
function countDownTimeBreaker(no_of_seconds) {
	var time_remaining_d = 0;
	var time_remaining_h = 0;
	var time_remaining_m = 0;
	var time_remaining_s = 0;
	time_remaining_d = Math.floor(no_of_seconds / 60 / 60 / 24);
	time_remaining_h = Math.floor(no_of_seconds / 60 / 60) - (time_remaining_d * 24);
	time_remaining_m = Math.floor(no_of_seconds / 60) - (time_remaining_h * 60) - (time_remaining_d * 24 * 60);
	time_remaining_s = Math.floor(no_of_seconds) - (time_remaining_m * 60) - (time_remaining_h * 60 * 60) - (time_remaining_d * 24 * 60 * 60);
	return String(time_remaining_d) + textAuctionDay + ' ' + Right('0' + String(time_remaining_h), 2) + textAuctionHour + ' ' + Right('0' + String(time_remaining_m), 2) + textAuctionMinute + ' ' + Right('0' + String(time_remaining_s), 2) + textAuctionSecond;
}
function Right(str, n) {
	if (n <= 0) { return ''; }
	else if (n > String(str).length) { return str; }
	else { return String(str).substring(String(str).length, String(str).length - n); }
}
function formatNumber(number, decimals, dec_point, thousands_sep) {
	number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
	var n = !isFinite(+number) ? 0 : +number;
	var prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
	var sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep;
	var dec = (typeof dec_point === 'undefined') ? '.' : dec_point;
	var s = '';
	toFixedFix = function(n, prec) {
		var k = Math.pow(10, prec);
		return '' + Math.round(n * k) / k;
	};
	s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
	if (s[0].length > 3) {
		s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
	}
	if ((s[1] || '').length < prec) {
		s[1] = s[1] || '';
		s[1] += new Array(prec - s[1].length + 1).join('0');
	}
	return s.join(dec);
}
function formatCurrency(amount) {
	return '' + defaultCurrencyPrefix + '' + formatNumber(amount, defaultCurrencyDecimalPlace, defaultCurrencyDecimalPoint, defaultCurrencyThousandPoint) + '' + defaultCurrencySuffix + '';
}
function formatYesNoText(indicator) {
	return indicator ? textYes : textNo;
}
function clearCountDownTimer(auction_id) {
	clearInterval(countDownTimer[auction_id]);
	countDownTimer[auction_id] = null;
	lastSetInterval[auction_id] = null;
}
function countDownAuction(recall, auction_id, starting_time, highest_bidder_id, highest_bidder_masked, highest_bidder_ip, highest_bid_amount, highest_bid_time, total_no_of_bid, total_auto_bid, reserve_met, buyout_made, real_ending_time, extension_count, auction_status_id) {
	var script_time_to_use = parseInt(Math.floor(new Date().getTime() / 1000) + serverClientTimeDiff);
	var is_active_auction = 0;
	var display_countdown = '';
	var time_difference = 0;
	if (recall) {
		// void current timer immediately to prevent function overlap with recall
		clearCountDownTimer(auction_id);
		// do an almost-immediate function recall for latest display updates
		countDownTimer[auction_id] = setInterval(function(){countDownAuction(0, auction_id, starting_time, highest_bidder_id, highest_bidder_masked, highest_bidder_ip, highest_bid_amount, highest_bid_time, total_no_of_bid, total_auto_bid, reserve_met, buyout_made, real_ending_time, extension_count, auction_status_id)}, defaultRecallTime);
		lastSetInterval[auction_id] = defaultRecallTime;
	} else {
		if (highest_bidder_id && $('#highest-bidder').attr('href') !== null && $('#highest-bidder').attr('href')) {
			var new_href_array = $('#highest-bidder').attr('href').split('&');
			var new_href = '';
			if (new_href_array instanceof Array && new_href_array.length > 0) {
				for (var href_param = 0; href_param < new_href_array.length - 1; href_param++) {
					new_href = new_href + String(new_href_array[href_param]) + '&';
				}
				new_href = new_href + 'customer_id=' + highest_bidder_id;
				if ($('#highest-bidder').attr('href') != new_href) {
					$('#highest-bidder').attr('href', new_href);
				}
			}
		}
		if (highest_bidder_id && $('#highest-bidder').html() != highest_bidder_masked) {
			$('#highest-bidder').html(highest_bidder_masked);
			$('#highest-bidder').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if (highest_bidder_id && $('#highest-bidder-ip').html() != highest_bidder_ip) {
			$('#highest-bidder-ip').html(highest_bidder_ip);
			$('#highest-bidder-ip').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if (highest_bidder_id && $('#highest-bid').html() != formatCurrency(highest_bid_amount)) {
			$('#highest-bid').html(formatCurrency(highest_bid_amount));
			$('#highest-bid').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if (highest_bidder_id && $('#last-bid-time').html() != setDateTimeFormatShort(highest_bid_time)) {
			$('#last-bid-time').html(setDateTimeFormatShort(highest_bid_time));
			$('#last-bid-time').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if ($('#total-bid').html() != total_no_of_bid) {
			$('#total-bid').html(total_no_of_bid);
			$('#total-bid').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
			$('#history').load('index.php?route=sale/auction/history&token=<?php echo $token; ?>&auction_id=<?php echo $auction_id; ?>');
		}
		if ($('#total-auto-bid').html() != total_auto_bid) {
			$('#total-auto-bid').html(total_auto_bid);
			$('#total-auto-bid').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if ($('#reserve-met').html() != formatYesNoText(reserve_met)) {
			$('#reserve-met').html(formatYesNoText(reserve_met));
			$('#reserve-met').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if ($('#buyout-made').html() != formatYesNoText(buyout_made)) {
			$('#buyout-made').html(formatYesNoText(buyout_made));
			$('#buyout-made').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if ($('#real-ending-time').html() != setDateTimeFormatShort(real_ending_time)) {
			$('#real-ending-time').html(setDateTimeFormatShort(real_ending_time));
			$('#real-ending-time').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if ($('#extension-count').html() != extension_count) {
			$('#extension-count').html(extension_count);
			$('#extension-count').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if (auction_status_id == statusAuctionVoided && $('#auction-status').html() != textAuctionVoided) {
			$('#auction-status').html(textAuctionVoided);
			$('#auction-status').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		} else if (auction_status_id == statusAuctionSold && $('#auction-status').html() != textAuctionSold) {
			$('#auction-status').html(textAuctionSold);
			$('#auction-status').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		} else if (auction_status_id == statusAuctionExpired && $('#auction-status').html() != textAuctionExpired) {
			$('#auction-status').html(textAuctionExpired);
			$('#auction-status').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		} else if (auction_status_id == statusAuctionWon && $('#auction-status').html() != textAuctionWon) {
			$('#auction-status').html(textAuctionWon);
			$('#auction-status').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		} else if (auction_status_id == statusAuctionExtended && $('#auction-status').html() != textAuctionExtended) {
			$('#auction-status').html(textAuctionExtended);
			$('#auction-status').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		} else if (auction_status_id == statusAuctionInProgress && $('#auction-status').html() != textAuctionInProgress) {
			$('#auction-status').html(textAuctionInProgress);
			$('#auction-status').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		} else if (auction_status_id == statusAuctionRelisting && $('#auction-status').html() != textAuctionRelisting) {
			$('#auction-status').html(textAuctionRelisting);
			$('#auction-status').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		} else if (auction_status_id == statusAuctionStarting && $('#auction-status').html() != textAuctionStarting) {
			$('#auction-status').html(textAuctionStarting);
			$('#auction-status').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
		}
		if (auction_status_id == statusAuctionInProgress || auction_status_id == statusAuctionExtended) {
			time_difference = parseInt(real_ending_time - script_time_to_use);
			if (time_difference > 0) {
				display_countdown = countDownTimeBreaker(time_difference);
			} else {
				display_countdown = textAuctionGoingGoing;
			}
			is_active_auction++;
		} else if (auction_status_id == statusAuctionStarting || auction_status_id == statusAuctionRelisting) {
			time_difference = parseInt(starting_time - script_time_to_use);
			if (time_difference > 0) {
				display_countdown = '-' + countDownTimeBreaker(time_difference);
			} else {
				display_countdown = textAuctionGetStarted;
			}
			is_active_auction++;
		}
		if (is_active_auction) {
			$('#auction-timeleft').html(display_countdown);
			if (time_difference <= defaultCountDownFast && time_difference >= 0 && (auction_status_id == statusAuctionStarting || auction_status_id == statusAuctionRelisting || auction_status_id == statusAuctionInProgress || auction_status_id == statusAuctionExtended)) {
				$('#auction-timeleft').stop(true, true).queue(function(){$(this).effect('pulsate', {times: 2}, defaultAnimationFast); $(this).dequeue();});
			} else if (time_difference <= defaultCountDownTime && time_difference >= 0 && (auction_status_id == statusAuctionStarting || auction_status_id == statusAuctionRelisting || auction_status_id == statusAuctionInProgress || auction_status_id == statusAuctionExtended)) {
				$('#auction-timeleft').stop(true, true).queue(function(){$(this).effect('pulsate', {times: 1}, defaultAnimationTime); $(this).dequeue();});
			} else {
				$('#auction-timeleft').stop(true, true);
			}
			// helps resetting timer to normal state after a function recall
			if (lastSetInterval[auction_id] != defaultIntervalTime) {
				clearCountDownTimer(auction_id);
				countDownTimer[auction_id] = setInterval(function(){countDownAuction(0, auction_id, starting_time, highest_bidder_id, highest_bidder_masked, highest_bidder_ip, highest_bid_amount, highest_bid_time, total_no_of_bid, total_auto_bid, reserve_met, buyout_made, real_ending_time, extension_count, auction_status_id)}, defaultIntervalTime);
				lastSetInterval[auction_id] = defaultIntervalTime;
			}
		} else {
			$('#auction-timeleft').stop(true, true).css({'color': '', 'font-weight': 'normal'}).html(setRealEndingDateTime(real_ending_time));
			$('#auction-timeleft').parent().stop(true, true).queue(function(){$(this).effect('highlight', {}, defaultAnimationTime); $(this).dequeue();});
			clearCountDownTimer(auction_id);
			location.reload(true);
		}
	}
}
function pollAuctionGlobal(auction_ids) {
	var auth = encodeURIComponent(Sha1.hash(String(parseInt(Math.floor(new Date().getTime() / 1000) + serverClientTimeDiff))));
	var curl = '../index.php?route=product/auction/auctionglobalpoll&auth=' + auth + '&auction_ids=' + auction_ids + '&last_polled=' + lastPollingTime + '&admin=1';
	lastPollingTime = parseInt(Math.floor(new Date().getTime() / 1000) + serverClientTimeDiff);
	$.ajax({
		url: curl,
		dataType: 'json',
		cache: false,
		success: function(auctions) {
			if (auctions instanceof Array && auctions.length > 0) {
				for (var auction_record = 0; auction_record < auctions.length; auction_record++) {
					var auction_id = parseInt(auctions[auction_record].auction_id);
					var highest_bidder_id = parseInt(auctions[auction_record].highest_bidder_id);
					var highest_bidder_masked = String(auctions[auction_record].highest_bidder_masked);
					var highest_bidder_ip = String(auctions[auction_record].highest_bidder_ip);
					var highest_bid_amount = parseFloat(auctions[auction_record].highest_bid_amount);
					var highest_bid_time = parseInt(auctions[auction_record].highest_bid_time);
					var total_no_of_bid = parseInt(auctions[auction_record].total_no_of_bid);
					var total_auto_bid = parseInt(auctions[auction_record].total_auto_bid);
					var reserve_met = parseInt(auctions[auction_record].reserve_met);
					var buyout_made = parseInt(auctions[auction_record].buyout_made);
					var real_ending_time = parseInt(auctions[auction_record].real_ending_time);
					var extension_count = parseInt(auctions[auction_record].extension_count);
					var auction_status_id = parseInt(auctions[auction_record].auction_status_id);
					if (auction_id) {
						var starting_time = parseInt(pollAuctionData[auction_id].starting_time);
						countDownAuction(1, auction_id, starting_time, highest_bidder_id, highest_bidder_masked, highest_bidder_ip, highest_bid_amount, highest_bid_time, total_no_of_bid, total_auto_bid, reserve_met, buyout_made, real_ending_time, extension_count, auction_status_id);
					}
				}
			}
		}
	});
}
<?php $auction_ids = array(); ?>
<?php if ($auction_status_id == $auction_status_ids['starting'] || $auction_status_id == $auction_status_ids['relisting'] || $auction_status_id == $auction_status_ids['inprogress'] || $auction_status_id == $auction_status_ids['extended']) { ?>
<?php $auction_ids[] = $auction_id; ?>
countDownTimer[<?php echo $auction_id; ?>] = setInterval(function(){countDownAuction(0, <?php echo $auction_id; ?>, <?php echo $starting_time; ?>, <?php echo $highest_bidder_id; ?>, '<?php echo $highest_bidder_masked; ?>', '<?php echo $highest_bidder_ip; ?>', <?php echo $highest_bid_amount; ?>, <?php echo $highest_bid_time; ?>, <?php echo $total_no_of_bid; ?>, <?php echo $total_auto_bid; ?>, <?php echo $reserve_met; ?>, <?php echo $buyout_made; ?>, <?php echo $real_ending_time; ?>, <?php echo $extension_count; ?>, <?php echo $auction_status_id; ?>)}, defaultIntervalTime);
lastSetInterval[<?php echo $auction_id; ?>] = defaultIntervalTime;
pollAuctionData[<?php echo $auction_id; ?>] = {auction_id: <?php echo $auction_id; ?>, starting_time: <?php echo $starting_time; ?>};
<?php } ?>
<?php if ($auction_ids) { ?>
setInterval(function(){pollAuctionGlobal('<?php echo implode(',', $auction_ids); ?>')}, defaultPollingInterval);
setTimeout(function(){location.reload(true)}, defaultPollingTimeout);
<?php } ?>
//--></script>
<?php echo $footer; ?>