var t=document.createElement("table");if(typeof t.moveRow=="undefined"){Node.prototype.moveRow=function(){if(this&&this.nodeName.match(/^(table|t(body|head|foot))$/i)){try{one=(!arguments[0]&&arguments[0]!=0?-1:arguments[0]);two=(!arguments[1]&&arguments[1]!=0?-1:arguments[1]);if(!this.rows[one]||two>this.rows.length){var err=new Error();throw err;};if(two>one)two=two+1;else if(one>two)one=one+1;newRow=this.insertRow(two);newRow.innerHTML=this.rows[one].innerHTML;this.deleteRow(one);}catch(e){}}}};t=null;function _ps_FocusZipCode(){var popup=document.getElementById(document._ps_ZipCodeTopEditId);popup.focus();};function StartPriceUpdateCheck(immidiate){document._ps_PriceUpdateAttemptsLeft=document._ps_PriceUpdateAttempts;if(immidiate)CheckForPriceUpdates();else if(!document._ps_checkForPriceUpdatesTimerId)ScheduleNextPriceUpdate();};function CheckForPriceUpdates(){document._ps_Cancel=false;document._ps_checkForPriceUpdatesTimerId=null;PriceLister.Avalon.Web.ScriptService.ProductUpdate3.GetProductSellerDelta(document._ps_ProductID,document._ps_NewCondition,document._ps_ImpressionId,document._ps_AllSellersVisibleHiddenFieldId==null?true:document.getElementById(document._ps_AllSellersVisibleHiddenFieldId).value=="1",document._ps_NewCondition?NewTabCheckForUpdatesCallback:UsedTabCheckForUpdatesCallback,CheckForUpdatesCallbackError);};function ScheduleNextPriceUpdate(){document._ps_checkForPriceUpdatesTimerId=window.setTimeout(function(){CheckForPriceUpdates();},document._ps_PriceUpdatesCheckInterval);};function ClearScheduledUpdates(){if(document._ps_checkForPriceUpdatesTimerId&&(document._ps_checkForPriceUpdatesTimerId!=null)){window.clearTimeout(document._ps_checkForPriceUpdatesTimerId);document._ps_checkForPriceUpdatesTimerId=null;};if(document._ps_checkForEBayUpdatesTimerId&&(document._ps_checkForEBayUpdatesTimerId!=null)){window.clearTimeout(document._ps_checkForEBayUpdatesTimerId);document._ps_checkForEBayUpdatesTimerId=null;};document._ps_Cancel=true;};function SetExtendedAttributes(row,sellerInfo){row.setAttribute('extendedPrice',sellerInfo.ExtendedPrice);row.setAttribute('sellerName',sellerInfo.Name);row.setAttribute('sellerID',sellerInfo.SellerID);row.setAttribute('rating',sellerInfo.Rating);row.setAttribute('featuredSeller',sellerInfo.FeaturedSeller&&!sellerInfo.PreferredSeller);row.setAttribute('updated',sellerInfo.Updated);};function FindRowPosition(tableElement,attrName,desc,rowSortValue,isPreferredSellersSection,isNumeric){var tableRows=tableElement.rows;var startIndex=isPreferredSellersSection?2:document._ps_AllSellersSectionStartIndex;var endIndex=isPreferredSellersSection?document._ps_AllSellersSectionStartIndex-3:tableRows.length-2;if(isNumeric&&(rowSortValue==0))return endIndex<=startIndex?startIndex:endIndex;if(endIndex<=startIndex)return startIndex;var i;while(startIndex<endIndex){i=Math.floor((endIndex+startIndex)/2);var currRowSortValue=_ps_GetSortValue(tableRows[i],attrName,isNumeric);if(isNumeric){if(currRowSortValue==0)currRowSortValue=Number.MAX_VALUE;else currRowSortValue=currRowSortValue*1;};if(desc){if(rowSortValue>currRowSortValue)endIndex=i-1;else if(rowSortValue<currRowSortValue)startIndex=i+1;else return i;}else{if(rowSortValue<currRowSortValue)endIndex=i-1;else if(rowSortValue>currRowSortValue)startIndex=i+1;else return i;}};if(startIndex==endIndex){if(startIndex<tableRows.length){var currRowSortValue=tableRows[startIndex].getAttribute(attrName);if(isNumeric){if(currRowSortValue==0)currRowSortValue=Number.MAX_VALUE;else currRowSortValue=currRowSortValue*1};if(currRowSortValue){if(currRowSortValue==rowSortValue)return startIndex+1;else if(currRowSortValue<rowSortValue)return startIndex+(desc?0:1);else return startIndex+(desc?1:0);}};return startIndex;}else return i;};function _ps_GetSortValue(tableRow,sortColumn,isNumeric){var value;if(isNumeric){value=tableRow.getAttribute(sortColumn);if(value==0)value=Number.MAX_VALUE;else value=value*1;}else value=tableRow.getAttribute(sortColumn).toLowerCase();return value;};function _ps_SortRows(table,sortColumn,descending,startIndex,endIndex,isNumeric){var tableRows=table.rows;var ascending=descending=='0';for(var i=startIndex;i<endIndex;i++){var minValue=_ps_GetSortValue(tableRows[i],sortColumn,isNumeric);var minValueIndex=i;for(var i2=i+1;i2<=endIndex;i2++){var value=_ps_GetSortValue(tableRows[i2],sortColumn,isNumeric);if((ascending&&(value<minValue))||(!ascending&&(value>minValue))){minValueIndex=i2;minValue=value;}};if(minValueIndex!=i){table.moveRow(minValueIndex,i);}}};function _ps_Sort(link,sortColumn){var sortInfoHiddenField=document.getElementById(document._ps_SortInfoHiddenField);var sortInfoHiddenFieldValue=sortInfoHiddenField.value;var separatorIndex=sortInfoHiddenFieldValue.indexOf(' ');var currentSortColumn=sortInfoHiddenFieldValue.substring(0,separatorIndex);var direction=sortInfoHiddenFieldValue.substring(separatorIndex+1);var table=document.getElementById(document._ps_SellerTableId);var sortDirectionImage=document.getElementById(document._ps_SortDirectionImageId);if(currentSortColumn==sortColumn){direction=(direction=='1'?'0':'1');}else{sortDirectionImage=sortDirectionImage.parentNode.removeChild(sortDirectionImage);link.appendChild(sortDirectionImage);};sortDirectionImage.src=document._ps_SiteImageBaseURL+(direction=='1'?"DarkUpArrow.gif":"DarkDownArrow.gif");var isSortColumnNumeric=(sortColumn=='extendedPrice')||(sortColumn=='rating');if(document._ps_AllSellersSectionStartIndex>3)_ps_SortRows(table,sortColumn,direction,2,document._ps_AllSellersSectionStartIndex-3,isSortColumnNumeric);_ps_SortRows(table,sortColumn,direction,document._ps_AllSellersSectionStartIndex,table.rows.length-2,isSortColumnNumeric);sortInfoHiddenField.value=sortColumn+' '+direction;};function _ps_RemoveElement(elementId){var element=document.getElementById(elementId);if(element)element.parentNode.removeChild(element);};function _ps_ShowAllSellers(){if(document._ps_LoadingPanelId!=null){var loadingPanel=document.getElementById(document._ps_LoadingPanelId);loadingPanel.style.display="block";};if(document._ps_checkForPriceUpdatesTimerId){window.clearTimeout(document._ps_checkForPriceUpdatesTimerId);document._ps_checkForPriceUpdatesTimerId=null;};document.getElementById(document._ps_AllSellersVisibleHiddenFieldId).value="1";document._ps_ShowAllSellerClicked=true;CheckForPriceUpdates();document.body.style.cursor='wait';};function GetSortValue(sellerInfo,sortColumn){var sortValue;if(sortColumn=='extendedPrice')sortValue=sellerInfo.ExtendedPrice;else if(sortColumn=='sellerName')sortValue=sellerInfo.SellerName;else if(sortColumn=='rating')sortValue=sellerInfo.Rating;return sortValue;};function SetSellerRow(tableElement,sellerInfo,updatedRows,insertedRows,deletedRows,sortColumn,sortDesc,showCondition,zipCodeEntered,isSortColumnNumeric){if(document._ps_Cancel)return;var tableRows=tableElement.rows;var rows=new Array();rows[0]=null;rows[1]=null;var rowIndexes=new Array();rowIndexes[0]=null;rowIndexes[1]=null;if(document._ps_AllSellersSectionStartIndex>2){for(i=2;i<document._ps_AllSellersSectionStartIndex;i++){var rowSellerID=tableRows[i].getAttribute("sellerID");if((rowSellerID!=null)&&(rowSellerID==sellerInfo.SellerID)){rows[0]=tableRows[i];rowIndexes[0]=i;break;}}};if(document._ps_Cancel)return;for(j=document._ps_AllSellersSectionStartIndex;j<tableRows.length;++j){var rowSellerID=tableRows[j].getAttribute("sellerID");if((rowSellerID!=null)&&(rowSellerID==sellerInfo.SellerID)){rows[1]=tableRows[j];rowIndexes[1]=j;break;}};for(var i=0;i<2;i++){if(document._ps_Cancel)return;var row=rows[i];if(row){if(sellerInfo.Removed){deletedRows.push(row);tableElement.deleteRow(rowIndexes[i]);}else{UpdateRow(tableElement,row,sellerInfo,updatedRows,sortColumn,sortDesc,rowIndexes[i],i==0,showCondition,zipCodeEntered,isSortColumnNumeric);}}else{if((i==0)&&sellerInfo.FeaturedSeller&&!sellerInfo.PreferredSeller){var tableRows=tableElement.rows;var l2=tableRows.length;var count=0;var doContinue=false;for(var i2=2;i2<l2;i2++){var isFeaturedSeller=tableRows[i2].getAttribute("featuredSeller");if(isFeaturedSeller){count++;if(count>=3){doContinue=true;break;}}};if(doContinue)continue;};if((!sellerInfo.Removed)&&((i>0&&tableRows.length>=5)||(document._ps_AllSellersSectionStartIndex>3&&(sellerInfo.FeaturedSeller||sellerInfo.PreferredSeller))))InsertRow(tableElement,sellerInfo,insertedRows,sortColumn,sortDesc,i==0,showCondition,zipCodeEntered,isSortColumnNumeric);}}};function InsertRow(tableElement,sellerInfo,insertedRows,sortColumn,sortDesc,isPreferredSellersSection,showCondition,zipCodeEntered,isSortColumnNumeric){var tableRows=tableElement.rows;var sortValue=GetSortValue(sellerInfo,sortColumn);var insertIndex=FindRowPosition(tableElement,sortColumn,sortDesc,sortValue,isPreferredSellersSection,isSortColumnNumeric);var newRow=tableElement.insertRow(insertIndex);newRow.appendChild(ConstructSellerNameLogoCellElement(sellerInfo.SellerID,sellerInfo.Name,sellerInfo.ImageURL,sellerInfo.RatingDisplay,sellerInfo.ReviewCount,sellerInfo.MarketPlaceSellerType,sellerInfo.RedirectURL,tableElement,isPreferredSellersSection));if(showCondition)newRow.appendChild(ConstructConditionCellElement(sellerInfo.Condition));newRow.appendChild(ConstructPriceCellElement(sellerInfo.BasePriceDisplay,zipCodeEntered,sellerInfo.Tax,sellerInfo.Rebate1Amount,sellerInfo.Rebate1StartDate,sellerInfo.Rebate1EndDate,sellerInfo.Rebate1Link,sellerInfo.Rebate2Amount,sellerInfo.Rebate2StartDate,sellerInfo.Rebate2EndDate,sellerInfo.Rebate2Link,sellerInfo.ExtendedPrice,sellerInfo.ExtendedPriceDisplay,sellerInfo.ShippingAndHandling,sellerInfo.RedirectURL));newRow.appendChild(ConstructPriceTrendCellElement(sellerInfo.SellerID,sellerInfo.PercentileChangeDecrease,sellerInfo.PercentileChange,sellerInfo.LastPriceChange,sellerInfo.LastPriceChangeStyle,sellerInfo.ProductTitle));newRow.appendChild(ConstructAvailabilityCellElement(sellerInfo.Name,sellerInfo.Availability,sellerInfo.RedirectURL,sellerInfo.ProductTitle));newRow.appendChild(ConstructProductTitleCellElement(sellerInfo.ProductTitle,sellerInfo.RedirectURL,sellerInfo.SellerOverviewURL,sellerInfo.OfferCount,sellerInfo.Name));newRow.appendChild(ConstructDealCellElement(sellerInfo));newRow.appendChild(ConstructPriceGraphCellElement(sellerInfo.SellerID,sellerInfo.Name,sellerInfo.PreferredSeller,sellerInfo.IsLocalSeller));newRow.appendChild(ConstructVerifiedCellElement(sellerInfo.Name,sellerInfo.Updated,sellerInfo.UpdatedStyle,sellerInfo.LastPriceChange,sellerInfo.ProductTitle));SetExtendedAttributes(newRow,sellerInfo);insertedRows.push(newRow);};function UpdateRow(tableElement,row,sellerInfo,updatedRows,sortColumn,sortDesc,rowIndex,isPreferredSellersSection,showCondition,zipCodeEntered,isSortColumnNumeric){var deletedRowIndex=rowIndex;tableElement.deleteRow(rowIndex);var sortValue=GetSortValue(sellerInfo,sortColumn);;rowIndex=FindRowPosition(tableElement,sortColumn,sortDesc,sortValue,isPreferredSellersSection,isSortColumnNumeric);if((rowIndex==2)&&(deletedRowIndex>2)&&(!zipCodeEntered)){var firstRow=tableElement.rows[2];var cells=firstRow.cells;var l=cells.length;for(var i=0;i<l;i++){if(cells[i].getAttribute('Tax')){firstRow.deleteCell(i);break;}}};var newRow=tableElement.insertRow(rowIndex);var oldRowUpdated=row.getAttribute('updated');newRow.appendChild(ConstructSellerNameLogoCellElement(sellerInfo.SellerID,sellerInfo.Name,sellerInfo.ImageURL,sellerInfo.RatingDisplay,sellerInfo.ReviewCount,sellerInfo.MarketPlaceSellerType,sellerInfo.RedirectURL,tableElement,isPreferredSellersSection));if(showCondition)newRow.appendChild(ConstructConditionCellElement(sellerInfo.Condition));newRow.appendChild(ConstructPriceCellElement(sellerInfo.BasePriceDisplay,zipCodeEntered,sellerInfo.Tax,sellerInfo.Rebate1Amount,sellerInfo.Rebate1StartDate,sellerInfo.Rebate1EndDate,sellerInfo.Rebate1Link,sellerInfo.Rebate2Amount,sellerInfo.Rebate2StartDate,sellerInfo.Rebate2EndDate,sellerInfo.Rebate2Link,sellerInfo.ExtendedPrice,sellerInfo.ExtendedPriceDisplay,sellerInfo.ShippingAndHandling,sellerInfo.RedirectURL));newRow.appendChild(ConstructPriceTrendCellElement(sellerInfo.SellerID,sellerInfo.PercentileChangeDecrease,sellerInfo.PercentileChange,sellerInfo.LastPriceChange,sellerInfo.LastPriceChangeStyle,sellerInfo.ProductTitle));newRow.appendChild(ConstructAvailabilityCellElement(sellerInfo.Name,sellerInfo.Availability,sellerInfo.RedirectURL,sellerInfo.ProductTitle));newRow.appendChild(ConstructProductTitleCellElement(sellerInfo.ProductTitle,sellerInfo.RedirectURL,sellerInfo.SellerOverviewURL,sellerInfo.OfferCount,sellerInfo.Name));newRow.appendChild(ConstructDealCellElement(sellerInfo));newRow.appendChild(ConstructPriceGraphCellElement(sellerInfo.SellerID,sellerInfo.Name,sellerInfo.PreferredSeller,sellerInfo.IsLocalSeller));newRow.appendChild(ConstructVerifiedCellElement(sellerInfo.Name,sellerInfo.Updated,sellerInfo.UpdatedStyle,sellerInfo.LastPriceChange,sellerInfo.ProductTitle));if(sellerInfo.Updated!=oldRowUpdated)AnimateUpdatedRows(newRow,rowIndex);SetExtendedAttributes(newRow,sellerInfo);updatedRows.push(newRow);};function SetAllSellersSectionStartIndex(tableRows){document._ps_AllSellersSectionStartIndex=2;var l=tableRows.length-1;for(var i=2;i<l;i++)if(tableRows[i].cells.length==2){document._ps_AllSellersSectionStartIndex=i+1;break;}};function AnimateUpdatedRows(row,index){var divOverlay=document.createElement('div');divOverlay.className="SellerRowFlashOverlay";divOverlay.id="overlay"+index;var rowPosition=_FindAbsolutePosition(row);divOverlay.style.left=rowPosition.offsetLeft+"px";divOverlay.style.top=rowPosition.offsetTop+"px";divOverlay.style.width=row.offsetWidth+"px";divOverlay.style.height=row.offsetHeight+"px";var initialOpacity=10;divOverlay.style.filter="alpha(style=0,opacity:"+initialOpacity+")";divOverlay.style.KHTMLOpacity=initialOpacity/100;divOverlay.style.MozOpacity=initialOpacity/100;divOverlay.style.opacity=initialOpacity/100;document.body.appendChild(divOverlay);window.setTimeout("FlashRow('"+divOverlay.id+"', 17)",50);};function FlashRow(divOverlayId,stepsLeft){var divOverlay=document.getElementById(divOverlayId);var opacity;if(stepsLeft>13)opacity=70+((13-stepsLeft)*15);else opacity=70-((13-stepsLeft)*5);divOverlay.style.filter="alpha(style=0,opacity:"+opacity+")";divOverlay.style.KHTMLOpacity=opacity/100;divOverlay.style.MozOpacity=opacity/100;divOverlay.style.opacity=opacity/100;if(stepsLeft>0)window.setTimeout("FlashRow('"+divOverlayId+"', "+(stepsLeft-1)+");",stepsLeft>13?50:100);else document.body.removeChild(divOverlay);};function NewTabCheckForUpdatesCallback(result){if(result==null)return;document._ps_PriceUpdateAttemptsLeft--;document._ps_checkForPriceUpdatesTimerId=null;var table=document.getElementById(document._ps_SellerTableId);var updatedRows=new Array();var insertedRows=new Array();var deletedRows=new Array();if(result&&result.ProductSellerDeltas&&result.ProductSellerDeltas.length>0){var l=result.ProductSellerDeltas.length;var sortInfoHiddenField=document.getElementById(document._ps_SortInfoHiddenField);if(!sortInfoHiddenField)return;var sortInfo=sortInfoHiddenField.value.split(' ');if(document._ps_Cancel)return;if(table==null)return;var tableRows=table.rows;SetAllSellersSectionStartIndex(tableRows);showCondition=document._ps_ShowCondition?document._ps_ShowCondition:false;var zipCodeTopEdit=document.getElementById(document._ps_ZipCodeTopEditId);var zipCodeEntered=zipCodeTopEdit?zipCodeTopEdit.value>0:false;var sortColumn=sortInfo[0];var isSortColumnNumeric=(sortColumn=='extendedPrice')||(sortColumn=='rating');for(var i=0;i<l;i++){SetSellerRow(table,result.ProductSellerDeltas[i],updatedRows,insertedRows,deletedRows,sortColumn,sortInfo[1]=='1',false,zipCodeEntered,isSortColumnNumeric);};if(document._ps_Cancel)return;var sellerCount=table.rows.length-(document._ps_AllSellersSectionStartIndex+1);var allSellersCountLabel=document.getElementById(document._ps_AllSellersCountTopLabelId);allSellersCountLabel.innerHTML=sellerCount;allSellersCountLabel=document.getElementById(document._ps_AllSellersCountBottomLabelId);allSellersCountLabel.innerHTML=sellerCount;};if(document._ps_Cancel)return;if(document._ps_PriceUpdateAttemptsLeft>0){var allUpdated;if(table==null){allUpdated=false;}else{var tableRows=table.rows;var l=tableRows.length;for(var i=2;i<l;i++){var updatedString=tableRows[i].getAttribute('updated');if(updatedString!='JUST NOW!'&&updatedString!='10 Minutes Ago'){allUpdated=false;break;}};if(document._ps_Cancel)return;};if(!allUpdated)ScheduleNextPriceUpdate();if(document._ps_LoadingPanelId!=null&&document._ps_ShowAllSellerClicked){var loadingPanel=document.getElementById(document._ps_LoadingPanelId);if(loadingPanel.style.display!='none')loadingPanel.style.display="none";_ps_RemoveElement(document._ps_ShowAllSellerTopButtonId);_ps_RemoveElement(document._ps_ShowAllSellerBottomButtonId);document.body.style.cursor='auto';document._ps_ShowAllSellerClicked=null;}}};function UsedTabCheckForUpdatesCallback(result){try{if(result==null)return;document._ps_PriceUpdateAttemptsLeft--;document._ps_checkForPriceUpdatesTimerId=null;var table=document.getElementById(document._ps_UsedSellerTableId);if(result.ProductSellerDeltas&&result.ProductSellerDeltas.length>0){var l=result.ProductSellerDeltas.length;var updatedRows=new Array();var insertedRows=new Array();var deletedRows=new Array();var sortInfoHiddenField=document.getElementById(document._ps_SortInfoHiddenField);if(!sortInfoHiddenField)return;var sortInfo=sortInfoHiddenField.value.split(' ');if(!table)return;var tableRows=table.rows;SetAllSellersSectionStartIndex(tableRows);var zipCodeEnteredHiddenField=document.getElementById(document._ps_ZipCodeEnteredId);var zipCodeEntered=zipCodeEnteredHiddenField?zipCodeHiddenField.value>0:false;var sortColumn=sortInfo[0];var isSortColumnNumeric=(sortColumn=='extendedPrice')||(sortColumn=='rating');for(var i=0;i<l;i++)SetSellerRow(table,result.ProductSellerDeltas[i],updatedRows,insertedRows,deletedRows,sortInfo[0],sortInfo[1]=='1',true,zipCodeEntered,isSortColumnNumeric);if(document._ps_Cancel)return;if(!zipCodeEntered)SetTaxCol(table);if(document._ps_Cancel)return;};if(document._ps_Cancel)return;if(document._ps_PriceUpdateAttemptsLeft>0){var allUpdated;if(table==null){allUpdated=false;}else{var tableRows=table.rows;var l=tableRows.length;for(var i=2;i<l;i++){var row=tableRows[i];if((row.getAttribute("updated")!=1)&&(row.getAttribute("sellerID")>0)){allUpdated=false;break;}};if(document._ps_Cancel)return;};if(!allUpdated)ScheduleNextPriceUpdate();}}finally{document.body.style.cursor='auto';}};function CheckForUpdatesCallbackError(){if(document._ps_LoadingPanelId!=null&&document._ps_ShowAllSellerClicked){var loadingPanel=document.getElementById(document._ps_LoadingPanelId);if(loadingPanel.style.display!='none')loadingPanel.style.display="none";_ps_RemoveElement(document._ps_ShowAllSellerTopButtonId);_ps_RemoveElement(document._ps_ShowAllSellerBottomButtonId);document.body.style.cursor='auto';document._ps_ShowAllSellerClicked=null;};document._ps_PriceUpdateAttemptsLeft--;document._ps_checkForPriceUpdatesTimerId=null;if(document._ps_PriceUpdateAttemptsLeft>0)ScheduleNextPriceUpdate();};function Product_OnBeginRequest(sender,args){ClearScheduledUpdates();};function RefreshPrices(productID){PriceLister.Avalon.Web.ScriptService.ProductUpdate3.IPURequest(productID);StartPriceUpdateCheck();};function SetSellerPopupAutoCloseTimer(){if(document._ps_sellerMenuPopupTimerId!=null){window.clearTimeout(document._ps_sellerMenuPopupTimerId);document._ps_sellerMenuPopupTimerId=null;};if((document._lastOpenedIFramePopups)&&(document._lastOpenedIFramePopups.parentNode))PopupOnMouseOut(document._lastOpenedIFramePopups.contentWindow);};function _ps_ShowShippingEstimates(link){var parent=link.parentNode;parent.style.display='none';parent.nextSibling.style.display='inline';};function _ps_HideShippingEstimates(link){var parent=link.parentNode;parent.style.display='none';parent.previousSibling.style.display='inline';};function ConstructSellerNameLogoCellElement(sellerID,sellerName,imageUrl,rating,reviewCounts,marketPlaceSellerType,redirectUrl,tableElement,isPreferredSellersSection){var cell=document.createElement('td');cell.className="SellerColumn";cell.align="left";cell.vAlign="top";cell.innerHTML=ConstructSellerNameLogo(sellerID,sellerName,imageUrl,rating,reviewCounts,marketPlaceSellerType,redirectUrl,tableElement,isPreferredSellersSection);return cell;};function ConstructSellerNameLogo(sellerID,sellerName,imageUrl,rating,reviewCounts,marketPlaceSellerType,redirectUrl,tableElement,isPreferredSellersSection){var cellInnerHtml='<a href="'+redirectUrl+'" class="MDkGrLink2-A" target="_blank">'+((imageUrl!=null)&&(imageUrl!='')?(marketPlaceSellerType>0?sellerName+'<br/>':'')+'<img src="'+imageUrl+'" class="TSSellerImg" alt="'+sellerName+'" title="'+sellerName+'" />':sellerName)+'</a><br/>'+(reviewCounts>0?'<div class="StarSmallContainer" title="'+rating+' out of 5. '+reviewCounts+' review(s). Click to read '+sellerName+' reviews.">'+ConstructStarRating(rating)+'</div>':'(<a title="Click here to be the first one to post a review for this seller." href="'+document._ps_SellerReviewUrl+sellerID+'" class="MDkBlLink-A">'+'No&nbsp;Reviews'+'</a>)');return cellInnerHtml;};function ConstructConditionCellElement(condition){var cell=document.createElement('td');cell.className="SellerColumn";cell.align="center";cell.vAlign="middle";cell.innerHTML=ConstructCondition(condition);return cell;};function ConstructCondition(condition){return condition;};function ConstructProductTitleCellElement(productTitle,redirectUrl,sellerOverviewURL,offerCount,sellerName){var cell=document.createElement('td');cell.className="SellerColumn";cell.align="left";cell.vAlign="top";cell.style.width='100%';cell.innerHTML=ConstructProductTitle(productTitle,redirectUrl,sellerOverviewURL,offerCount,sellerName);return cell;};function ConstructProductTitle(productTitle,redirectUrl,sellerOverviewURL,offerCount,sellerName){var cellInnerHtml=productTitle+(offerCount>0?'<div style="padding-top: 10px">'+'<a href="'+sellerOverviewURL+'">'+offerCount+' Offers and Coupons from '+sellerName+'</a>'+'</div>':'');return cellInnerHtml;};function ConstructDealCellElement(sellerInfo){var cell=document.createElement('td');cell.className="SellerColumn";cell.align="center";cell.vAlign="middle";cell.innerHTML=ConstructDealCell(sellerInfo);return cell;};function ConstructDealCell(sellerInfo){var cellInnerHtml=document._ps_IsAdmin||sellerInfo.BasePrice>0?sellerInfo.UserDealID==0?'<a class="XSRegTXT-A" onclick="OpenDeals(this,\'' + document._ps_DealsUri + '\','+sellerInfo.ProductMatchID+','+document._ps_UserIsLogged+');" href="javascript:;"><img src="'+document._ps_SiteImageBaseURL+'PostDeal.png" style="border-width: 0px; display: block;"><span class="NR">Flag This<br />As a Deal</span></a>':'<table class="PCursor" onclick="OpenDealsVoting(this,\'' + document._ps_DealsVotingUri + '\','+sellerInfo.UserDealID+','+document._psUserIsLogged+');">'+'<tr>'+'<td>'+'<div class="UserInfoSmallDiv" enableviewstate="false">'+'<img src="'+document._ps_UserThumbUrl+encodeURIComponent(sellerInfo.DealPosterScreenName)+'.smth" class="UserThumbImageSmall" alt="'+sellerInfo.DealPosterScreenName+'"><br>'+'<span class="ScreenNameOffline">'+sellerInfo.DealPosterScreenName+'</span>'+'</div>'+'</td>'+'<td valign="middle" align="center">'+'<div class="SellerDealContainer">'+'Deal Score <br />'+'<span class="ScoreText">'+sellerInfo.DealScore+'</span>'+'<br />'+sellerInfo.VoteCount+' votes'+'</div>'+'</td>'+'</tr>'+'<tr>'+'<td colspan="2" valign="middle" align="center">'+'Flagged<br>'+'<span class="'+sellerInfo.DealDateStyle+'">'+sellerInfo.DealDateEntered+'</span>'+'</td>'+'</tr>'+'</table>':'';return cellInnerHtml;};function ConstructPriceCellElement(basePrice,zipCodeEntered,tax,rebate1Amount,rebate1StartDate,rebate1EndDate,rebate1Link,rebate2Amount,rebate2StartDate,rebate2EndDate,rebate2Link,extendedPrice,extendedPriceDisplay,shippingAndHandling,redirectUrl){var cell=document.createElement('td');cell.className="SellerPriceColumn NR LRegTXT-A";cell.align="right";cell.valign="middle";cell.innerHTML=ConstructPrice(basePrice,zipCodeEntered,tax,rebate1Amount,rebate1StartDate,rebate1EndDate,rebate1Link,rebate2Amount,rebate2StartDate,rebate2EndDate,rebate2Link,extendedPrice,extendedPriceDisplay,shippingAndHandling,redirectUrl);return cell;};function ConstructPrice(basePrice,zipCodeEntered,tax,rebate1Amount,rebate1StartDate,rebate1EndDate,rebate1Link,rebate2Amount,rebate2StartDate,rebate2EndDate,rebate2Link,extendedPrice,extendedPriceDisplay,shippingAndHandling,redirectUrl){var cellInnerHtml=(extendedPrice>0?'<table>'+'<tr>'+'<td align="left" valign="top">Base:</td>'+'<td align="right" valign="top" class="SellerPriceElementCell">'+basePrice+'</td>'+'</tr>'+(document._ps_Country==1?'<tr>'+'<td align="left" valign="top">Tax:</td>'+'<td align="right" valign="top" class="SellerPriceElementCell">'+(zipCodeEntered?tax:'[<a class="SDkBlLink-A" href="javascript:_ps_FocusZipCode();">Enter&nbsp;Zip&nbsp;Code</a>]')+'</td>'+'<tr/>':'')+(rebate1Amount&&rebate1Amount!=''?'<tr>'+'<td align="left" valign="top">'+(rebate1Link&&rebate1Link!=''?'<a class="MDkGrLink-A" target="_blank" href="'+rebate1Link+'" rel="nofollow" target="_blank">Rebate</a>':'Rebate')+':'+'</td>'+'<td class="SellerPriceElementCell" align="right" valign="top">'+'('+rebate1Amount+')'+'</td>'+'<tr>':'')+(rebate2Amount&&rebate2Amount!=''?'<tr>'+'<td align="left" valign="top">'+(rebate2Link&&rebate2Link!=''?'<a class="MDkGrLink-A" target="_blank" href="'+rebate2Link+'" rel="nofollow" target="_blank">Rebate</a>':'Rebate')+':'+'</td>'+'<td class="SellerPriceElementCell" align="right" valign="top">'+'('+rebate2Amount+')'+'</td>'+'<tr>':'')+'</table>'+'<div class="ProductBoxSeparatorHorizontal">&nbsp;</div>'+'<div style="float: right;">'+'<a class="XLDkBlLink-A" href="'+redirectUrl+'" rel="nofollow" target="_blank">'+extendedPriceDisplay+'</a><br/>'+'<span class="SRegTXT-V">[S&H: '+(shippingAndHandling!="See Seller's Website"?(shippingAndHandling=='FREE SHIPPING'?'<span class="FreeShipping">'+shippingAndHandling+'</span>':shippingAndHandling):'<a target="_blank" href="'+redirectUrl+'" rel="nofollow">See Seller'+"'"+'s Website</a>')+']</span>'+'</div>':'<a class="LDkBlLink-A" target="_blank" href="'+redirectUrl+'" rel="nofollow">See Seller'+"'"+'s Website</a>');return cellInnerHtml};function ConstructVerifiedCellElement(sellerName,updated,updatedStyle,lastPriceChange,productTitle){var cell=document.createElement('td');if(updated=='JUST NOW!'||updated=='10 Minutes Ago'){cell.className="SellerPriceColumn SellerPriceVerified";cell.align='center';}else{cell.className="SellerPriceColumn XSRegTXT-A";cell.align='left';};cell.vAlign="middle";cell.innerHTML=ConstructVerified(sellerName,updated,updatedStyle,lastPriceChange,productTitle);return cell;};function ConstructVerified(sellerName,updated,updatedStyle,lastPriceChange,productTitle){var cellInnerHtml=(updated=='JUST NOW!'||updated=='10 Minutes Ago'?(lastPriceChange=='JUST NOW!'?'<img style="border-width: 0px;" src="'+document._ps_SiteImageBaseURL+'Alert_small.png" title="Price Change Detected!" alt="Price Change Detected for'+productTitle+'"/><br/>'+'Price Change<br/>'+'Just Detected!':'<img style="border-width: 0px;" src="'+document._ps_SiteImageBaseURL+'PriceVerified.png" title="Price Verified. No Price Change." alt="No Price Change for '+productTitle+'" /><br/>'+'Just<br/>'+'Verified'):'<table cellspacing="0" cellpadding="0" border="0">'+'<tr>'+'<td valign="middle">'+'<img style="border-width: 0px;" src="'+document._ps_SiteImageBaseURL+'Loading_small.gif" alt="Loading.." />'+'</td>'+'<td align="left" valign="middle" style="padding-left: 6px;">'+'Checking...'+'</td>'+'</tr>'+'<tr>'+'<td class="XSRegTXT-A SellerLastPriceUpdatedCell" align="center" colspan="2">'+'Last&nbsp;verified:<br/>'+'<span class='+updatedStyle+'">'+updated+'</span>'+'</td>'+'</tr>'+'</table>');return cellInnerHtml;};function ConstructPriceGraphCellElement(sellerId,sellerName,isPreferredSeller,isLocalSeller){var cell=document.createElement('td');cell.className="SellerColumn PriceGraphCell";cell.align="center";cell.vAlign="middle";cell.innerHTML=ConstructPriceGraph(sellerId,sellerName,isPreferredSeller,isLocalSeller);return cell;};function ConstructPriceGraph(sellerId,sellerName,isPreferredSeller,isLocalSeller){var cellInnerHtml='<img class="PCursor" onclick="OpenPriceHistory(this,'+document._ps_ProductID+','+sellerId+(document._ps_IsNewCondition?',true':'')+');" title="Click to see Price History Graph for '+sellerName+'" src="'+document._ps_SiteImageBaseURL+(document._ps_Country!=3?'graph_small.png':'graph_small_uk.png')+'" alt="Price Graph History" />'+(isPreferredSeller?'<div class="SpaceDiv6">&nbsp;</div>'+'<a href="'+document._ps_PreferredSellersManageURL+'" title="Preferred Stores. Click to change preferred stores selections.">'+'<img style="border-width: 0px;" src="'+document._ps_SiteImageBaseURL+'Star_medium.png" title="Preferred Stores. Click to change preferred stores selections."/>'+'</a>':'')+(isLocalSeller?'<div class="SpaceDiv6">&nbsp;</div>'+'<img class="PCursor" style="border-width: 0px;" alt="Local Stores" src="'+document._ps_SiteImageBaseURL+'LocalMaps_medium.png" onclick="OpenSellerMap(this,'+sellerId+',false);" title="'+sellerName+' Local Stores" />':'');return cellInnerHtml;};function ConstructPriceTrendCellElement(sellerId,percentileChangeDecrease,percentileChange,lastPriceChange,lastPriceChangeStyle,productTitle){var cell=document.createElement('td');cell.className="SellerColumn PriceChangeCell";cell.align="center";cell.vAlign="middle";cell.innerHTML=ConstructPriceTrend(sellerId,percentileChangeDecrease,percentileChange,lastPriceChange,lastPriceChangeStyle,productTitle);return cell;};function ConstructPriceTrend(sellerId,percentileChangeDecrease,percentileChange,lastPriceChange,lastPriceChangeStyle,producTitle){var cellInnerHtml=percentileChange!=null&&percentileChange!=''&&percentileChange!='0.00%'?'<div class="PCursor '+(percentileChangeDecrease?'PriceChangeDown':'PriceChangeUp')+'" onclick="OpenPriceHistory(this,'+document._ps_ProductID+','+sellerId+(document._ps_IsNewCondition?',true':'')+');" title="Price History Graph">'+'<img style="border-width: 0px;" src="'+document._ps_SiteImageBaseURL+(percentileChangeDecrease?'PriceDrop.png':'PriceRaise.png')+'" alt="'+(percentileChangeDecrease?'Price Drop':'Price Increase')+' for '+producTitle+'"><br/>'+percentileChange+'<br/><br/>'+'<span class="'+lastPriceChangeStyle+'">'+lastPriceChange+'</span>'+'</div>':'';return cellInnerHtml;};function ConstructAvailabilityCellElement(sellerName,availability,redirectUrl,productTitle){var cell=document.createElement('td');cell.className="SellerColumn";cell.align="center";cell.vAlign="middle";cell.innerHTML=ConstructAvailability(sellerName,availability,redirectUrl,productTitle);return cell;};function ConstructAvailability(sellerName,availability,redirectUrl,productTitle){var inventoryIndex=availability.indexOf('[Inventory:');var availabilityPart1;var availabilityPart2;if(inventoryIndex>-1){availabilityPart1=availability.slice(0,inventoryIndex);availabilityPart2=availability.slice(inventoryIndex);}else{availabilityPart1=availability;availabilityPart2='';};var cellinnerHtml=(availabilityPart1.length>36?availabilityPart1.slice(0,36)+'<span>...[<a href="javascript:;" onclick="_ps_ShowShippingEstimates(this);">More</a>]</span><span style="display:none">'+availabilityPart1.split(36)+' [<a href="javascript:;" onclick="_ps_HideShippingEstimates(this);">More</a>]</span>'+availabilityPart2:availability)+'<div class="SpaceDiv6">&nbsp;</div>'+'<a href="'+redirectUrl+'" rel="nofollow" title="Shop Now from "'+sellerName+'" target="_blank">'+'<img style="border-width: 0px;" src="'+document._ps_SiteImageBaseURL+'ShopNowBtn_0.png" alt="Shop Now For '+productTitle+'" />'+'</a>';return cellinnerHtml;};function ConstructStarRating(rating){var starRatingString='';var count=0;while(rating>=1){starRatingString=starRatingString+'<span class="StarSmallSellerFull">&nbsp;</span>';rating--;count++;};var isSet=false;while(count<5){if((rating%1>=.5)&&!isSet){starRatingString=starRatingString+'<span class="StarSmallSellerHalfFull">&nbsp;</span>';isSet=true;}else starRatingString=starRatingString+'<span class="StarSmallEmpty">&nbsp;</span>';count++;};return starRatingString;}

