/* Copyright (c) 2008, Retrevo Inc.  All rights reserved.*/
var gProxyUrl="/redirectUrl?useCache=1&ws_path=";var gProxyUrl2="/redirectUrl?ws_path=";var gUseProxy=1;var gLinkinID=7000848;var gProdVariationMap=null;var gProdIDInputArray=null;var gSDCProductID=null;var gIsInProcess=false;var gLinkType=1;var maxNoOfStores=30;function truncate(A){var B=A+"";if(B.indexOf(".")==-1){return B+".00"}dot=B.length-B.indexOf(".");if(dot>3){return B.substring(0,B.length-dot+3)}else{if(dot==2){return B+"0"}}return B}var BorderContainer=Class.create({initialize:function(){if(arguments.length<1||arguments.length>4){alert("usage: addCustomBorder elementID [type [borderWidth [extraStyle]]]")}var I=$(arguments[0]);if(!I){return }var L=I.up();var Q=L.up();var P=Q.up();if(L.immediateDescendants().length>1||Q.immediateDescendants().length>1||P.immediateDescendants().length>1){return }var K=arguments.length>0&&arguments[1]!=null?arguments[1]:"simple";var B=arguments.length>2&&arguments[2]!=null?arguments[2]:5;var C=arguments.length>3&&arguments[3]!=null?arguments[3]:{};if(typeof (B)=="number"){B=[B,B,B,B]}var E,H,O,N;var J,F;var D,G;if(C.left==undefined||C.left){E='<div id="left" style="float:left;width:'+B[3]+"px;height:"+B[0]+'px" pass></div>';H='<div id="left" style="float:left;width:'+B[3]+"px;height:"+B[2]+'px" pass></div>';L.addClassName(K+"_left");I.setStyle({marginLeft:B[3]+"px"});D="margin-left:"+B[3]+"px"}else{E="";H="";D=""}if(C.right==undefined||C.right){O='<div id="right" style="float:right;width:'+B[1]+"px;height:"+B[0]+'px" pass></div>';N='<div id="right" style="float:right;width:'+B[1]+"px;height:"+B[2]+'px" pass></div>';Q.addClassName(K+"_right");I.setStyle({marginRight:B[1]+"px"});G="margin-right:"+B[1]+"px"}else{O="";N="";G=""}if(C.top==undefined||C.top||C.catalogBorder){J='<div class="'+K+'_top" style="overflow:hidden;height:'+B[0]+'px;">'+E+(C.catalogBorder?'<div id="left2" style="cursor:pointer;float:left;height:'+B[0]+'px" onmouseover=\'catalogBorderMouseOver(this, "left")\' onmouseout=\'catalogBorderMouseOut(this, "left")\'  onclick=\'catalogBorderClick(this, "left")\'  pass></div>':"")+O+(C.catalogBorder?'<div id="right2" style="cursor:pointer;float:right;height:'+B[0]+'px" onmouseover=\'catalogBorderMouseOver(this, "right")\' onmouseout=\'catalogBorderMouseOut(this, "right")\'  onclick=\'catalogBorderClick(this, "right")\' pass></div>':"")+'<div id="border" style="'+D+";"+G+'">'+(C.title?'<div style="height:'+B[0]+'px">'+C.title+"</div>":'<img src="/search/v2/images/spacer.gif" border="0" style="height:'+B[0]+'px" alt="" />')+"</div></div>";new Insertion.Top(P,J)}else{J=null}if(C.bottom==undefined||C.bottom){F='<div class="'+K+'_bottom" style="overflow:hidden;height:'+B[2]+'px;">'+H+N+'<div id="border" style="'+D+";"+G+'"><img src="/search/v2/images/spacer.gif" border="0" style="height:'+B[2]+'px" alt="" /></div></div>';new Insertion.Bottom(P,F)}else{F=null}var M={};if(C.arrow){M.position="relative";new Insertion.Bottom(P,"<div id='_arrow_' class='"+C.arrow+"' style='position:absolute'></div>")}if(C.width){M.width=C.width;Q.setStyle({width:C.width});L.setStyle({width:C.width})}if(C.height){M.height=C.height;var A=C.height-(B[0]+B[2]);I.setStyle({height:A});Q.setStyle({height:A});L.setStyle({height:A})}if(C.margin){M.margin=C.margin}if(M!=""){P.setStyle(M)}if(J!=null){I.setStyle({marginTop:"0px"})}if(F!=null){I.setStyle({marginBottom:"0px"})}this.contentDiv=arguments[0];I.setAttribute("rwidget",this)},updateArrowStyle:function(E,C){var D=$(this.contentDiv);var F=D.up();var I=F.up();var H=I.up();var A=$(H).childElements();for(var B=0;B<A.length;B++){var G=A[B];if(G.id=="_arrow_"){G=$(G);if(E!=null&&E!=undefined){G.className=E}if(C!=null&&C!=undefined){G.setStyle(C)}return }}}});var ParseYahooProductData=Class.create({dataListener:null,requestID:null,isStaticContent:false,initialize:function(C,B,A){this.dataListener=B;this.requestID=C;this.isStaticContent=A},getIndex:function(){return 13},processResponse:function(data){var myparser=data.getData();if(typeof myparser=="string"){myparser=eval("("+myparser+")")}if(this.dataListener&&myparser.result){try{this.dataListener.processEvent({requestID:this.requestID,allProducts:myparser.result},this.isStaticContent)}catch(e){alert(e)}}},processException:function(A){DebugLog.error("In processException -yahooShopping",A.getReason())}});var gProdInfoInputArray=null;var containerSDC="";var gFormat;var gProvider="sdc";var gListDivId;var selectedStyleTitle="";var activeStyle=0;var zipCode="";var gSortType;var gSortOrd;var sdcLogoUrl="";var prodDet=null;var gLinkToDisplay;var gShowListImage=false;var gDivListElementText;var gPriceElementText;var gFullListingText;var gMoreLink="";var gPreviewMoreLink="";var gSortOption="price";var gOffersArray=null;var gShowImage=false;var gKeywordTokens=new Array();var gTitleCheck=false;var gTrackingURL="";var gTblView="list";var gBlankTargetName="_blank";var gGridViewImgHeight=60;var gGridViewImgWidth=90;var gSvrRpcTimeout=20000;var buttonModelHash={};function searchMultiple(G,F,E,C){if(G.length==0){return }var I=new Array();var B=new Array();for(var D=0;D<G.length;D++){I.push(new Product(G[D],null,null,null,null,null,null,null));B.push(G[D])}gProvider=F;gProdInfoInputArray=I;prodDet=gProdInfoInputArray[0];gTrackingURL="/money/"+gProvider;var A="/cataloglisting?minWebRequestTime=1&operation=attributes&priceOnly=1&useCache=5&catid="+gCategoryID+"&catalogid="+B.join(",")+"&isProduction="+(gUseProxy?"0":"1");if(!E){E=900504}var H=A+"&refreshAge=86400000&json=1";C.requestURL=A;ServerRPC.getData(H,C,gSvrRpcTimeout,C)}function getRevenueProvider(B){var A=/(?:pricepid|refreshPricePid)=([^&]+)/;var C=A.exec(B);if(C!=null){return C[1]}return"900999"}function trackPriceClick(A,D,C,B){trackPriceClickInOmniture(getRevenueProvider(A),C,B);urchinTracker(gTrackingURL);showAds(6)}var storesOffersCallbackData=new Array;var storesOffersProductData={processResponse:function(F,C){var A=F.getData();if(typeof A=="string"){A=A.evalJSON()}A.result[0].mOffers=unique(A.result[0].mOffers);if((storesOffersCallbackData[C]!=undefined)&&(storesOffersCallbackData[C].bAdPricing)){try{if((A==null)||(A.result[0]==null)){throw new Error("No Data returned from server for pg ad's")}var B=storesOffersCallbackData[C].adOwnerObj;B.addStoresAndOffers(A.result,true,0);if(storesOffersCallbackData[C].provider==900501){B.displayAd(storesOffersCallbackData[C].outDiv,storesOffersCallbackData[C].adOwnerName,storesOffersCallbackData[C].adFormat,storesOffersCallbackData[C].bAdHeader)}else{if(storesOffersCallbackData[C].adFormat=="rect"){B.displayAd(storesOffersCallbackData[C].outDiv,storesOffersCallbackData[C].adOwnerName,storesOffersCallbackData[C].adFormat,storesOffersCallbackData[C].bAdHeader,true,storesOffersCallbackData[C].provider)}else{B.display(storesOffersCallbackData[C].adFormat,storesOffersCallbackData[C].listDiv,storesOffersCallbackData[C].pids,storesOffersCallbackData[C].provider,storesOffersCallbackData[C].bDisplayAll)}}}catch(D){DebugLog.info("storesOffersProductData - processResponse","storesOffers.js - unable to load ad pricing data\r\n"+D)}return }else{var E=gStoresOffers;if((A!=null)&&(A.result!=null)&&(A.result.length>0)&&(A.result[0].mOffers.length>0)){try{var G=A.result[0].mOffers[0].PartnerID;gStoresOffers.addStoresAndOffers(A.result,false,0);gStoresOffers.display("full","",gStoresOffers.pids,G)}catch(D){DebugLog.info("storesOffersProductData - processResponse","storesOffers.js - unable to load pricing data\r\n"+D)}}else{gStoresOffers.displayNothing("storeDetail")}gStoresOffers.bPriceGetInProgress=false}},processException:function(A){DebugLog.info("storesOffersProductData - processException","Unable to get stores and offers, for ad's: "+this.bAdPricing,A.getReason());if(this.bAdPricing){DebugLog.info("storesOffersProductData - processException",A.getReason())}else{if(typeof gStoresOffers!="undefined"){gStoresOffers.displayError("storeDetail");gStoresOffers.bPriceGetInProgress=false}}}};var storesOffersGotoStoreBtn={processClick:function(E){var F=document.getElementById(E.elementID);var B=F.getAttribute("soListIndex");var C=F.getAttribute("soProductIndex");var A="";if(gStoresOffers.storesOffersList[C].storesOffers[B].type=="offer"){A=gStoresOffers.storesOffersList[C].storesOffers[B].offerUrl;trackTotal=gStoresOffers.storesOffersList[C].storesOffers.length;trackType="k"}else{if(gStoresOffers.storesOffersList[C].storesOffers[B].type=="store"){A=gStoresOffers.storesOffersList[C].storesOffers[B].storeUrl;trackTotal=gStoresOffers.storesOffersList[C].storesOffers.length;trackType="g"}else{return false}}trackTotal=trackTotal==1?1:"n";var D="1_"+trackTotal+"_"+trackType+"_tb_"+gStoresOffers.getPageTracking();trackPriceClick(A,"offersSell",gStoresOffers.storesOffersList[C].storesOffers[B].storeName,gStoresOffers.storesOffersList[C].storesOffers[B].price);window.setTimeout(function(){top.location.href=A+"&mode="+D},100);return false}};var storesOffersSeeAllPricesModel={processClick:function(A){window.open(gPreviewMoreLink,"_top");return false}};var StoresOffers=Class.create({bTitleCheck:false,numToOutput:5,categoryName:"",outputDiv:"",listDiv:"",listDisplayStoresOnly:false,pids:"",keyword:"",categoryId:"",provider:"",activeProduct:0,storesOffersList:null,numToDisplay:0,bJustStores:false,zipCode:null,bDisplayZipCode:false,bDisplayImages:false,sortedStoresOffersList:null,sortOrder:0,sortDataIndex:0,productCatalogId:null,productName:null,productDesc:null,productThumbnailUrl:null,productThumbnailDim:null,bPriceGetInProgress:false,svrRpcTimeout:20000,initialize:function(H,E,D,F,A,I,B,G,C){this.storesOffersList=new Array();this.productDesc=null;this.pids=H;this.keyword=E;this.categoryId=D;this.provider=F;this.bTitleCheck=A;this.numToOutput=I;this.outputDiv=B;this.listDiv=G;this.categoryName=C},newStoresOffersEntry:function(){var A=new Object;A.type="";A.source="";A.partnerId="";A.merchantId="";A.storeName="";A.bTrustedStore=false;A.storeUrl=null;A.storeLogoUrl=null;A.storeLogoDim=null;A.storeDesc=null;A.storeStatus=null;A.rating=-1;A.numReview=0;A.storeTrusted=-1;A.productName="";A.productDesc="";A.productImageUrl=null;A.productImageDim=null;A.productId=null;A.id=null;A.offerDesc=null;A.offerName=null;A.offerUrl=null;A.price="0.00";A.minPrice="0.00";A.maxPrice="0.00";A.shippingZipCode=null;A.salesTax=null;A.shippingCost=null;A.totalCost=null;A.inStock=null;A.stockDesc=null;A.partnerAttribution=null;A.bDisplayed=false;return A},randomOrder:function(){var B=0;var A=Math.random();if(A>0.5){B=1}else{if(A<0.5){B=-1}}return B},isDataToDisplay:function(){var A=true;if((this.storesOffersList==null)||(this.storesOffersList.length==0)){A=false}return A},display:function(H,E,G,B,I){if(I==undefined){I=true}var C="";if(H=="small"){C=this.buildListDisplay(3,2,I,false,true)}else{if(H=="smallWide"){C=this.buildListDisplay(3,3,true,true,false,"",true,false,true)}else{if(H=="medium"){C=this.buildListDisplay(3,2,I,false,true)}else{if(H=="full"){var A=getCookieData("zipcode");C=this.buildDisplay(30,true,true,A,true,G,B)}}}}var F="";var D=document.getElementById(this.outputDiv);if(D!=null){D.innerHTML=C}if(E!=null){D=document.getElementById(E);if(D!=null){D.innerHTML=F;if(E!="sl2"){D.style.border="1px solid #eeeeee"}}}this.loadButtons();if(buttonModelHash.setLocation&&buttonModelHash.setLocation.applyWidgets){buttonModelHash.setLocation.applyWidgets();buttonModelHash.setLocation=null}if((typeof gStoresOffers!="undefined")&&(gStoresOffers.isDataToDisplay())){gStoresOffers.displayPrices("sl2")}},displayPrices:function(H,E){if(H!=null){var G=document.getElementById(H);if(G==null){return }var C=null;var D=false;if(H=="sl3"){C=gStoresOffers.buildListDisplay(3,2,false,false,true)}else{var K=E?30:5;var B=E?false:true;C=this.buildDisplay(K,true,false,null,true,gStoresOffers.pids,null,false,false,B,"inlineWide");D=true}G.innerHTML=C;if(D==true){for(var J=0;J<this.storesOffersList.length;J++){var I=this.storesOffersList[J].storesOffers.length;for(var F=0;F<I;F++){var A="storesOffersBtn"+F+"-"+J;new Button(A,null,Button.GREEN_PUSH)}}}}},displayNothing:function(C){var A='<div class="storesOffersNoInfo">No deals found for this product.</div>';var B=document.getElementById(C);if(B!=null){B.innerHTML=A}},displayError:function(C){var A="<div class=storesOffersListStorePrice>The store price is temporarily unavailable <br>Please try again later</div>";var B=document.getElementById(C);if(B!=null){B.innerHTML=A}},displayAdPrices:function(S,K,E,B,J,P,R){var F="";var H=K[E[0]].partnerId==900506;var M=80;var Q=100;var A=45;var C=55;var D=S;if(S=="inlineWide"){if(R){M=100;Q=140;D="inlineWideVertical"}else{M=75;Q=100}A=100;C=140}var Y=K[E[0]].offerName;if(Y==null){Y=K[E[0]].productName}if((Y!=null)&&(Y.length>M)){var V=Y.indexOf(" ",M);if((V==-1)||(V>Q)){Y=Y.substring(0,Q)+"..."}else{Y=Y.substring(0,V)+"..."}}if(H){var T=K[E[0]].offerDesc}else{var T=""}if((T==null)||(T.toLowerCase()=="not available")){T=""}if(T.length>C){var V=T.indexOf(" ",A);if((V==-1)||(V>C)){T=T.substring(0,A)+"..."}else{T=T.substring(0,V)+"..."}}F+="<tr>";if(S=="inline"){F+='<td colspan="2" class="storesOffersAdTitle">';F+='<div class=storesOffersAdTitleDiv style="color:#666666;font-size:11px;font-weight:bold">'+Y+"</div>";F+="</td>"}else{if(S=="inlineWide"){var I=50;F+='<td class=offerImage style="padding:0px 10px 0px 5px;vertical-align:top">';if(K[E[0]].productImageUrl!=null){var O=getImageDim(K[E[0]].productImageDim,I,I,false);F+="<img "+O+" src='"+K[E[0]].productImageUrl+"' alt=''>"}else{}F+="</td>";F+='<td style="padding:0;vertical-align:center;text-align:left">';F+='<table style="width:100%" cellspacing=0 cellpadding=0 border=0>';F+="<tr>";F+='<td colspan="10" class="storesOffersAdTitle">';if(E.length==1&&H){F+='<a style="font-size:14px;font-weight:bold" href=\'javascript:'+B+".onClickSeller(0, "+E[0]+', true, "'+D+"\", false, 0);'>";F+=Y;F+="</a>"}else{F+='<div class=storesOffersAdTitleDiv style="color:#666666;font-size:12px;font-weight:bold">'+Y+"</div>"}F+="</td>";F+="</tr>"}else{F+="<td colspan=2 class=storesOffersAdTitle>";F+="<a href='javascript:"+B+".onClickSeller(0, "+E[0]+', true, "'+D+"\", true, 0);'>";F+="<div ";if(H){F+=" "}else{F+=" class=storesOffersAdTitleDiv "}F+=' style="font-weight:normal">'+Y+"</div>";F+="</a>";F+="</td>"}}F+="</tr>";if(T!=""){F+='<tr><td colspan=2 class=storesOffersAdDesc style="padding:0px"><div class=storesOffersAdDescDiv>'+T+"</div></td></tr>";if(!(R==true)){}}if(E.length==1){var X="Available for&nbsp;<b>$"+K[E[0]].price+"</b>&nbsp;at&nbsp;<b>"+K[E[0]].storeName+"</b>";if(K[E[0]].price=="Too low to display"){X="See <b>"+K[E[0]].storeName+"</b> for low price"}F+="<tr>";F+='<td colspan=2 class=storesOffersAdDesc style="padding:0px" nowrap>';F+="<div class=storesOffersAdStorePrice>";F+="<a ";if(H){F+=' style="color:#000000" '}F+="href='javascript:"+B+".onClickSeller(0, "+E[0]+', true, "'+D+"\", false, 0);'>";F+=X;F+="</a>";F+="</div>";if(P&&(J!=1)){for(var U=0;U<J;U++){F+="<tr><td colspan=2>&nbsp;</td></tr>"}}F+="</td>";F+="</tr>"}var L="";var G=E.length>J?J:E.length;var W="";if(G>1){for(var N=0;N<G;N++){var X=(K[E[N]].price=="Too low to display")?"See Site":"$"+K[E[N]].price;if(S=="inline"){F+='<tr style="color:blue" onmouseover="this.style.color=\'red\'" onmouseout="this.style.color=\'blue\'" >';F+='<td colspan="2" style="font-size:12px;cursor:pointer" onclick="'+B+".onClickSeller(0, "+E[N]+", true, '"+D+"', false, "+N+');">';F+="<b>"+X+"</b> at <b>"+K[E[N]].storeName+"</b>";F+="</td>";F+="</tr>"}else{if(S=="inlineWide"){if(R){F+="<tr onmouseover=\"this.style.color='red'\" onmouseout=\"this.style.color='blue'\" style='cursor:pointer;color:blue' onclick='"+B+".onClickSeller(0, "+E[N]+', true, "'+D+'", false,'+N+");'>";F+="<td style=\"width:170px;padding:0px\" ><div class=storesOffersAdStore style='font-weight:bold'>";F+=K[E[N]].storeName;F+="</div></td>";F+="<td style=\"width:100px;padding:0px\"><div class=storesOffersAdPrice style='font-weight:bold;text-align:left'>";F+=X;F+="</div></td>";F+='<td style="width:200px;padding:0px;color:#999999;text-align:left">'+this.buildRating(K[E[N]].rating,K[E[N]].numReview)+"</td>";F+="<td>&nbsp;</td></tr>"}else{W="";if(L!=""){W=";padding-left:15px"}L+='<span style="font-size:12px;cursor:pointer;color:blue'+W+'" onmouseover="this.style.color=\'red\'" onmouseout="this.style.color=\'blue\'" onclick="'+B+".onClickSeller(0, "+E[N]+", true, '"+D+"', false,"+N+');">';L+="<b>"+X+"</b> at <b>"+K[E[N]].storeName+"</b>";L+="</span>"}}else{F+="<tr>";F+="<td width='170px' style='cursor:pointer;' onclick='"+B+".onClickSeller(0, "+E[N]+', true, "'+D+'", false,'+N+");'><div class=storesOffersAdStore style=''>";F+="<a href='' onclick='return false'>";F+=K[E[N]].storeName;F+="</a>";F+="</div></td>";F+="<td style='cursor:pointer;' onclick='"+B+".onClickSeller(0, "+E[N]+', true, "'+D+'", false,'+N+");'><div class=storesOffersAdPrice>";F+="<a href='' onclick='return false'>";F+=X;F+="</a>";F+="</div></td>";F+="</tr>"}}}}if(S=="inlineWide"){if(R==false){F+="<tr>";F+='<td colspan=2 class=storesOffersAdDesc style="padding:0px">'+L+"</td>";F+="</tr>"}F+="</table>"}if(P&&(J!=G)){for(var U=0;U<J-G;U++){F+="<tr><td colspan=2>&nbsp;</td></tr>"}}return F},displayAd:function(K,D,S,J,P,A,B,O,M,C){if(C==undefined){C=true}var L=document.getElementById(K);if(L==null){return }if((D==undefined)||(D==null)||(D=="")){return }if((S==undefined)||(S==null)||(S=="")){S="rect"}if(J==undefined){J=true}if((A==undefined)||(A==null)){A="900501"}if(P==undefined){P=true}var N=false;if((this.storesOffersList==undefined)||(this.storesOffersList[0]==undefined)||(this.storesOffersList[0].storesOffers==undefined)||(this.storesOffersList[0].storesOffers==null)||(this.storesOffersList[0].storesOffers.length==0)){N==true;L.innerHTML="";return }if(B==undefined){B=(S=="footer3"||S=="inlineWide")?3:2}if(O==undefined){O=1}if(M==undefined){M=3}var E=new Array();var F=new Array();for(var R=0;R<this.storesOffersList[0].storesOffers.length;R++){if(this.storesOffersList[0].storesOffers[R].isPremium||this.storesOffersList[0].storesOffers[R].storeName.indexOf("Retrevo Marketplace")!=-1){continue}if(F[this.storesOffersList[0].storesOffers[R].productId]!=undefined){var Q=F[this.storesOffersList[0].storesOffers[R].productId];if((P)&&(this.storesOffersList[0].storesOffers[R].partnerId!=A)){continue}E[Q].loc=(E[Q].loc==undefined)?R:E[Q].loc+","+R;E[Q].numSeller++}else{var T=E.length;E[T]=new Object;E[T].productId=this.storesOffersList[0].storesOffers[R].productId;E[T].loc=R+"";E[T].numSeller=1;if(typeof this.storesOffersList[0].storesOffers[R].productId=="undefined"){F[R]=T}else{F[this.storesOffersList[0].storesOffers[R].productId]=T}}}if(E.length==0){N==true;return }var I=E.length>B?B:E.length;var G=0;for(var R=0;R<I;R++){G+=E[R].numSeller}if(G<=3&&S!="inline"){I++;I=I>E.length?E.length:I}var H="";switch(S){case"rect":if(A=="900501"){H=this.buildDisplayRectAd(E,I,O,M,C,D,J)}else{H=this.buildListDisplay(3,3,false,false,false,"",true,false,false,true)}break;case"footer":case"footer2":case"footer3":H=this.buildDisplayFooter3Ad(E,I,O,M,C,D,J);break;case"inline":H=this.buildDisplayInlineAd(E,false,I,O,M,C,D,J);break;case"inlineWide":H=this.buildDisplayInlineAd(E,true,I,O,M,C,D,J,false);break;case"inlineWideVertical":H=this.buildDisplayInlineAd(E,true,I,O,M,C,D,J,true);break;default:H="StoresOffers-->displayAd - Invalid Format: "+S;break}L.innerHTML=H},buildDisplayRectAd:function(A,H,J,K,B,I,C){var E="";if((H>0)&&(C)){E+="<h2>Today's special offer</h2>"}E+="<table class=storesOffersAdTable cellspacing=0 cellpadding=0 border=0>";var G=false;for(var D=0;D<H;D++){if(A[D].numSeller>=J){if(G){E+="<tr><td colspan=2 class=storesOffersAdSeperator></td></tr>"}G=true;var F=A[D].loc.split(",");if(B){F.sort(this.randomOrder)}E+=this.displayAdPrices("rect",this.storesOffersList[0].storesOffers,F,I,K,false)}}E+="</table>";return E},buildDisplayInlineAd:function(A,E,L,N,O,B,M,C,D){var H="";if(L>0&&C){H+='<div id="featuredOffersHeading" class="storesOffersInlineAdTitle">Featured Offers:</div>'}H+="<table class=storesOffersAdTable cellspacing=0 cellpadding=0 border=0>";var J=false;for(var G=0;G<L;G++){if(A[G].numSeller>=N){if(J){H+="<tr><td colspan=2 class=storesOffersAdSeperator></td></tr>"}J=true;var I=A[G].loc.split(",");if(B){I.sort(this.randomOrder)}var K="inline";if(E){K="inlineWide"}H+=this.displayAdPrices(K,this.storesOffersList[0].storesOffers,I,M,O,false,D);if(K=="inline"&&A[G].numSeller>=3){break}}}if(E&&D){if(D){var F='style="padding:15px 0px 0px 0px;font-weight:bold;text-align:left"'}H+="<tr><td colspan=10 "+F+" onclick=\"showURL(gPreviewMoreLink,event)\"><a href='' onclick='return false;'>See More Offers ...</a></td></tr>"}H+="</table>";return H},buildDisplayFooter3Ad:function(A,G,I,J,B,H,C){var E="";if(G<=0){return E}E+='<table class=storesOffersAdTable cellspacing=0 cellpadding=0 border=0 style="margin:auto">';if(C){E+="<tr>";E+="<td align=center>";E+="<h2>Today's special offers</h2>";E+="</td>";E+="</tr>"}E+="<tr>";E+="<td>";E+="<table class=storesOffersAdTable cellspacing=0 cellpadding=0 border=0>";E+="<tr>";for(var D=0;D<G;D++){if(A[D].numSeller>=I){var F=A[D].loc.split(",");if(B){F.sort(this.randomOrder)}E+="<td style='vertical-align:top;width:330px'><div style=\"padding:0px 5px 0px 5px\">";E+='<table style="width:100%" class=storesOffersAdTable cellspacing=0 cellpadding=0 border=0>';E+=this.displayAdPrices("footer",this.storesOffersList[0].storesOffers,F,H,J,false);E+="</table>";E+="</div></td>"}}E+="</tr>";E+="</table>";E+="</td>";E+="</tr>";E+="</table>";return E},buildListDisplay:function(O,W,F,E,Y,Q,H,P,R,C,d,S){var a=new Array();if((this.storesOffersList==undefined)||(this.storesOffersList[0]==undefined)||(this.storesOffersList[0].storesOffers==undefined)||(this.storesOffersList[0].storesOffers==null)||(this.storesOffersList[0].storesOffers.length==0)){return }if((O==undefined)||(O==-1)||(O>this.storesOffersList[0].storesOffers.length)){O=this.storesOffersList[0].storesOffers.length}if((W==undefined)||(W==-1)||(W>this.storesOffersList[0].storesOffers.length)){W=O}if(F==undefined){F=true}if(E==undefined){E=true}if(Y==undefined){Y=false}if(Q==undefined){Q=""}if(H==undefined){H=true}if(P==undefined){P=false}if(R==undefined){R=false}if(C==undefined){C=false}if(d==undefined){d=true}if(S==undefined){S=true}if(O==0){return a.join("")}var N=0;var J=0;for(var Z=0;Z<this.storesOffersList[0].storesOffers.length;Z++){if(this.storesOffersList[0].storesOffers[Z].type=="store"){N++}else{if(this.storesOffersList[0].storesOffers[Z].type=="offer"){J++}}}var L=false;if(N>=O){L=true}if(!L){O=W}var G=80;var g=120;var I=100;var T=120;var b="list";if(Y){G=50;g=60;I=50;T=60;b="slist"}else{if(C){G=50;g=50;b="ad"}else{if(R){G=120;g=160;I=140;T=175;b="adwide"}}}var D=0;var K=1;a.push("<div id='offerContainer'>");if(H){if(R){a.push('<div class="storesOffersSectionTitle" style="text-align:center;">Featured Offers:</div>')}else{a.push('<div class="storesOffersSectionTitle">Featured Offers:</div>')}}a.push("<table cellspacing=0 cellpadding=0 border=0>");if(P&&L){K=2;a.push("<tr>");a.push('<td style="border:none 0;" align=top>');a.push('<img src="'+this.storesOffersList[0].productThumbnailUrl+'" alt="">');a.push("</td>");a.push('<td style="border:none 0;padding:0;" align=top>');a.push("<table cellspacing=0 cellpadding=0 border=0>")}if(d){for(var Z=0;Z<this.storesOffersList[0].storesOffers.length;Z++){if(this.storesOffersList[0].storesOffers[Z].isPremium||this.storesOffersList[0].storesOffers[Z].storeName.indexOf("Retrevo Marketplace")!=-1){continue}if(this.storesOffersList[0].storesOffers[Z].type=="store"){this.storesOffersList[0].storesOffers[Z].bDisplayed=true;var j=(this.storesOffersList[0].storesOffers[Z].price=="Too low to display")?"See Site":"$"+this.storesOffersList[0].storesOffers[Z].price;if(L){var U=this.storesOffersList[0].storesOffers[Z].storeName;if(U.length>23){U=U.substring(0,20)+"..."}var B=U.replace(/\'/g,"\\'");a.push("<tr>");a.push('<td class="storesOffersListOld">');a.push('<a style="cursor:pointer;text-decoration:none" onclick="gStoresOffers.onClickSeller(0, '+Z+" ,false,'"+b+"',false,-1);\">");a.push(U);a.push("</a>");a.push("</td>");a.push('<td class="storesOffersListOld">');a.push("&nbsp;&nbsp;&nbsp;&nbsp;");a.push('<a style="cursor:pointer;" onclick="gStoresOffers.onClickSeller(0, '+Z+", false,'"+b+"',false,-1);\">");a.push(j);a.push("</a>");a.push("</td>");if(R){a.push('<td style="text-align:left;width:200px;">');var V=this.buildRating(this.storesOffersList[0].storesOffers[Z].rating,this.storesOffersList[0].storesOffers[Z].numReview,true);a.push(V);a.push("</td>")}a.push("</tr>")}else{a.push("<tr class=offerSmall onclick='gStoresOffers.onClickSeller(0, "+Z+', false,"'+b+"\",true,-1);'>");if(E){a.push("<td class=offerImage>");if(this.storesOffersList[0].storesOffers[Z].productImageUrl!=null){var X=getImageDim(this.storesOffersList[0].storesOffers[Z].productImageDim,75,75,false);a.push("<img "+X+" src='"+this.storesOffersList[0].storesOffers[Z].productImageUrl+"' alt=''>")}else{}a.push("</td>")}var h=(this.storesOffersList[0].storesOffers[Z].productName==null)?"":this.storesOffersList[0].storesOffers[Z].productName;if(h.length>G){var e=h.indexOf(" ",G);if((e==-1)||(e>g)){h=h.substring(0,G)+"..."}else{h=h.substring(0,e)+"..."}}var c="";if(!Y){c=(this.storesOffersList[0].storesOffers[Z].productDesc==null)?"":this.storesOffersList[0].storesOffers[Z].productDesc;if(c.length>I){var e=c.indexOf(" ",I);if((e==-1)||(e>T)){c=c.substring(0,I)+"..."}else{c=c.substring(0,e)+"..."}}}a.push("<td>");a.push("<div class=offerTitle >");a.push("<a onclick='return false;' href='"+this.storesOffersList[0].storesOffers[Z].storeUrl+"'>");a.push(h);a.push("</a>");a.push("</div>");if(c!=""){a.push("<div class=offerSummary>"+c+"</div>")}a.push("<div class=offerLastLine>");a.push("<a href='"+this.storesOffersList[0].storesOffers[Z].storeUrl+"' onclick='return false;' style='color:green'>");if(Y){a.push("Available&nbsp;for")}else{a.push("Price")}a.push("&nbsp;<span class=offerPrice>"+j+"</span>");a.push("&nbsp;at&nbsp;<span class=offerPrice>"+this.storesOffersList[0].storesOffers[Z].storeName+"</span>");a.push("</a>");a.push("</div>");a.push("</td>");a.push("</tr>")}D++;if(D>=O){break}}}}if((D<O)&&(S)){if(E){K=2}for(var Z=0;Z<this.storesOffersList[0].storesOffers.length;Z++){if(this.storesOffersList[0].storesOffers[Z].type!="offer"||this.storesOffersList[0].storesOffers[Z].isPremium||this.storesOffersList[0].storesOffers[Z].storeName.indexOf("Retrevo Marketplace")!=-1){continue}this.storesOffersList[0].storesOffers[Z].bDisplayed=true;a.push("<tr class=offerSmall onclick='gStoresOffers.onClickOffer(0, "+Z+', "'+b+"\");'>");if(E){a.push("<td class=offerImage>");if(this.storesOffersList[0].storesOffers[Z].productImageUrl!=null){var X=getImageDim(this.storesOffersList[0].storesOffers[Z].productImageDim,75,75,false);a.push("<img "+X+" src='"+this.storesOffersList[0].storesOffers[Z].productImageUrl+"' alt=''>")}a.push("</td>")}var h=(this.storesOffersList[0].storesOffers[Z].offerName==null)?"":this.storesOffersList[0].storesOffers[Z].offerName;if(h.length>G){var e=h.indexOf(" ",G);if((e==-1)||(e>g)){h=h.substring(0,G)+"..."}else{h=h.substring(0,e)+"..."}}var c="";if(true||!Y){c=(this.storesOffersList[0].storesOffers[Z].offerDesc==null)?"":this.storesOffersList[0].storesOffers[Z].offerDesc;var M=(this.storesOffersList[0].storesOffers[Z].storeDesc==null)?"":this.storesOffersList[0].storesOffers[Z].storeDesc;var f=(this.storesOffersList[0].storesOffers[Z].storeStatus==null)?"":this.storesOffersList[0].storesOffers[Z].storeStatus;var A=new Array();if(M!=""){A.push(M)}if(f!=""){A.push(f)}if(A.length>0){c="<b>"+A.join(", ")+"</b> "+c}if(c.length>I){var e=c.indexOf(" ",I);if((e==-1)||(e>I)){c=c.substring(0,I)+"..."}else{c=c.substring(0,e)+"..."}}if(c.indexOf("</b>")==-1){c+="</b>"}}a.push('<td style="padding:5px 0px 0px 0px">');a.push("<div class=offerTitle >");a.push("<a  style=\"font-weight:bold\"  onclick='return false;' href='"+this.storesOffersList[0].storesOffers[Z].offerUrl+"'>");a.push(h);a.push("</a>");a.push("</div>");if(c!=""){a.push('<div class=offerSummary style="font-size:0.9em;color:#333333">'+c+"</div>")}a.push("<div class=offerLastLine>");a.push("<a href='"+this.storesOffersList[0].storesOffers[Z].offerUrl+"' onclick='return false;' style='color:green;font-size:0.9em'>");if(Y){a.push("Available&nbsp;for")}else{a.push("Price")}a.push("&nbsp;<span class=offerPrice>$"+this.storesOffersList[0].storesOffers[Z].price+"</span>");a.push("&nbsp;at&nbsp;<span class=offerPrice>"+this.storesOffersList[0].storesOffers[Z].storeName+"</span>");a.push("</a>");a.push("</div>");a.push("</td>");a.push("</tr>");D++;if(D>=O){break}}}if(P&&L){a.push("</table>");a.push("</td>");a.push("</tr>")}if((this.storesOffersList[0].storesOffers.length>O)&&(F)){a.push("<tr>");if(K==2){a.push("<td>&nbsp;</td>")}a.push("<td>");if(L){a.push("<div style='height:2px;line-height:2px'>&nbsp;</div>")}else{a.push("<div style='height:5px;line-height:5px'>&nbsp;</div>")}a.push('<div style="text-align:left">');a.push('<span><a style="font-size:11px;color:#666666" onmouseover="this.style.color=\'red\'" onmouseout="this.style.color=\'#666666\'" href="" onclick="showURL(gPreviewMoreLink,event)">See All Prices ...</a></span>');a.push("</div>");if(!L){a.push("<div style='height:5px;line-height:5px'>&nbsp;</div>")}a.push("</td>");a.push("</tr>")}a.push("</table>");a.push("</div>");this.listDisplayStoresOnly=L;return a.join("")},buildRating:function(D,H,I){var F="";var G="";if((I==undefined)||(I)){G="Single"}var B=5-D;var C=Math.floor(D);var A=Math.floor(B);if(D-C>0.5){C=C+1}if(B-A>0.5){A=A+1}F+="<div>";F+="<div class='storesOffersRatingStars"+G+"'>";for(var E=0;E<C;E++){F+='<img class="rating-star" src="/search/v2/images/rating-star-active.gif">'}if(D-C==0.5){F+='<img class="rating-star" src="/search/v2/images/rating-star-active-half.gif">'}for(var E=0;E<A;E++){F+='<img class="rating-star" src="/search/v2/images/rating-star-inactive.gif">'}F+="</div>";if(H>0){F+="<div class='storesOffersRating"+G+"'>"+H+" store reviews</div>"}else{if(D>0){var J=parseFloat(D).toFixed(1);F+="<div class='storesOffersRating"+G+"'>"+J+" average rating</div>"}else{F+="<div class='storesOffersRating"+G+"'></div>"}}F+="</div>";return F},buildSeller:function(A,C,L,D){var I="";if(A.type=="offer"){I+="<table class=storesOffersOfferSeller cellspacing=0 cellpadding=0 border=0>";var E=1;if(A.productImageUrl!=null){E=2}if(A.productName!=""){var M=A.productName;if(M.length>80){var N=M.indexOf(" ",80);if((N==-1)||(N>100)){M=M.substring(0,80)+"..."}else{M=M.substring(0,N)+"..."}}I+="<tr>";I+="<td colspan="+E+"><div class=storesOffersOfferProdName>"+M+"</div></td>";I+="</tr>"}I+="<tr>";if(A.productImageUrl!=null){var H="";if(A.productImageDim!=null){H=getImageDim(A.productImageDim,60,60,false)}I+="<td width='60px'>";I+="<img "+H+" alt='' src='"+A.productImageUrl+"'>";I+="</td>"}I+="<td align=left width='100%'>";var K="";if(A.productDesc!=""){K=A.productDesc;if(K.length>100){var N=K.indexOf(" ",100);if((N==-1)||(N>120)){K=K.substring(0,100)+"..."}else{K=K.substring(0,N)+"..."}}}else{K=(A.offerDesc==null)?"":A.offerDesc;var B=(A.storeDesc==null)?"":A.storeDesc;var J=(A.storeStatus==null)?"":A.storeStatus;var G=new Array();if(B!=""){G.push(B)}if(J!=""){G.push(J)}if(G.length>0){K="<b>"+G.join(", ")+"</b> "+K}if(K.length>100){var F=K.indexOf(" ",100);if((F==-1)||(F>100)){K=K.substring(0,100)+"..."}else{K=K.substring(0,F)+"..."}}if(K.indexOf("</b>")==-1){K+="</b>"}}if(K!=""){I+="<div class=storesOffersOfferDesc>"+K+"</div>"}if(A.storeName!=""){I+="<div class=storesOffersOfferStore>"+A.storeName+"</div>"}I+="</td>";I+="</tr>";I+="</table>"}else{if(A.type=="store"){I+='<div class="storesOfferStoreStoreDiv">';if((this.bJustStores)||((!this.bJustStores)&&(this.productThumbnailUrl==null))){I+="<table cellspacing= cellpadding=0 border=0>";I+="<tr>";I+="<td style='border-top:none;border-bottom:none' valign='middle' style='padding-left:10px;'>";if(A.storeLogoUrl!=null){I+="<img src='"+A.storeLogoUrl+"' alt=\""+A.storeName+'">'}else{I+='<div class="storesOffersStoreStore" style="padding-left:5px;">'+A.storeName+"</div>"}I+="</td>";I+="</tr>";I+="</table>"}else{var E=1;if(this.productThumbnailUrl!=null){E++}I+='<table class=storesOffersOfferSeller cellspacing=0 cellpadding=0 border=0 onclick="gStoresOffers.onClickSeller('+C+", '"+L+"', false, '"+D+"', false,-1)\">";I+="<tr>";I+="<td colspan="+E+"><div class=storesOffersOfferProdName>"+this.productName+"</div></td>";I+="</tr>";I+="<tr>";if(this.productThumbnailUrl!=null){I+="<td width='60px'>";var H="";if(this.productThumbnailDim!=null){H=getImageDim(this.productThumbnailDim,60,60,false)}I+="<img src='"+this.productThumbnailUrl+"' "+H+" alt=''>";I+="</td>"}I+="<td>";if(A.storeLogoUrl==null){I+="<div class=storesOffersOfferStore>"+A.storeName+"</div>"}else{I+="<img src='"+A.storeLogoUrl+"' alt='"+A.storeName+"'>"}I+="</td>";I+="</tr>";I+="</table>"}I+="</div>"}else{I="Unknown type"}}return I},buildPriceDetailPrice:function(D,B,A){var C="";if((D.totalCost=="0")||(D.totalCost=="0.00")){C+="<div class=storesOffersPrice>$"+D.price+"<div>";return C}C+="<table class=storesOffersDetailPriceTable cellspacing=0 cellpadding=0 border=0>";C+="<tr>";C+="<td class=storesOffersDetailPriceLeft>Price:</td>";if(D.price=="Too low to display"){C+="<td class=storesOffersDetailPriceRight>See Site<td>"}else{C+="<td class=storesOffersDetailPriceRight>$"+D.price+"<td>"}C+="</tr>";C+="<tr>";C+="<td class=storesOffersDetailPriceLeft>Tax:</td>";if((D.salesTax==null)||(D.salesTax==undefined)||D.salesTax=="Check Site"){C+="<td class=storesOffersDetailPriceRight>See Site<td>"}else{if(D.salesTax=="0.00"){C+="<td class=storesOffersDetailPriceRight>None<td>"}else{C+="<td class=storesOffersDetailPriceRight>$"+D.salesTax+"<td>"}}C+="</tr>";C+="<tr>";C+="<td class=storesOffersDetailPriceLeft>Shipping:</td>";if((D.shippingCost==null)||(D.shippingCost==undefined)||D.shippingCost=="Check Site"){C+="<td class=storesOffersDetailPriceRight>See Site<td>"}else{if(D.shippingCost=="0.00"){C+="<td class=storesOffersDetailPriceRight>Free<td>"}else{C+="<td class=storesOffersDetailPriceRight>$"+D.shippingCost+"<td>"}}C+="</tr>";C+="<tr>";C+="<td class=storesOffersDetailPriceTotalLeft>Total:</td>";if((D.totalCost==null)||(D.totalCost==undefined)||D.totalCost=="Check Site"||D.totalCost=="Too low to display"){C+="<td nowrap class=storesOffersDetailPriceTotalRight>See Site<td>"}else{C+="<td nowrap class=storesOffersDetailPriceTotalRight>";C+="<a href='"+D.storeUrl+"' target='_blank' onclick='gStoresOffers.onClickTrack("+B+", "+A+",this.href)'>";C+="$"+D.totalCost;C+="</a>";C+="<td>"}C+="</tr>";C+="</table>";return C},buildDisplay:function(c,Y,K,L,B,Z,A,T,S,Q,b){var X=new Array();if((c==-1)||(this.storesOffersList.length>0&&c>this.storesOffersList[0].storesOffers.length)){numToDisplay=this.storesOffersList[0].storesOffers.length}else{numToDisplay=c}if(K==undefined){K=false}if(B==undefined){B=false}if(Q==undefined){Q=false}if(L==null){L=""}this.zipCode=L;this.bDisplayZipCode=K;if(T==undefined){T=true}if(b==undefined){b="tb"}this.bDisplayImages=B;this.numDisplayed=numToDisplay;if(numToDisplay==0){X.push("<div class='storesOffersNoInfo' style='padding-bottom:10px'>No deals found for this product.</div>");return X.join("")}if(S==undefined){S=true}if(B){if((Z!=undefined)&&(Z.length>1)){var F=new Array();F.push("<div id='prodList'>");if(Z.length>3){F.push("<div id='prodLstScroller' style='height:250px;position:relative;overflow-y:scroll;overflow-x:hidden;top:0px'>");F.push("<div currentPos='0' numItems='"+Z.length+"' id='prodLstScrollerLst' style='position:absolute;top:0px'>")}for(var W=0;W<Z.length;W++){F.push('<div style="border-top:1px solid #ccc;">');var H="#ffffff";if(W==gStoresOffers.activeProduct){H="#d3d3d3"}F.push("<table id='prodLstCell"+W+"' bgcolor='"+H+"' style='padding-left:3px;padding-right:3px' cellspacing=0 cellpadding=0 border=0 width='100%' onmouseover='gStoresOffers.prodListMouse(\"over\", "+W+")' onmouseout='gStoresOffers.prodListMouse(\"out\", "+W+")' onclick='gStoresOffers.prodListClick("+W+")'>");F.push("<tr height='64px' style='cursor:pointer;'>");F.push("<td valign='middle' style='padding-right:5px;width:80px;'>");var V=getImageDim(Z[W].getProductImageDimension(),75,75,false);F.push("<img "+V+" id='prodSelImage"+W+"' src='"+Z[W].getProductImage()+"'>");F.push("</td>");F.push("<td align='top' valign='middle'>");F.push("<table cellspacing=0 cellpadding=0 border=0>");F.push("<tr>");F.push("<td>");var d=StringUtil.priceTitleLimitCharacters(Z[W].getProductTitle(),120);F.push("<div id='prodSelTitle"+W+"' style='font-weight:bold'>"+d+"</div>");F.push("</td>");F.push("</tr>");F.push("<tr>");F.push("<td nowrap>");F.push("<div id='prodSelSKU"+W+"'>SKU: "+Z[W].getProductId()+"</div>");F.push("</td>");F.push("</tr>");if((Z[W].getMinPrice()!="none")&&(Z[W].getMaxPrice()!="none")){F.push("<tr>");F.push("<td nowrap>");var U="?";if(Z[W].getMinPrice()==Z[W].getMaxPrice()){U="Price: $"+Z[W].getMinPrice()}else{U="Price: $"+Z[W].getMinPrice()+" to $"+Z[W].getMaxPrice()}F.push("<div id='prodSelPrice"+W+"'>"+U+"</div>");F.push("</td>");F.push("</tr>")}F.push("</table>");F.push("</td>");F.push("</tr>");F.push("</table>");F.push("</div>")}if(Z.length>3){F.push("</div>");F.push("</div>")}F.push("</div>");if($("osProductSelection")){$("osProductSelection").update(F.join(""))}else{X.push(F.join(""))}var C=document.getElementById("mainProductImage");if(C!=null){C.src=Z[gStoresOffers.activeProduct].getProductLargeImage()}}}if(K){X.push('<table cellspacing=0 cellpadding=0 border=0 width="100%" style="margin-bottom:5px"><tr><td style="border:none;padding:2px 0px 5px 0px">');X.push('<span style="float: right;"><form style="margin:0px;padding:0px" name="zipForm" onsubmit="return gStoresOffers.searchStoreWithZip();">');X.push("<table cellpadding=0 cellspacing=0 border=0>");X.push("<tr>");X.push('<td valign=middle style="border:none;padding:0px 5px 0px 0px"><div class="storesOffersZipIcon"></div></td>');X.push('<td class=storesOffersEnterZipLabel style="border:none;padding: 0px 5px 0px 0px" valign=middle>Enter zip code for tax &amp; shipping:</td>');X.push('<td style="border:none;padding: 0 5px 0 0" valign=middle><input type="text" name="zip"  size="5" maxlength="5" autocomplete="off" value="'+L+'"></td>');X.push('<td style="border:none;padding: 0 0 0 0" valign=middle>');X.push('<span id="setLocation" style="vertical-align: middle;" >');X.push('<a href="">Set Location</a>');X.push("</span>");X.push("</td>");X.push("</tr>");X.push("</table>");X.push("</form></span>");X.push('<span style="font-size:20px;font-family:Georgia ">Store Prices:</span>');X.push('<div class="clearDivBoth"></div>');X.push("</td></tr></table>");var M={applyWidgets:function(){var e={processClick:function(f){gStoresOffers.searchStoreWithZip();return false}};Model.attach(e);new Button("setLocation",e,Button.GREEN_SMALL_PUSH)}};buttonModelHash.setLocation=M}if(K){for(var W=0;W<numToDisplay;W++){if((this.storesOffersList[0].storesOffers[W].totalCost=="0")||(this.storesOffersList[0].storesOffers[W].totalCost=="0.00")){X.push("<div class=storesOffersInvalidZip>Invalid Zip Code</div>");break}}}var P=this.storesOffersList.length;if(b!="tb"){P=1}for(var a=0;a<P;a++){if((c==-1)||(c>this.storesOffersList[a].storesOffers.length)){numToDisplay=this.storesOffersList[a].storesOffers.length}else{numToDisplay=c}if(numToDisplay<=0){continue}var I=true;for(var W=0;W<numToDisplay;W++){if(this.storesOffersList[a].storesOffers[W].type=="offer"){I=false;break}}var O=0;var D=0;for(var W=0;W<numToDisplay;W++){if(this.storesOffersList[a].storesOffers[W].type=="store"){O++}else{if(this.storesOffersList[a].storesOffers[W].type=="offer"){D++}}}this.bJustStores=false;if(O==numToDisplay){this.bJustStores=true}A=this.storesOffersList[a].storesOffers[0].partnerId;if(a!=0){X.push("<table border=0 cellpadding=0 cellspacing=0 width='100%'>");X.push("<tr>");X.push('<td height="2px" style="xborder:2px solid #cfcfcf;width:100%;height:2px;line-height:2px;padding:0px"><hr size=2 color="#cfcdcd"></td>');X.push("</tr>");X.push("<tr>");var J=this.storesOffersList[a].productName;if(J.length>25){J=J.substring(0,25)+"..."}X.push('<td style="font-weight:bold;color:#999999;padding:5px 0px 10px 0px">... users also liked: <span style="color:#333333;font-size:14px">'+this.storesOffersList[a].productName+"</span></td>");X.push("</tr>");X.push("</table>")}else{if(Z!=undefined&&Z.length>1&&T){X.push('<div style="height:25px;">');X.push('<div id="prodLstBtnDiv" class="prodStyleChooserBtn" onmouseover="gStoresOffers.styleChooserHover();" onMouseOut="gStoresOffers.styleChooserOut();" onclick="javascript:gStoresOffers.prodListDisplay();">');X.push("Select a Style");X.push("</div>");var d=StringUtil.priceTitleLimitCharacters(Z[gStoresOffers.activeProduct].getProductTitle(),65);X.push('<div style="float:right;padding-left:0px;color:#333333;font-size:1.1em;font-weight:bold;width:450px;">'+d+"</div>");X.push("</div>")}}X.push("<table class=storesOffersTable border=0 cellpadding=0 cellspacing=0 width='100%'>");X.push("<tr>");if(Y){X.push("<td class=storesOffersHeaderBorder style='cursor: pointer;padding-left:40px;' valign=middle align=left ");X.push("onclick='gStoresOffers.mouseClick(this, "+a+', "seller")\' ');X.push("onmouseover='gStoresOffers.mouseOverOutHeader(this, "+a+', "seller", "over")\' ');X.push("onmouseout='gStoresOffers.mouseOverOutHeader(this, "+a+', "seller", "out")\'>');X.push("<table class=storesOffersHeaderTable cellspaceing=0 cellpadding=0 border=0>");X.push("<tr>");X.push('<td valign=middle id="storesOffersSortSellerText'+a+'" class=storesOffersHeaderTextSort>');X.push("Seller");X.push("</td>");X.push('<td id="storesOffersSortSellerArrowTd'+a+'" valign=middle>');X.push('<div id="storesOffersSortSellerArrow'+a+'" class=storesOffersSortArrowNone></div>');X.push("</td>");X.push("</tr>");X.push("</table>");X.push("</td>");if(I){X.push("<td class=storesOffersHeaderBorder style='cursor: pointer;' valign=middle align=center width='155px' ");X.push("onclick='gStoresOffers.mouseClick(this, "+a+', "rating")\' ');X.push("onmouseover='gStoresOffers.mouseOverOutHeader(this, "+a+', "rating", "over")\' ');X.push("onmouseout='gStoresOffers.mouseOverOutHeader(this, "+a+', "rating", "out")\'>');X.push("<table class=storesOffersHeaderTable cellspaceing=0 cellpadding=0 border=0>");X.push("<tr>");X.push('<td nowrap valign=middle id="storesOffersSortRatingText'+a+'" class=storesOffersHeaderTextSort>');X.push("Seller Rating");X.push("</td>");X.push('<td id="storesOffersSortRatingArrowTd'+a+'" valign=middle>');X.push('<div id="storesOffersSortRatingArrow'+a+'" class=storesOffersSortArrowNone></div>');X.push("</td>");X.push("</tr>");X.push("</table>");X.push("</td>")}X.push("<td class=storesOffersHeaderBorder style='cursor: pointer;' width='155px' valign=middle align=center ");X.push("onclick='gStoresOffers.mouseClick(this, "+a+', "price")\' ');X.push("onmouseover='gStoresOffers.mouseOverOutHeader(this, "+a+', "price", "over")\' ');X.push("onmouseout='gStoresOffers.mouseOverOutHeader(this, "+a+', "price", "out")\'>');X.push("<table class=storesOffersHeaderTable cellspaceing=0 cellpadding=0 border=0>");X.push("<tr>");X.push('<td valign=middle id="storesOffersSortPriceText'+a+'" class=storesOffersHeaderTextSort>');X.push("Price");X.push("</td>");X.push('<td id="storesOffersSortPriceArrowTd'+a+'" valign=middle>');X.push('<div id="storesOffersSortPriceArrow'+a+'" class=storesOffersSortArrowNone></div>');X.push("</td>");X.push("</tr>");X.push("</table>");X.push("</td>")}else{X.push("<td class=storesOffersHeaderBorder valign=middle align=center>");X.push("<div class=storesOffersHeaderSort>Seller</div>");X.push("</td>");if(I){X.push("<td class=storesOffersHeaderBorder width='200px' valign=middle align=center>");X.push("<div class=storesOffersHeaderSort>Seller Rating</div>");X.push("</td>")}X.push("<td class=storesOffersHeaderBorder width='155px' valign=middle align=center>");X.push("<div class=storesOffersHeaderText>Price</div>");X.push("</td>")}X.push("<td class=storesOffersHeaderBorder width='155px' valign=middle align=center>");X.push("<div class=storesOffersHeaderText>&nbsp;</div>");X.push("</td>");X.push("</tr>");var G="tb";if(b=="inlineWide"){G="inlineWideVertical"}for(var W=0;W<numToDisplay;W++){if((this.storesOffersList[a].storesOffers[W].isPremium&&!I)||this.storesOffersList[a].storesOffers[W].storeName.indexOf("Retrevo Marketplace")!=-1){continue}this.storesOffersList[a].storesOffers[W].bDisplayed=true;X.push('<tr onMouseOver="this.className=\'highlight\'" onMouseOut="this.className=\'normal\'" onClick="gStoresOffers.onClickSeller('+a+", '"+W+"', false, '"+G+"',false,-1);return false;\">");X.push("<td id='storesOffersSellerCell"+W+"-"+a+'\' class=storesOffersSellerTD valign=middle align=left style="padding:2px 0px 2px 15px;">');var E=this.buildSeller(this.storesOffersList[a].storesOffers[W],a,W,G);X.push(E);X.push("</td>");if(I){X.push("<td id='storesOffersRatingCell"+W+"-"+a+"' class=storesOffersRatingTD valign=middle>");if(this.storesOffersList[a].storesOffers[W].storeName=="Amazon.com"){X.push("<div class=storesOffersRating>&nbsp;</div>")}else{var E=this.buildRating(this.storesOffersList[a].storesOffers[W].rating,this.storesOffersList[a].storesOffers[W].numReview,false);X.push(E)}X.push("</td>")}if((this.storesOffersList[a].storesOffers[W].type=="store")&&(L!=undefined)&&(L!="")){X.push("<td id='storesOffersPriceCell"+W+"-"+a+"' valign=middle align=center class=storesOffersPriceNoCursorTD itemIndex="+W+">")}else{X.push("<td id='storesOffersPriceCell"+W+"-"+a+"' valign=middle align=center class=storesOffersPriceTD itemIndex="+W+" productIndex="+a+">")}X.push("<div id='storesOffersPriceDiv"+W+"-"+a+"' class=storesOfferPrice>");if((L!=undefined)&&(L!="")){X.push(this.buildPriceDetailPrice(this.storesOffersList[a].storesOffers[W],a,W))}else{if(this.storesOffersList[a].storesOffers[W].price=="Too low to display"){X.push("<span style='font-size:0.8em;font-weight:bold'>See Site</span>")}else{X.push("$"+this.storesOffersList[a].storesOffers[W].price)}}X.push("</div>");X.push("<div id='storesOffersConditionDiv"+W+"-"+a+'\' class="storesOffersRefurbishedPrice" ');if(this.storesOffersList[a].storesOffers[W].condition!=undefined&&this.storesOffersList[a].storesOffers[W].condition.toLowerCase()!="new"){X.push(" style='display:block;'>");X.push(this.storesOffersList[a].storesOffers[W].condition)}else{X.push(" style='display:none;'>");X.push("New")}X.push("</div>");X.push("</td>");X.push("<td class=storesOffersSeeItTD>");X.push("<div id=storesOffersListButton>");var N=this.storesOffersList[a].storesOffers[W].storeUrl;if(N==null){N=this.storesOffersList[a].storesOffers[W].offerUrl}X.push("<span id='storesOffersBtn"+W+"-"+a+"' soListIndex='"+W+"' soProductIndex='"+a+"'><a href='"+N+"'>See It</a></span>");X.push("</div>");X.push("</td>");X.push("</tr>")}if(Q&&this.storesOffersList[0].storesOffers.length>c){X.push('<tr style="height:42px;" onMouseOver="this.className=\'highlight\'" onMouseOut="this.className=\'normal\'">');X.push('<td colspan="4" class=storesOffersSellerTD valign=bottom align=center style="border-right:1px solid #cfcfcf;padding:2px 0px 2px 10px;font-size:1.5em;">');X.push('<a href="#" onclick="gStoresOffers.displayPrices(gListDivId,true);return false;">See All Prices</a>');X.push("</td>");X.push("</tr>")}X.push("</table>");if(A&&S){X.push('	<table cellpadding="0" cellspacing="0" border="0" width="100%">');X.push("		<tr>");X.push('<th class="sdcFooter">');if(A=="900506"){X.push("<table align=right cellspacing=0 cellpadding=0>");X.push("<tr>");X.push('<td nowrap valign=middle style="padding:0px;border:none;font-size:10px;font-weight:normal;color:#666666"">Powered by:&nbsp;</td>');X.push('<td valign=middle style="padding:0px;border:none"><a style="border:none" href="http://www.shopping.com"> <img src="http://img.shopping.com/sc/glb/sdc_logo_106x19.gif"/></a></td>');X.push("</tr>");X.push("</table>")}else{if(A=="900504"){X.push('<br/><a href="http://shopping.yahoo.com"><img style="border:none" src="/search/v2/images/yahooshopping.gif" border="0"/></a>&nbsp;&nbsp;')}else{if(A=="900505"){X.push("<table align=right cellspacing=0 cellpadding=0>");X.push("<tr>");X.push('<td nowrap valign="middle" style="padding:0px;border:none"><a href="http://www.amazon.com?tag=retrevo-20" style="font-size:11px;font-weight:normal;color:#666666">Powered by:&nbsp;</a></td>');X.push('<td valign="middle" style="padding:0px;border:none"><a href="http://www.amazon.com?tag=retrevo-20" style="border:none"><img style="border:none" src="/search/v2/images/amazon_logo.gif" border="0"/></a></td>');X.push("</tr>");X.push("</table>")}else{if(A=="900501"){var R="http://www.pricegrabber.com";if(this.storesOffersList[a].storesOffers[0].partnerAttribution!=null){R=this.storesOffersList[a].storesOffers[0].partnerAttribution}X.push("<table align=right cellspacing=0 cellpadding=0>");X.push("<tr>");X.push('<td nowrap valign="middle" style="padding:0px;border:none"><span style="font-size:10px;font-weight:normal;color:#666666">Powered by:&nbsp;</span></td>');X.push('<td valign=middle style="padding:0px;border:none"><a style="border:none" href="http://www.pricegrabber.com"> <img src="/searchJsp/v2/images/logos/pricegrabber.gif"  border="0"/></a></td>');X.push("</tr>");X.push("</table>")}else{if(A=="900510"){var R="http://publisher.shopzilla.com";if(this.storesOffersList[a].storesOffers[0].partnerAttribution!=null){R=this.storesOffersList[a].storesOffers[0].partnerAttribution}X.push("<table align=right cellspacing=0 cellpadding=0>");X.push("<tr>");X.push('<td nowrap valign="middle" style="padding:0px;border:none"><span style="font-size:10px;font-weight:normal;color:#666666">Powered by:&nbsp;</span></td>');X.push('<td valign=middle style="padding:0px;border:none"><a style="border:none" href="http://publisher.shopzilla.com"> <img src="/searchJsp/v2/images/logos/shopzilla_logo.gif"  border="0"/></a></td>');X.push("</tr>");X.push("</table>")}}}}}X.push("			</th>");X.push("		</tr>");X.push("	</table>");X.push("<div class=storesOfferBottomSpacer>&nbsp;</div>")}}return X.join("")},updateTable:function(D){for(var C=0;C<this.sortedStoresOffersList.length;C++){var B=this.sortedStoresOffersList[C];var A=this.buildSeller(this.storesOffersList[D].storesOffers[B],D,B,"tb");var G=document.getElementById("storesOffersSellerCell"+C+"-"+D);G.innerHTML=A;var G=document.getElementById("storesOffersRatingCell"+C+"-"+D);if(G!=null){var E="";if(this.storesOffersList[D].storesOffers[B].storeName=="Amazon.com"){E="<div class=storesOffersRating>Not Rated</div>"}else{E=this.buildRating(this.storesOffersList[D].storesOffers[B].rating,this.storesOffersList[D].storesOffers[B].numReview,false)}G.innerHTML=E}var F="??";if((this.storesOffersList[D].storesOffers[B].type=="store")&&(this.zipCode!=undefined)&&(this.zipCode!="")){F=this.buildPriceDetailPrice(this.storesOffersList[D].storesOffers[B],D,B)}else{if(parseFloat(this.storesOffersList[D].storesOffers[B].price)>=0){F="$"+this.storesOffersList[D].storesOffers[B].price}else{var H=this.storesOffersList[D].storesOffers[B].price=="Too low to display"?"See Site":this.storesOffersList[D].storesOffers[B].price;F="<span style='font-weight:bold;font-size:0.8em'>"+H+"</span>"}}var G=document.getElementById("storesOffersPriceDiv"+C+"-"+D);G.innerHTML=F;var G=document.getElementById("storesOffersConditionDiv"+C+"-"+D);if(G!=undefined&&this.storesOffersList[D].storesOffers[B].condition!=undefined&&this.storesOffersList[D].storesOffers[B].condition.toLowerCase()!="new"){G.style.display="block";G.innerHTML=this.storesOffersList[D].storesOffers[B].condition}else{if(G!=undefined){G.style.display="none";G.innerHTML="New"}}if((this.storesOffersList)){var G=document.getElementById("storesOffersPriceCell"+C+"-"+D)}G.setAttribute("itemIndex",B);var G=document.getElementById("storesOffersBtn"+C+"-"+D);G.setAttribute("soListIndex",B);G.setAttribute("soProductIndex",D)}},loadButtons:function(){for(var C=0;C<this.storesOffersList.length;C++){var D=this.storesOffersList[C].storesOffers.length;for(var B=0;B<D;B++){var A="storesOffersBtn"+B+"-"+C;new Button(A,null,Button.GREEN_PUSH)}}if(buttonModelHash.setLocation&&buttonModelHash.setLocation.applyWidgets){buttonModelHash.setLocation.applyWidgets();buttonModelHash.setLocation=null}if(document.getElementById("storesOffersSeeAllPricesBtn")!=null){new Button("storesOffersSeeAllPricesBtn",storesOffersSeeAllPricesModel,Button.RED_SMALL_PUSH)}if(document.getElementById("storesOffersSeeAllPricesBtn1")!=null){new Button("storesOffersSeeAllPricesBtn1",storesOffersSeeAllPricesModel,Button.RED_SMALL_PUSH)}},showMoreProdDesc:function(){document.getElementById("moreProdDecr").style.height="auto";document.getElementById("moreProdDecrLink").style.display="none";document.getElementById("lessProdDecrLink").style.display="inline"},hideMoreProdDesc:function(){document.getElementById("moreProdDecr").style.height="64px";document.getElementById("moreProdDecrLink").style.display="inline";document.getElementById("lessProdDecrLink").style.display="none"},addStoresAndOffers:function(B,M,N){if(isNaN(N)){N=0}this.storesOffersList=new Array();for(var Q=0;Q<B.length;Q++){var K=B[Q];var I=new Object;if((K.mCatalogId!=undefined)&&(K.mCatalogId!=null)&&(K.mCatalogId!="")){I.productCatalogId=K.mCatalogId}else{I.productCatalogId=""}if((K.mProductName!=undefined)&&(K.mProductName!=null)&&(K.mProductName!="")){I.productName=K.mProductName}if((K.mDescription!=undefined)&&(K.mDescription!=null)&&(K.mDescription!="")){I.productDesc=K.mDescription}if((K.mThumbnail!=undefined)&&(K.mThumbnail!=null)){I.productThumbnailUrl=K.mThumbnail.mUrl;I.productThumbnailDim=K.mThumbnail.mWidth+"x"+K.mThumbnail.mHeight}I.storesOffers=new Array();var C=K.mOffers;if(C==null){C=K}if(M==undefined){M=false}var P=0;var O=0;if((C==undefined)||(C==null)||(typeof C!="object")||(C.length==0)){if(gOmniture){if(M){trackPGAdOfferInventory("priceGrabberAd",0)}else{gOmniture.offerType="sdc";gOmniture.offerCount=0;trackOfferInventory()}}return }for(var J=0;J<C.length-N;J++){var F=true;if((C[J].OfferDesc!=undefined)||(C[J].OfferName!=undefined)){F=false}var H=(C[J].PartnerID!=undefined&&C[J].PartnerID!=YAHOO_PARTNER_ID)||gStoreMgr.isValid(C[J].ID);if((F)&&(!H)){continue}if((!F)&&(C[J].Url!=undefined)&&(C[J].Url!=null)&&(C[J].Url.indexOf("lrd.yahoo.com")!=-1)){continue}if(gLinkType&&gLinkType!=1){if(C[J].DisplayMerchant.indexOf("Amazon")==-1){continue}}var E=this.newStoresOffersEntry();if(E==null){continue}if(F){P++;if((C[J].Price!=undefined)&&(C[J].Price!=null)&&(C[J].Price!="")){E.price=C[J].Price}if((C[J].Condition!=undefined)&&(C[J].Condition!=null)&&(C[J].Condition!="")){E.condition=C[J].Condition}if((C[J].DisplayMerchant!=undefined)&&(C[J].DisplayMerchant!=null)&&(C[J].DisplayMerchant!="")){E.storeName=C[J].DisplayMerchant}if((C[J].Url!=undefined)&&(C[J].Url!=null)&&(C[J].Url!="")){var D="";D+=K.mRequestUrl;D+="&refreshCatalogID="+K.mCatalogId;if(gLinkType&&gLinkType!=1){D+="&refreshPricePid=900505";D+="&offerUrl="+this.getAZUrl(C[J].Url2)}else{D+="&refreshPricePid="+C[J].PartnerID;D+="&offerUrl="+encodeURIComponent(C[J].Url2)}E.storeUrl=D}if((C[J].Logo!=undefined)&&(C[J].Logo!=null)&&(C[J].Logo!="")){E.storeLogoUrl=C[J].Logo}if(((C[J].LogoWidth!=undefined)&&(C[J].LogoWidth!=null)&&(C[J].LogoWidth!=""))&&((C[J].LogoHeight!=undefined)&&(C[J].LogoHeight!=null)&&(C[J].LogoHeight!=""))){E.storeLogoDim=C[J].LogoWidth+"x"+C[J].LogoHeight}if((C[J].TrustedBargain!=undefined)&&(C[J].TrustedBargain!=null)&&(C[J].TrustedBargain!="")){var L=C[J].TrustedBargain;L=L.toLowerCase();if(L=="true"){E.bTrustedStore=true}}if((C[J].AverageRating!=undefined)&&(C[J].AverageRating!=null)&&(parseFloat(C[J].AverageRating)>=0)){E.rating=C[J].AverageRating}if((C[J].NumReviews!=undefined)&&(C[J].NumReviews!=null)&&(C[J].NumReviews!="")){E.numReview=C[J].NumReviews}if((C[J].Tax!=undefined)&&(C[J].Tax!=null)&&(C[J].Tax!="")){if(C[J].Tax.toUpperCase()=="CHECK SITE"){E.salesTax="Check Site"}else{E.salesTax=C[J].Tax}}if((C[J].Shipping!=undefined)&&(C[J].Shipping!=null)&&(C[J].Shipping!="")){E.shippingCost=C[J].Shipping}if((C[J].TotalPrice!=undefined)&&(C[J].TotalPrice!=null)&&(C[J].TotalPrice!="")){E.totalCost=C[J].TotalPrice}if((C[J].InStock!=undefined)&&(C[J].InStock!=null)&&(C[J].InStock=="yes")){E.inStock="In Stock"}else{if((C[J].InStock!=undefined)&&(C[J].InStock!=null)&&(C[J].InStock=="no")){E.inStock="Not In Stock"}else{E.inStock="Stock info not available"}}if((C[J].StockDescription!=undefined)&&(C[J].StockDescription!=null)&&(C[J].StockDescription!="")){E.stockDesc=C[J].StockDescription}if((K.mProductName!=undefined)&&(K.mProductName!=null)){E.productName=K.mProductName}if((K.mDescription!=undefined)&&(K.mDescription!=null)){E.productDesc=K.mDescription}E.type="store";if((C[J].PartnerID!=undefined)&&(C[J].PartnerID!=null)){E.partnerId=C[J].PartnerID}E.merchantId=C[J].ID;if((C[J].PartnerAttribution!=undefined)&&(C[J].PartnerAttribution!=null)){E.partnerAttribution=C[J].PartnerAttribution}E.isPremium=(C[J].MerchantType!=undefined)&&(C[J].MerchantType=="premium")}else{O++;if((C[J].Price!=undefined)&&(C[J].Price!=null)&&(C[J].Price!="")){E.price=C[J].Price}if((C[J].DisplayMerchant!=undefined)&&(C[J].DisplayMerchant!=null)&&(C[J].DisplayMerchant!="")){E.storeName=C[J].DisplayMerchant}if((C[J].Logo!=undefined)&&(C[J].Logo!=null)&&(C[J].Logo!="")){E.storeLogoUrl=C[J].Logo}if(((C[J].LogoWidth!=undefined)&&(C[J].LogoWidth!=null)&&(C[J].LogoWidth!=""))&&((C[J].LogoHeight!=undefined)&&(C[J].LogoHeight!=null)&&(C[J].LogoHeight!=""))){E.storeLogoDim=C[J].LogoWidth+"x"+C[J].LogoHeight}if((C[J].TrustedBargain!=undefined)&&(C[J].TrustedBargain!=null)&&(C[J].TrustedBargain!="")){var L=C[J].TrustedBargain;L=L.toLowerCase();if(L=="true"){E.bTrustedStore=true}}if((C[J].ThumbnailUrl!=undefined)&&(C[J].ThumbnailUrl!=null)&&(C[J].ThumbnailUrl!="")){E.productImageUrl=C[J].ThumbnailUrl}if(((C[J].ThumbnailWidth!=undefined)&&(C[J].ThumbnailWidth!=null)&&(C[J].ThumbnailWidth!=""))&&((C[J].ThumbnailHeight!=undefined)&&(C[J].ThumbnailHeight!=null)&&(C[J].ThumbnailHeight!=""))){E.productImageDim=C[J].ThumbnailWidth+"x"+C[J].ThumbnailHeight}if((C[J].AverageRating!=undefined)&&(C[J].AverageRating!=null)&&(parseFloat(C[J].AverageRating)>=0)){E.rating=C[J].AverageRating}if((C[J].NumReviews!=undefined)&&(C[J].NumReviews!=null)&&(C[J].NumReviews!="")){E.numReview=C[J].NumReviews}else{if((C[J].NumRating!=undefined)&&(C[J].NumRating!=null)&&(C[J].NumRating!="")){E.numReview=C[J].NumRating}}if((C[J].OfferDesc!=undefined)&&(C[J].OfferDesc!=null)&&(C[J].OfferDesc!="")){E.offerDesc=C[J].OfferDesc;E.produectDesc=C[J].OfferDesc}if((C[J].OfferName!=undefined)&&(C[J].OfferName!=null)&&(C[J].OfferName!="")){E.offerName=C[J].OfferName;E.productName=C[J].OfferName}if((C[J].Url2!=undefined)&&(C[J].Url2!=null)){var D="";D+=K.mRequestUrl;if(gLinkType&&gLinkType!=1){D+="&refreshPricePid=900505";D+="&offerUrl="+this.getAZUrl(C[J].Url2)}else{D+="&refreshPricePid="+C[J].PartnerID;D+="&offerUrl="+encodeURIComponent(C[J].Url2)}E.offerUrl=D}if((C[J].Tax!=undefined)&&(C[J].Tax!=null)&&(C[J].Tax!="")){if(C[J].Tax.toUpperCase()=="CHECK SITE"){E.salesTax="Check Site"}else{E.salesTax=C[J].Tax}}if((C[J].Shipping!=undefined)&&(C[J].Shipping!=null)&&(C[J].Shipping!="")){E.shippingCost=C[J].Shipping}if((C[J].TotalPrice!=undefined)&&(C[J].TotalPrice!=null)&&(C[J].TotalPrice!="")){E.totalCost=C[J].TotalPrice}if((C[J].StoreStatus!=undefined)&&(C[J].StoreStatus!=null)&&(C[J].StoreStatus=="yes")){E.storeStatus="In Stock"}else{if((C[J].StoreStatus!=undefined)&&(C[J].StoreStatus!=null)&&(C[J].StoreStatus=="no")){E.storeStatus="Not In Stock"}else{if((C[J].StoreStatus!=undefined)&&(C[J].StoreStatus!=null)&&(C[J].StoreStatus=="in-stock")){E.storeStatus="In Stock"}else{if((C[J].StoreStatus!=undefined)&&(C[J].StoreStatus!=null)&&(C[J].StoreStatus=="unknown")){E.storeStatus=""}else{E.storeStatus=""}}}}if((C[J].StoreStatus!=undefined)&&(C[J].StoreStatus!=null)&&(C[J].StoreStatus=="")){E.storeStatus=C[J].StoreStatus}if((C[J].StoreNotes!=undefined)&&(C[J].StoreNotes!=null)&&(C[J].StoreNotes!="")){E.storeDesc=C[J].StoreNotes}if((C[J].InStock!=undefined)&&(C[J].InStock!=null)&&(C[J].InStock=="yes")){E.inStock="In Stock"}else{if((C[J].InStock!=undefined)&&(C[J].InStock!=null)&&(C[J].InStock=="no")){E.inStock="Not In Stock"}else{E.inStock=""}}if((C[J].ProductId!=undefined)&&(C[J].ProductId!=null)&&(C[J].ProductId!="")){E.productId=C[J].ProductId}if((C[J].ID!=undefined)&&(C[J].ID!=null)&&(C[J].ID!="")){E.productId=C[J].ProductId}E.type="offer";if((C[J].PartnerID!=undefined)&&(C[J].PartnerID!=null)){E.partnerId=C[J].PartnerID}E.merchantId=C[J].ID;if((C[J].PartnerAttribution!=undefined)&&(C[J].PartnerAttribution!=null)){E.partnerAttribution=C[J].PartnerAttribution}E.isPremium=(C[J].MerchantType!=undefined)&&(C[J].MerchantType=="premium")}var A="unknown";if(C[J].PartnerID=="900501"){A="pricegrabber"}else{if(C[J].PartnerID=="900504"){A="yahoo"}else{if(C[J].PartnerID=="900505"){A="amazon"}else{if(C[J].PartnerID=="900506"){A="sdc"}else{if(C[J].PartnerID=="900508"){A="cnet"}}}}}E.source=A;I.storesOffers[I.storesOffers.length]=E}this.storesOffersList[this.storesOffersList.length]=I;if(gOmniture){if(M){trackPGAdOfferInventory("priceGrabberAd",O+P)}else{gOmniture.offerType=(O==0)?"Catalog":"SDC";gOmniture.offerCount=O+P;trackOfferInventory()}}}if((this.pids!=undefined)&&(this.pids!="")){if((gStoresOffers.activeProduct==0)&&((gStoresOffers.firstProduct==undefined)||(gStoresOffers.firstProduct==""))){var G="";for(var J=0;J<this.storesOffersList.length;J++){if(G!=""){G+=","}G+=this.storesOffersList[J].productCatalogId}gStoresOffers.firstProduct=G}}},getAZUrl:function(B){var C=B.indexOf("%2Fdp%2F");if(C<0){return B}var A=B.indexOf("%2F",C+10);return A<0?B:B.substring(0,A)},sortCompare:function(B,A){var C=getCookieData("zipcode");if(gStoresOffers.sortOrder==0){return 0}else{if(gStoresOffers.sortOrder==1){var E=parseFloat(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].price);var D=parseFloat(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].price);if((gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].type=="store")&&(C!=undefined)&&(C!="")){E=parseFloat(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].totalCost)}if((gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].type=="store")&&(C!=undefined)&&(C!="")){D=parseFloat(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].totalCost)}if(isNaN(E)){return -1}if(isNaN(D)){return 1}return(E-D)}else{if(gStoresOffers.sortOrder==2){var E=parseFloat(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].price);var D=parseFloat(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].price);if((gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].type=="store")&&(C!=undefined)&&(C!="")){E=parseFloat(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].totalCost)}if((gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].type=="store")&&(C!=undefined)&&(C!="")){D=parseFloat(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].totalCost)}if(isNaN(D)){return -1}if(isNaN(E)){return 1}return(D-E)}else{if(gStoresOffers.sortOrder==3){if(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].storeName.toLowerCase()<gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].storeName.toLowerCase()){return -1}else{if(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].storeName.toLowerCase()>gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].storeName.toLowerCase()){return 1}else{return 0}}}else{if(gStoresOffers.sortOrder==4){if(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].storeName.toLowerCase()<gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].storeName.toLowerCase()){return -1}else{if(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].storeName.toLowerCase()>gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].storeName.toLowerCase()){return 1}else{return 0}}}else{if(gStoresOffers.sortOrder==5){aRating=gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].rating;if(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].storeName=="Amazon.com"){aRating=-1}bRating=gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].rating;if(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].storeName=="Amazon.com"){bRating=-1}if(aRating<bRating){return -1}else{if(aRating>bRating){return 1}else{return 0}}}else{if(gStoresOffers.sortOrder==6){aRating=gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].rating;if(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[B].storeName=="Amazon.com"){aRating=-1}bRating=gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].rating;if(gStoresOffers.storesOffersList[gStoresOffers.sortDataIndex].storesOffers[A].storeName=="Amazon.com"){bRating=-1}if(bRating<aRating){return -1}else{if(bRating>aRating){return 1}else{return 0}}}}}}}}}},sortData:function(A,C){gStoresOffers.sortedStoresOffersList=new Array();for(var B=0;B<this.storesOffersList[A].storesOffers.length;B++){if(this.storesOffersList[A].storesOffers[B].bDisplayed){gStoresOffers.sortedStoresOffersList[gStoresOffers.sortedStoresOffersList.length]=B}}gStoresOffers.sortOrder=C;gStoresOffers.sortDataIndex=A;gStoresOffers.sortedStoresOffersList.sort(gStoresOffers.sortCompare)},isZip:function(A){reZip=new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);if(!reZip.test(A)){alert("ZIP Code is not valid.");return false}return true},searchStoreWithZip:function(){var A=document.zipForm.zip.value;A=A.replace(/\s*(.*\S|)\s*/g,"$1");if((A)&&(!this.isZip(A))){return false}storeCookieData("zipcode",A,"/");gStoresOffers.getNewPricing(A);return false},onClickTrack:function(A){trackPriceClick(gStoresOffers.storesOffersList[productIndex].storesOffers[A].storeUrl,"offersSell",gStoresOffers.storesOffersList[productIndex].storesOffers[A].storeName,gStoresOffers.storesOffersList[productIndex].storesOffers[A].price)},onClickOffer:function(D,C,G){var B=gStoresOffers.storesOffersList[D].storesOffers[C].offerUrl;if(B==null){B=gStoresOffers.storesOffersList[D].storesOffers[C].storeUrl}var H="Multiple Offers";var F="k",A=gStoresOffers.storesOffersList[D].storesOffers.length;if(gStoresOffers.storesOffersList[D].storesOffers[C].storeName!=null){H=gStoresOffers.storesOffersList[D].storesOffers[C].storeName+"- Offer"}A=A==1?1:"n";var E="0_"+A+"_"+F+"_"+G.charAt(0)+G.charAt(G.length-1)+"_"+this.getPageTracking();trackPriceClick(B,"offersSell",H,gStoresOffers.storesOffersList[D].storesOffers[C].price);window.setTimeout(function(){top.location.href=B+"&mode="+E,"_blank"},100)},onClickSeller:function(F,C,H,A,E,G){var B="";if(this.storesOffersList[F].storesOffers[C].type=="store"){B=this.storesOffersList[F].storesOffers[C].storeUrl;trackType="g";trackTotal=this.storesOffersList[F].storesOffers.length}else{if(this.storesOffersList[F].storesOffers[C].type=="offer"){B=this.storesOffersList[F].storesOffers[C].offerUrl;trackType="k";trackTotal=this.storesOffersList[F].storesOffers.length}}if(B==""){return }trackTotal=trackTotal==1?1:"n";var D=(E?0:1)+"_"+trackTotal+"_"+trackType+"_"+A.charAt(0)+A.charAt(A.length-1)+"_"+this.getPageTracking();if(location.href.indexOf("s_kwcid=")>-1){trackPriceClickInOmniture("900503",this.storesOffersList[F].storesOffers[C].storeName,this.storesOffersList[F].storesOffers[C].price)}else{trackPriceClick(B,"offersSell",this.storesOffersList[F].storesOffers[C].storeName,this.storesOffersList[F].storesOffers[C].price)}window.setTimeout(function(){top.location.href=B+"&mode="+D},100)},onClickSeller2:function(C,B,A,E){var F=document.getElementById("storesOffersPriceCell"+B+"-"+C);var D=F.getAttribute("itemIndex");var C=F.getAttribute("productIndex");if((D==undefined)||(C==undefined)){return }this.onClickSeller(C,D,false,A,E,-1)},onClickSellerByUrl:function(B,A){trackType="g";trackTotal=1;if(B==""){return }var C=1+"_"+trackTotal+"_"+trackType+"_0_"+this.getPageTracking();trackPriceClick(B,"offersSell",A,"");window.setTimeout(function(){top.location.href=B+"&mode="+C},100)},mouseClick:function(H,B,A){var G=document.getElementById("storesOffersSortSellerArrow"+B);var D=document.getElementById("storesOffersSortPriceArrow"+B);var F=document.getElementById("storesOffersSortRatingArrow"+B);var C=0;if(D.className=="storesOffersSortArrowAscendBlack"){C=1}else{if(D.className=="storesOffersSortArrowDecendBlack"){C=2}else{if(G.className=="storesOffersSortArrowAscendBlack"){C=3}else{if(G.className=="storesOffersSortArrowDecendBlack"){C=4}else{if((F!=null)&&(F.className=="storesOffersSortArrowAscendBlack")){C=5}else{if((F!=null)&&(F.className=="storesOffersSortArrowDecendBlack")){C=6}}}}}}var E=0;if((A=="price")&&(C==1)){E=2}else{if((A=="price")&&(C==2)){E=1}else{if((A=="seller")&&(C==3)){E=4}else{if((A=="seller")&&(C==4)){E=3}else{if((A=="rating")&&(C==5)){E=6}else{if((A=="rating")&&(C==6)){E=5}else{if(A=="price"){E=1}else{if(A=="seller"){E=3}else{if(A=="rating"){E=5}}}}}}}}}if(E==1){G.className="storesOffersSortArrowNone";D.className="storesOffersSortArrowAscendBlack";if(F!=null){F.className="storesOffersSortArrowNone"}}else{if(E==2){G.className="storesOffersSortArrowNone";D.className="storesOffersSortArrowDecendBlack";if(F!=null){F.className="storesOffersSortArrowNone"}}else{if(E==3){G.className="storesOffersSortArrowAscendBlack";D.className="storesOffersSortArrowNone";if(F!=null){F.className="storesOffersSortArrowNone"}}else{if(E==4){G.className="storesOffersSortArrowDecendBlack";D.className="storesOffersSortArrowNone";if(F!=null){F.className="storesOffersSortArrowNone"}}else{if(E==5){G.className="storesOffersSortArrowNone";D.className="storesOffersSortArrowNone";F.className="storesOffersSortArrowAscendBlack"}else{if(E==6){G.className="storesOffersSortArrowNone";D.className="storesOffersSortArrowNone";F.className="storesOffersSortArrowDecendBlack"}}}}}}this.sortData(B,E);this.updateTable(B)},mouseOverOutHeader:function(E,C,A,D){var F=null;var B=null;if(A=="seller"){F=document.getElementById("storesOffersSortSellerText"+C);B=document.getElementById("storesOffersSortSellerArrow"+C)}else{if(A=="price"){F=document.getElementById("storesOffersSortPriceText"+C);B=document.getElementById("storesOffersSortPriceArrow"+C)}else{if(A=="rating"){F=document.getElementById("storesOffersSortRatingText"+C);B=document.getElementById("storesOffersSortRatingArrow"+C)}else{return }}}if(D=="over"){E.className="storesOffersHeaderBorderMouseIn";F.className="storesOffersHeaderTextSortMouseIn";B.className+="Black"}else{if(D=="out"){E.className="storesOffersHeaderBorder";F.className="storesOffersHeaderTextSort";B.className=B.className.replace("Black","")}}},getNewPricing:function(D,B,G){if(G==undefined){G=false}if(gStoresOffers.bPriceGetInProgress){return }gStoresOffers.bPriceGetInProgress=true;var F="";if(B==undefined){for(var E=0;E<gStoresOffers.storesOffersList.length;E++){if(F!=""){F+=","}F+=gStoresOffers.storesOffersList[E].productCatalogId}}else{F=B}var C="";if((F!=null)&&(F!="")){C="/cataloglisting?minWebRequestTime=1&operation=attributes&priceOnly=1&useCache=1&catid="+gStoresOffers.categoryId+"&catalogid="+F+"&isProduction="+(gUseProxy?"0":"1")}else{C="/cataloglisting?minWebRequestTime=1&operation=offersearch&useCache=1&numItems=30&pricepid=900506&json=1";"&isProduction="+(gUseProxy?"0":"1")}if((!G)&&(gStoresOffers.keyword!=null)&&(gStoresOffers.keyword!="")){C+="&q="+encodeURIComponent(gStoresOffers.keyword)}if((D!=null)&&(D!="")){C+="&zip="+D}var H=C+"&condition=all&refreshAge=21600000&frontEnd=1&json=1&callback=";var A=ServerRPC.getJSONData(H,storesOffersProductData,gStoresOffers.svrRpcTimeout,storesOffersProductData);storesOffersCallbackData[A]=new Object;storesOffersCallbackData[A].requestURL=C;storesOffersCallbackData[A].bAdPricing=false;storesOffersCallbackData[A].zipCode=D==null?"":D},getAdPricing:function(B,E,D,K,C,G,H,J,F){if(!G){G=900501}var A="/cataloglisting?minWebRequestTime=1&operation=offersearch&pricepid="+G+"&useCache=1&isProduction="+(gUseProxy?"0":"1");if((B!=null)&&(B!="")){A+="&q="+encodeURIComponent(B)}var L=A+"&refreshAge=21600000&frontEnd=1&json=1&callback=";var I=ServerRPC.getJSONData(L,storesOffersProductData,this.svrRpcTimeout,storesOffersProductData);storesOffersCallbackData[I]=new Object;storesOffersCallbackData[I].requestURL=A;storesOffersCallbackData[I].bAdPricing=true;storesOffersCallbackData[I].adOwnerObj=this;storesOffersCallbackData[I].adOwnerName=D;storesOffersCallbackData[I].adFormat=K==undefined?"rect":K;storesOffersCallbackData[I].outDiv=E;storesOffersCallbackData[I].bAdHeader=C==undefined?true:C;storesOffersCallbackData[I].provider=G;storesOffersCallbackData[I].listDiv=H;storesOffersCallbackData[I].pids=J;storesOffersCallbackData[I].bDisplayAll=F},pageTracking:null,getPageTracking:function(){if(this.pageTracking==null){if(gOmniture&&gOmniture.pageName){var B="";if(gOmniture.pageName.indexOf("Catalog")!=-1){B="c"}else{if(gOmniture.pageName.indexOf("Product")!=-1){if(gOmniture.model=="Unknown"){B="oo"}else{B=gOmniture.pageName.substring(8);var A=/.([sco])./i.exec(B);if(A!=null){B="p"+A[1]}}}else{B=gOmniture.pageName}}var C=B}else{var C=null}this.pageTracking=C}return this.pageTracking},displayReviewPrice:function(B,K,A){var L="";var C=false;for(var J=0;C==false&&J<this.storesOffersList.length;J++){for(var F=0;C==false&&F<this.storesOffersList[J].storesOffers.length;F++){var M=this.storesOffersList[J].storesOffers[F].merchantId;if((M.search("402")==0)||(M.search(K)==0)){var I=this.storesOffersList[J].storesOffers[F].storeName;var G=this.storesOffersList[J].storesOffers[F].price;var E=this.storesOffersList[J].storesOffers[F].storeUrl;var H="Buy it for $"+G;if(G=="Too low to display"){H="See Prices On Amazon.com";E=A='javascript:gStoresOffers.onClickSellerByUrl("'+A+'", "Amazon.com")'}else{E="javascript:gStoresOffers.onClickSeller("+J+", "+F+', false, "'+I+'", false, -1)'}L+="<a href='"+E+"'>"+H+"</a>";C=true;break}}}if(L==""){A='javascript:gStoresOffers.onClickSellerByUrl("'+A+'", "Amazon.com")';L="<a href='"+A+"'>See Prices On Amazon.com</a>"}var D=document.getElementById(B);if(D!=null){D.innerHTML=L}},styleChooserHover:function(C,A){var B=document.getElementById("prodLstBtnDiv");B.className="prodStyleChooserBtnHover"},styleChooserOut:function(C,A){var B=document.getElementById("prodLstBtnDiv");B.className="prodStyleChooserBtn"},prodListMouse:function(E,B){var C="";var A="";if(E=="over"){C="#CCE3F2";A="black"}else{if(E=="out"){C="white";A="black";if(B==gStoresOffers.activeProduct){C="#d3d3d3"}}else{return }}var F="prodLstCell"+B;var D=document.getElementById(F);if(D!=null){D.bgColor=C}F="prodSelTitle"+B;D=document.getElementById(F);if(D!=null){D.style.color=A}F="prodSelPrice"+B;D=document.getElementById(F);if(D!=null){D.style.color=A}F="prodSelSKU"+B;D=document.getElementById(F);if(D!=null){D.style.color=A}},prodListClick:function(C){gStoresOffers.storesOffersList=new Array();var A=gStoresOffers.pids[C].getProductId();if(C==0){A=gStoresOffers.firstProduct}gStoresOffers.prodListHide();obj=document.getElementById(gStoresOffers.outputDiv);if(obj!=null){obj.innerHTML='<div class="findingStore">Finding Stores... <img alt="" src="/images/status_anim.gif" /></div>'}var B=getCookieData("zipcode");gStoresOffers.activeProduct=C;gStoresOffers.getNewPricing(B,A,false)},prodListDisplay:function(){var G=document.getElementById("prodList");if(G==null){return }var E=document.getElementById("prodLstBtnDiv");if(E==null){return }var F=E;var D=0;var B=0;while(F!=null&&F.className!="headerNew"){D+=F.offsetLeft;B+=F.offsetTop;F=F.offsetParent}var C=0;if(this.pids!=null&&this.pids.length>3){C=0}G.style.top=(B+20)+"px";G.style.left=(D+C)+"px";G.style.display="inline";G.style.visibility="visible";ScreenMask.on(ScreenMask.STYLE_THIN);var A=document.getElementById("screenMaskDiv");if(A.addEventListener){A.addEventListener("mousedown",gStoresOffers.prodListHide,true)}else{if(A.addEvent){A.addEvent("onmousedown",gStoresOffers.prodListHide)}else{A.onmousedown=gStoresOffers.prodListHide}}},prodListHide:function(B){var D=document.getElementById("prodList");if(D==null){return }var C;var A=navigator.appName;if(A=="Microsoft Internet Explorer"){C=window.event.srcElement}else{if(B!=undefined){C=B.targetName?B.target:B.target.parentNode}}if((C!=undefined)&&(C==D)){return }ScreenMask.off();D.style.display="none";D.style.visibility="hidden"}});var Product=Class.create({initialize:function(D,C,A,B,G,F,H,E){this.pId=D;this.pTitle=C;this.pImage=A;this.pLargeImage=B;this.pImageDimension=G;this.pLargeImageDimension=F;this.pMinPrice=H;this.pMaxPrice=E},getProductId:function(){return this.pId},getProductTitle:function(){return this.pTitle},getProductImage:function(){return this.pImage},getProductLargeImage:function(){return this.pLargeImage},getProductImageDimension:function(){return this.pImageDimension},getProductLargeImageDimension:function(){return this.pLargeImageDimension},getSnPDetails:function(){return this.sNpDetails},setSnPDetails:function(A){this.sNpDetails=FilterBadOffers(A)},getMinPrice:function(){return this.pMinPrice},getMaxPrice:function(){return this.pMaxPrice},getPFullDesc:function(){return this.pFullDesc},setPFullDesc:function(A){this.pFullDesc=(A!=null&&A!=undefined)?A:""},getPSpecsDetails:function(){return this.pSpecsDetails}});function FilterBadOffers(A){if(A&&A.length>0){var C=new Array();for(var B=0;B<A.length;B++){if(A[B].isValid()){C.push(A[B])}}if(C.length>0){return C}else{return A}}else{return A}}var StorePriceDetails=Class.create({initialize:function(U,R,M,T,L,C,J,O,V,P,S,D,W,F,H,Q,B,K,E,I,G,N,A){this.sIndex=U;this.sStoreId=R;this.sStoreName=M;this.sStoreLogo=T;this.sStoreRating=L;this.sStoreRatingImage=C;this.sNumStoreReviews=J;this.sOfferName=O;this.sOfferUrl=V;this.sOfferPrice=P;this.sStockStatus=S;this.sStockDescription=D;this.sInStock=W;this.sTrusted=F;this.sFeatured=H;this.sStoreReviewUrl=Q;this.sTax=B;this.sShipping=K;this.sTotalPrice=E;this.sStoreLogoAddOn=I;this.sStoreLogoImgHeight=G;this.sStoreLogoImgWidth=N;this.sPartnerID=A;this.sValidOffer=V.indexOf("lrd.yahoo.com")==-1?true:false;this.sValidStore=(A!=undefined&&A!=YAHOO_PARTNER_ID)||gStoreMgr.isValid(this.sStoreId)},setIsValidFromFullURL:function(A){this.sValidOffer=A.indexOf("lrd.yahoo.com")==-1?true:false},isValidStore:function(){return this.sValidStore},getIndex:function(){return this.sIndex},toString:function(){var A="Store Price Details - toString() --"+this.sStoreId;return A},getStoreId:function(){return this.sStoreId},getStoreName:function(){return this.sStoreName},getStoreLogo:function(){return this.sStoreLogo},getStoreLogoImgHeight:function(){return this.sStoreLogoImgHeight},getStoreLogoImgWidth:function(){return this.sStoreLogoImgWidth},getStoreRating:function(){return this.sStoreRating},getStoreRatingImage:function(){return this.sStoreRatingImage},getNumStoreReviews:function(){return this.sNumStoreReviews},getOfferName:function(){return this.sOfferName},getOfferUrl:function(){return this.sOfferUrl},getOfferPrice:function(){return this.sOfferPrice},getStockStatus:function(){return this.sStockStatus},getStockDescription:function(){return this.sStockDescription},getInStock:function(){return this.sInStock},getTrusted:function(){return this.sTrusted},getFeatured:function(){return this.sFeatured},getStoreReviewUrl:function(){return this.sStoreReviewUrl},getTax:function(){return this.sTax},getShipping:function(){return this.sShipping},getTotalPrice:function(){return this.sTotalPrice},getStoreLogoAddOn:function(){return this.sStoreLogoAddOn},isValid:function(){return this.sValidOffer},getPartnerID:function(){return this.sPartnerID}});function createRecentList(A,B){new Insertion.Bottom(A,"<ul id='"+B+"'></ul>")}function addRecentListElements(A,H){var G;var F;var C=navigator.appName;var E=H.list.length;var B=5;if(B>E){B=E}for(var D=0;D<B;D++){F="<a href='"+H.list[D].Urls+"'>"+H.list[D].titles+"</a><br/>";if(H.list[D].markerImage!=null){imageUrl="url("+H.list[D].markerImage+")";new Insertion.Bottom(A,"<li class='sidebar-list-item' style='list-style-image:"+imageUrl+"'>"+F+"</li><br>")}else{new Insertion.Bottom(A,"<li class='sidebar-list-item'>"+F+"</li><br>")}}return }function createRecentlyVisitedProductList(A){createRecentList("visitedProductSection","visitedSearchResults");addRecentListElements("visitedSearchResults",A)}var manuals;function buildTabButtons(){var C=document.getElementById("tab_buttons");if(C&&C.childNodes){C=C.getElementsByTagName("span");if(C&&C.length>0){for(var B=0;B<C.length;B++){var A={processClick:function(G){var H=document.getElementById(G.elementID);var E=H.getAttribute("tabIndex");var F=gTabUrls[E];if(typeof (gCategoryID)!="undefined"&&gCategoryID==32){go(F)}else{window.location.href=F}return false}};if(C[B].id&&C[B].id.length>0){var D=C[B].id.indexOf("current")>-1?"channel_tab_current":"channel_tab";if(C[B].id.indexOf("manual")>-1){D=C[B].id.indexOf("current")>-1?"manual_tab_current":"manual_tab"}new Button(C[B].id,A,D)}}}}}function setTabUrls(string){gTabUrls=eval(decodeURIComponent(string));var tabUrlsDiv=document.getElementById("tabUrls");if(tabUrlsDiv!=null){tabUrlsDiv.innerHTML=string}}function setTabUrlsForAjax(string){gTabUrls=eval(decodeURIComponent(string))}function runMetaResultScripts(E){if((typeof gStoresOffers!="undefined")&&(gStoresOffers!=undefined)){var A=$(E).select(".mechPricing");if(A!=null){for(var C=0;C<A.length;C++){var B=A[C].getAttribute("mid");var D=A[C].getAttribute("mtitle");gStoresOffers.displayReviewPrice(A[C].id,B,D)}}}}function viewAllLinkMouseover(A){if(!A){return }A.style.color="red";A.style.cursor="pointer"}function viewAllLinkMouseout(A){if(!A){return }A.style.color="blue";A.style.cursor="none"}function viewAllLinkMouseclick(A){if(!A){return }window.location=A}StringUtil={priceTitleLimitCharacters:function(B,A){if(!B||A<=0){return""}if(A>=B.length){return B}cutPnt=B.lastIndexOf(" ",A);if(cutPnt==-1){cutPnt=A}return B.substring(0,cutPnt)+(cutPnt<B.length?" ...":"")}};function toggleRemainingMetaresult(A){if($("remainingMetaresult")){if($("remainingMetaresult").style.display!="none"){$("remainingMetaresult").style.display="none";$("SeeAllSeeLess").down().innerHTML='Show More <img src="/search/v2/images/home/small_arrow_down.gif"/>';if($("firstArticleViewAlloa")){$("firstArticleViewAlloa").style.display="block"}if($("firstArticleViewAllfb")){$("firstArticleViewAllfb").style.display="block"}if(A&&A.type=="click"){location.hash="#landing2MetaresultBlock"}}else{$("remainingMetaresult").style.display="block";$("SeeAllSeeLess").down().innerHTML='Show Less <img src="/search/v2/images/home/small_arrow_up.gif"/>';if($("firstArticleViewAllfb")){$("firstArticleViewAllfb").style.display="none"}if($("firstArticleViewAlloa")){$("firstArticleViewAlloa").style.display="none"}}}return false}function gotoPDFViewerOnClick(D,A,C,B,E){url="/pdf/"+A+"/"+C+"/"+B;E=(E&&E.length>0)?"#q="+E:"";if(gCategoryID&&(gCategoryID==8||gCategoryID==60||gCategoryID==32)){return go(url+E)}else{window.location.href=url+E;return cancelEvent(D)}}function gotoPDFViewerDifferentModel(B,A,C){C=(C&&C.length>0)?"#q="+C:"";window.location.href=A+C;return cancelEvent(B)}function limitText(C,A){var B=document.getElementById("countdown");if(C.value.length>=A){C.value=C.value.substring(0,A);B.innerHTML="0 remaining"}else{if(C.value.length==0){B.innerHTML="Max "+A+" characters"}else{B.innerHTML=(A-C.value.length)+" remaining"}}}function gotoDiscussionPost(E,C,D,A){var E=$(E);if(!E){return }var B="/c/"+C+"/blogs/start?title="+encodeURIComponent(E.title.value)+"&tags=m_"+D+"+v_"+A;E.title.value="";top.location.href=B}function loadCatalogPromo(B,A,C){if(B&&A&&A!="null"&&C&&C!="null"){document.write('<a h\x72ef="'+C+'"><span id="catalog_promo"><div style="float:left; text-align:right; padding: 5px 10px 0px 0px;">Check out Retrevo&#39;s <br> '+A+' Catalog</div>  <img style="vertical-align: middle;" src="/search/v2/images/retrevolution/catalog_promo.jpg"></img><div style="clear:left;"></div> </span> </a> ')}}function performanceBodyOnload(C,B){var A=new Image();A.src="/search/v2/js/performanceTestTop.js?pageRequestStartTime="+C+"&"+B+"&ts="+new Date()}function showOutput(){}function processReviewClick(B,A){this.window.location.href=A;return cancelEvent(B)}function initDiv(){}function showDiv(A){$("tooltip").innerHTML='<div class="outer" style="text-align:left;">&nbsp;&nbsp;Why login?<div class="inner" style="color:#6d6cb0;">For your privacy, certain features are fully enabled only after you login. click on the login link to find out more.</div></div>';var B=Position.positionedOffset(A);$("tooltip").setStyle({width:226+"px",top:(20+B[1])+"px",left:(B[0]-180)+"px",display:"none"});new Effect.Appear("tooltip",{duration:0.3})}function setHeaderWidth(){}function setSuggestPos(){$("targetDiv").style.left="596px";$("targetDiv").style.top="455px";$("targetDiv").style.width="224px"}var gProduct=null;var gSdcLogoUrl;var lastActiveImage;var activeStyle=-1;var gProdIDInputArray=new Array();var gSpecTimeout=20000;var gQueryString="";function getSpecs(E,D,B,C,A){gSpecContainerSDC=C;gProvider=B;gPartnerId=A;gProdIDInputArray=E;gProdInfoInputArray=E;activeStyle=-1;gQueryString=D;chooseSpecStyle(0)}var getInHouseProductFeatures={processResponse:function(A){if(A.getData()=="null"){return }var B=A.getData().evalJSON();if(!B||!B.modelSpec||!B.catFeature){return }buildInHouseSpecDiv(B)},processException:function(A){DebugLog.error("getInHouseProductFeatures","exception or timeout in getting product specification. ")}};function buildInHouseSpecDiv(E){if(E==null){return""}var G="";var H=E.catFeature;var J=E.modelSpec;var A=[];if(J.description!=null&&J.description!=""){A.push('<div style="height:10px;"></div><div class = "headingText" >Description:</div><div class = "desc">'+J.description+"</div><br/>")}A.push('<div class = "headingText" >Product Specification:</div>');for(var F=0;F<H.groupSequence.length;F++){var L=H.groupNames[H.groupSequence[F]];var K='<table cellpadding="0" cellspacing="0" border="0" class="specTable" ><caption>'+L+"</caption>";var B=H.attributeSequence[F];var M=0;for(var C=0;C<B.length;C++){var D=H.attributeNames[B[C]];var I=J.specs[B[C]];if(D!=undefined&&I!=undefined){if(K.length>0){A.push(K);K=""}G=M++%2==0?"evenRow":"oddRow";A.push("<tr class="+G+'><td class="pFeatureName">'+D+'</td><td class="pFeatureValue">'+I+"</td></tr>")}}if(K.length==0){A.push("</table>")}}if($("prodSpecsId")){$("prodSpecsId").update(A.join(""))}}function createSpecDiv(){var E;var B=new Array();var G=gProduct.getPSpecsDetails();var D=gProduct.getPFullDesc();if(gProdIDInputArray.length>0){if(gProdIDInputArray.length>1){B.push('<div style="border:1px solid #eeeeee;padding:5px;color:#666666">There are several styles for this product.  Click an image to choose another style.');B.push("<br><br>");for(var C=0;C<gProdIDInputArray.length;C++){var F=getImageDim(gProdIDInputArray[C].getProductImageDimension(),75,75,true);B.push('<div class="styleImage"><div id="styleImg'+C+'" class="styleBorder" '+(C==activeStyle?'style="border-color:#b3daa3"':"")+'onclick="chooseSpecStyle('+C+')" onmouseover="specStyleHover(\''+C+"')\" onmouseout=\"clearSpecStyleHover('"+C+'\')" ><div class="styleInner"><img src="'+gProdIDInputArray[C].getProductImage()+'"alt="'+gProdIDInputArray[C].getProductTitle()+'" border="1px" bordercolor="white" '+F+"/></div></div></div>")}B.push('<div style="clear:both" id="prodStyleTitle" class="prodStyleTitle">');B.push(selectedStyleTitle);B.push("</div></div>")}B.push('<div class = "prodSpecs" id="prodSpecsId" >');B.push("</div></div></div>");if(B){$(gSpecContainerSDC).innerHTML=B.join("");var A={processClick:function(I){var H=gPreviewMoreLink;showInWindow(H,"_top",I);return false}};Model.attach(A);new Button("seeAllPrices",A,Button.RED_SMALL_PUSH)}else{$(gSpecContainerSDC).innerHTML="No Specification Found for this Product."}if($("productSpecQ_A")!=null){$("productSpecQ_A").show()}}}function chooseSpecStyle(C){var A=activeStyle==-1;activeStyle=C;gProduct=gProdIDInputArray[C];cId=gProdIDInputArray[C].getProductId();selectedStyleTitle=gProduct.getProductTitle();gProductPId=cId;createSpecDiv();if(ownSpecObj!=null){buildInHouseSpecDiv(ownSpecObj);ownSpecObj=null}else{var B="/search/spec?productId="+gProductPId+"&partnerId="+gPartnerId;ServerRPC.getData(B,getInHouseProductFeatures,gSpecTimeout,getInHouseProductFeatures)}}function specStyleHover(A){document.getElementById("prodStyleTitle").innerHTML=gProdIDInputArray[A].getProductTitle();document.getElementById("styleImg"+A).style.borderColor="#0000EE";document.getElementById("prodStyleTitle").style.color="#0000EE";if(activeStyle==A){document.getElementById("styleImg"+activeStyle).style.borderColor="#b3daa3";document.getElementById("prodStyleTitle").style.color="brown"}}function clearSpecStyleHover(A){document.getElementById("prodStyleTitle").innerHTML=selectedStyleTitle;document.getElementById("styleImg"+A).style.borderColor="white";if(activeStyle==A){document.getElementById("styleImg"+activeStyle).style.borderColor="#b3daa3"}document.getElementById("prodStyleTitle").style.color="brown"}var ServerRPC={gListenerIndex:10000,gListenerMap:{},gListenerMapCounter:{},gTimeoutIndex:0,gTimeoutMap:{},gScriptMap:{},gDefaultTimeout:45000,getData:function(B,H,K,J,C){var D=null;var A=ServerRPC.gDefaultTimeout;if((K!=null)&&(K!=undefined)){A=K}if(C){C=true}else{C=false}D=ServerRPC.gTimeoutIndex++;var E=ServerRPC.timeout.bind(null,D,J,null);var G=new Object();G.onSuccess=ServerRPC.successHandler.bind(null,H,D,C);if(J){G.onFailure=ServerRPC.failHandler.bind(null,J)}else{G.onFailure=ServerRPC.failHandler.bind(null,null,D)}G.method="Get";G.asynchronous=true;var I=(new Date()).getTime();if(B.indexOf("?")>-1){B+="&ts="+I}else{B+="?ts="+I}var L=new Ajax.Request(B,G);var F=setTimeout(E,A);ServerRPC.gTimeoutMap[D]=F;DebugLog.debug("ServerRPC-getData","url="+B)},getJSONData:function(B,D,C,A){this.getData(B,D,C,A,true)},jsonSuccessHandler:function(F,G,B,E){DebugLog.debug("ServerRPC.js","callback: "+G+","+B);var H=0;var A="";if(B!=null){if(ServerRPC.gTimeoutMap[B]){var C=ServerRPC.gTimeoutMap[B];clearTimeout(C);delete ServerRPC.gTimeoutMap[B]}else{H=1}}ServerRPC.gListenerMapCounter[G]--;var I=ServerRPC.gListenerMapCounter[G];if(H==0){var J=ServerRPC.gScriptMap[G][I];if(J&&(J!="undefined")){J.removeScriptTag()}if(I==0){delete ServerRPC.gListenerMap[G];delete ServerRPC.gListenerMapCounter[G];delete ServerRPC.gScriptMap[G][0]}var D=new ServerRpcResponse(E);F.processResponse(D,G)}},successHandler:function(svrRpcListener,tindex,isJSON,response){DebugLog.debug("ServerRPC.js","In successHandler ");var stop=0;if(tindex>=0){if(ServerRPC.gTimeoutMap[tindex]){var timeoutID=ServerRPC.gTimeoutMap[tindex];clearTimeout(timeoutID);delete ServerRPC.gTimeoutMap[tindex]}else{stop=1}}if(stop==0){var data=new ServerRpcResponse(isJSON?eval(response.responseText):response.responseText);svrRpcListener.processResponse(data)}},failHandler:function(B,G,A){DebugLog.debug("ServerRPC.js","In failHandler ");var D=0;if(G!=null){if(ServerRPC.gTimeoutMap[G]){var F=ServerRPC.gTimeoutMap[G];clearTimeout(F);delete ServerRPC.gTimeoutMap[G]}else{D=1}}if(D==0){if(A){DebugLog.error("ServerRPC","Ajax Request failed: status="+A.statusText+" url="+A.request.url+" responseText="+A.responseText);var E={Status:A.statusText,request:"ajax",responseText:A.responseText};var C=new ServerRpcException(E);B.processException(C)}else{DebugLog.error("ServerRPC","Ajax Request failed: status="+A.statusText+" url="+response1.request.url+" responseText="+response1.responseText)}}},timeout:function(H,C,A){DebugLog.error("ServerRPC","request timeout: "+H+","+A);if((ServerRPC.gTimeoutMap[H]!=undefined)&&(ServerRPC.gTimeoutMap[H]!=null)){DebugLog.debug("ServerRPC","process timeout");var G=ServerRPC.gTimeoutMap[H];clearTimeout(ServerRPC.timeoutID);delete ServerRPC.gTimeoutMap[H];if(A!=null){ServerRPC.gListenerMapCounter[A]--;var D=ServerRPC.gListenerMapCounter[A];var F=ServerRPC.gScriptMap[A][D];if(F&&(F!="undefined")){F.removeScriptTag()}if(D==0){delete ServerRPC.gListenerMap[A];delete ServerRPC.gListenerMapCounter[A];delete ServerRPC.gScriptMap[A][0]}}if((C!=undefined)&&(C!=null)){var B={Status:"timeout",request:"json",responseText:"timeout"};var E=new ServerRpcException(B);C.processException(E)}}}};var ServerRpcResponse=Class.create({initialize:function(A){this.data=A},getData:function(){return(this.data)}});var ServerRpcException=Class.create({initialize:function(A){this.response=A},getReason:function(){return(this.response.Status)},getRequest:function(){return(this.response.request)},getResponse:function(){return(this.response.responseText)}});var gManualPagePopup=null;var gHighlightedsectionTitle;function getMoreTOC(C){var D="bulk_rest"+C;var B="more_toc0"+C;var A="more_toc1"+C;if($(D).className=="toc_bottom"){$(D).removeClassName("toc_bottom");$(D).addClassName("toc_top");$(B).innerHTML="Hide&nbsp;<img src='/search/v2/images/toc/arrow_down.gif'/>";$(A).innerHTML="Hide&nbsp;<img src='/search/v2/images/toc/arrow_down.gif'/>"}else{$(D).removeClassName("toc_top");$(D).addClassName("toc_bottom");$(A).innerHTML="View All&nbsp;<img src='/search/v2/images/toc/arrow_up.gif'/>";$(B).innerHTML="View All&nbsp;<img src='/search/v2/images/toc/arrow_up.gif'/>";hidePage()}}function showPage(E,C){var B="previewFrame_"+(new Date()).getTime();var D='<div style="width:500px; height:510px;"><div style="text-align:right;background-color:#EEEEEE;" onclick="hidePage()"><img src="/search/v2/images/ui/button_close_blue.gif"/></div> <div style="height:500px;"><iframe scrolling="no" frameborder="0"  class="previewFrame" id="'+B+'" name="'+B+'" src ="'+C+'"></iframe></div></div>';if(gHighlightedsectionTitle){$(gHighlightedsectionTitle).style.color="black"}$(E).style.color="blue";gHighlightedsectionTitle=E;var A=findPos(E);if(!gManualPagePopup){gManualPagePopup=new CalloutDialog("manualPopupDiv",null,CalloutDialog.YELLOW_LEFT_MIDDLE150);gManualPagePopup.show(null,[A[0]+400,A[1]-160],{getContent:function(){return D}})}else{gManualPagePopup.show(null,[A[0]+400,A[1]-160],{getContent:function(){return D}})}}function hidePage(){if(gManualPagePopup){gManualPagePopup.hide()}if(gHighlightedsectionTitle){$(gHighlightedsectionTitle).style.color="black"}}function highlightTitleRollOver(A){if(!gHighlightedsectionTitle||gHighlightedsectionTitle!=A){$(A).style.color="blue"}}function highlightTitleRollOut(A){if(!gHighlightedsectionTitle||gHighlightedsectionTitle!=A){$(A).style.color="#666666"}}function showTOC(D){var E="toc_parent"+D;var C="child"+D;var B="show_toc"+D;var A="show_results"+D;$(E).removeClassName("toc_bottom");$(E).addClassName("show_manual_content");$(C).removeClassName("show_manual_content");$(C).addClassName("toc_bottom");$(B).removeClassName("inactiveTitle");$(B).addClassName("activeTitle");$(A).removeClassName("activeTitle");$(A).addClassName("inactiveTitle")}function showResults(D){var E="toc_parent"+D;var C="child"+D;var B="show_toc"+D;var A="show_results"+D;$(E).removeClassName("show_manual_content");$(E).addClassName("toc_bottom");$(C).removeClassName("toc_bottom");$(C).addClassName("show_manual_content");$(B).removeClassName("activeTitle");$(B).addClassName("inactiveTitle");$(A).removeClassName("inactiveTitle");$(A).addClassName("activeTitle")}var Model={addChangeListener:function(A){if(!this.listeners){this.listeners=new ListenerManager()}this.listeners.addListener(A)},removeChangeListener:function(A){if(this.listeners){this.listeners.removeListener(A)}},modelChangeEvent:function(A){if(this.listeners){this.listeners.callListeners(A)}},attach:function(A){A.addChangeListener=this.addChangeListener;A.removeChangeListener=this.removeChangeListener;A.modelChangeEvent=this.modelChangeEvent}};var ModelEvent=Class.create({initialize:function(){if(arguments.length<1||arguments.length>4){alert("usage: CheckboxGroup eventType, theModel, [theData], [underlyingEvent]")}this.type=arguments[0];this.model=arguments[1];this.data=arguments.length>2&&arguments[2]!=null?arguments[2]:null;this.underlyingEvent=arguments.length>3&&arguments[3]!=null?arguments[3]:null},getType:function(){return this.type},getModel:function(){return this.model},getUnderlyingEvent:function(){return this.underlyingEvent},getData:function(){return this.data}});var Button=Class.create({initialize:function(A,B,C){this.control=null;this.elementID=A;if(this.elementID==null||this.elementID.length==0||$(this.elementID)==null){return }this.model=B?B:null;this.style=C?C:Button.RED_PUSH;switch(this.style){case Button.LIKE_TO_KNOW:this.className="button-likeToKnow";break;case Button.LIKE_TO_KNOW_QUOTES:this.className="button-likeToKnowQuotes";break;case Button.LIKE_TO_KNOW_PDF:this.className="button-likeToKnowPdf";break;case Button.LIKE_TO_KNOW_TAG:this.className="button-likeToKnowTag";break;case Button.WHAT_TO_EXPECT:this.className="button-whattoexpect";break;case Button.RED_RECTANGLE:this.className="button-rectangle-red";break;case Button.GREEN_PUSH:this.className="button-green";break;case Button.GREEN_SMALL_PUSH:this.className="button-small-green";break;case Button.RED_SMALL_PUSH:this.className="button-small-red";break;case Button.RED_PUSH_LEFT:case Button.RED_PUSH:this.className="button-red";break;default:this.className=this.style}this.isShown=true;this.disabled=false;$(this.elementID).RUILwidget=this;this.doRefresh()},doRefresh:function(){var F=$(this.elementID);F.addClassName(this.className);var A;for(A=0;A<F.childNodes.length&&F.childNodes[A].tagName!="A";A++){}var E=F.childNodes[A];var D=E.href;var C="";if(this.model&&this.model.getLabel){C=this.model.getLabel()||""}else{if(E){C=E.innerHTML}}C="<div>"+C+"</div>";F.RUILwidget=this;switch(this.style){case Button.RED_PUSH_LEFT:var B="<div class='left'></div><div class='center'>"+C+"</div>";break;case Button.LIKE_TO_KNOW:case Button.LIKE_TO_KNOW_QUOTES:case Button.LIKE_TO_KNOW_PDF:case Button.LIKE_TO_KNOW_TAG:case Button.WHAT_TO_EXPECT:case Button.GREEN_PUSH:case Button.GREEN_SMALL_PUSH:case Button.RED_PUSH:case Button.BLUE_PUSH:case Button.RED_SMALL_PUSH:case Button.BLUE_SMALL_PUSH:default:var B="<div class='center'>"+C+"</div><div class='right'></div>"}E.innerHTML="<span>"+B+"<div class='divClearBoth' ></div></span>";if(this.model!=null){Event.observe(F.firstChild,"click",this.processClick.bindAsEventListener(this,F.RUILwidget))}},processClick:function(B,A){if(A.model.processClick(A)==false){return cancelEvent(B)}},enable:function(){this.disabled=false},disable:function(){this.disabled=true},show:function(){this.isShown=true;return true},hide:function(A){if(A){}else{}this.isShown=false;return true},isEnabled:function(){return !this.disabled},isShown:function(){return this.isShown},getModel:function(){return this.model}});Button.RED_PUSH=0;Button.RED_PUSH_LEFT=1;Button.RED_LINK=2;Button.RED_LINK_LEFT=3;Button.GREEN_PUSH=4;Button.GREEN_SMALL_PUSH=5;Button.TOP10=6;Button.RED_SMALL_PUSH=7;Button.RED_RECTANGLE=8;Button.WHAT_TO_EXPECT=9;Button.LIKE_TO_KNOW=10;Button.LIKE_TO_KNOW_QUOTES=11;Button.LIKE_TO_KNOW_PDF=12;Button.LIKE_TO_KNOW_TAG=13;Button.BLUE_PUSH=14;Button.BLUE_SMALL_PUSH=15;var StoreMgr=Class.create({initialize:function(C,B,A){this.bList=C;this.wList=B;this.max=A},isValid:function(A){var B=(A<=this.max)?true:false;var D=(this.wList[A])?true:false;var C=(this.bList[A])?true:false;return((B||D)&&(!C))}});function filterArrayHelper(B,F){if(!B&&!F){return[]}var G=[];var C=decodeURIComponent(F).split(" ");var A=0;for(var E=0;E<C.length;E++){if(C[E]!=""){A++;C[E]=C[E].toLowerCase()}}for(var D=0;D<B.length;D++){var H=0;var I=B[D].toLowerCase();for(var E=0;E<C.length;E++){if(C[E]==""){continue}var J=0;while(J!=-1){J=I.indexOf(C[E],J);if(J>0){if(I.charAt(J-1)==" "){H++;break}J++}else{if(J==0){H++;break}}}}if(H>=A){G.push([B[D]])}}return G}var ProductVO=Class.create();Object.extend(ProductVO,{VENDOR_ID:0,PRODUCT_NAME:1,IMAGE_SMALL:2,IMAGE_SMALL_DIM:3,IMAGE_LARGE:4,IMAGE_LARGE_DIM:5,PRICE_MIN:6,PRICE_MAX:7,GRID_X:8,GRID_Y:9,TYPE_IDX:10,PRICE_MEDIAN:11,MODEL_ID:12,SENTIMENT:13,TYPE_STR:14,FEATURE_STR:15,PRODUCT_URL:16,VALUE_INDEX:17,POPULAR_INDEX:18,KEY_ATTRIBUTES:19,YAHOO_PID:20,PRODUCT_DECR:21,HAS_SPEC:22,LAST_ACCESS_TIME:23,EXPERT_REVIEW:24,USER_REVIEW:25,CAT_ID:26,CAT_NAME:27,AD_CAT_NAME:28,VENDOR_NAME:29,NUM_PREFERRED_STORES:30,PREFERED_PARTNER_ID:31,HAS_SNAPSHOT:32,LIFE_CYCLE:33,BUY_NOW:34,INTRO_TIME:35,LINK_CHANNEL:36,SIZE:37});ProductVO.prototype={initialize:function(A){this.data=A.data;this.matchBasic=true;this.matchAdvanced=true;this.pid=0;this.mapObj=null},get:function(A){return this.data[(A+this.data[ProductVO.SIZE])%ProductVO.SIZE]},getAttr:function(A){if(A=="TYPE"){return this.get(ProductVO.TYPE_IDX)[0]}else{if(A=="FEATURE"){return this.get(ProductVO.TYPE_IDX)[1]}else{if(A=="VALUE"){return this.get(ProductVO.TYPE_IDX)[2]}else{if(A=="SUB_VALUE"){return this.get(ProductVO.TYPE_IDX)[3]}else{if(A=="PRICE_MIN"){return parseFloat(this.get(ProductVO[A]))}else{return this.get(ProductVO[A])}}}}}},setMatchBasic:function(A){this.matchBasic=A},setMatchAdvanced:function(A){this.matchAdvanced=A},isShowOnMap:function(){return this.matchBasic&&this.matchAdvanced},getVendorID:function(){return this.get(ProductVO.VENDOR_ID)},getVendorName:function(){return this.get(ProductVO.VENDOR_NAME)},getProductName:function(){return this.get(ProductVO.PRODUCT_NAME)},getImageSmallUrl:function(){return this.get(ProductVO.IMAGE_SMALL)},getImageSmallDim:function(){return this.get(ProductVO.IMAGE_SMALL_DIM)},getImageUrl:function(){return this.get(ProductVO.IMAGE_SMALL)},getImageLarge:function(){return this.get(ProductVO.IMAGE_LARGE)},getImageLargeDim:function(){return this.get(ProductVO.IMAGE_LARGE_DIM)},getPriceMin:function(){var A=String(this.get(ProductVO.PRICE_MIN));if(A.length-A.lastIndexOf(".")<3){A=A+"0"}return A!="null"?A:"0"},getPriceMinNoDecimal:function(){var A=this.getPriceMin().split(".");return A[0]},getPriceMax:function(){var A=String(this.get(ProductVO.PRICE_MAX));if(A.length-A.lastIndexOf(".")<3){A=A+"0"}return A!="null"?A:"0"},getPrice:function(){return this.getPriceMin()},getSortPrice:function(){var A=this.getPrice();if(A.indexOf("check")!=-1){return 1000000}else{return A}},getKeyFeatureText:function(){return this.get(ProductVO.KEY_ATTRIBUTES)},getProductRating:function(){return this.get(ProductVO.VALUE_INDEX)},getPopularRating:function(){return this.get(ProductVO.POPULAR_INDEX)},getProductX:function(){return this.get(ProductVO.GRID_X)},getProductY:function(){return this.get(ProductVO.GRID_Y)},getProductNumber:function(){return 0},getUserRating:function(){return"to be removed"},getExpertRating:function(){return"to be removed"},getTypeDecr:function(){return this.get(ProductVO.TYPE_STR)},getFeatureDecr:function(){return this.get(ProductVO.FEATURE_STR)},getType:function(){return this.get(ProductVO.TYPE_IDX)[0]},getValue:function(){return this.get(ProductVO.TYPE_IDX)[2]},getSubValue:function(){return this.get(ProductVO.TYPE_IDX)[3]},getProductURL:function(){return this.get(ProductVO.PRODUCT_URL)},getSentiment:function(){return this.get(ProductVO.SENTIMENT)},getModelID:function(){return this.get(ProductVO.MODEL_ID)},setPid:function(A){this.pid=A},getPid:function(){return this.pid},getYahooPID:function(){return this.get(ProductVO.YAHOO_PID)},getNumPreferredStores:function(){return this.get(ProductVO.NUM_PREFERRED_STORES)},getPreferredPID:function(){return this.get(ProductVO.PREFERRED_PARTNER_ID)},getProductDecr:function(){return this.get(ProductVO.PRODUCT_DECR)},hasSpec:function(){return this.get(ProductVO.HAS_SPEC)},hasSnapshot:function(){return this.get(ProductVO.HAS_SNAPSHOT)},getCatID:function(){return this.get(ProductVO.CAT_ID)},getCatName:function(){return this.get(ProductVO.CAT_NAME)},getLinkChannel:function(){return this.get(ProductVO.LINK_CHANNEL)},getAdCatName:function(){return this.get(ProductVO.AD_CAT_NAME)},getDisplayX:function(){var A=this.getProductX();if(typeof jsPriceMarkers!="undefined"&&jsPriceMarkers!=null&&jsPriceMarkers.length>=2){A=parseInt((A+parseInt(jsPriceMarkers[0]))*parseFloat(jsPriceMarkers[1])+gMapLeftOffset-gShadowLeftOffset)}return A},getLifeCycle:function(){return this.get(ProductVO.LIFE_CYCLE)},isNewProduct:function(){if(typeof gLIFECYCLE_NEW!="undefined"){if(this.getLifeCycle()==gLIFECYCLE_NEW||this.getLifeCycle()==gLIFECYCLE_NEW_AND_BUZZING){return true}}return false}};var PListActButton=Class.create({initialize:function(C,A,D,B){this.action=C;this.enableSrc="/search/v2/images/mytrevo/button_"+C+".gif";this.disableSrc="/search/v2/images/mytrevo/button_"+C+"_dimmed.gif";if(D){this.id=D}else{this.id="button_"+C}if(B){this.idLen=B}else{this.idLen=1}if(A){if(A=="none"){this.eventn=null}else{this.eventn=A}}else{switch(C){case"remove":this.eventn=pl_remove;break;case"addtolist":this.eventn=pl_addtolist;break;case"compare":this.eventn=pl_compare;break;default:DebugLog.error("PListActButton","illegal action parameter: "+C);this.eventn=null}}},reset:function(C){for(var B=0;B<this.idLen;B++){var A=this.id;if(B>0){A=this.id+B}if(!$(A)){continue}if(C=="disable"){$(A).src=this.disableSrc;$(A).style.cursor="default";if(this.eventn!=null){Event.stopObserving($(A),"click",this.eventn)}}if(C=="enable"){$(A).src=this.enableSrc;$(A).style.cursor="pointer";if(this.eventn!=null){Event.observe($(A),"click",this.eventn)}}}},disable:function(){this.reset("disable")},enable:function(){this.reset("enable")}});var PListOp={common:function(G,A,I,D,K,H,C,E,F){if(D!=null){D.disable()}var J=[];var B=new Personalization();if(E){J.push(E)}else{J=(I==null)?"":I.getSelIDs()}switch(G){case"add":B.addModelToListByType(K,3,J,F);break;case"rm":B.removeModelToListById(K,C,J,F);break;case"comp":B.addModelToListByType(K,1,J,F);break;default:DebugLog.error("PListOp","Illegal type: "+G);return }},addtolist:function(D,C,B,F,E,A,G){this.common("add",D,C,B,F,E,null,A,G)},remove:function(C,F,B,A,E,D,G){this.common("rm",C,B,A,E,D,F,null,G)},compare:function(D,C,B,F,E,A,G){this.common("comp",D,C,B,F,E,null,A,G)},compRm:function(D,C,B,G,E,F,A,H){this.common("rm",D,C,B,G,E,F,A,H)}};