jQuery.noConflict();
jQuery(document).ready(function($){

    // Variable to hold auction data
    var auctions = '';

    // Collecting auction data, the layer id and auction id
    $('.auction-item').each(function(){
        var auctionId    = $(this).attr('id');
        var auctionTitle = $(this).attr('title');

        if($('#' + auctionId + ' .countdown').length){
            // collect the id for post data
            auctions = auctions + auctionId + '=' + auctionTitle + '&';
        }
    });

    // additional object
    var getstatus_url_time;
    var getstatus_url;

    getstatus_url = '/getstatus.php?ms=';

    // Do the loop when auction available only
    if(auctions){
        setInterval(function(){
            getstatus_url_time = getstatus_url + new Date().getTime();
            $.ajax({
                url: getstatus_url_time,
                dataType: 'json',
                type: 'POST',
                data: auctions,
                success: function(data){
                    $.each(data, function(i, item){
						$('#auction_' + item.id + ' .countdown').html(item.countdown);
                    });
                }
            });
        }, 1000);
    }
});
