function onUpdatePanelFinished_AuctionDataPanel() {
var startingPrice = parseFloat($('#data_mb').val
()); var highestBid = parseFloat($('#data_hbv').val() ); var myBid = parseFloat($('#data_mbv').val()); var reservePrice = parseFloat($('#data_rp').val( ));
var barHolderWidth = $('.barholder').css('width' ).replace('px', ''); var barWidth = $('.bar').css('width').replace('p x', ''); var hbvWidth = $('.pointer').css('width').replac e('px', ''); var mbvWidth = $('.mypointer').css('width').repl ace('px', ''); //handle var startingPriceP = getPositionOnBar(startingPr ice, reservePrice); startingPriceP = startingPriceP < 0 ? 0 : starti ngPriceP; startingPriceP = startingPriceP > barWidth ? bar Width : startingPriceP; //pointer var highestBidP = getPositionOnBar(highestBid, r eservePrice); highestBidP = highestBidP < 0 ? 0 : highestBidP; highestBidP = highestBidP > barWidth ? barWidth : highestBidP; //mypointer var myBidP = getPositionOnBar(myBid, reservePric e); myBidP = myBidP < 0 ? 0 : myBidP; myBidP = myBidP > barWidth ? barWidth : myBidP; var barPosition; if (highestBid >= startingPrice) { //+ (highestBidP + hbvWidth >= barHolderWidt h ? parseFloat(hbvWidth) : 0) barPosition = parseFloat(highestBidP) ; //g ive some extra space to the right side (hbvWidth = 120:the width of pointer) } else { barPosition = parseFloat(startingPriceP); } barPosition = barPosition > barWidth ? barWidth : barPosition; //don't scroll more than the total width barPosition = parseFloat(barPosition) - parseFlo at(barHolderWidth); //scroll back viewport.width pixels in order to make the des ired part visible and not squeezed to the left. barPosition = barPosition < 0 ? 0 : barPosition; //But also, we should also never deattach the bar from the left wall //var scrollBG = parseFloat(highestBidP) >= (par seFloat(barPosition) + (parseFloat(barHolderWidth) / 2));
var barLeft = -barPosition ; var handleLeft = startingPriceP - barPosition ; var pointerLeft = highestBidP - barPosition ; var mypointerLeft = myBidP - barPosition ; //do the animations if the values have changed if(parseFloat($('.bar').attr('target_left')) != barLeft){ $('.bar').animate({ 'left': barLeft }, { dur ation: 1000, queue: false}); } if (parseFloat($('.handle h2').attr('target_left ')) != handleLeft) { $('.handle h2').animate({ 'left': handleLeft , 'z-index': 1 } , { duration: 1500 , queue: false , progress: fun ction () { //$(this).c hildren('.async_value').text(getPriceFromPositionOnBar(parseFloat($(this).css('l eft').replace('px', '')),reservePrice)); if (parseFl oat($(this).css('left').replace('px', '')) < 0