var ecAPO;
function ensureEcObsReady(){if(window.ecObs){if(!window.ecAPO){function B(){}B.prototype={version:"1.0",showVersion:function(){alert("EchoCurrent Affiliate Product Optimizer version:  "+ecAPO.version)
},apoResourceLoc:"/engine/apo/",genAPs:function(E,I,H,G,F){setTimeout("ecAPO.genAPsImpl('"+E+"', '"+I+"', '"+H+"', '"+G+"', '"+F+"')",10)
},genAPsImpl:function(E,J,I,G,F){if(ecObs.initialized){var H="cid="+E;
if(I!=null&&I!=""&&I!="undefined"){H+="&pnfc="+encodeURIComponent(I)
}if(G!=null&&G!=""&&G!="undefined"){H+="&pdfc="+encodeURIComponent(G)
}if(F!=null&&F!=""&&F!="undefined"){H+="&afc="+encodeURIComponent(F)
}ecObs.callServer(ecAPO.apoResourceLoc,"genAPs/"+(J?J:"leaderboard"),"ecAPO._genOffersCallback",H)
}else{setTimeout("ecAPO.genAPsImpl('"+E+"', '"+J+"', '"+I+"', '"+G+"', '"+F+"')",5)
}},_ensureProductImageSize:function(G,I,H){var F=G.offsetWidth;
var E=G.offsetHeight;
if(F>H){G.width=H
}if(E>I){G.height=I
}G.style.visibility="visible"
},_ensureFooter:function(E){var G=ecObs._getFirstEleWithClassName(E,"div","ec_footer");
var F=(G!=null&&G.getElementsByTagName("a")!=null?G.getElementsByTagName("a").item(0):null);
if(G==null||G=="undefined"){var G=document.createElement("div");
G.setAttribute("class","ec_footer");
G.setAttribute("align","right");
G.setAttribute("style","font: normal 10px 'century gothic',verdana; color: #aaaaaa; position:absolute; bottom:2px; right:5px;");
F=document.createElement("a");
F.setAttribute("target","_blank");
F.setAttribute("href","http://www.echocurrent.com/");
(F.textContent?F.textContent="by EchoCurrent":F.innerText="by EchoCurrent");
G.appendChild(F);
E.appendChild(G)
}else{if(F==null||F=="undefined"){F=document.createElement("a");
F.setAttribute("target","_blank");
F.setAttribute("href","http://www.echocurrent.com/");
(F.textContent?F.textContent="by EchoCurrent":F.innerText="by EchoCurrent");
G.appendChild(F)
}else{if(F.href!="http://www.echocurrent.com"||(F.textContent&&F.textContent!="EchoCurrent")||(F.innerText&&F.innerText!="EchoCurrent")){F.href="http://www.echocurrent.com";
(F.textContent?F.textContent="EchoCurrent":F.innerText="EchoCurrent")
}}}},_releaseUnusedHeight:function(G,E){if(G.clientHeight>0){var H=ecObs._getFirstEleWithClassName(E,"div","ec_footer");
var F=(H!=null&&H!="undefined"?H.clientHeight:0);
if((E.clientHeight-(G.clientHeight+F))>=10){E.style.height=(G.clientHeight+F+5)+"px";
E.parentNode.style.height=E.clientHeight+6+"px"
}}},_genOffersCallback:function(I,F,G){var E=document.getElementById(F);
if(E!=null){var J=ecObs._getFirstEleWithClassName(E,"div","ec_loading");
if(J!=null&&J!="undefined"){J.parentNode.removeChild(J)
}var H=document.createElement("div");
H.style.padding="0px";
H.innerHTML=I;
E.appendChild(H);
if(G){ecAPO._ensureFooter(E)
}ecAPO._releaseUnusedHeight(H,E)
}},recCT:function(G,I,J){var E="aid="+G+"&upc="+I+"&sku="+J;
var H=document.getElementsByTagName("meta");
for(var F=H.length-1;
F>=0;
F--){if(H[F].name=="title"){E+="&contt="+encodeURIComponent(H[F].content.trim())
}else{if(H[F].name=="description"){E+="&contd="+encodeURIComponent(H[F].content.trim())
}}}ecObs.callServer(ecAPO.apoResourceLoc,"recCT","",E)
},showCouponArea:function(F,E){if(document.getElementById(E).style.display=="none"){document.getElementById(E).style.display="";
ecObs._addEvent(document,"click",ecAPO.hideCouponArea);
ecObs._stopEvent(F)
}},hideCouponArea:function(E){if(document.getElementById("ec_couponpop_1").style.display==""){document.getElementById("ec_couponpop_1").style.display="none";
ecObs._removeEvent(document,"click",ecAPO.hideCouponArea)
}}};
ecAPO=new B()
}var C="&ref="+encodeURIComponent(document.referrer);
var D=document.getElementsByTagName("meta");
for(var A=D.length-1;
A>=0;
A--){if(D[A].name=="keywords"){C+="&pkeys="+encodeURIComponent(D[A].content.trim());
break
}}ecAPO.genAPs(window.ec_zoneId,window.ec_zoneStyle,window.ec_productNameFontColor,window.ec_productDescFontColor,window.ec_altFontColor)
}else{setTimeout(ensureEcObsReady,500)
}}ensureEcObsReady();