var _amzn_utils={insertStyleSheet:function(_1,_2,_3){
if(!document.getElementById(_1)){
var _4=document.getElementsByTagName("head");
if(_4[0]){
var _5;
if(document.createElementNS&&_4[0].tagName=="head"){
_5=document.createElementNS("http://www.w3.org/1999/xhtml","link");
}else{
_5=document.createElement("link");
}
_5.id=_1;
_5.rel="stylesheet";
_5.href=this.amznMediaserverURL(_3)+_2;
_5.type="text/css";
_4[0].appendChild(_5);
}
}
},objHasOwnProperty:function(_6,_7){
return Object.prototype.hasOwnProperty?_6.hasOwnProperty(_7):typeof _6[_7]!="function";
},insertAfter:function(_8,_9,_a){
var pn=_9.parentNode;
if(_9==pn.lastChild){
if((!_a)&&(_8===_9)){
return false;
}
pn.appendChild(_8);
}else{
return this.insertBefore(_8,_9.nextSibling,_a);
}
return true;
},insertBefore:function(_c,_d,_e){
if(!_e&&(_c===_d||_c.nextSibling===_d)){
return false;
}
var _f=_d.parentNode;
_f.insertBefore(_c,_d);
return true;
},getById:function(id,_11){
if(this.isAppleWebKit()){
var _12=null;
var _13=_11.childNodes;
for(var i=0;i<_13.length;i++){
if(_12!=null){
return _12;
}
var _15=_13[i];
if(_15&&_15.childNodes&&_15.childNodes.length>0){
var _16=this.getById(id,_15);
if(_16!=null){
_12=_16;
}
}
if(_15&&_15.id==id){
_12=_15;
}
}
return _12;
}else{
var _12=null;
var _13=_11.childNodes;
for(var i in _13){
if(_12!=null){
return _12;
}
var _15=_13[i];
if(_15&&_15.childNodes&&_15.childNodes.length>0){
var _16=this.getById(id,_15);
if(_16!=null){
_12=_16;
}
}
if(_15&&_15.id==id){
_12=_15;
}
}
return _12;
}
},byId:function(id,doc){
if((id)&&((typeof id=="string")||(id instanceof String))){
doc=document;
var ele=doc.getElementById(id);
if(ele&&(ele.id!=id)&&doc.all){
ele=null;
var _1a=doc.all[id];
if(_1a){
if(_1a.length){
for(var i=0;i<_1a.length;i++){
if(_1a[i].id==id){
ele=_1a[i];
break;
}
}
}else{
ele=_1a;
}
}
}
return ele;
}
return id;
},replaceAll:function(str,_1d,_1e){
if(str==null){
return str;
}
var idx=str.indexOf(_1d);
while(idx>-1){
str=str.replace(_1d,_1e);
idx=str.indexOf(_1d);
}
return str;
},msie:"",amzn_isMSIE:function(){
if(this.msie==""){
this.msie=navigator.userAgent.toLowerCase().indexOf("msie")>0;
}
return this.msie;
},msie_6:"",amzn_isMSIE_6:function(){
if(this.msie_6==""){
this.msie_6=/MSIE (5\.5|6\.)/.test(navigator.userAgent);
}
return this.msie_6;
},firefox_1_5:"",isFirefox_1_5:function(){
if(this.firefox_1_5==""){
this.firefox_1_5=navigator.userAgent.toLowerCase().indexOf("firefox/1.5")>0;
}
return this.firefox_1_5;
},safari:"",isAppleWebKit:function(){
if(this.safari==""){
this.safari=navigator.userAgent.toLowerCase().indexOf("applewebkit")>0;
}
return this.safari;
},$:function(id){
return this.byId(id,document);
},validateParams:function(_21){
var _22=true;
for(var _23 in _21){
if(_amzn_utils.objHasOwnProperty(_21,_23)){
if(typeof _21[_23]=="undefined"){
_22=false;
return;
}
}
}
return _22;
},clone:function(_24){
if(_24==null){
return _24;
}
var _25=new _24.constructor();
for(var _26 in _24){
if(_amzn_utils.objHasOwnProperty(_24,_26)){
if(typeof _24[_26]=="object"){
_25[_26]=this.clone(_24[_26]);
}else{
_25[_26]=_24[_26];
}
}
}
return _25;
},runPNGTransparencyHackForBkgdImage:function(_27){
if(/MSIE (5\.5|6\.)/.test(navigator.userAgent)&&_27){
var _28=_27.currentStyle.backgroundImage||_27.style.backgroundImage;
if(_28){
var _29=false;
if(_28.match(/^url[("']+(.*\.png)[)"']+$/i)){
var _2a=RegExp.$1;
if(_2a&&_2a.indexOf("_tpng.png")>0){
if(_27.currentStyle.width=="auto"&&_27.currentStyle.height=="auto"){
_27.style.width=_27.offsetWidth+"px";
}
_27.style.backgroundImage="none";
_27.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader"+"(src='"+_2a+"',sizingMethod='scale')";
}
_29=true;
}else{
if(_28=="none"){
_29=true;
}
}
if(_29){
for(var n=0;n<_27.childNodes.length;n++){
if(_27.childNodes[n].style){
_27.childNodes[n].style.position="relative";
}
}
}
}
}
},runPNGTransparencyHack:function(_2c,_2d){
if(typeof _2d=="undefined"){
_2d="US";
}
if(/MSIE (5\.5|6\.)/.test(navigator.userAgent)&&_2c){
if(window.ActiveXObject){
var _2e=_2c.getElementsByTagName("input");
for(var i=0;i<_2e.length;++i){
if(_2e[i].src.indexOf("_tpng.png")>0){
var src=_2e[i].src;
_2e[i].src=this.imageDirectory(_2d)+"/transparent-pixel.gif";
_2e[i].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";
}
}
var _31=_2c.getElementsByTagName("img");
for(var i=0;i<_31.length;++i){
if(_31[i].src.indexOf("_tpng.png")>0){
var src=_31[i].src;
_31[i].src=this.imageDirectory(_2d)+"/transparent-pixel.gif";
_31[i].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";
}
}
}
}
},stripTags:function(str){
if(str==null){
return null;
}
return str.replace(/<\/?[^>]+>/gi,"");
},unescapeHTML:function(_33){
var div=document.createElement("div");
div.innerHTML=this.stripTags(_33);
return div.childNodes[0]?div.childNodes[0].nodeValue:"";
},escapeHTML:function(_35){
if(typeof _35=="string"){
var div=document.createElement("div");
var _37=document.createTextNode(_35);
div.appendChild(_37);
return div.innerHTML;
}else{
if(typeof _35=="array"){
for(var i=0;i<_35.length;i++){
_35[i]=this.escapeHTML(_35[i]);
}
}else{
if(typeof _35=="object"){
for(var i in _35){
if(_amzn_utils.objHasOwnProperty(_35,i)){
_35[i]=this.escapeHTML(_35[i]);
}
}
}
}
}
return _35;
},getRatingImage:function(_39,_3a){
if(!_39){
return "";
}
var _3b;
var _3c=_39.split(".");
if(_3c&&_3c.length==2){
var _3d=_3c[0]+_3c[1];
_3b="<img style='height:11px; width:56px;border: none;margin:0;' src='"+_amzn_utils.imageDirectory(_3a)+"/star"+_3d+"_tpng.png'>";
}
return _3b;
},numberOfOccurencesOfSubstr:function(str,_3f){
var _40=0;
var pos=str.indexOf(_3f);
while(pos!=-1){
_40++;
pos=str.indexOf(str,pos+_3f.length);
}
return _40;
},_amzn_popup_onshow_callback:function(){
_amzn_utils.runPNGTransparencyHack(_amzn_utils.$("amzn_popup_div"));
},_amzn_popup_callback_helper:function(){
_amzn_popup.onshow_callback=_amzn_utils._amzn_popup_onshow_callback;
_amzn_popup.onhide_callback=_amzn_utils._amzn_popup_onhide_callback;
},_amzn_popup_onhide_callback:function(){
_amzn_popup.onhide_callback=null;
},getTile:function(_42,_43,_44){
var _45=Math.floor((_43.innerWidth-6*_43.cols)/_43.cols);
var res="<div class='wdgt_tl_pad'>"+"<div class='wdgt_tl' style='height:"+_43.height+"px;width:"+_45+"px'>";
if(typeof _42=="string"&&_42=="INVALID"){
res+="<a target='_blank' href='"+_amzn_utils.getString(_amzn_utils.AmazonCom,_43.marketPlace)+"'><img style='width:40px;height:54px;border:none' src='"+_amzn_utils.imageDirectory(_43.marketPlace)+"/itemNoLongerAvailable-40px.gif'></a>";
res+="</div>";
res+="</div>";
return res;
}
var _47=escape(_43.createPopupTile(_42));
var _48="";
var _49="";
var _4a="";
var _4b="";
var _4c="";
var _4d="";
var _4e=_43.getURL(_42["DetailPageURL"]);
var _4f=_45-15;
var _50=_45;
var _51=0;
var _52="";
if(_43.show_image){
var _53=_42["ThumbImageUrl"];
var _54=_42["ThumbImageWidth"];
_51=_42["ThumbImageHeight"];
if(!_53||_53==""){
_53=_amzn_utils.imageDirectory(_43.marketPlace)+"/noImageAvailable-40px.gif";
}
if(!_54||_54==""){
_54=40;
}
if(!_51||_51==""){
_51=44;
}
if(_54>40){
_54=40;
_51=Math.floor(40*_42["ThumbImageHeight"]/_42["ThumbImageWidth"]);
}
if(_51>60){
_51=60;
_54=Math.floor(60*_42["ThumbImageWidth"]/_42["ThumbImageHeight"]);
}
_52="<div class='asin_img' ";
_48="><a style='float:left;"+_43.style_tile_asin_a()+"' target='_blank' onmouseover='_amzn_utils._amzn_popup_callback_helper();_a=this; _amzn_popup.showpreview(\""+_47+"\", _a, event, 500,\""+_43.tag+"\",\""+_43.linkCode+"\",\""+_43.creativeId()+"\",\""+_43.marketPlace+"\")' onmouseout='_amzn_popup.hide()' href='"+_4e+"'>"+"<img src='"+_53+"' width='"+_54+"' height='"+_51+"' style='border: none;margin:0;"+_43.style_tile_asin_img()+"' /></a></div>";
if(_45>150){
_4f=_45-_54-6-10;
}
_50=_45-_54-6-10;
}else{
_4f=_45-6-15;
_50=_45-6;
}
_49="<div style='"+_43.style_tile_h1()+"' class='asin_h1'><a target='_blank' onmouseover='_amzn_utils._amzn_popup_callback_helper();_a=this; _amzn_popup.showpreview(\""+_47+"\", _a, event, 500,\""+_43.tag+"\",\""+_43.linkCode+"\",\""+_43.creativeId()+"\",\""+_43.marketPlace+"\")' onmouseout='_amzn_popup.hide()' style='"+_43.style_tile_a()+_43.style_tile_h1_a()+"' href='"+_4e+"'>"+_43.trimCharsByWidth(this.escapeHTML(_42["Title"]),"10bold",_4f)+"</a></div>";
_4a="<div style='"+_43.style_tile_h2()+"' class='asin_h2'><a target='_blank' onmouseover='_amzn_utils._amzn_popup_callback_helper();_a=this; _amzn_popup.showpreview(\""+_47+"\", _a, event, 500,\""+_43.tag+"\",\""+_43.linkCode+"\",\""+_43.creativeId()+"\",\""+_43.marketPlace+"\")' onmouseout='_amzn_popup.hide()' style='"+_43.style_tile_a()+"' href='"+_4e+"'>"+_43.trimCharsByWidth(this.escapeHTML(_42["Subtitle"]),"9",_50)+"</a></div>";
var _55=_43.show_price&&_42["Price"];
if(_55){
_4b="<div  style='"+_43.style_tile_price()+"' class='asin_price'>"+_42["Price"]+"</div>";
}
var _56=_43.show_review&&_42["Rating"];
if(_56){
_4c="<div style='"+_43.style_tile_review()+"' class='asin_review'>"+_43.getReviewImage(_42["Rating"])+"</div>";
}
if(_44){
var _57=2;
if(_43.show_image){
var _58=15;
if(_45>=150){
_58+=15;
}
if(_56){
_58+=15;
}
if(_55){
_58+=15;
}
_58=Math.max(_51,_58);
_57+=Math.floor((60-_58)/12);
_52+="style='height:"+_58+"px;'";
}
_4d="<div onmouseover='_amzn_utils._amzn_popup_callback_helper();_a=this; _amzn_popup.showpreview(\""+_47+"\", _a, event, 500,\""+_43.tag+"\",\""+_43.linkCode+"\",\""+_43.creativeId()+"\",\""+_43.marketPlace+"\")' onmouseout='_amzn_popup.hide()' class='asin_cmnt' style='cursor:pointer;width:"+_45+"px;"+_43.style_tile_comment()+"'>"+_43.trimMultiLineComments(_44,"10",_45-6,_57)+"</div>";
}
_48=_52+_48;
if(_45<150){
res+=_49;
res+=_48;
}else{
res+=_48;
res+=_49;
}
res+=_4a;
res+=_4b;
res+=_4c;
if(_44){
res+=_4d;
}
res+="</div>";
res+="</div>";
return res;
},pageNumberDiv:function(_59,_5a,_5b,_5c){
if(typeof _5c=="undefined"){
_5c=_59;
}
if(_5a){
return "<strong style='"+_5b.style_pgn_strong()+"'>"+_5c+"</strong>";
}else{
if(!window.nextCallBack){
window.nextCallBack=new Object();
}
if(!window.nextCallBack[_5b.marketPlace]){
window.nextCallBack[_5b.marketPlace]=new Object();
}
if(!window.nextCallBack[_5b.marketPlace][_5b.templateId]){
window.nextCallBack[_5b.marketPlace][_5b.templateId]=new Object();
}
if(!window.nextCallBack[_5b.marketPlace][_5b.templateId][_5b.instanceId]){
window.nextCallBack[_5b.marketPlace][_5b.templateId][_5b.instanceId]=new Object();
}
window.nextCallBack[_5b.marketPlace][_5b.templateId][_5b.instanceId]["showpage"]=_5b.showpage;
return "<a style='cursor:pointer;"+_5b.style_pgn_a()+"' onclick='javascript:window.nextCallBack[\""+_5b.marketPlace+"\"]["+_5b.templateId+"]["+_5b.instanceId+"].showpage("+_59+","+_5b.instanceId+","+_5b.templateId+",\""+_5b.marketPlace+"\");'>"+_5c+"</a>";
}
},calcContrastColor:function(_5d){
function f(c,n){
return parseInt(c.substr(n,2),16);
}
var av=(f(_5d,1)+f(_5d,3)+f(_5d,5))/3;
av+=(av>=100)?-100:100;
return "rgb("+av+","+av+","+av+")";
},createPopupTile:function(_61,_62,_63){
var _64=300;
var _65=_61["ThumbImageUrl"];
var _66=_61["ThumbImageWidth"];
var _67=_61["ThumbImageHeight"];
if(!_65||_65==""){
_65=_amzn_utils.imageDirectory(_62.marketPlace)+"/noImageAvailable-90px.gif";
}
if(!_66||_66==""){
_66=90;
}
if(!_67||_67==""){
_67=90;
}
if(_66>100){
_66=100;
_67=100*_61["ThumbImageHeight"]/_61["ThumbImageWidth"];
}
if(_67>100){
_67=100;
_66=100*_61["ThumbImageWidth"]/_61["ThumbImageHeight"];
}
var _68="";
if(_61["Rating"]){
_68="<div style='"+_62.style_tile_review()+"' class='asin_review'>"+_62.getReviewImage(_61["Rating"])+" ("+_61["TotalReviews"]+this.getString(this.CustomerReviews,_62.marketPlace)+")"+"</div>";
}
var _69="";
if(_61["Price"]){
_69="<div style='"+_62.style_tile_price()+"' class='asin_price'>"+this.getString(this.Price,_62.marketPlace)+":&nbsp;"+_61["Price"]+"</div>";
}
var _6a="";
if(_63){
_6a="<div style='"+_62.style_tile_comment()+"' class='asin_cmnt'>"+_63+"</div>";
}
return "<div id='wdgt_pop_tl' class='wdgt_pop_tl' style='"+_62.style_wdgt_pop_tl(_64)+"'>"+"<img onclick='_amzn_popup.hideNow()' style='border: none;margin:0;width:19px;height:19px;float:right;padding:0 3px 0 6px;cursor:pointer;' src='"+_amzn_utils.imageDirectory(_62.marketPlace)+"/close_down.gif"+"'>"+"<table><tr><td>"+"<a style='"+_62.style_tile_asin_a()+"' target='_blank' href='"+_62.getURL(_61["DetailPageURL"])+"'>"+"<img src='"+_65+"' width='"+_66+"' height='"+_67+"'  style='border: none;margin:0;padding:6px 6px 6px 6px;"+_62.style_tile_asin_img()+"' class='asin_img'/>"+"</a>"+"</td><td>"+"<div style='"+_62.style_tile_h1()+"' class='asin_h1'><a style='"+_62.style_tile_a()+_62.style_tile_h1_a()+"' target='_blank' href='"+_62.getURL(_61["DetailPageURL"])+"'>"+_61["Title"]+"</a></div>"+"<div style='"+_62.style_tile_h2()+"' class='asin_h2'><a target='_blank'  style='"+_62.style_tile_a()+"' href='"+_62.getURL(_61["DetailPageURL"])+"'>"+_61["Subtitle"]+"</a></div>"+_69+_68+"</td></tr></table>"+_6a+"<div style='clear:left'></div>"+"</div>";
},recordImpression:function(tag,_6c,_6d,_6e){
var img=document.createElement("IMG");
img.style.width="1px";
img.style.height="1px";
img.style.border="none";
var _70=1;
switch(_6e){
case "US":
_70=1;
break;
case "GB":
_70=2;
break;
case "DE":
_70=3;
break;
case "FR":
_70=8;
break;
case "JP":
_70=9;
break;
case "CA":
_70=15;
break;
}
img.src="http://"+this.getString(this.AssocImpVIP,_6e)+"/e/ir?"+"o="+_70+"&t="+tag+"&l="+_6c+"&camp="+this.getString(this.CampaignID,_6e)+"&creative="+_6d;
document.body.appendChild(img);
},recordPopover:function(tag,_72,_73,_74){
var img=document.createElement("IMG");
img.style.width="1px";
img.style.height="1px";
img.style.border="none";
var _76=1;
switch(_74){
case "US":
_76=1;
break;
case "GB":
_76=2;
break;
case "DE":
_76=3;
break;
case "FR":
_76=8;
break;
case "JP":
_76=9;
break;
case "CA":
_76=15;
break;
}
img.src="http://"+this.getString(this.AssocImpVIP,_74)+"/s/pp?"+"o="+_76+"&t="+tag+"&l="+_72+"&camp="+this.getString(this.CampaignID,_74)+"&asin=INVALDASIN"+"&creative="+_73;
document.body.appendChild(img);
},getAmazonLogoDimensions:function(_77){
var _78=new Object();
switch(_77){
case "CA":
_78.height=27;
_78.width=89;
break;
case "DE":
_78.height=26;
_78.width=88;
break;
case "FR":
_78.height=28;
_78.width=89;
break;
case "GB":
_78.height=22;
_78.width=84;
break;
case "JP":
_78.height=23;
_78.width=87;
break;
default:
_78.height=22;
_78.width=86;
break;
}
return _78;
},getGetWidgetButtonDimensions:function(_79){
var _7a=new Object();
switch(_79){
case "DE":
_7a.height=18;
_7a.width=95;
break;
case "FR":
_7a.height=18;
_7a.width=79;
break;
case "JP":
_7a.height=18;
_7a.width=94;
break;
default:
_7a.height=18;
_7a.width=82;
break;
}
return _7a;
},getRevampGetWidgetButtonDimensions:function(_7b){
var _7c=new Object();
switch(_7b){
case "DE":
_7c.height=17;
_7c.width=89;
break;
case "FR":
_7c.height=17;
_7c.width=78;
break;
case "JP":
_7c.height=17;
_7c.width=87;
break;
default:
_7c.height=17;
_7c.width=70;
break;
}
return _7c;
},drawFooter:function(_7d){
var _7e;
var _7f;
var _80=new Color(_7d.getBackgroundColor().substring(1));
if(_80.isDark()){
_7e="amazon-logo-w_tpng.png";
_7f="#FFFFFF";
}else{
_7e="amazon-logo-b_tpng.png";
_7f="#000000";
}
var _81=32;
var _82=_7d.getWidth();
var _83="left";
var _84="";
var _85=230;
if(_82<132){
_81=60;
}else{
if(_82<230){
_81=50;
}
}
switch(_7d.marketPlace){
case "CA":
_81=32;
_85=240;
if(_82<130){
_81=65;
}else{
if(_82<_85){
_81=54;
}
}
break;
case "DE":
_85=260;
_81=31;
if(_82<175){
_81=71;
}else{
if(_82<_85){
_81=53;
}
}
break;
case "FR":
_85=250;
_81=33;
if(_82<150){
_81=65;
}else{
if(_82<_85){
_81=55;
}
}
break;
case "GB":
break;
case "JP":
_85=270;
if(_82<190){
_81=68;
}else{
if(_82<_85){
_81=50;
}
}
break;
default:
break;
}
if(_82<_85){
_83="right";
_84="clear: left; ";
}
var _86;
if(_7d.showAmazonLogoAsText){
_86=_amzn_utils.getString(_amzn_utils.AmazonCom,_7d.marketPlace);
}else{
_86="<img height=\""+this.getAmazonLogoDimensions(_7d.marketPlace).height+"\" width=\""+this.getAmazonLogoDimensions(_7d.marketPlace).width+"\" border=\"0\" alt=\""+_amzn_utils.getString(_amzn_utils.AmazonCom,_7d.marketPlace)+"\" src=\""+_amzn_utils.imageDirectory(_7d.marketPlace)+"/"+_7e+"\"/>";
}
var res="<div class='wdgt_ft' style='height: "+_81+"px; padding: 5px 5px 5px 3px; "+_7d.style_wdgt_ft()+";'><div class='ft_cnt'>";
var _88="<img "+_amzn_utils.getGetWidgetOnclickStr(_7d)+" style=\"float: left; cursor: pointer; "+_84+" \" width=\""+this.getGetWidgetButtonDimensions(_7d.marketPlace).width+"\" height=\""+this.getGetWidgetButtonDimensions(_7d.marketPlace).height+"\" border=\"0\" alt=\"Get Widget\""+"border=\"0\" src=\""+_amzn_utils.imageDirectory(_7d.marketPlace)+"/btn-get-widget_tpng.png\"/>";
_88+="<a target=\"_blank\" style=\"padding: 2px 0 0 3px; text-decoration: none; float: "+_83+"; font-size: 10px; color: #"+_80.getBlendingColor().getHex()+" !important;\" "+"href=\""+_7d.getURL(_amzn_utils.getString(_amzn_utils.PrivacyPolicyLink,_7d.marketPlace))+"\">"+_amzn_utils.getString(_amzn_utils.PrivacyPolicy,_7d.marketPlace)+"</a>";
if(_82<_85){
res=res+"<a target=\"_blank\" style=\"text-decoration: none; float: left; font-size:12px; color: "+_7f+" !important; \" href=\""+_7d.getURL(_amzn_utils.getString(_amzn_utils.AmazonComLink,_7d.marketPlace))+"\">"+_86+"</a><br/>"+_88;
}else{
res=res+_88+"<a target=\"_blank\" style=\"text-decoration: none; float: right; right: 5px; font-size:12px; color: "+_7f+" !important; \" href=\""+_7d.getURL(_amzn_utils.getString(_amzn_utils.AmazonComLink,_7d.marketPlace))+"\">"+_86+"</a>";
}
res+="</div></div>";
return res;
},drawRevampFooter:function(_89,_8a){
var _8b;
var _8c;
var _8d;
if(_8a){
_8c="#FFFFFF";
_8d="amazon-logo-w_tpng.png";
}else{
_8c="#000000";
_8d="amazon-logo-b_tpng.png";
}
if(_89.showAmazonLogoAsText){
_8b=_amzn_utils.getString(_amzn_utils.AmazonCom,_89.marketPlace);
}else{
_8b="<img height=\""+this.getAmazonLogoDimensions(_89.marketPlace).height+"\" style='top: 5px;' width=\""+this.getAmazonLogoDimensions(_89.marketPlace).width+"\" border=\"0\" alt=\""+_amzn_utils.getString(_amzn_utils.AmazonCom,_89.marketPlace)+"\" src=\""+_amzn_utils.imageDirectory(_89.marketPlace)+"/"+_8d+"\"/>";
}
var res="<div class='wdgt_ft' style='padding:0px; width:100%;"+_89.style_wdgt_ft()+";'>"+"<div class='new_ft_cnt'>"+"<a target='_blank' style='color: "+_8c+" !important; width:90px;text-align:left; float: left;' href='"+_89.getURL(_amzn_utils.getString(_amzn_utils.AmazonComLink,_89.marketPlace))+"'>"+_8b+"</a> ";
res+="<a target='_blank' onmouseover='' style='float:right; text-align:right;"+_89.style_wdgt_ft()+";' href='"+_89.getURL(_amzn_utils.getString(_amzn_utils.PrivacyPolicyLink,_89.marketPlace))+"'>"+_amzn_utils.getString(_amzn_utils.PrivacyPolicy,_89.marketPlace)+"</a>";
res+="</div></div>";
return res;
},drawRevampGetWidgetAndEdit:function(_8f,_90){
var res="";
var _92=_amzn_utils.getRevampGetWidgetButtonDimensions(_8f.marketPlace);
res+="<table width=\"100%\">"+"<tr style='vertical-align:middle;'>"+"<td align=\"left\">"+"<img "+_amzn_utils.getGetWidgetOnclickStr(_8f)+" style=\"cursor: pointer;\" width=\""+_92.width+"\" height=\""+_92.height+"\" border=\"0\" align=\"absmiddle\" alt=\""+_amzn_utils.getString(_amzn_utils.GetEditWidgetShort,_8f.marketPlace)+"\""+"src=\""+_amzn_utils.imageDirectory(_8f.marketPlace)+"/"+_90+"\"/>"+"</td>";
res+="</tr></table>";
return res;
},widgetServerURL:function(_93){
return this.getString(this.WSUrl,_93);
},amznMediaserverURL:function(_94){
return this.getString(this.WMSUrl,_94);
},imageDirectory:function(_95){
return this.amznMediaserverURL(_95)+"/img";
},getEditWidgetMessageHTML:function(_96){
var url="#";
var _98="";
if(typeof amzn_widget_central_preview=="undefined"){
if(_96.origParams.tag!=_amzn_utils.getString(_amzn_utils.DefaultTag,_96.marketPlace)&&typeof _96.origParams.ID!="undefined"&&_96.origParams.ID!=null){
url=_amzn_utils.getString(_amzn_utils.WebsiteUrl,_96.marketPlace)+"/"+_96.getEditWidgetTarget+"?widget_id="+_96.origParams.ID+"&"+this.WebsiteRefParam+"="+this.getString(this.WebsiteRefTag,_96.marketPlace)+"&refURL="+_96.origParams.refURL;
_98=" target=\"_blank\" ";
}else{
return "";
}
}
_98+=" href=\""+url+"\" onclick=\"_amzn_popup.hideNow();\" "+"style=\"text-decoration: none; color: #0000FF; border: none; font: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; text-align: left;\" ";
var res="<div style='clear: left; font: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; text-align: left; color: #000000;margin:10px 0;padding: 0 4px 4px 4px;'>";
switch(_96.marketPlace){
case "DE":
res+="Ist das Ihr Widget?<br/>Zum Bearbeiten <a "+_98+">hier klicken</a><br/>";
break;
case "FR":
res+="Est-ce votre Widget?<br/><a "+_98+">Cliquez ici</a> pour modifier<br/>";
break;
case "JP":
res+="\u4f5c\u6210\u6e08\u307f\u306e\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092\u7de8\u96c6\u3057\u307e\u3059\u304b\uff1f\u7de8\u96c6\u3059\u308b\u306b\u306f<a "+_98+">\u3053\u3053</a>\u3092<br/>\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044<br/>";
break;
default:
res+="Is this your widget?<br/><a "+_98+">Click here</a> to edit it.";
}
res+="</div>";
return res;
},ErrorMessage:"ErrorMessage",Price:"Price",Loading:"Loading",Searching:"Searching",PrivacyPolicy:"PrivacyPolicy",NoResultsFor:"NoResultsFor",CustomerReviews:"CustomerReviews",Search:"Search_On_",Showing:"Showing",CampaignID:"CampaignID",AssocImpVIP:"AssocImpVIP",AmazonCom:"AmazonCom",AmazonComLink:"AmazonComLink",PrivacyPolicyLink:"PrivacyPolicyLink",WSUrl:"WidgetServerURL",WMSUrl:"MediaServerURL",WebsiteUrl:"WebsiteUrlURL",GetEditWidgetShort:"GetEditWidgetShort",GetEditWidgetLong:"GetEditWidgetLong",selectStore:"SelectStore",closeString:"CloseWindow",SortBy:"SortBy",NoItemsWishlist:"NoItemsWishlist",DefaultTag:"DefaultTag",WebsiteRefTag:"WebsiteRefTag",WebsiteRefParam:"ref",getStringForCA:function(key){
switch(key){
case this.ErrorMessage:
return "Could not connect to server. Please try later.";
case this.Price:
return "Price";
case this.Loading:
return "Loading";
case this.Searching:
return "Searching";
case this.PrivacyPolicy:
return "Privacy";
case this.NoResultsFor:
return "No results for ";
case this.CustomerReviews:
return " Customer Reviews";
case this.Search:
return "Search";
case this.CampaignID:
return "212529";
case this.AssocImpVIP:
return "www.assoc-amazon.ca";
case this.AmazonCom:
return "Amazon.ca";
case this.AmazonComLink:
return "http://www.amazon.ca/?";
case this.PrivacyPolicyLink:
return "http://rcm-ca.amazon.ca/e/cm/privacy-policy.html?o=15";
case this.GetEditWidgetLong:
return "Get/Edit this widget";
case this.GetEditWidgetShort:
return "Get/Edit widget";
case this.selectStore:
return "Select an Amazon store";
case this.closeString:
return "Close window";
case this.SortBy:
return "Sort by";
case this.NoItemsWishlist:
return "No items in the Wish List";
case this.DefaultTag:
return "amawid-20";
case this.WebsiteRefTag:
return "assoc_wdgt_ca";
case this.WSUrl:
return "http://ws.amazon.ca/widgets";
case this.WMSUrl:
return "http://wms.assoc-amazon.ca/CA";
case this.WebsiteUrl:
return "http://widgets.amazon.ca/";
default:
return "Unknown string";
}
},getStringForDE:function(key){
switch(key){
case this.ErrorMessage:
return "Es konnte keine Verbindung zum Server hergestellt werden. Bitte versuchen Sie es erneut.";
case this.Price:
return "Preis";
case this.Loading:
return "Laden";
case this.Searching:
return "Suchen";
case this.PrivacyPolicy:
return "Information";
case this.NoResultsFor:
return "Keine Suchergebnisse f\xfcr ";
case this.CustomerReviews:
return " Kundenrezensionen";
case this.Search:
return "Suche in";
case this.CampaignID:
return "2474";
case this.AssocImpVIP:
return "www.assoc-amazon.de";
case this.AmazonCom:
return "Amazon.de";
case this.AmazonComLink:
return "http://www.amazon.de/?";
case this.PrivacyPolicyLink:
return "http://rcm-de.amazon.de/e/cm/privacy-policy.html?o=3";
case this.GetEditWidgetLong:
return "Erhalten/\xc4ndern";
case this.GetEditWidgetShort:
return "Erhalten/\xc4ndern";
case this.selectStore:
return "Amazon Zielseite ausw\xe4hlen";
case this.closeString:
return "schlie\xdfen";
case this.SortBy:
return "Sortieren nach";
case this.NoItemsWishlist:
return "Kein Element in der Wunschliste";
case this.DefaultTag:
return "amawid0f-21";
case this.WebsiteRefTag:
return "assoc_wdgt_de";
case this.WSUrl:
return "http://ws.amazon.de/widgets";
case this.WMSUrl:
return "http://wms.assoc-amazon.de/DE";
case this.WebsiteUrl:
return "http://widgets.amazon.de/";
default:
return "Unknown string";
}
},getStringForFR:function(key){
switch(key){
case this.ErrorMessage:
return "Connexion au serveur impossible. Veuillez r\xe9essayer plus tard.";
case this.Price:
return "Prix";
case this.Loading:
return "Charger";
case this.Searching:
return "Rechercher";
case this.PrivacyPolicy:
return "Plus d'info";
case this.NoResultsFor:
return "Aucun r\xe9sultat ne correspond \xe0 votre recherche de ";
case this.CustomerReviews:
return " commentaires client";
case this.Search:
return "Rechercher";
case this.CampaignID:
return "2498";
case this.AssocImpVIP:
return "www.assoc-amazon.fr";
case this.AmazonCom:
return "Amazon.fr";
case this.AmazonComLink:
return "http://www.amazon.fr/?";
case this.PrivacyPolicyLink:
return "http://rcm-fr.amazon.fr/e/cm/privacy-policy.html?o=8";
case this.GetEditWidgetLong:
return "Copier/Editer";
case this.GetEditWidgetShort:
return "Copier/Editer";
case this.selectStore:
return "S\xe9lectionner un site Amazon";
case this.closeString:
return "Fermer";
case this.SortBy:
return "Trier par";
case this.NoItemsWishlist:
return "Nombre de produits dans la liste Envies Cadeaux";
case this.DefaultTag:
return "amawid0b-21";
case this.WebsiteRefTag:
return "assoc_wdgt_fr";
case this.WSUrl:
return "http://ws.amazon.fr/widgets";
case this.WMSUrl:
return "http://wms.assoc-amazon.fr/FR";
case this.WebsiteUrl:
return "http://widgets.amazon.fr/";
default:
return "Unknown string";
}
},getStringForGB:function(key){
switch(key){
case this.ErrorMessage:
return "Could not connect to server. Please try later.";
case this.Price:
return "Price";
case this.Loading:
return "Loading";
case this.Searching:
return "Searching";
case this.PrivacyPolicy:
return "Privacy";
case this.NoResultsFor:
return "No results for ";
case this.CustomerReviews:
return "Customer Reviews";
case this.Search:
return "Search";
case this.CampaignID:
return "2486";
case this.AssocImpVIP:
return "www.assoc-amazon.co.uk";
case this.AmazonCom:
return "Amazon.co.uk";
case this.AmazonComLink:
return "http://www.amazon.co.uk/?";
case this.PrivacyPolicyLink:
return "http://rcm-uk.amazon.co.uk/e/cm/privacy-policy.html?o=2";
case this.GetEditWidgetLong:
return "Get/Edit this widget";
case this.GetEditWidgetShort:
return "Get/Edit widget";
case this.selectStore:
return "Select an Amazon store";
case this.closeString:
return "Close window";
case this.SortBy:
return "Sort by";
case this.NoItemsWishlist:
return "No items in the Wish List";
case this.DefaultTag:
return "amawid-21";
case this.WebsiteRefTag:
return "assoc_wdgt_gb";
case this.WSUrl:
return "http://ws.amazon.co.uk/widgets";
case this.WMSUrl:
return "http://wms.assoc-amazon.co.uk/GB";
case this.WebsiteUrl:
return "http://widgets.amazon.co.uk/";
default:
return "Unknown string";
}
},getStringForJP:function(key){
switch(key){
case this.ErrorMessage:
return "\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3002\u3000\u6642\u9593\u3092\u7f6e\u3044\u3066\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002";
case this.Price:
return "\u4fa1\u683c";
case this.Loading:
return "\u8aad\u307f\u8fbc\u307f\u4e2d";
case this.Searching:
return "\u691c\u7d22\u4e2d";
case this.PrivacyPolicy:
return "\u30d7\u30e9\u30a4\u30d0\u30b7\u30fc\u898f\u7d04";
case this.NoResultsFor:
return " \u306b\u8a72\u5f53\u3059\u308b\u3082\u306e\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002";
case this.CustomerReviews:
return " \u30ab\u30b9\u30bf\u30de\u30fc\u30fb\u30ec\u30d3\u30e5\u30fc";
case this.Search:
return "\u30b5\u30fc\u30c1";
case this.CampaignID:
return "759";
case this.AssocImpVIP:
return "www.assoc-amazon.jp";
case this.AmazonCom:
return "Amazon.co.jp";
case this.AmazonComLink:
return "http://www.amazon.jp/?";
case this.PrivacyPolicyLink:
return "http://rcm-jp.amazon.co.jp/e/cm/privacy-policy.html?o=9";
case this.GetEditWidgetLong:
return "\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u53d6\u5f97/\u7de8\u96c6";
case this.GetEditWidgetShort:
return "\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u53d6\u5f97/\u7de8\u96c6";
case this.selectStore:
return "\u3069\u306e\u30b9\u30c8\u30a2\u306e\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092<br/>\u4f5c\u308a\u307e\u3059\u304b\uff1f";
case this.closeString:
return "\u9589\u3058\u308b";
case this.SortBy:
return "\u4e26\u3073\u66ff\u3048";
case this.NoItemsWishlist:
return "\u30a6\u30a3\u30c3\u30b7\u30e5\u30ea\u30b9\u30c8\u306b\u5546\u54c1\u304c\u3042\u308a\u307e\u305b\u3093";
case this.DefaultTag:
return "widgetsamazon-22";
case this.WebsiteRefTag:
return "assoc_wdgt_jp";
case this.WSUrl:
return "http://ws.amazon.co.jp/widgets";
case this.WMSUrl:
return "http://wms.assoc-amazon.jp/JP";
case this.WebsiteUrl:
return "http://widgets.amazon.co.jp/";
default:
return "Unknown string";
}
},getStringForUS:function(key){
switch(key){
case this.ErrorMessage:
return "Could not connect to server. Please try later.";
case this.Price:
return "Price";
case this.Loading:
return "Loading";
case this.Searching:
return "Searching";
case this.PrivacyPolicy:
return "Privacy";
case this.NoResultsFor:
return "No results for ";
case this.CustomerReviews:
return " Customer Reviews";
case this.Search:
return "Search";
case this.CampaignID:
return "212361";
case this.AssocImpVIP:
return "www.assoc-amazon.com";
case this.AmazonCom:
return "Amazon.com";
case this.AmazonComLink:
return "http://www.amazon.com/?";
case this.PrivacyPolicyLink:
return "http://rcm.amazon.com/e/cm/privacy-policy.html?o=1";
case this.GetEditWidgetLong:
return "Get/Edit this widget";
case this.GetEditWidgetShort:
return "Get/Edit widget";
case this.selectStore:
return "Select an Amazon store";
case this.closeString:
return "Close window";
case this.SortBy:
return "Sort by";
case this.NoItemsWishlist:
return "No items in the Wish List";
case this.DefaultTag:
return "widgetsamazon-20";
case this.WebsiteRefTag:
return "assoc_wdgt_us";
case this.WSUrl:
return "http://ws.amazon.com/widgets";
case this.WMSUrl:
return "http://wms.assoc-amazon.com/US";
case this.WebsiteUrl:
return "http://widgets.amazon.com/";
default:
return "Unknown string";
}
},getString:function(key,_a1){
switch(_a1){
case "CA":
return this.getStringForCA(key);
case "DE":
return this.getStringForDE(key);
case "FR":
return this.getStringForFR(key);
case "JP":
return this.getStringForJP(key);
case "GB":
return this.getStringForGB(key);
default:
return this.getStringForUS(key);
}
},trimMultiLineComments:function(_a2,_a3,_a4,_a5,_a6){
if(typeof _a2=="string"){
_a2=[_a2];
}
if(_a2.length<1){
return _a2;
}
if(!_a5){
_a5=1;
}
var _a7=_a2[0];
for(var i=1;i<_a2.length;i++){
_a7+="<br/>"+_a2[i];
}
_a7=_a7.replace(/&nbsp;/gi,"&nbsp;<wbr/>");
var _a9;
if(_a5==-1){
_a9=_amzn_utils.splitTextBlock(_a7,_a3,_a4,false,_a6);
}else{
_a9=_amzn_utils.trimTextBlock(_a7,_a3,_a4,_a5,false,_a6);
}
return _a9;
},trimCharsByWidth:function(_aa,_ab,_ac,_ad,_ae){
if(typeof _aa=="string"){
_aa=[_aa];
}
if(_aa.length<1){
return _aa;
}
if(!_ad){
_ad=1;
}
var _af=_aa[0];
for(var i=1;i<_aa.length;i++){
if(i%2==0){
_af+=" "+_aa[i];
}else{
_af+="<b> "+_aa[i]+" </b>";
}
}
_af=_af.replace(/&nbsp;/gi,"&nbsp;<wbr/>");
var _b1=_aa.length>1;
var _b2;
if(_ad==-1){
_b2=_amzn_utils.splitTextBlock(_af,_ab,_ac,_b1,_ae);
}else{
_b2=_amzn_utils.trimTextBlock(_af,_ab,_ac,_ad,_b1,_ae);
}
return _b2;
},getValidTextBoundary:function(txt,_b4){
if(_b4>=txt.length){
return txt.length;
}
var _b5=txt.substring(0,_b4);
var _b6=_b4;
var _b7=_b5.lastIndexOf("<");
if(_b7!=-1){
var _b8=_b5.lastIndexOf("<br/>");
var _b9=_b5.lastIndexOf("<wbr/>");
var _ba=_b5.lastIndexOf("<b>");
var _bb=_b5.lastIndexOf("</b>");
if(_b7>_b8&&_b7>_b9&&_b7>_ba&&_b7>_bb){
_b6=_b7;
_b5=txt.substring(0,_b6);
}
}
var _bc=_b5.lastIndexOf("&");
if(_bc!=-1){
var _bd=_b5.lastIndexOf(";");
if(_bc>_bd){
_b6=_bc;
}
}
return _b6;
},getClosingTags:function(txt,_bf){
if(!_bf){
return "";
}
var _c0=txt.lastIndexOf("<b>");
var _c1=txt.lastIndexOf("</b>");
var _c2="";
if(_c1<_c0){
_c2="</b>";
}
return _c2;
},limitedIndexOf:function(txt,_c4){
var _c5=15;
var _c6=0;
var _c7=false;
while(_c6<txt.length&&_c6<_c5){
if(txt.charAt(_c6)==_c4){
_c7=true;
break;
}
_c6++;
}
if(!_c7){
_c6=-1;
}
return _c6;
},htmlCharAt:function(txt,_c9){
var _ca="";
var _cb=txt.charAt(_c9);
switch(_cb){
case "<":
_ca=">";
break;
case "&":
_ca=";";
break;
}
if(_ca!=""){
var _cc=txt.substring(_c9);
var _cd=_amzn_utils.limitedIndexOf(_cc,_ca);
if(_cd!=-1){
_cb=_cc.substring(0,_cd+1);
}
}
return _cb;
},calculateBlockHeight:function(_ce,_cf,_d0,_d1,_d2){
var _d3=_amzn_utils.getDivId("amzn_wdgts_calculateBlockHeight",_d2);
var _d4=_amzn_utils.getProcessingDiv(_d3,_cf);
_d4.innerHTML="";
var _d5=_d4.offsetHeight;
var _d6=_ce;
if(_d1){
_d6=_amzn_utils.replaceAll(_d6,"<b>","");
_d6=_amzn_utils.replaceAll(_d6,"</b>","");
}
_d6=_amzn_utils.replaceAll(_d6,"<br/>","");
_d6=_amzn_utils.replaceAll(_d6,"<wbr/>","");
var _d7=0;
var _d8=20;
while(_d6.length>0){
var _d9=_d8<_d6.length?_d8:_d6.length;
_d9=_amzn_utils.getValidTextBoundary(_d6,_d9);
var _da=_d6.substring(0,_d9);
if(_d1){
_d4.innerHTML="<b>"+_da+"</b>";
}else{
_d4.innerHTML=_da;
}
if(_d4.offsetHeight>_d7){
_d7=_d4.offsetHeight;
}
_d6=_d6.substring(_d9);
}
var _db=0;
if(_d7>_d5){
_d7=_d7-_d5;
_db=_d7*_d0-_d5;
}else{
_db=_d7*_d0;
}
return _db;
},trimTextBlock:function(_dc,_dd,_de,_df,_e0,_e1){
if(!_dc||_dc==""){
return _dc;
}
var _e2=_amzn_utils.getDivId("amzn_wdgts_trimTextBlock",_e1);
var _e3=_amzn_utils.getProcessingDiv(_e2,_dd);
_e3.style.width=_de+"px";
_e3.innerHTML="X";
var _e4=_e3.scrollWidth;
var _e5=_amzn_utils.calculateBlockHeight(_dc,_dd,_df,false,_e1);
if(_e0){
var _e6=_amzn_utils.calculateBlockHeight(_dc,_dd,_df,true,_e1);
if(_e6>_e5){
_e5=_e6;
}
}
if(_e5<=0){
return "";
}
var _e7=_dc;
_e3.innerHTML=_e7;
var _e8=_e7.length;
while(_e3.offsetHeight>_e5){
var _e9=_e3.offsetHeight/_e5;
var _ea=Math.round((_e7.length)/_e9);
_ea=_amzn_utils.getValidTextBoundary(_e7,_ea);
if(_ea==_e8){
break;
}
_e8=_ea;
_e7=_e7.substring(0,_ea);
_e3.innerHTML=_e7+_amzn_utils.getClosingTags(_e7,_e0);
}
for(var i=_e7.length;i<_dc.length;i++){
var _ec=_amzn_utils.htmlCharAt(_dc,i);
i+=_ec.length-1;
_e3.innerHTML=_e7+_ec+_amzn_utils.getClosingTags(_e7+_ec,_e0)+"&hellip;";
if(_e3.scrollWidth>_e4){
_ec=" "+_ec;
_e3.innerHTML=_e7+_ec+_amzn_utils.getClosingTags(_e7+_ec,_e0)+"&hellip;";
}
if(_e3.offsetHeight>_e5){
_e7=_e7+_amzn_utils.getClosingTags(_e7,_e0)+"&hellip;";
break;
}
_e7+=_ec;
}
_e7=_e7+_amzn_utils.getClosingTags(_e7,_e0);
_e7=_amzn_utils.splitTextBlock(_e7,_dd,_de,_e0,_e1);
_e3.innerHTML=_e7;
if(_e3.offsetHeight>_e5){
_e3.innerHTML=_e7+"&hellip;";
var _ea=_e7.length;
while(_ea>0&&(_e3.offsetHeight>_e5||_e3.scrollWidth>_e4)){
_ea--;
_ea=_amzn_utils.getValidTextBoundary(_e7,_ea);
_e7=_e7.substring(0,_ea);
_e3.innerHTML=_e7+_amzn_utils.getClosingTags(_e7,_e0)+"&hellip;";
}
_e7=_e7+_amzn_utils.getClosingTags(_e7,_e0)+"&hellip;";
}
return _e7;
},setDivText:function(_ed,_ee,_ef){
var _f0=_amzn_utils.getClosingTags(_ee,_ef);
_ed.innerHTML=_ee+_f0;
return _f0!="";
},splitTextBlock:function(_f1,_f2,_f3,_f4,_f5){
if(!_f1||_f1==""){
return _f1;
}
var _f6=_amzn_utils.getDivId("amzn_wdgts_splitTextBlock",_f5);
var _f7=_amzn_utils.getProcessingDiv(_f6,_f2);
_f7.style.width=_f3+"px";
_f7.innerHTML="";
var _f8=_f7.offsetHeight;
_f7.innerHTML="X";
var _f9=_f7.offsetHeight;
var _fa=_f7.scrollWidth;
_f7.innerHTML=_f1;
if(_f7.scrollWidth<=_fa){
return _f1;
}
var _fb=Math.floor(_f3/20);
_f7.innerHTML="";
var _fc="";
var _fd=false;
var _fe=_amzn_utils.getLineEndIndex(_f1,0,_fb,_f2,_f3,_f4,_fd,_f5);
_fc=_f1.substring(0,_fe);
_fd=_amzn_utils.setDivText(_f7,_fc,_f4);
var _ff=_amzn_utils.getLineEndIndex(_f1,_fe,_fb,_f2,_f3,_f4,_fd,_f5);
while(_ff>0&&_ff>_fe){
var temp=_f1.substring(_fe,_ff);
_fd=_amzn_utils.setDivText(_f7,_fc+temp,_f4);
if(_f7.scrollWidth>_fa){
temp=" "+temp;
_amzn_utils.setDivText(_f7,_fc+temp,_f4);
}
_fb=_ff-_fe;
_fe=_ff;
_fc=_fc+temp;
_ff=_amzn_utils.getLineEndIndex(_f1,_fe,_fb,_f2,_f3,_f4,_fd,_f5);
}
return _fc+_amzn_utils.getClosingTags(_fc,_f4);
},getLineEndIndex:function(txt,_102,_103,_104,_105,_106,_107,self){
var _109=_amzn_utils.getDivId("amzn_wdgts_getLineText",self);
var _10a=_amzn_utils.getProcessingDiv(_109,_104);
var _10b=_102+_103+1;
var bold="";
if(_107){
bold="<b>";
}
if(txt.length<_10b){
_amzn_utils.setDivText(_10a,bold+txt.substring(_102),_106);
_10b=txt.length;
}else{
_amzn_utils.setDivText(_10a,bold+txt.substring(_102,_10b),_106);
}
var _10d=_10a.offsetHeight;
for(;_10b<txt.length&&_10a.offsetWidth<_105&&_10a.offsetHeight<=_10d;_10b++){
var temp=_amzn_utils.htmlCharAt(txt,_10b);
_10b+=temp.length-1;
_amzn_utils.setDivText(_10a,bold+_10a.innerHTML+temp,_106);
}
_10b=(_10b<txt.length)?_10b:txt.length;
_10b=_amzn_utils.getValidTextBoundary(txt.substring(_102),_10b-_102)+_102;
while(_10a.offsetWidth>_105&&_10b>0){
_10b--;
_10b=_amzn_utils.getValidTextBoundary(txt.substring(_102),_10b-_102)+_102;
_amzn_utils.setDivText(_10a,bold+txt.substring(_102,_10b),_106);
}
return _10b;
},getProcessingDiv:function(id,_110){
var pDiv=document.getElementById(id);
var _112=true;
if(!pDiv){
_112=false;
pDiv=document.createElement("div");
pDiv.id=id;
}
pDiv.style.padding="0 5px 0 5px";
pDiv.style.visibility="hidden";
pDiv.style.clear="both";
pDiv.style.position="absolute";
pDiv.style.left="0px";
pDiv.style.top="0px";
pDiv.style.overflow="auto";
pDiv.style.font="100% Verdana, Arial, Helvetica, sans-serif";
pDiv.style.lineHeight="normal";
pDiv.style.fontSize=parseInt(_110)+"px";
pDiv.style.height=null;
pDiv.style.width=null;
if(/bold/.test(_110)){
pDiv.style.fontWeight="bold";
}
if(!_112){
document.body.appendChild(pDiv);
}
return pDiv;
},getDivId:function(_113,self){
return _113+self.marketPlace+self.templateId+self.instanceId;
},addHiddenInputField:function(_115,_116,_117){
var _118=document.createElement("input");
_118.setAttributeNode(this.createHtmlAttribute("type","hidden"));
_118.setAttributeNode(this.createHtmlAttribute("name",_116));
_118.setAttributeNode(this.createHtmlAttribute("value",_117));
_115.appendChild(_118);
},createHtmlAttribute:function(name,_11a){
var _11b=document.createAttribute(name);
_11b.nodeValue=_11a;
return _11b;
},addHtmlForm:function(_11c){
var _11d=document.createElement("form");
_11d.method="POST";
_11d.action=_11c;
var body=document.getElementsByTagName("body")[0];
body.appendChild(_11d);
return _11d;
},createLocaleDropDown:function(self){
if(!window.nextCallBack){
window.nextCallBack=new Object();
}
if(!window.nextCallBack[self.marketPlace]){
window.nextCallBack[self.marketPlace]=new Object();
}
if(!window.nextCallBack[self.marketPlace][self.templateId]){
window.nextCallBack[self.marketPlace][self.templateId]=new Object();
}
if(!window.nextCallBack[self.marketPlace][self.templateId][self.instanceId]){
window.nextCallBack[self.marketPlace][self.templateId][self.instanceId]=new Object();
}
window.nextCallBack[self.marketPlace][self.templateId][self.instanceId].selectLocaleFromDropdown=_amzn_utils.selectLocaleFromDropdown;
var _120=escape("<div style='background-color:#FFFFFF;border: #666666 1px solid;width:200px;overflow:none;'>"+_amzn_utils.createAllLocaleDivs(self)+"</div>");
var _121=self.innerWidth<180?"style='text-align:center;":"style='text-align:left; left: 4px;";
var _122=self.innerWidth>180?_amzn_utils.getString(_amzn_utils.GetEditWidgetLong,self.marketPlace):_amzn_utils.getString(_amzn_utils.GetEditWidgetShort,self.marketPlace);
return "<div onclick='_a=this; _amzn_popup.showpreview(\""+_120+"\", _a, event,50);' "+_121+self.style_get_edit_wdgt()+";float: left;font-size: 10px;font-weight: bold;cursor:pointer;white-space:nowrap;position:relative;bottom: 4px;'>"+_122+"</div>";
},getGetWidgetOnclickStr:function(self){
this.setGetEditCallbacks(self);
var _124=escape("<div style='background-color:#FFFFFF;border: #666666 1px solid;width:200px;overflow:none;'>"+_amzn_utils.createAllLocaleDivs(self)+"</div>");
return "onclick='_a=this; _amzn_popup.showpreview(\""+_124+"\", _a, event,50);'";
},getEditWidgetOnclickStr:function(self){
this.setGetEditCallbacks(self);
return "onclick='window.nextCallBack[\""+self.marketPlace+"\"]["+self.templateId+"]["+self.instanceId+"].editThisWidgetClicked(\""+self.marketPlace+"\","+self.templateId+","+self.instanceId+",\""+self.marketPlace+"\");' ";
},setGetEditCallbacks:function(self){
if(!window.nextCallBack){
window.nextCallBack=new Object();
}
if(!window.nextCallBack[self.marketPlace]){
window.nextCallBack[self.marketPlace]=new Object();
}
if(!window.nextCallBack[self.marketPlace][self.templateId]){
window.nextCallBack[self.marketPlace][self.templateId]=new Object();
}
if(!window.nextCallBack[self.marketPlace][self.templateId][self.instanceId]){
window.nextCallBack[self.marketPlace][self.templateId][self.instanceId]=new Object();
}
window.nextCallBack[self.marketPlace][self.templateId][self.instanceId].selectLocaleFromDropdown=_amzn_utils.selectLocaleFromDropdown;
window.nextCallBack[self.marketPlace][self.templateId][self.instanceId].editThisWidgetClicked=_amzn_utils.editThisWidgetClicked;
},createLocaleDiv:function(_127,self){
var _129=_amzn_utils.getString(_amzn_utils.AmazonCom,_127);
var url=_amzn_utils.getString(_amzn_utils.WebsiteUrl,_127);
url=url+"/"+self.getEditWidgetTarget+"?"+this.WebsiteRefParam+"="+this.getString(this.WebsiteRefTag,self.marketPlace)+"&refURL="+self.origParams.refURL;
if(typeof amzn_widget_central_preview=="undefined"&&self.origParams.ID){
url+="&id="+self.origParams.ID;
}
return "<div style='width:200px;height:34px;'><a target=\"_blank\" href=\""+url+"\"><div style='clear:left; padding: 2px 2px 2px 4px; cursor:pointer;text-decoration: none; font: 100% Verdana, Arial, Helvetica, sans-serif;font-size: 10px;text-align: left;' "+"onmouseover='this.style.backgroundColor=\"#E3E3E3\";' onmouseout='this.style.backgroundColor=\"#FFFFFF\";'>"+"<img style='border:none;padding: 4px;' src='"+_amzn_utils.imageDirectory(self.marketPlace)+"/"+_127+"-flag.gif'/>"+"<span style='white-space:nowrap;position:relative; bottom: 12px;font: 100% Verdana, Arial, Helvetica, sans-serif;font-size: 10px; text-align: left; color:#003399;text-decoration:underline;'>"+_129+"</span>"+"</div></a></div>";
},createAllLocaleDivs:function(self){
var _12c=_amzn_utils.getString(_amzn_utils.selectStore,self.marketPlace);
var _12d=_amzn_utils.getString(_amzn_utils.closeString,self.marketPlace);
var _12e=self.marketPlace=="JP"?25:14;
var res="<div style='font: 100% Verdana, Arial, Helvetica, sans-serif; height: "+_12e+"px;font-weight: bold; font-size: 11px; text-align: left; color: #CC6600;padding:4px;'>"+_12c+"</div>";
res+=_amzn_utils.createLocaleDiv("US",self);
res+=_amzn_utils.createLocaleDiv("DE",self);
res+=_amzn_utils.createLocaleDiv("JP",self);
res+=_amzn_utils.createLocaleDiv("FR",self);
res+=_amzn_utils.createLocaleDiv("GB",self);
res+=_amzn_utils.createLocaleDiv("CA",self);
res+=this.getEditWidgetMessageHTML(self);
res+="<div style='white-space:nowrap;cursor:pointer;font: 100% Verdana, Arial, Helvetica, sans-serif;font-size: 11px; text-align: left; color: #0000FF;text-decoration:underline;margin:10px 0;padding: 0 4px 0 4px; height: 12px;' onclick='_amzn_popup.hideNow()'>"+_12d+"</div>";
return res;
},selectLocaleFromDropdown:function(_130,_131,_132,_133){
var self=all_amzn_wdgts[_133][_131][_132];
var _135=_amzn_utils.addHtmlForm(_amzn_utils.getString(_amzn_utils.WebsiteUrl,_130)+"/"+self.getEditWidgetTarget);
if(_131!="8006"){
_amzn_utils.addHiddenInputField(_135,"amzn_wdgt",_amzn_utils.encodetoJSON(self.origParams));
}
_135.submit();
},editThisWidgetClicked:function(_136,_137,_138,_139){
var self=all_amzn_wdgts[_139][_137][_138];
var _13b=_amzn_utils.addHtmlForm(_amzn_utils.getString(_amzn_utils.WebsiteUrl,_136)+"/"+self.getEditWidgetTarget);
_amzn_utils.addHiddenInputField(_13b,"amzn_wdgt",_amzn_utils.encodetoJSON(self.origParams));
_13b.submit();
},getValidParam:function(_13c,_13d){
if(typeof _13c=="undefined"||_13c==null){
return _13d;
}
return _13c;
},encodetoJSON:function(obj){
var pad=function(n){
return n<10?"0"+n:n;
};
var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"};
var _142=function(s){
if(/["\\\x00-\x1f]/.test(s)){
return "\""+s.replace(/([\x00-\x1f\\"])/g,function(a,b){
var c=m[b];
if(c){
return c;
}
c=b.charCodeAt();
return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
})+"\"";
}
return "\""+s+"\"";
};
var _147=function(o){
var a=["["],b,i,l=o.length,v;
for(i=0;i<l;i+=1){
v=o[i];
switch(typeof v){
case "undefined":
case "function":
case "unknown":
break;
default:
if(b){
a.push(",");
}
a.push(v===null?"null":_amzn_utils.encodetoJSON(v));
b=true;
}
}
a.push("]");
return a.join("");
};
var _14e=function(o){
return "\""+o.getFullYear()+"-"+pad(o.getMonth()+1)+"-"+pad(o.getDate())+"T"+pad(o.getHours())+":"+pad(o.getMinutes())+":"+pad(o.getSeconds())+"\"";
};
if(typeof obj=="undefined"||obj===null){
return "null";
}else{
if(obj instanceof Array){
return _147(obj);
}else{
if(obj instanceof Date){
return _14e(obj);
}else{
if(typeof obj=="string"){
return _142(obj);
}else{
if(typeof obj=="number"){
return isFinite(obj)?String(obj):"null";
}else{
if(typeof obj=="boolean"){
return String(obj);
}else{
var a=["{"],b,v;
for(var i in obj){
if(_amzn_utils.objHasOwnProperty(obj,i)){
v=obj[i];
switch(typeof v){
case "undefined":
case "function":
case "unknown":
break;
default:
if(b){
a.push(",");
}
a.push(_amzn_utils.encodetoJSON(i),":",v===null?"null":_amzn_utils.encodetoJSON(v));
b=true;
}
}
}
a.push("}");
return a.join("");
}
}
}
}
}
}
}};
function initOnloadFunctions(){
if(typeof (window.addEventListener)!="undefined"){
window.addEventListener("load",main,false);
}else{
var _154=window.onload;
var _155=main;
window.onload=function(){
if(typeof _154=="function"){
_154();
}
_155();
};
}
}
if(typeof amzn_wdgts_vars=="undefined"){
amzn_wdgts_vars=new Array();
}
if(typeof amzn_wdgt=="undefined"){
amzn_wdgt={};
}
if(typeof amzn_wdgt.templateId=="undefined"){
amzn_wdgt.templateId=null;
}
if(typeof amzn_wdgt.marketPlace=="undefined"){
amzn_wdgt.marketPlace="US";
}
if(typeof amzn_wdgts_vars[amzn_wdgt.marketPlace]=="undefined"){
amzn_wdgts_vars[amzn_wdgt.marketPlace]=new Array();
}
if(typeof amzn_wdgts_vars[amzn_wdgt.marketPlace][amzn_wdgt.templateId]=="undefined"){
amzn_wdgts_vars[amzn_wdgt.marketPlace][amzn_wdgt.templateId]=new Array();
}
if(typeof amzn_wdgt.displayTemplate=="undefined"){
amzn_wdgt.displayTemplate="1";
}
var instanceId=amzn_wdgts_vars[amzn_wdgt.marketPlace][amzn_wdgt.templateId].length;
var divId="amazon_widget_"+amzn_wdgt.marketPlace+"_"+amzn_wdgt.templateId+"_"+instanceId;
if(typeof amzn_wdgt.width=="undefined"){
amzn_wdgt.width=0;
}
if(typeof amzn_wdgt.tag=="undefined"){
amzn_wdgt.tag=_amzn_utils.getString(_amzn_utils.DefaultTag,amzn_wdgt.marketPlace);
}
amzn_wdgt.refURL=escape(document.location).replace(/[+]/g,"%2B");
document.write("<div class='"+divId+"' id='"+divId+"'></div>");
amzn_wdgt.instanceId=instanceId;
amzn_wdgt.isTaken=false;
amzn_wdgts_vars[amzn_wdgt.marketPlace][amzn_wdgt.templateId].push(_amzn_utils.clone(amzn_wdgt));
if(typeof _amzn_popup=="undefined"){
document.writeln("<script src=\""+_amzn_utils.amznMediaserverURL(amzn_wdgt.marketPlace)+"/js/popup.js\" > </script>");
}
if(!(typeof Nifty=="function"&&typeof NiftyCheck=="function")){
document.writeln("<script src=\""+_amzn_utils.amznMediaserverURL(amzn_wdgt.marketPlace)+"/js/nifty.js\" > </script>");
}
if(!(typeof Color=="function"&&typeof RGB=="function")){
document.writeln("<script src=\""+_amzn_utils.amznMediaserverURL(amzn_wdgt.marketPlace)+"/js/colors.js\" > </script>");
}
function main(){
var wdgt={validateRowsAndColumns:function(){
if(this.cols*120>this.width){
this.cols=Math.floor(this.width/120);
}
},amazon_generate_widgets_url:function(_157){
var _158=this.totalItemsPerPage>10?this.totalItemsPerPage:10;
var _159=_157*_158;
var _15a=(_157+1)*_158;
var _15b="";
for(var i=_159;i<_15a&&i<this.items.length;i++){
if(i!=_159){
_15b+=",";
}
_15b+=this.items[i].asin;
}
return _amzn_utils.widgetServerURL(this.marketPlace)+"/q?"+"Operation=GetResults"+"&InstanceId="+escape(this.instanceId)+"&TemplateId="+escape(this.templateId)+"&ItemId="+_15b+"&ServiceVersion="+this.serviceVersion+"&MarketPlace="+this.marketPlace;
},getBlankLayout:function(){
var res="";
for(var i=0;i<this.rows;i++){
for(var j=0;j<this.cols;j++){
res+=this.getBlankTile();
}
}
return res;
},fetchInProgress:false,fetchInProgressID:null,getFromServer:function(_160){
if(this.fetchInProgress||!this.items||this.items.length==0){
return;
}
this.fetchInProgress=true;
var _161=_amzn_utils.$("amazon_widget_"+this.marketPlace+"_"+this.templateId+"_"+this.instanceId);
var self=this;
self.fetchInProgressID=setTimeout(function(){
var _163=_amzn_utils.getById("wdgt_brdr",_161);
if(self.fetchInProgress&&_163){
var _164=_amzn_utils.getString(_amzn_utils.ErrorMessage,this.marketPlace);
_163.innerHTML="<div style='width:"+(self.innerWidth-30)+"px;padding:9px 2px 9px 2px;font-family: Verdana, sans-serif; font-weight:bold; font-size: 10px;'>"+_164+"</div>"+self.getBlankLayout();
self.fetchInProgress=false;
}
},30000);
var res=document.createElement("script");
res.charset="utf-8";
res.src=self.amazon_generate_widgets_url(_160);
document.body.appendChild(res);
self.addWait("wait");
},addWait:function(_166){
var _167=_amzn_utils.$("amazon_widget_"+this.marketPlace+"_"+this.templateId+"_"+this.instanceId);
var _168=_amzn_utils.getById("wdgt_brdr",_167);
if(_168){
_168.innerHTML=this.getSearchingLayout();
}
},getSearchingLayout:function(){
var _169=_amzn_utils.$("amazon_widget_"+this.marketPlace+"_"+this.templateId+"_"+this.instanceId);
var _16a=_amzn_utils.getById("wdgt_brdr",_169);
if(_16a&&this.currentPage!=1){
var ht=_16a.clientHeight;
var _16c=(Math.floor((ht-58)/2))+"px";
return "<div align='center' style='width:"+this.innerWidth+"px;height:"+ht+"px;'>"+"<div class='message' id='searching' style='background-image: url(\""+_amzn_utils.imageDirectory(this.marketPlace)+"/round.gif\");position: relative;top:"+_16c+";color:black;text-align:center;height: 59px;width: 100px;font:10px Verdana;'>"+"<div class='messagetext' align='center' style='position: relative;top:17px;'><img style='position:relative;top:4px;border:none;margin:0;' src='"+_amzn_utils.imageDirectory(this.marketPlace)+"/loading-spinner.gif'/>&nbsp;&nbsp;"+_amzn_utils.getString(_amzn_utils.Loading,this.marketPlace)+"..."+"</div>"+"</div>"+"</div>";
}
return "";
},getItem:function(_16d,_16e){
if(typeof _16e=="undefined"){
_16e=false;
}
var item=null;
var _170=this.totalItemsPerPage>10?this.totalItemsPerPage:10;
if(_16d+1>this.totalNumOfResults()){
return null;
}
var _171=Math.floor(_16d/_170);
var _172=this.resultData[_171];
if(_172==null){
item=false;
if(!_16e){
this.getFromServer(_171);
}
}else{
item=_172[_16d%_170];
if(typeof item=="undefined"||item==null||(!item["ASIN"]&&item!="INVALID")){
item=false;
if(!_16e){
this.getFromServer(_171);
}
}
}
return item;
},getItemsForPage:function(){
var _173=new Array();
var _174=(this.currentPage-1)*this.totalItemsPerPage;
var _175=(this.currentPage)*this.totalItemsPerPage;
for(var i=_174;i<_175&&i<this.totalNumOfResults();i++){
var item=this.getItem(i);
if(item!=null){
_173.push(item);
}else{
if(item==null){
return _173;
}else{
if(!item){
return null;
}
}
}
}
return _173;
},showpage:function(page,_179,_17a,_17b){
var self;
if(typeof _179=="undefined"){
self=this;
}else{
self=all_amzn_wdgts[_17b][_17a][_179];
}
if(typeof page=="undefined"){
page=self.currentPage;
}
self.currentPage=page;
var _17d=self.mergeTemplate();
if(_17d==null){
return;
}
var _17e=_amzn_utils.$("amazon_widget_"+self.marketPlace+"_"+self.templateId+"_"+self.instanceId);
_17e.innerHTML=_17d;
if(typeof self.doCurveCorners=="string"){
self.doCurveCorners=self.doCurveCorners=="true";
}
if(self.doCurveCorners){
self.curveCorners();
}
_amzn_utils.runPNGTransparencyHack(_17e,self.marketPlace);
_amzn_utils.runPNGTransparencyHackForBkgdImage(_amzn_utils.getById("wdgt_brdr",_17e));
var _17f=_amzn_utils.$("amzn_popup_div");
_17f.onmouseover=function(){
if(_amzn_popup){
return _amzn_popup._continue();
}
};
_17f.onmouseout=function(){
if(_amzn_popup){
return _amzn_popup._stop();
}
};
},curveCorners:function(){
if(!this.curveTheseCorners){
this.curveTheseCorners="all";
}
Nifty("div#amzn_wdgt_t_8001_"+this.instanceId,"transparent"+this.curveTheseCorners);
},pageNumberDiv:function(_180,_181,_182){
return _amzn_utils.pageNumberDiv(_180,_181,this,_182);
},getEndPage:function(){
var res=this.navBarBeginPage+this.resultWindowSize-1;
if(res>this.numberOfPages()){
res=this.numberOfPages();
}
return res;
},getResultForAsin:function(asin,_185){
for(var i in _185){
if(_amzn_utils.objHasOwnProperty(_185,i)){
var _187=_185[i];
if(_187["ASIN"]==asin){
return _187;
}
}
}
for(var i=0;i<this.resultData.length;i++){
var _188=this.resultData[i];
if(_188){
for(var j=0;j<_188.length;j++){
var _187=_188[j];
if(_187&&_187["ASIN"]==asin){
return _187;
}
}
}
}
return null;
},display_callback:function(_18a){
this.fetchInProgress=false;
clearTimeout(this.fetchInProgressID);
var _18b=_amzn_utils.$("amazon_widget_"+this.marketPlace+"_"+this.templateId+"_"+this.instanceId);
var _18c=_amzn_utils.getById("wdgt_brdr",_18b);
if(typeof _18a=="undefined"&&_18c){
_18c.innerHTML="<div style='width:"+(this.innerWidth-30)+"px;padding:0 9px 9px 9px;font-family: Verdana, sans-serif; text-align:left; font-size: 10px;"+this.style_tile_h1()+";'>"+_amzn_utils.getString(_amzn_utils.ErrorMessage,this.marketPlace)+"</div>"+this.getBlankLayout();
return;
}
this.title=this.getSplitTitle();
var _18d=this.totalItemsPerPage>10?this.totalItemsPerPage:10;
var _18e=new Array();
for(var i=0;i<this.items.length;i++){
var _190=this.getResultForAsin(this.items[i].asin,_18a);
var _191=Math.floor(i/_18d);
var _192=Math.floor(((this.currentPage*this.totalItemsPerPage)-1)/_18d);
var _193=(i>=_192*_18d&&i<(_192+1)*_18d);
if(_190==null&&_193){
if(typeof _18e[_192]=="undefined"||_18e[_192]==null){
_18e[_192]=new Array();
}
_18e[_192].push("INVALID");
}else{
if(typeof _18e[_191]=="undefined"||_18e[_191]==null){
_18e[_191]=new Array();
}
if(_190==null&&this.getItem(i,true)=="INVALID"){
_190="INVALID";
}
_18e[_191].push(_190);
}
}
this.resultData=_18e;
this.showpage();
if(typeof loadComplete=="function"){
loadComplete();
}
},getReviewImage:function(_194){
return _amzn_utils.getRatingImage(_194,this.marketPlace);
},getURL:function(url){
if(url.indexOf("?")==-1){
url+="?";
}
return url+"&camp="+_amzn_utils.getString(_amzn_utils.CampaignID,this.marketPlace)+"&creative="+this.creativeId()+"&linkCode="+this.linkCode+"&tag="+this.tag;
},trimMultiLineComments:function(text,_197,_198,_199){
return _amzn_utils.trimMultiLineComments(text,_197,_198,_199,this);
},trimCharsByWidth:function(text,_19b,_19c,_19d){
return _amzn_utils.trimCharsByWidth(text,_19b,_19c,_19d,this);
},getCommentForAsin:function(asin){
for(var i=0;i<this.items.length;i++){
var item=this.items[i];
if(item.asin==asin){
if(item.comment){
return item.comment;
}else{
return "";
}
}
}
return "";
},callWebService:function(){
_amzn_utils.insertStyleSheet("stylesheet.widgets.amazon.com","/css/widgets.css",this.marketPlace);
this.getFromServer(0);
},resultWindowSize:5,totalNumOfResults:function(){
return this.items.length;
},serviceVersion:"",show_image:true,show_price:true,show_review:true,width:120,innerWidth:120,rows:2,cols:1,title:"Amazon Widget",items:new Array(),curveTheseCorners:" tl tr bl br big ",doCurveCorners:true,sortOrder:"InAddedOrder",resultData:[],totalItemsPerPage:0,numberOfPages:function(){
return Math.ceil(this.totalNumOfResults()/this.totalItemsPerPage);
},currentPage:1,navBarBeginPage:1,navBarEndPage:0,instanceId:0,templateId:"8001",height:120,tag:"",linkCode:"wey",mergeTemplate:function(){
var _1a1=_amzn_utils.amzn_isMSIE()?this.innerWidth:this.innerWidth-2;
_amzn_popup.init();
var _1a2=this.title;
if(!_1a2){
_1a2="&nbsp;";
}
var _1a3="<div id='amzn_wdgt_t_8001_"+this.instanceId+"' class='amzn_wdgt' style='"+this.style_amzn_wdgt()+"'>"+"<div class='amzn_wdgt_pad' style='"+this.style_wdgt_pad()+"'>"+"<div class='wdgt_hd' style='"+this.style_wdgt_hd()+"'>"+_1a2+"</div>"+"<div id='wdgt_brdr' class='wdgt_brdr' style='"+this.style_wdgt_brdr(_1a1)+"'>";
var _1a4="</div>";
var _1a5=_1a3;
var res=this.getItemsForPage();
if(res==null||this.fetchInProgress){
return null;
}
var _1a7=0;
for(var i in res){
if(_amzn_utils.objHasOwnProperty(res,i)){
_1a5+=this.getTile(res[i]);
_1a7++;
}
}
for(var i=0;i<(this.cols*this.rows)-_1a7;i++){
_1a5+=this.getBlankTile();
}
_1a5+=_1a4;
_1a5+=this.drawNavBar();
_1a5+=this.drawFooter();
_1a5+="</div></div>";
return _1a5;
},getEditWidgetTarget:"Amazon-My-Favorites-Widget/",drawFooter:function(){
return _amzn_utils.drawFooter(this);
},drawNavBar:function(){
if(this.numberOfPages()==1){
return "<div class='wdgt_pgn' style='"+this.style_wdgt_pgn()+"' id='wdgt_pgn'><div class='pgn_cnt'></div></div>";
}
this.navBarEndPage=this.getEndPage();
if(this.currentPage==this.navBarEndPage&&this.currentPage<this.numberOfPages()){
this.navBarBeginPage+=Math.floor(this.resultWindowSize/2);
this.navBarEndPage=this.getEndPage();
}else{
if(this.currentPage==this.navBarBeginPage&&this.currentPage!=1){
this.navBarBeginPage-=Math.floor(this.resultWindowSize/2);
this.navBarEndPage=this.getEndPage();
}
}
var prev=(this.currentPage==1)?this.currentPage:this.currentPage-1;
var next=(this.currentPage==this.numberOfPages())?this.currentPage:this.currentPage+1;
var res="<div class='wdgt_pgn' style='"+this.style_wdgt_pgn()+"' id='wdgt_pgn'><div class='pgn_cnt'>";
if(prev!=this.currentPage){
res+=this.pageNumberDiv(prev,prev==this.currentPage,"&lt;");
}
for(var i=this.navBarBeginPage;i<=this.navBarEndPage;i++){
res+=this.pageNumberDiv(i,i==this.currentPage);
}
if(next!=this.currentPage){
res+=this.pageNumberDiv(next,next==this.currentPage,"&gt;");
}
res+="</div></div>";
return res;
},createPopupTile:function(_1ad){
var _1ae=this.getCommentForAsin([_1ad["ASIN"]]);
_1ae=this.trimMultiLineComments(_1ae,"10",300-2,-1);
return _amzn_utils.createPopupTile(_1ad,this,_1ae);
},getBlankTile:function(){
var diff=_amzn_utils.amzn_isMSIE()?0:6*this.cols;
var _1b0=Math.floor((this.innerWidth-6*this.cols)/this.cols);
return "<div class='wdgt_tl_pad'><div class='wdgt_tl' style='height:"+this.height+"px;width:"+_1b0+"px'></div></div>";
},hasNoComments:function(){
var res=true;
for(var i=0;i<this.items.length;i++){
var _1b3=this.items[i].comment;
for(var j=0;j<_1b3.length;j++){
var _1b5=_1b3[j];
res=res&&(typeof _1b3=="undefined"||_1b3==null||_1b3==""||_1b3.length==0);
}
}
return res;
},getTile:function(_1b6){
return _amzn_utils.getTile(_1b6,this,this.getCommentForAsin(_1b6["ASIN"]));
},getSplitTitle:function(){
return this.trimCharsByWidth(this.origTitle,"12bold",this.innerWidth-16,-1);
},add_pad_helper:function(_1b7){
if(_1b7){
return _1b7+"px ";
}else{
return "0 ";
}
},style_wdgt_pad:function(){
var res="padding: ";
res+=this.add_pad_helper(this.wdgt_pad_top);
res+=this.add_pad_helper(this.wdgt_pad_right);
res+=this.add_pad_helper(this.wdgt_pad_bottom);
res+=this.add_pad_helper(this.wdgt_pad_left);
res+=";";
return res;
},repaint:function(_1b9){
if(typeof _1b9.tag=="undefined"){
_1b9.tag=_amzn_utils.getString(_amzn_utils.DefaultTag,this.marketPlace);
}
var _1ba=this.sortOrder;
this.internalRepaint(_1b9);
this.sortAsinList();
this.title=this.getSplitTitle();
this.fetchInProgress=false;
if(this.fetchInProgressID){
clearTimeout(this.fetchInProgressID);
}
if(this.sortOrder!=_1ba){
this.callWebService();
}else{
this.showpage();
}
},setTileHeight:function(){
this.height=this.show_image?60:35;
var _1bb=Math.floor((this.innerWidth-6*this.cols)/this.cols);
if(_1bb<150&&this.show_image){
this.height+=16;
}
if(!this.show_image&&this.show_price){
this.height+=16;
}
if(!this.show_image&&this.show_review){
this.height+=25;
}
if(_amzn_utils.isFirefox_1_5&&!this.show_image){
this.height+=16;
}
if(_amzn_utils.isFirefox_1_5&&this.show_image&&!this.hasNoComments()){
this.height+=16;
}
if(this.hasNoComments()){
this.height+=10;
}
if(!this.hasNoComments()){
this.height+=24;
}
},internalMain:function(_1bc){
this.fetchInProgress=false;
if(this.fetchInProgressID){
clearTimeout(this.fetchInProgressID);
}
this.internalRepaint(_1bc);
this.sortAsinList();
this.callWebService();
},sortAsinList:function(){
var _1bd=this.items;
if(this.sortOrder=="Random"){
this.items.sort(function(){
return 0.5-Math.random();
});
}
},getWidth:function(){
return this.innerWidth;
},origTitle:"",wdgt_pad_top:8,wdgt_pad_left:9,wdgt_pad_bottom:0,wdgt_pad_right:9,marketPlace:"US",internalRepaint:function(_1be){
this.origParams=_amzn_utils.clone(_1be);
_1be=_amzn_utils.escapeHTML(_1be);
this.sortOrder=_1be.sort_order;
this.showAmazonLogoAsText=_amzn_utils.getValidParam(_1be.showAmazonLogoAsText,false);
this.show_image=_1be.show_image;
this.show_price=_1be.show_price;
this.show_review=_1be.show_review;
this.width=_1be.width;
this.rows=_1be.rows;
this.cols=_1be.cols;
this.validateRowsAndColumns();
this.origTitle=_amzn_utils.replaceAll(_1be.title," ","&nbsp;");
this.items=_1be.items;
for(var i=0;i<this.items.length;i++){
var item=this.items[i];
var _1c1=item.comment;
if(typeof _1c1=="undefined"||_1c1==null){
_1c1=item.comment=[""];
}else{
if(typeof _1c1=="object"&&typeof _1c1!="string"){
for(var j=0;j<_1c1.length;j++){
var _1c3=""+_1c1[j];
item.comment[j]=_amzn_utils.replaceAll(_1c3," ","&nbsp;");
}
}else{
if(typeof _1c1=="string"){
item.comment=[item.comment];
}
}
}
}
this.tag=_1be.tag;
this.serviceVersion=_1be.serviceVersion;
this.MarketPlace=_1be.MarketPlace;
this.curveTheseCorners=" none ";
this.wdgt_pad_top=5;
this.wdgt_pad_right=0;
this.wdgt_pad_bottom=0;
this.wdgt_pad_left=0;
this.innerWidth=this.width-this.cols-this.wdgt_pad_right-this.wdgt_pad_left;
if(typeof _1be.theme_version=="undefined"){
this.theme_version="0";
}else{
this.theme_version=_1be.theme_version;
}
this.setTileHeight();
this.theme_version=""+this.theme_version;
switch(this.theme_version){
case "1":
this.head_text_color="#666666";
this.text_color="#66A0B2";
this.price_color="#999999";
this.wdgt_border_color="#ABCCCB";
this.backGroundColor="#F2F1E5";
this.wdgt_hd_bkdg_color="#DEE6E6";
this.wdgt_hd_top_border_color="#C5CDCD";
this.wdgt_hd_bottom_border_color="#FFFFFF";
this.bkgd_img="bg21.png";
break;
case "2":
this.head_text_color="#595959";
this.text_color="#51621d";
this.price_color="#333333";
this.wdgt_border_color="#c0efa0";
this.backGroundColor="#F2F1E5";
this.wdgt_hd_bkdg_color="#e6e5d9";
this.wdgt_hd_top_border_color="#cdccc1";
this.wdgt_hd_bottom_border_color="#cdccc1";
this.bkgd_img="bgSpearmint.png";
break;
default:
this.head_text_color="#666666";
this.text_color="#CC6600";
this.price_color="#999999";
this.wdgt_border_color="#CCCC99";
this.backGroundColor="#F2F1E5";
this.wdgt_hd_bkdg_color="#E6E5D9";
this.wdgt_hd_top_border_color="#CDCCC1";
this.wdgt_hd_bottom_border_color="#FFFFFF";
this.bkgd_img="bg2.png";
break;
}
if(_1be.head_text_color){
this.head_text_color=_1be.head_text_color;
}
if(_1be.text_color){
this.text_color=_1be.text_color;
}
if(_1be.price_color){
this.price_color=_1be.price_color;
}
this.totalItemsPerPage=this.rows*this.cols;
this.navBarEndPage=this.getEndPage();
if(typeof _amzn_popup=="undefined"){
res.charset="utf-8";
var res=document.createElement("script");
res.src=_amzn_utils.amznMediaserverURL(this.marketPlace)+"/js/popup.js";
document.body.appendChild(res);
}
},creativeId:function(){
switch(this.marketPlace){
case "US":
return "380725";
case "CA":
return "381121";
case "GB":
return "8874";
case "DE":
return "8994";
case "FR":
return "9114";
case "JP":
return "3815";
}
},text_color:"#666666",head_text_color:"#666666",price_color:"#000000",wdgt_border_color:"#CCCC99",backGroundColor:"#F2F1E5",wdgt_hd_bkdg_color:"#E6E5D9",wdgt_hd_top_border_color:"#CDCCC1",wdgt_hd_bottom_border_color:"#FFFFFF",bkgd_img:"bg2.png",style_pgn_strong:function(){
return "color:#000000;";
},style_pgn_a:function(){
return "text-decoration:none;color: "+this.text_color+";";
},style_amzn_wdgt:function(){
return "border:1px solid "+this.wdgt_border_color+";color:"+this.price_color+";background: "+this.backGroundColor+" url("+_amzn_utils.imageDirectory(this.marketPlace)+"/"+this.bkgd_img+") repeat right top;"+";width:"+this.width+"px;";
},style_wdgt_hd:function(){
return "text-align: left;font: bold 12px / 1em Verdana, Arial, Helvetica, sans-serif;color: "+this.head_text_color+";border-top: 1px solid "+this.wdgt_hd_top_border_color+";border-bottom: 1px solid "+this.wdgt_hd_top_border_color+";background: "+this.wdgt_hd_bkdg_color+";";
},style_wdgt_brdr:function(_1c5){
return "";
},style_wdgt_ft:function(){
return "color:"+this.text_color+" !important;";
},style_wdgt_ft_a:function(){
return "color:"+this.text_color+" !important;border-bottom: 1px dotted "+this.text_color+";";
},style_wdgt_pgn:function(){
return "background:"+this.wdgt_hd_bkdg_color+";color: "+this.price_color+";border-top: 1px solid "+this.wdgt_hd_top_border_color+";border-bottom: 1px solid "+this.wdgt_hd_top_border_color+";";
},style_wdgt_pop_tl:function(_1c6){
return "border: 1px solid #000000"+";color:"+this.head_text_color+";background: "+this.backGroundColor+" url("+_amzn_utils.imageDirectory(this.marketPlace)+"/"+this.bkgd_img+") repeat right top;"+"width:"+_1c6+"px;";
},style_tile_a:function(){
return "border-bottom: none; text-decoration:none;color: "+this.text_color+" !important;";
},style_tile_h1_a:function(){
return "";
},style_tile_h1:function(){
return "color: "+this.text_color+" !important;";
},style_get_edit_wdgt:function(){
return "color: "+this.text_color+";border-bottom: 1px dotted "+this.text_color+";";
},style_tile_h2:function(){
return "color: "+this.text_color+" !important;";
},style_tile_category:function(){
return "color: "+this.price_color+" !important;";
},style_tile_price:function(){
return "color: "+this.price_color+" !important;";
},style_tile_asin_img:function(){
return "color: "+this.price_color+" !important;";
},style_tile_asin_a:function(){
return "border-bottom: none; text-decoration:none;";
},style_tile_review:function(){
return "color: "+this.price_color+" !important;";
},display_template_id:4,style_tile_comment:function(){
return "color: "+this.price_color+" !important;";
},getBackgroundColor:function(){
return this.backGroundColor;
}};
var _1c7=""+wdgt.display_template_id;
var id=null;
for(var i=0;i<amzn_wdgts_vars[wdgt.marketPlace][wdgt.templateId].length;i++){
var _1ca=amzn_wdgts_vars[wdgt.marketPlace][wdgt.templateId][i];
if(_1ca.displayTemplate==_1c7&&!_1ca.isTaken){
_1ca.isTaken=true;
id=_1ca.instanceId;
break;
}
}
if(id==null){
id=0;
}
wdgt.instanceId=id;
all_amzn_wdgts[wdgt.marketPlace][wdgt.templateId][id]=wdgt;
if(typeof amzn_wdgts_vars[wdgt.marketPlace][wdgt.templateId][id]!="undefined"){
if(typeof amzn_wdgts_vars[wdgt.marketPlace][wdgt.templateId][id].tag=="undefined"){
amzn_wdgts_vars[wdgt.marketPlace][wdgt.templateId][id].tag=_amzn_utils.getString(_amzn_utils.DefaultTag,wdgt.marketPlace);
}
_amzn_utils.recordImpression(amzn_wdgts_vars[wdgt.marketPlace][wdgt.templateId][id].tag,wdgt.linkCode,wdgt.creativeId(),wdgt.marketPlace);
wdgt.internalMain(amzn_wdgts_vars[wdgt.marketPlace][wdgt.templateId][id]);
}
}
if(typeof all_amzn_wdgts=="undefined"){
all_amzn_wdgts=new Array();
}
var curr_mkt_place="US";
if(typeof all_amzn_wdgts[curr_mkt_place]=="undefined"){
all_amzn_wdgts[curr_mkt_place]=new Array;
}
if(typeof all_amzn_wdgts[curr_mkt_place]["8001"]=="undefined"){
all_amzn_wdgts[curr_mkt_place]["8001"]=new Array();
}
var curr_wdgt=all_amzn_wdgts[curr_mkt_place]["8001"];
function clearWidgets(){
amzn_wdgts_vars=new Array();
amzn_wdgts_vars[amzn_wdgt.marketPlace]=new Array();
amzn_wdgts_vars[amzn_wdgt.marketPlace][amzn_wdgt.templateId]=new Array();
all_amzn_wdgts=new Array();
all_amzn_wdgts[amzn_wdgt.marketPlace]=new Array();
all_amzn_wdgts[amzn_wdgt.marketPlace][amzn_wdgt.templateId]=new Array();
amzn_wdgts_vars[amzn_wdgt.marketPlace][amzn_wdgt.templateId].push(_amzn_utils.clone(amzn_wdgt));
}
function display_callback(data){
if(_amzn_utils.amzn_isMSIE()){
setTimeout(new function(){
if(typeof _amzn_popup=="object"&&typeof Nifty=="function"){
all_amzn_wdgts[data.MarketPlace]["8001"][data.InstanceId].display_callback(data.results);
}else{
display_callback(data);
}
},50);
}else{
all_amzn_wdgts[data.MarketPlace]["8001"][data.InstanceId].display_callback(data.results);
}
}
initOnloadFunctions();

