//Copyright ©2009 ProtoPenny. All rights reserved. session_start(); include_once("../config/config.php"); include_once("../languages/".$setts['site_lang'].".php"); if ($_SESSION['commonAccess']==true) { header("Content-type: text/javascript");?> $(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 != '=$lang['ptp38'];?>' && 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 = '
=$lang['ptp241'];?>
'); } 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('=$lang['ptp242'];?>'); } 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('=$lang['ptp112'];?>'); isOctionEnded = 1; } }); }, error: function (XMLHttpRequest,textStatus,errorThrown) { $('.countdown').each(function() { var current = $(this).text(); var lastGoodCurrent; if (current != '=$lang['ptp242'];?>' && current != '=$lang['ptp243'];?>' && current != '=$lang['ptp1139'];?>') { 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 == '=$lang['ptp112'];?>') { $(this).text('=$lang['ptp112'];?>'); } else if (isNaN(hour) || isNaN(minute) || isNaN(second)) { $(this).text('=$lang['ptp244'];?>'); } 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 == "=$lang['ptp245'];?>") 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 (!$_SESSION['isadmin']||$_SESSION['isadmin']==false) { ?> if (document.layers) window.captureEvents(Event.MOUSEMOVE); window.onMouseMove = resetTimer(); var tID = ""; function resetTimer() { clearTimeout(tID); tID = setTimeout('executeTimer()',1800000); } function executeTimer() { location.href = "=$path;?>noactivity/index.php"; } window.onload = pageInit; function pageInit() { tID = setTimeout('executeTimer()',1800000); } } ?> var str1 = "=$lang['ptp16'];?>"; var str2 = "=$lang['ptp17'];?>"; var str3 = "=$lang['ptp19'];?>"; var str4 = "=$lang['ptp18'];?>"; var str5 = "=$lang['ptp20'];?>"; var str6 = "=$lang['ptp22'];?>"; var str7 = "=$lang['ptp21'];?>"; if ($setts['nbItemsBeginnersCanPlaceBids']==1) { ?> var str8 = "=$lang['ptp23'];?> =$setts['nbItemsBeginnersCanPlaceBids'];?> =$lang['ptp24'];?>"; } else { ?> var str8 = "=$lang['ptp23']?> =$setts['nbItemsBeginnersCanPlaceBids'];?> =$lang['ptp25'];?>"; } ?> if ($setts['nbItemsNonBeginnersCanPlaceBids']==1) { ?> var str9 = "=$lang['ptp26'];?> =$setts['nbItemsNonBeginnersCanPlaceBids'];?> =$lang['ptp28'];?>"; } else { ?> var str9 = "=$lang['ptp26'];?> =$setts['nbItemsNonBeginnersCanPlaceBids'];?> =$lang['ptp27'];?>"; } ?> var str10 = "=$lang['ptp1148'];?>"; 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('=$lang['ptp16'];?>'); window.location = "refill.html"; } else if (bresults.search(str2) > -1) { alert('=$lang['ptp17'];?>'); } else if (bresults.search(str3) > -1) { alert('=$lang['ptp19'];?>'); window.location = "ended.html"; } else if (bresults.search(str4) > -1) { alert('=$lang['ptp18'];?>'); } else if (bresults.search(str5) > -1) { alert('=$lang['ptp20'];?>'); } else if (bresults.search(str6) > -1) { } else if (bresults.search(str7) > -1) { alert('=$lang['ptp21'];?>'); window.location = "format-13-Beginner-auctions.html"; } else if (bresults.search(str8) > -1) { if ($setts['nbItemsBeginnersCanPlaceBids']==1) { ?> alert('=$lang['ptp23'];?> =$setts['nbItemsBeginnersCanPlaceBids'];?> =$lang['ptp24'];?>'); } else { ?> alert('=$lang['ptp23'];?> =$setts['nbItemsBeginnersCanPlaceBids'];?> =$lang['ptp25'];?>'); } ?> } else if (bresults.search(str9) > -1) { if ($setts['nbItemsNonBeginnersCanPlaceBids']==1) { ?> alert('=$lang['ptp26'];?> =$setts['nbItemsNonBeginnersCanPlaceBids'];?> =$lang['ptp28'];?>'); } else { ?> alert('=$lang['ptp26'];?> =$setts['nbItemsNonBeginnersCanPlaceBids'];?> =$lang['ptp27'];?>'); } ?> } else if (bresults.search(str10) > -1) { alert('=$lang['ptp1148'];?>'); }}} if ($setts['islinkpartnerpage']==1&&$setts['is_autolpbinsert']==1) { ?> var strLTP1 = "=$lang['ptp246'];?>"; var strLTP2 = "=$lang['ptp247'];?>"; 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 = "=$lang['ptp247'];?>"; document.getElementById("linktobannerX").className = "puRPfields"; document.getElementById("linktobannerX").disabled = false; } else { alert('=$lang['ptp246'];?>'); document.getElementById('displayer_linktopageX').innerHTML = "=$lang['ptp246'];?>"; 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(); $_SESSION['commonAccess'] = false; } ?>