$(document).ready(function() { fetchTimestamp = function() { return parseInt($('#timezer').text()); }; var auctionUpdateTime = 10; var isOctionEnded = 0; if ($('#frequenzer')) auctionUpdateTime = parseInt($('#frequenzer').text()); auctionUpdateTime = auctionUpdateTime*1000; var auctions = ''; $('.auction-product').each(function() { var auctionId = $(this).attr('id'); var auctionTitle = $(this).attr('title'); var counter = $('#' + auctionId + ' .countdown'); if (counter) auctions = auctions + auctionId + '=' + auctionTitle + '&'; }); var auction_status_url; if ($('#closedup').length) auction_status_url = '../status.php?'+auctions+'cu=1&ms='; else if ($('#scheduledup').length) auction_status_url = '../status.php?'+auctions+'fu=1&ms='; else if ($('#seatup').length) auction_status_url = '../status.php?'+auctions+'su=1&ms='; else if ($('#bidhis_screen').length) auction_status_url = '../status.php?'+auctions+'hi=1&hi_id='+$('#bidhis_screen').attr('title')+'&ms='; else auction_status_url = '../status.php?'+auctions+'ms='; setInterval(function() { if (auctions) { var auction_status_url_time = auction_status_url + new Date().getTime(); $.ajax({ url: auction_status_url_time, dataType: 'json', type: 'POST', timeout: 900, data: auctions, success: function(data) { $.each(data, function(i, item) { var auctionEndTime = $('#' + item.Auction.element + ' .countdown').attr('title'); var auctionLatestBidder = $('#' + item.Auction.element + ' .bid-bidder').text(); var auctionCountdown = $('#' + item.Auction.element + ' .countdown'); var auctionClosesOn = $('#' + item.Auction.element + ' .closes-on'); if (document.getElementById('bidhis_screen') && item.LastBid.username != '' && item.Auction.id == $('#bidhis_screen').attr('title')) { $('#bidhis_screen tbody tr').remove(); var rowCounter = 0; $.each(item.Histories, function(n,tRow) { if ($('#bidhis_screen p').text()) $('#bidhis_screen p').remove(); if (rowCounter == 0) var row = '' + tRow.Bid.created + '' + tRow.User.username + '' + tRow.Bid.description + ''; else var row = '' + tRow.Bid.created + '' + tRow.User.username + '' + tRow.Bid.description + ''; $('#bidhis_screen tbody').append(row); if (document.getElementById('stats_screen')) $('#stats_screen').html(item.Auction.biddersUsernameList); rowCounter++; }); } if (auctionLatestBidder != item.LastBid.username) { auctionCountdown.attr('title', item.Auction.end_time); $('#' + item.Auction.element + ' .bid-bidder').html(item.LastBid.username); $('#' + item.Auction.element + ' .bid-price').html(item.Auction.start_price); $('#' + item.Auction.element + ' .bid-price2').html(item.Auction.start_price); $('#' + item.Auction.element + ' .bid-price3').html(item.Auction.start_price); auctionClosesOn.text(item.Auction.closes_on); if (auctionLatestBidder!='') $('#' + item.Auction.element + ' .bid-price').css('backgroundColor','#FD2B98'); if (auctionLatestBidder!='') $('#' + item.Auction.element + ' .bid-price').css('backgroundColor','#FFF'); if (auctionLatestBidder!='') $('#' + item.Auction.element + ' .bid-price2').css('backgroundColor','#FD2B98'); if (auctionLatestBidder!='') $('#' + item.Auction.element + ' .bid-price2').css('backgroundColor','#FFF'); if (auctionLatestBidder!='') $('#' + item.Auction.element + ' .bid-price, #' + item.Auction.element + ' .bid-price2').animate({ backgroundColor: '#FD2B98' }, 500).animate({backgroundColor: '#FFF'}, 1000); } $('#' + item.Auction.element + ' .bid-savings-percentage').html(item.Auction.savings.percentage); $('#' + item.Auction.element + ' .bid-savings-price').html(item.Auction.savings.price); $('#' + item.Auction.element + ' .bid-savings-count').html(item.Auction.savings.count); $('#' + item.Auction.element + ' .bid-savings-countprice').html(item.Auction.savings.countprice); $('#' + item.Auction.element + ' .bid-savings-countbuy').html(item.Auction.savings.countbuy); if (item.Auction.peak_only==1 && item.Auction.isPeakNow==0) { auctionCountdown.text(''); $('#' + item.Auction.element + ' .nash-button a').hide(); $('#' + item.Auction.element + ' .nash-button p').remove(); if (item.Auction.time_left > 0 && item.Auction.closed == 0) $('#' + item.Auction.element + ' .nash-button').append('

'); } else { if ((item.Auction.end_time - item.Auction.serverTimestamp) > 0) { auctionCountdown.text(item.Auction.end_time_string); if (item.Auction.time_left <= 10) { auctionCountdown.css('color','#FD2B98'); } else if ($('#scheduledup').length) { $('#' + item.Auction.element + ' .countdown').html(''); } else { auctionCountdown.css('color','#000000'); } } if ($('#' + item.Auction.element + ' .nash-button p').text()!="") { $('#' + item.Auction.element + ' .nash-button a').show(); $('#' + item.Auction.element + ' .nash-button p').remove(); } $('#' + item.Auction.element + ' .nash-button').append('

 

'); } if ((item.Auction.end_time - item.Auction.serverTimestamp) <= 0 || item.Auction.closed == 1) { auctionCountdown.css('color','#000000'); auctionCountdown.text(''); isOctionEnded = 1; } }); }, error: function (XMLHttpRequest,textStatus,errorThrown) { $('.countdown').each(function() { var current = $(this).text(); var lastGoodCurrent; if (current != '' && current != '' && current != '') { var day_time = ''; var day = ''; var time = ''; if (current.indexOf('d') > 0) { day_time = current.split(' '); day = day_time[0]; time = day_time[1].split(':'); } else { time = current.split(':'); } var hour = parseInt(time[0]); var minute = parseInt(time[1]); var second = parseInt(time[2]); if (second > 0) { second = second - 1; } else if (second == 0) { if (minute > 0) { second = 59; minute = minute - 1; }} if (hour < 10) hour = '0' + hour; if (minute < 10) minute = '0' + minute; if (second < 10) second = '0' + second; if (current == '') { $(this).text(''); } else if (isNaN(hour) || isNaN(minute) || isNaN(second)) { $(this).text(''); } else { if (day != '') $(this).text(day + ' ' + hour + ':' + minute + ':' + second); else $(this).text(hour + ':' + minute + ':' + second); } } }); } }); }}, auctionUpdateTime); $('.nash-button-link').click(function() { var auctionElement = 'tslice' + $(this).attr('title'); var bidButton = $('#' + auctionElement + ' .nash-button'); var bidMessage = $('#' + auctionElement + ' .nash-message'); bidButton.hide(1); $.ajax({ url: $(this).attr('href') + '&' + new Date().getTime(), dataType: 'json', success: function(data) { bidMessage.html(data.Auction.message).show(1).animate({opacity: 1.0}, 2000).hide(1); bidButton.show(1); } }); return false; }); $("#report tr:odd").addClass("odd"); $("#report tr:not(.odd)").hide(); $("#report tr:first-child").show(); $("#report tr.odd").click(function(){ $(this).next("tr").toggle(); }); }); function roll_over(img_name,img_src) { document[img_name].src = img_src; } function submitForm() { if (document.mainsearchform.s.value == ""||document.mainsearchform.s.value == "") return false; else document.mainsearchform.submit(); } function submitForm2() { if (document.tmaticsform.bidfrom.value == ""||document.tmaticsform.bidto.value == ""||document.tmaticsform.nbbids.value == "") return false; else document.tmaticsform.submit(); } function checkAll(formId,cName,check) { for (i = 0,n = formId.elements.length; i < n; i++) { if (formId.elements[i].className.indexOf(cName) != -1) formId.elements[i].checked = check; }} if (document.layers) window.captureEvents(Event.MOUSEMOVE); window.onMouseMove = resetTimer(); var tID = ""; function resetTimer() { clearTimeout(tID); tID = setTimeout('executeTimer()',1800000); } function executeTimer() { location.href = "noactivity/index.php"; } window.onload = pageInit; function pageInit() { tID = setTimeout('executeTimer()',1800000); } var str1 = ""; var str2 = ""; var str3 = ""; var str4 = ""; var str5 = ""; var str6 = ""; var str7 = ""; var str8 = " "; var str8 = " "; var str9 = " "; var str9 = " "; var str10 = ""; var burl = "../index.php?page=auctionbid&id="; function bidit(aid) { http.open("GET",burl+aid,true); http.onreadystatechange = bhandleHttpResponse; http.send(null); } function bhandleHttpResponse() { if (http.readyState==4) { bresults = http.responseText; if (bresults.search(str1) > -1) { document.getElementById('leftTenders').innerHTML = "0"; alert(''); window.location = "refill.html"; } else if (bresults.search(str2) > -1) { alert(''); } else if (bresults.search(str3) > -1) { alert(''); window.location = "ended.html"; } else if (bresults.search(str4) > -1) { alert(''); } else if (bresults.search(str5) > -1) { alert(''); } else if (bresults.search(str6) > -1) { } else if (bresults.search(str7) > -1) { alert(''); window.location = "format-13-Beginner-auctions.html"; } else if (bresults.search(str8) > -1) { alert(' '); alert(' '); } else if (bresults.search(str9) > -1) { alert(' '); alert(' '); } else if (bresults.search(str10) > -1) { alert(''); }}} var strLTP1 = ""; var strLTP2 = ""; var urlLTP = "../check_linktopage.php?param="; function updateLTP() { var nameLTP = document.getElementById("linktopageX").value; http.open("GET",urlLTP+escape(nameLTP),true); http.onreadystatechange = handleHttpResponseLTP; http.send(null); } function handleHttpResponseLTP() { if (http.readyState==4) { resultsLTP = http.responseText; if (resultsLTP.search(strLTP2) > -1) { document.getElementById('displayer_linktopageX').innerHTML = ""; document.getElementById("linktobannerX").className = "puRPfields"; document.getElementById("linktobannerX").disabled = false; } else { alert(''); document.getElementById('displayer_linktopageX').innerHTML = ""; document.getElementById('linktopageX').value = ""; document.getElementById("linktobannerX").className = "puRPfields disabled"; document.getElementById("landinglinkX").className = "puRPfields disabled"; document.getElementById("linktobannerX").disabled = true; document.getElementById("landinglinkX").disabled = true; }}} function getHTTPObject() { var xmlhttp; if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } var http = getHTTPObject();