var timer=null,hpBannerTimer=null,hpBannerTimerSwitch=5e3,refreshTimer=null,primaryTimer=null,secondaryTimer=null,timeLeftArray=[],primaryAuctionInterval=495,secondaryAuctionInterval=495,refreshTimerTimeout=9e5,HpNavIndex=1,HpNavIndexSize=3,refreshTimerType=null;function hpDropDownListChange(b){var a=$(b.target||b.srcElement);if(a.val()==0)document.location.href="/";else if(a.val()==1)document.location.href="/auctions/beginner";else if(a.val()==2)document.location.href="/auctions/rewards";else if(a.val()==3)document.location.href="/myaccount.aspx";else if(a.val()==4)document.location.href="/winners.aspx"}function hidediv(a){el=document.getElementById(a);if(el){if(el.style.display=="block")el.style.display="none"}else el.style.display="none"}function selectValue(b){var a=$(b.currentTarget);if(a.hasClass("selected")){a.removeClass("selected");a.mouseout(function(){$(this).animate({fontSize:"15px"},50)})}else if(!a.hasClass("notunique")&&!a.hasClass("lowestunique")&&!a.hasClass("higherunique")){a.addClass("selected");a.unbind("mouseout")}}function SetLoadingBidBoard(){$("#ctl00_MainContent_BidControlOpenPanel").addClass("ap_main_left_desc_bidcontrol_selected");$("#ctl00_MainContent_BidBoardPanel").addClass("ap_main_left_desc_bidboardpanel_selected")}function ClearLoadingBidBoard(){$("#ctl00_MainContent_BidControlOpenPanel").removeClass("ap_main_left_desc_bidcontrol_selected");$("#ctl00_MainContent_BidBoardPanel").removeClass("ap_main_left_desc_bidboardpanel_selected")}function clearValue(){$(".bidrow td").removeClass("selected")}function placebidboard(d){var c=$("#ctl00_MainContent_PrimaryAuctionId").text(),e=$("#ctl00_MainContent_UserId").text();$("#ctl00_MainContent_StatusBox").is(":visible")&&$("#ctl00_MainContent_StatusBox").slideToggle();if($(".bidrow td.selected").length==0){SetErrorStatusBox("No bids selected");return}SetLoadingBidBoard();DisableBidButtons();var a="";$(".bidrow td.selected").each(function(){a+=$(this).attr("value")+","});try{var b=_gat._getTracker("UA-12208848-1");b._trackPageview("/activeuser_funnel/placebid.aspx")}catch(f){}$.ajax({url:"http://"+window.location.hostname+"/placebids.aspx?aid="+c+"&uid="+e+"&bidtype=multibid&price="+a+"&confirm="+d,cache:false,success:ParseBidBoardStatusMessage,error:ErrorBidStatusMessage,timeout:5e3})}function ParseBidBoardStatusMessage(p){ClearLoadingBidBoard();SetBidButtons();var a=eval("("+p+")");if(a.ErrorMessage!=null){SetErrorStatusBox(a.ErrorMessage);return false}else{$(".selected").removeClass("selected");!a.IsTimedAuction&&SetHintStatusBox(a.HintMessage);SetHintRange(a.HintMinRange,a.HintMaxRange);UpdateBidBoardTable(a.BidStatusList);$("#ctl00_CreditsCountLabel").text("$"+a.Bids.toFixed(2));$("#ctl00_RewardCreditsCountLabel").text("$"+a.RewardBids.toFixed(2));$("#ctl00_MainContent_UserStatusLabel")[0].innerHTML=a.UserStatusMessage;var k=$("#ctl00_MainContent_MaxBidComplete");if(k.length>0&&a.IsHot==true)k.innerHTML=a.BidsLeft;$("#ctl00_MainContent_TotalCost")[0].innerHTML=a.BidCost;$("#ctl00_MainContent_Savings")[0].innerHTML=a.Savings;UpdateCurrentBidders(a.LastBidders);(a.IsHot==true||a.IsUserOverLimit)&&$("#ctl00_MainContent_BidCostLabel").text(a.ClosingBidPrice).css({color:"red","font-weight":"bold"});if(a.LowRange>0&&a.HighRange>0){$("#ctl00_MainContent_LowHint").text(a.LowRange);$("#ctl00_MainContent_HighHint").text(a.HighRange)}var g=null,c=$("#ctl00_MainContent__TimeLeft");if(c.length>0&&p.TimeLeftFormatted!=c[0].innerHTML){g=c[0].innerHTML;c[0].innerHTML=a.TimeLeftFormatted;a.TimeLeft<=30&&c.css({"font-weight":"bold",color:"red"})}if(a.TimeLeft<=30&&$("#ctl00_MainContent_TimerLimitedImage").hasClass("hidden")){$("#ctl00_MainContent_TimerImage").addClass("hidden");$("#ctl00_MainContent_TimerLimitedImage").removeClass("hidden")}var n=false,e=$("#ctl00_MainContent__Winner");if(e.length>0&&e[0].innerHTML!=a.WinnerName){n=true;e[0].innerHTML=a.WinnerName}var o=false,f=$("#ctl00_MainContent_PercentCompleted");if(f.length>0&&f[0].innerHTML!=a.PercentComplete){o=true;f[0].innerHTML=a.PercentComplete}var j=false,b=$("#ctl00_MainContent_PriceRangeLabel");if(b.length>0&&b.length>0&&b[0].innerHTML!=a.BidsLeft){j=true;b[0].innerHTML=a.BidsLeft}var i=false,d=$("#ctl00_MainContent_TimerStatusLabel");if(g){var m=TimeToSeconds(g),l=a.TimeLeft-m;if(l>0){if(m<=30)d[0].innerHTML="Bids Placed : Time @30 secs";else{var h=Math.round(l/30);if(h==1)d[0].innerHTML="1 Bid : Time +30 secs";else d[0].innerHTML="{0} Bids : Time +{1} secs".format(h,h*30)}i=true}}o&&f.css({backgroundColor:"yellow"}).animate({backgroundColor:"white"},1500);j&&b.css({backgroundColor:"yellow"}).animate({backgroundColor:"white"},1500);n&&e.animate({backgroundColor:"yellow"}).animate({backgroundColor:"white"},1500);i&&d.css({color:"black"}).animate({color:"white"},2e3)}SetBidButtons()}function UpdateCurrentBidders(b){var a="";if(b.length==0)a='<tr style="font-size: 13px;"><td colspan="2" style="text-align: left;"><i>Too early to show!</i></td></tr>';else $.each(b,function(c,b){a+='<tr style="font-size: 12px;"><td style="width: 70px; text-align: left;">'+b.Name+"</td><td>"+b.BidTimeFormatted+"</td></tr>"});$("#ctl00_MainContent_LastBiddersTable").text("").append(a);$("#ctl00_MainContent_AuctionParticipantsLabel")[0].innerHTML="Current Bidders"}function UpdateBidBoardTable(a){if(a==null)return;$.each(a,function(d,b){var c="#price_"+Math.round(b.Price.toFixed(2)*100),a=$(c);if(b.Status=="1")a.removeClass().addClass("notunique");else if(b.Status=="2")a.removeClass().addClass("lowestunique");else b.Status=="3"&&a.removeClass().addClass("higherunique");a.attr("style","font-size:15px").unbind()})}function ToggleBidPackage(d){var c=(d.target||d.srcElement).id;$("#ctl00_MainContent_RadioButtonList1_0").parent().parent().removeClass();$("#ctl00_MainContent_RadioButtonList1_1").parent().parent().removeClass();$("#ctl00_MainContent_RadioButtonList1_2").parent().parent().removeClass();$("#ctl00_MainContent_RadioButtonList1_3").parent().parent().removeClass();$("#ctl00_MainContent_RadioButtonList1_4").parent().parent().removeClass();$("#ctl00_MainContent_RadioButtonList1_5").parent().parent().removeClass();$("#ctl00_MainContent_OneListItemTableRow").hide();$("#ctl00_MainContent_TwoListItemTableRow").hide();$("#ctl00_MainContent_ThreeListItemTableRow").hide();$("#ctl00_MainContent_FourListItemTableRow").hide();$("#ctl00_MainContent_FiveListItemTableRow").hide();var b=parseFloat($("#ctl00_MainContent_AuctionPriceLabel").text()),a=parseFloat($("#ctl00_MainContent_RewardCreditLabel").text());if(c=="ctl00_MainContent_RadioButtonList1_0"){$("#ctl00_MainContent_TotalLabel").text("$"+(b+250-a).toFixed(2));$("#ctl00_MainContent_OneListItemTableRow").show();$("#ctl00_MainContent_RadioButtonList1_0").checked=true;$("#ctl00_MainContent_RadioButtonList1_0").parent().parent().addClass("bp_left_list_selected")}else if(c=="ctl00_MainContent_RadioButtonList1_1"){$("#ctl00_MainContent_TotalLabel").text("$"+(b+100-a).toFixed(2));$("#ctl00_MainContent_TwoListItemTableRow").show();$("#ctl00_MainContent_RadioButtonList1_1").checked=true;$("#ctl00_MainContent_RadioButtonList1_1").parent().parent().addClass("bp_left_list_selected")}else if(c=="ctl00_MainContent_RadioButtonList1_2"){$("#ctl00_MainContent_TotalLabel").text("$"+(b+50-a).toFixed(2));$("#ctl00_MainContent_ThreeListItemTableRow").show();$("#ctl00_MainContent_RadioButtonList1_2").checked=true;$("#ctl00_MainContent_RadioButtonList1_2").parent().parent().addClass("bp_left_list_selected")}else if(c=="ctl00_MainContent_RadioButtonList1_3"){$("#ctl00_MainContent_TotalLabel").text("$"+(b+25-a).toFixed(2));$("#ctl00_MainContent_FourListItemTableRow").show();$("#ctl00_MainContent_RadioButtonList1_3").checked=true;$("#ctl00_MainContent_RadioButtonList1_3").parent().parent().addClass("bp_left_list_selected")}else if(c=="ctl00_MainContent_RadioButtonList1_4"){$("#ctl00_MainContent_TotalLabel").text("$"+(b+10-a).toFixed(2));$("#ctl00_MainContent_FiveListItemTableRow").show();$("#ctl00_MainContent_RadioButtonList1_4").checked=true;$("#ctl00_MainContent_RadioButtonList1_4").parent().parent().addClass("bp_left_list_selected")}else if(c=="ctl00_MainContent_RadioButtonList1_5"){$("#ctl00_MainContent_TotalLabel").text("$"+(b-a).toFixed(2));$("#ctl00_MainContent_RadioButtonList1_5").checked=true;$("#ctl00_MainContent_RadioButtonList1_5").parent().parent().addClass("bp_left_list_selected")}}function showDiv(a){document.getElementById(a).style.display="block"}function hidedisplay(a){el=document.getElementById(a);if(el){if(el.style.display=="none")el.style.display=""}else el.style.display="none"}function hidedisplay_help(b){for(var a=0;a<100;a++){el=document.getElementById("ctl00_MainContent_help_index_"+a);if(el)el.style.display="none"}hidedisplay("ctl00_MainContent_"+b);hidedisplay("ctl00_MainContent_help_email")}function hidedisplay_helpheaders(b){for(var a=0;a<15;a++){el=document.getElementById("help_header_"+a);if(el)el.style.display="none"}hidedisplay(b)}function DisableBidButtons(){$("#ctl00_MainContent_BidBoardButton_BidBoardButton").unbind();$("#ctl00_MainContent_BidButler_BidButler").unbind();$("#ctl00_MainContent_MinPrice").unbind();$("#ctl00_MainContent_MaxPrice").unbind()}function SetBidButtons(){$("#ctl00_MainContent_BidBoardButton_BidBoardButton").click(function(){return placebidboard("0")});$("#ctl00_MainContent_BidButler_BidButler").click(function(){return placebutler("0")});$("#ctl00_MainContent_MinPrice").keyup(function(a){a.keyCode==13&&placebutler("0");return false});$("#ctl00_MainContent_MaxPrice").keyup(function(a){a.keyCode==13&&placebutler("0");return false})}function ErrorBidStatusMessage(){ClearLoadingBidBoard();SetBidButtons();SetErrorStatusBox("Sorry, we've encountered an unknown error.<br />Please try again.");return false}function ShowAuctionThumbnail(c){var b=(c.target||c.srcElement).id,d=$("#"+b).attr("src").replace("_thumb","");$("#ctl00_MainContent__ProductImage").attr("src",d);var a;if(b=="ctl00_MainContent_Thumbnail1Image")a=1;else if(b=="ctl00_MainContent_Thumbnail2Image")a=2;else if(b=="ctl00_MainContent_Thumbnail3Image")a=3;else if(b=="ctl00_MainContent_Thumbnail4Image")a=4;$("#ctl00_MainContent_PointerImage").attr("class","ap_main_left_thumbnail_pointer"+a)}function HpNavPrev(){if(HpNavIndex==1)HpNavIndex=3;else HpNavIndex--;HpBannerFlip()}function HpNavPause(){if(hpBannerTimer==null)hpBannerTimer=setTimeout(HpNavNextTimer,hpBannerTimerSwitch);else clearInterval(hpBannerTimer)}function HpNavNext(){if(HpNavIndex==HpNavIndexSize)HpNavIndex=1;else HpNavIndex++;HpBannerFlip()}function HpNavNextTimer(){HpNavNext();hpBannerTimer=setTimeout(HpNavNextTimer,hpBannerTimerSwitch)}function HpBannerFlip(){var b;for(index=1;index<=HpNavIndexSize;index++){var a="#HpBanner"+index;if(index==HpNavIndex)$(a).show();else $(a).hide()}clearInterval(hpBannerTimer)}function SetHintStatusBox(a){$("#ctl00_MainContent_StatusBoxLabel")[0].innerHTML=a;$("#ctl00_MainContent_StatusBox").addClass("lightgray").removeClass("lightred").slideDown("slow")}function SetHintRange(b,a){$("#ctl00_MainContent_MinPrice").val(b);$("#ctl00_MainContent_MaxPrice").val(a)}function SetErrorStatusBox(a){setTimeout(function(){$("#ctl00_MainContent_StatusBoxLabel")[0].innerHTML=a;$("#ctl00_MainContent_StatusBox").addClass("lightred").removeClass("lightgray").slideDown("slow")},500)}function SetAllSelectorBidControl(){if($("#ctl00_MainContent_AllBidsSelectorLabel").hasClass("active")==false){$("#ctl00_MainContent_ActiveBidsSelectorLabel").addClass("inactive");$("#ctl00_MainContent_ActiveBidsSelectorLabel").removeClass("active");$("#ctl00_MainContent_AllBidsSelectorLabel").addClass("active");$("#ctl00_MainContent_AllBidsSelectorLabel").removeClass("inactive")}}function ToggleAllActiveBidControl(a){if(a=="ctl00_MainContent_AllBidsSelectorLabel"){$("#ctl00_MainContent_ActiveBidsSelectorLabel").addClass("inactive");$("#ctl00_MainContent_ActiveBidsSelectorLabel").removeClass("active");$("#ctl00_MainContent_AllBidsSelectorLabel").addClass("active");$("#ctl00_MainContent_AllBidsSelectorLabel").removeClass("inactive")}else{$("#ctl00_MainContent_ActiveBidsSelectorLabel").addClass("active");$("#ctl00_MainContent_ActiveBidsSelectorLabel").removeClass("inactive");$("#ctl00_MainContent_AllBidsSelectorLabel").addClass("inactive");$("#ctl00_MainContent_AllBidsSelectorLabel").removeClass("active")}}function UpdateAuctionPage(a){if(a==null||a=="")return;a=eval("("+a+")");$("#ctl00_MainContent_AuctionStatusLabel")[0].innerHTML=a.AuctionStatus;var h=$("#ctl00_MainContent_UserStatusLabel");if(h.length!=0){h[0].innerHTML=a.UserStatusMessage;UpdateBidBoardTable(a.BidStatusList);$("#ctl00_CreditsCountLabel").text("$"+a.CreditsLeft.toFixed(2));$("#ctl00_RewardCreditsCountLabel").text("$"+a.RewardCreditsLeft.toFixed(2));$("#ctl00_MainContent_TotalCost")[0].innerHTML=a.BidCost;$("#ctl00_MainContent_Savings")[0].innerHTML=a.Savings}var k=false,d=$("#ctl00_MainContent_PercentCompleted");if(d.length>0&&d[0].innerHTML!=a.PercentComplete){k=true;d[0].innerHTML=a.PercentComplete}var j=false,c=$("#ctl00_MainContent_PriceRangeLabel");if(c.length>0&&c[0].innerHTML!=a.BidsLeft){j=true;c[0].innerHTML=a.BidsLeft}var g=null,b=$("#ctl00_MainContent__TimeLeft");if(b.length>0&&a.TimeLeftFormatted!=b[0].innerHTML){g=b[0].innerHTML;b[0].innerHTML=a.TimeLeftFormatted;a.TimeLeft<31&&b.css({"font-weight":"bold",color:"red"})}if(a.TimeLeft<31&&$("#ctl00_MainContent_TimerLimitedImage").hasClass("hidden")){$("#ctl00_MainContent_TimerImage").addClass("hidden");$("#ctl00_MainContent_TimerLimitedImage").removeClass("hidden")}UpdateCurrentBidders(a.LastBidders);var n=false,e=$("#ctl00_MainContent__Winner");if(e.length>0&&e[0].innerHTML!=a.WinnerName){n=true;e[0].innerHTML=a.WinnerName}(a.IsHot==true||a.IsUserOverLimit)&&$("#ctl00_MainContent_BidCostLabel").css({color:"red","font-weight":"bold"}).text(a.ClosingBidPrice);UpdateBidBoardTable(obj.BidStatusList);var i=false,f=$("#ctl00_MainContent_TimerStatusLabel");if(g){var m=TimeToSeconds(g),l=a.TimeLeft-m;if(l>0){if(m<=30)f[0].innerHTML="Bids Placed : Time @30 secs";else{var o=Math.round(l/30);f[0].innerHTML="{0} Bids: Time +{1} secs".format(o,o*30)}i=true}}k&&d.css({backgroundColor:"yellow"}).animate({backgroundColor:"white"},2e3);j&&c.css({backgroundColor:"yellow"}).animate({backgroundColor:"white"},2e3);n&&e.css({backgroundColor:"yellow"}).animate({backgroundColor:"white"},2e3);i&&f.css({color:"black"}).animate({color:"white"},2e3);if(a.AuctionStatus>=2)location.reload(true);else ClearLoadingBidBoard()}function UpdateYourBidsTable(a){$("#ctl00_MainContent_BidTable").text("");$.each(a,function(b,a){if(a.Status=="Not Unique")$("#ctl00_MainContent_BidTable").append('<tr><td class="ap_main_right_yourbids_table_1"><img src="/images/not-unique.jpg"></td><td class="ap_main_right_yourbids_table_2">$'+a.Price.toFixed(2)+'</td><td style="color:red" class="ap_main_right_yourbids_table_3">'+a.Status+"</td></tr>");else if(a.Status=="Lowest Unique!")$("#ctl00_MainContent_BidTable").append('<tr style="font-weight:bold;background-color:#00FF66"><td class="ap_main_right_yourbids_table_1"><img src="/images/lowest-unique.png"></td><td class="ap_main_right_yourbids_table_2">$'+a.Price.toFixed(2)+'</td><td class="ap_main_right_yourbids_table_3">'+a.Status+"</td></tr>");else a.Status=="Higher Unique"&&$("#ctl00_MainContent_BidTable").append('<tr><td class="ap_main_right_yourbids_table_1"><img src="/images/higher-unique.jpg"></td><td class="ap_main_right_yourbids_table_2">$'+a.Price.toFixed(2)+'</td><td class="ap_main_right_yourbids_table_3">'+a.Status+"</td></tr>");$("#ctl00_MainContent_ActiveBidsSelectorLabel").hasClass("active")&&$("#ctl00_MainContent_BidTable").scrollTop()});if(a.length==0)if($("#ctl00_MainContent_AllBidsSelectorLabel").hasClass("active"))$("#ctl00_MainContent_BidTable").append("<i>You haven't bid on this auction!</i>");else $("#ctl00_MainContent_BidTable").append("<i>No active bids on this auction!</i>")}function UpdatePrimaryAuction(a){UpdateAuctionPage(a);window.setTimeout(function(){$.ajax({url:"http://"+window.location.hostname+"/Status.aspx?aid="+$.getAuctions({type:"Primary"}),cache:false,success:UpdateAuctionPage,error:StopAuctionRefreshIcon})},primaryAuctionInterval)}function UpdateSecondaryAuction(a){a=eval(a);$.each(a,function(l,a){var d=$("#ctl00_MainContent_AuctionItemList1_"+a.Id+"_BidsLeftLabel"),e=$("#ctl00_MainContent_AuctionItemList1_"+a.Id+"_RetailPriceLabel"),b=$("#ctl00_MainContent_AuctionItemList1_"+a.Id+"_TimeLeftLabel"),c=$("#ctl00_MainContent_AuctionItemList1_"+a.Id+"_MaxBidLabel");if(a.Status>1){d[0].innerHTML='Final Price: <b style="color:blue;">{0}</b>'.format(a.AuctionPriceRange);d.parent().css("background-color","#BDE7FE");e[0].innerHTML='<b style="font-size:18px;"> Winner: {0}</b>'.format(a.TopBidderName);b.hide();c.hide();var j=$("#ctl00_MainContent_AuctionItemList1_"+a.Id+"_CustomButton_CustomButton");j[0].innerHTML='<a style="padding-top:8px;" href="http://thesmartbid.com/auction.aspx?aid={0}">View Auction</a>'.format(a.Id);j.css("background","none");$("div[auctionid='"+a.Id+"'] .hp_auctionItem_bstrip").attr({src:"",alt:"",title:""});$("div[auctionid='"+a.Id+"'] .hp_icon").attr({src:"",alt:"",title:""})}else{var i=false;if(d.text()!="Price: "+a.AuctionPriceRange){i=true;d.text("Price: "+a.AuctionPriceRange)}var h=false;if(e[0].innerHTML!=a.TopBidderName){h=true;e.text(a.TopBidderName)}var f=false;if(b.length>0&&b.text()!=a.TimeLeftFormatted){var k=TimeToSeconds(b.text());if(a.TimeLeft-k>0)f=true;b.text(a.TimeLeftFormatted)}var g=false;if(c.length>0&&c.text()!=a.BidsLeftFormatted){g=true;c.text(a.BidsLeftFormatted);a.BidsLeftFormatted=="Closing Soon!"&&c.addClass("red").addClass("bold")}i&&d.parent().animate({backgroundColor:"yellow"},250,function(){d.parent().animate({backgroundColor:"#F8F8F8"},2e3)});h&&e.parent().animate({backgroundColor:"yellow"},250,function(){e.parent().animate({backgroundColor:"white"},2e3)});f&&b.parent().animate({backgroundColor:"yellow"},250,function(){b.parent().animate({backgroundColor:"white"},2e3)});g&&c.parent().animate({backgroundColor:"yellow"},250,function(){c.parent().animate({backgroundColor:"white"},2e3)})}})}function SecondsToTime(a){if(a==null)return"";else if(a=="")return"";else if(a<0)return"Ended";var e=Math.floor(Math.round(a)/(60*60*24)),d=Math.floor(Math.round(a)/(60*60)%24),b=Math.floor(Math.round(a)/60%60),c=Math.floor(Math.round(a)%60);if(d<10)d="0"+d.toString();if(b<10)b="0"+b.toString();if(c<10)c="0"+c.toString();return e>0?e+"d "+d+":"+b+":"+c:d+":"+b+":"+c}function placebutler(e){var d=$("#ctl00_MainContent_PrimaryAuctionId").text(),f=$("#ctl00_MainContent_UserId").text();if($("#ctl00_MainContent_AuctionStatusLabel").text()!=1){SetErrorStatusBox("Sorry the auction has already closed!");return false}var b=$("#ctl00_MainContent_MinPrice").val(),a=$("#ctl00_MainContent_MaxPrice").val();if(b<=0||a<=0){SetErrorStatusBox("Min and Max Price has to be higher than 0!");return false}$("#ctl00_MainContent_StatusBox").is(":visible")&&$("#ctl00_MainContent_StatusBox").slideToggle();DisableBidButtons();SetLoadingBidBoard();$("#ctl00_MainContent_StatusBox").slideUp("fast");try{var c=_gat._getTracker("UA-12208848-1");c._trackPageview("/activeuser_funnel/placebid.aspx")}catch(g){}$.ajax({url:"http://"+window.location.hostname+"/placebids.aspx?aid="+d+"&uid="+f+"&bidtype=bidbutler&minprice="+b+"&maxprice="+a+"&confirm="+e,cache:false,success:ParseBidBoardStatusMessage,error:ErrorBidStatusMessage,timeout:5e3});return false}function TimeToSeconds(b){if(b==null)return;var c=parseInt(b.substring(0,b.search("d"))),a=b.substring(b.search("d")+1,b.length).split(":");return c>0?parseInt(parseInt(c*60*60*24)+parseInt(a[0],10)*60*60+parseInt(a[1],10)*60+parseInt(a[2],10)):parseInt(parseInt(a[0],10)*60*60+parseInt(a[1],10)*60+parseInt(a[2],10))}function GetSecondaryAuctions(){var a="",b=$(".hp_auctionItem .auctionid");$.each(b,function(c,b){a+=b.innerHTML+","});return a}String.prototype.format=function(){var a=this,b=arguments.length;while(b--)a=a.replace(new RegExp("\\{"+b+"\\}","gm"),arguments[b]);return a};function setupRefreshTimer(a){refreshTimerType=a;$("#m_fuzz").css("height",$(document).height());$(window).bind("resize",function(){$("#m_fuzz").css("height",$(window).height())});startRefreshTimer();refreshTimerType=="primary"&&setupPrimaryTimer();refreshTimerType=="secondary"&&setupSecondaryTimer();$("body").mousemove(function(){if(refreshTimer!=null){clearTimeout(refreshTimer);startRefreshTimer()}});$("body").keydown(function(){if(refreshTimer!=null){clearTimeout(refreshTimer);startRefreshTimer()}})}function startRefreshTimer(){refreshTimer=window.setTimeout(function(){refreshTimer=null;refreshTimerType=="primary"&&stopPrimaryTimer();refreshTimerType=="secondary"&&stopSecondaryTimer();$("html, body").animate({scrollTop:0},"fast");$("#m_fuzz").show()},refreshTimerTimeout)}function clearRefreshTimer(){startRefreshTimer();$("#m_fuzz").hide();refreshTimerType=="primary"&&setupPrimaryTimer();refreshTimerType=="secondary"&&setupSecondaryTimer()}function RefreshBids(){SetLoadingBidBoard();RefreshButtonClick()}function RefreshButtonClick(){var a=$("#ctl00_MainContent_PrimaryAuctionId").text();$.ajax({url:"http://"+window.location.hostname+"/Status.aspx?aid="+a+"&active=0",cache:false,success:UpdateAuctionPage,timeout:5e3})}function setupPrimaryTimer(){startPrimaryTimer();primaryTimer=setInterval(function(){startPrimaryTimer()},primaryAuctionInterval)}function startPrimaryTimer(){var a="http://{0}/Status.aspx?aid={1}&active=0".format(window.location.hostname,$("#ctl00_MainContent_PrimaryAuctionId").text());$.ajax({url:a,cache:false,success:UpdateAuctionPage,timeout:primaryAuctionInterval})}function stopPrimaryTimer(){clearInterval(primaryTimer)}function setupSecondaryTimer(){startSecondaryTimer();secondaryTimer=window.setInterval(function(){startSecondaryTimer()},secondaryAuctionInterval)}function startSecondaryTimer(){var a="http://{0}/GetStatus.aspx?aids={1}".format(window.location.hostname,GetSecondaryAuctions());$.ajax({url:a,dataType:"json",timeout:secondaryAuctionInterval,success:UpdateSecondaryAuction},secondaryAuctionInterval)}function stopSecondaryTimer(){clearInterval(secondaryTimer)}(function(a){a.ajaxSetup({cache:false});a(document).ready(function(){})})(jQuery)