function InfoBlocks(a){this.opt=a;this.aBlockDivs=[];this.aBlockBelowDivs=[];this.aBlockBelowImages=[];this.aSpeed=[];this.aIntervalId=[];this.aExpanded=[];this.oInfoBlock=null;this.bLock=!1;this.init()}
InfoBlocks.prototype.init=function(){var a=[];this.oInfoBlock=document.getElementById("info-block-text-publisher");for(var b=0,c=this.opt.aBlocks.length;b<c;b++){this.aBlockDivs[b]=document.getElementById("info-block-item-"+this.opt.aBlocks[b].sId);for(var d=this.aBlockDivs[b].getElementsByTagName("div"),e=0,f=d.length;e<f;e++)"info-block-item-below"==d[e].className&&(this.aBlockBelowDivs[b]=d[e]);this.aBlockBelowImages[b]=this.aBlockBelowDivs[b].getElementsByTagName("img")[0];this.aBlockDivs[b].instanceRef=
this;this.aBlockDivs[b].iBlock=b;this.aBlockDivs[b].onmouseover=function(){this.instanceRef.handleMouseOverBlock(this.iBlock,!0)};this.aBlockDivs[b].onmouseout=function(){this.instanceRef.handleMouseOverBlock(this.iBlock,!1)};this.aSpeed[b]=0;this.aIntervalId[b]=null;this.aExpanded[b]=!1;a[b]=document.createElement("img");a[b].src=oBase.oPath.imageURL+"/homepage/info_blocks/info_block_"+this.opt.aBlocks[b].sId+"_below.png"}a[0].instanceRef=this;a[0].onload=function(){this.instanceRef.expandBlock(0)}};
InfoBlocks.prototype.handleMouseOverBlock=function(a,b){b&&this.expandBlock(a)};
InfoBlocks.prototype.expandBlock=function(a){if(!this.bLock){this.aBlockBelowDivs[a].className="info-block-item-below info-block-item-below-expanding";for(var b=0,c=this.opt.aBlocks.length;b<c;b++)this.aExpanded[b]&&this.collapseBlock(b);this.aExpanded[a]=!0;this.aSpeed[a]=this.opt.iStepSize;null!=this.aIntervalId[a]&&clearTimeout(this.aIntervalId[a]);this.aIntervalId[a]=setTimeout(this.opt.sSelf+".setBlockSize("+a+", 40, "+this.opt.iDelay+", '"+this.opt.sSelf+".expandBlockReady("+a+");')",this.opt.iDelay);
this.bLock=!0;setTimeout(this.opt.sSelf+".bLock = false;",50)}};InfoBlocks.prototype.expandBlockReady=function(a){this.aIntervalId[a]=null;this.updateTextBlock(a)};InfoBlocks.prototype.collapseBlock=function(a){this.aSpeed[a]=-this.opt.iStepSize;this.aExpanded[a]=!1;null!=this.aIntervalId[a]&&clearTimeout(this.aIntervalId[a]);this.aIntervalId[a]=setTimeout(this.opt.sSelf+".setBlockSize("+a+", 0, "+this.opt.iDelay+", '"+this.opt.sSelf+".collapseBlockReady("+a+");')",this.opt.iDelay)};
InfoBlocks.prototype.collapseBlockReady=function(a){this.aBlockBelowDivs[a].className="info-block-item-below";this.aIntervalId[a]=null};
InfoBlocks.prototype.setBlockSize=function(a,b,c,d){var e=""==this.aBlockBelowImages[a].style.marginTop?0:parseInt(this.aBlockBelowImages[a].style.marginTop);e!=b?0<this.aSpeed[a]&&e+this.aSpeed[a]>b||0>this.aSpeed[a]&&e+this.aSpeed[a]<b?(this.aBlockBelowImages[a].style.marginTop=b+"px","undefined"!=typeof d&&eval(d)):(this.aBlockBelowImages[a].style.marginTop=e+this.aSpeed[a]+"px",setTimeout(this.opt.sSelf+".setBlockSize("+a+", "+b+", "+c+", '"+("undefined"==typeof d?"null":d)+"')",c)):"undefined"!=
typeof d&&eval(d)};
InfoBlocks.prototype.updateTextBlock=function(a){this.oInfoBlock.id="info-block-text-"+this.opt.aBlocks[a].sId;oBase.setInnerHTML(this.oInfoBlock.getElementsByTagName("p")[0],this.opt.aBlocks[a].sDescription.htmlspecialchars());oBase.setInnerHTML(this.oInfoBlock.getElementsByTagName("ul")[0],"<li>"+this.opt.aBlocks[a].aBullets.join("</li><li>")+"</li>");oBase.setInnerHTML(this.oInfoBlock.getElementsByTagName("a")[1],this.opt.aBlocks[a].sRegisterButton.htmlspecialchars());document.getElementById(this.opt.oReadMore.sAnchorId).href=this.opt.aBlocks[a].sURL;
document.getElementById(this.opt.sRegisterId).href=this.opt.aBlocks[a].sRegisterURL};function LocaleSelector(a){this.opt=a;this.iInterval=this.oContainerDiv=this.oBoxDiv=null;this.init()}
LocaleSelector.prototype.init=function(){this.oBoxDiv=document.getElementById(this.opt.sBoxDiv);this.oBoxDiv.className="scripted-locale";for(var a="",b=0,c=this.opt.aLocales.length;b<c;b++)this.opt.aLocales[b].bIsSelected&&(a=this.opt.sTemplateItem.replace(/%languageId%/g,this.opt.aLocales[b].sId).replace(/%languageName%/g,this.opt.aLocales[b].sName).replace(/ onclick="[^"]+"/,""));oBase.setInnerHTML(this.oBoxDiv,a);this.oBoxDiv.instanceRef=this;this.oBoxDiv.onmouseover=function(){this.instanceRef.handleMouseOverBox(!0)};
this.oBoxDiv.onmouseout=function(){this.instanceRef.handleMouseOverBox(!1)}};LocaleSelector.prototype.handleMouseOverBox=function(a){a?this.expandContainer():(null!=this.iInterval&&clearTimeout(this.iInterval),this.iInterval=setTimeout(this.opt.sSelf+".collapseContainer()",200))};LocaleSelector.prototype.expandContainer=function(){null!=this.iInterval&&clearTimeout(this.iInterval);null==this.oContainerDiv?this.createContainer():(this.recalcPosition(),this.oContainerDiv.style.display="inline")};
LocaleSelector.prototype.collapseContainer=function(){this.iInterval=null;this.oContainerDiv.style.display="none"};
LocaleSelector.prototype.createContainer=function(){this.oContainerDiv=document.createElement("div");document.body.appendChild(this.oContainerDiv);this.oContainerDiv.style.position="absolute";this.oContainerDiv.className="locale-item-container";this.recalcPosition();for(var a="",b=0,c=this.opt.aLocales.length;b<c;b++)a+=this.opt.sTemplateItem.replace(/%languageId%/g,this.opt.aLocales[b].sId).replace(/%languageName%/g,this.opt.aLocales[b].sName);oBase.setInnerHTML(this.oContainerDiv,a)};
LocaleSelector.prototype.recalcPosition=function(){var a=oBase.getPos(this.oBoxDiv);oBase.setPos(this.oContainerDiv,{x:a.x,y:a.y+this.oBoxDiv.clientHeight+2});"opera"in window&&oBase.setPos(this.oContainerDiv,{x:a.x,y:a.y+this.oBoxDiv.clientHeight+2})};
LocaleSelector.prototype.handleMouseOverItem=function(a,b){b?(a.className="locale-item selected-locale-item",this.expandContainer()):(a.className="locale-item",null!=this.iInterval&&clearTimeout(this.iInterval),this.iInterval=setTimeout(this.opt.sSelf+".collapseContainer()",200))};LocaleSelector.prototype.handleClickItem=function(a){location.href+=(0<=location.href.indexOf("?")?"&":"?")+"locale="+a};
function HomepageLogin(a){this.opt=a;this.bCollapsed=this.opt.bIsCollapsed;this.sSelected=this.opt.sSelected;this.oArrowImg=this.oSurrogateBackground=this.oMerchantTabLink=this.oAffiliateTabLink=this.oLoginBoxDiv=this.oContainerDiv=this.oHeaderBlock=this.oHeaderDiv=null;this.iSpeed=0;this.init()}
HomepageLogin.prototype.init=function(){this.oHeaderDiv=document.getElementById(this.opt.sHeaderId);for(var a=this.oHeaderDiv.getElementsByTagName("div"),b=0,c=a.length;b<c;b++)switch(a[b].className){case "active":case "normal":this.oHeaderBlock=a[b]}b=this.oHeaderDiv.getElementsByTagName("a")[0];b.instanceRef=this;b.onclick=function(){this.instanceRef.handleClickActivation();this.blur();return!1};b.parentNode.instanceRef=this;b.parentNode.onclick=function(){this.instanceRef.handleClickActivation();
this.blur();return!1};this.oContainerDiv=document.getElementById(this.opt.sContainerId);a=this.oContainerDiv.getElementsByTagName("div");b=0;for(c=a.length;b<c;b++)switch(a[b].className){case "a":case "m":this.oLoginBoxDiv=a[b];break;case "affiliate-button":this.oAffiliateTabLink=a[b].getElementsByTagName("a")[0];this.oAffiliateTabLink.instanceRef=this;this.oAffiliateTabLink.onclick=function(){this.instanceRef.switchTo("affiliate");this.blur();return!1};a[b].instanceRef=this;a[b].onclick=function(){this.instanceRef.switchTo("affiliate")};
break;case "merchant-button":this.oMerchantTabLink=a[b].getElementsByTagName("a")[0],this.oMerchantTabLink.instanceRef=this,this.oMerchantTabLink.onclick=function(){this.instanceRef.switchTo("merchant");this.blur();return!1},a[b].instanceRef=this,a[b].onclick=function(){this.instanceRef.switchTo("merchant")}}a=this.oLoginBoxDiv.getElementsByTagName("input");b=0;for(c=a.length;b<c;b++)switch(a[b].name){case "username":a[b].className="text label";a[b].value=this.opt.sLabelUsername;a[b].instanceRef=
this;a[b].onfocus=function(){if(this.value==this.instanceRef.opt.sLabelUsername)this.value="",this.className="text"};a[b].onblur=function(){if(""==this.value)this.value=this.instanceRef.opt.sLabelUsername,this.className="text label"};break;case "password":a[b].className="text label";if(!oBase.ua.bIsIE)a[b].type="text";if(!oBase.ua.bIsIE)a[b].value=this.opt.sLabelPassword;a[b].instanceRef=this;if(!oBase.ua.bIsIE)a[b].onfocus=function(){if(this.value==this.instanceRef.opt.sLabelPassword&&(oBase.ua.bIsIE||
"text"==this.type))this.value="",this.className="text",this.type="password"},a[b].onblur=function(){if(""==this.value&&(this.value=this.instanceRef.opt.sLabelPassword,this.className="text label",!oBase.ua.bIsIE))this.type="text"}}this.oArrowImg=this.oHeaderBlock.getElementsByTagName("img")[0];null!=this.opt.sExpandTo&&(this.switchTo(this.opt.sExpandTo),this.expandLoginBox())};HomepageLogin.prototype.handleClickActivation=function(){this.bCollapsed?this.expandLoginBox():this.collapseLoginBox()};
HomepageLogin.prototype.expandLoginBox=function(){if(0==this.iSpeed)this.oLoginBoxDiv.style.display="none",this.oContainerDiv.style.display="block",this.oArrowImg.src=this.oArrowImg.src.replace(/_up\.png/,".png"),this.oHeaderBlock.className="active",this.iSpeed=20,this.resizeLoginBox(88,5,this.opt.sSelf+".expandLoginBoxReady();")};HomepageLogin.prototype.expandLoginBoxReady=function(){this.oLoginBoxDiv.style.display="block";this.bCollapsed=!1;this.iSpeed=0};
HomepageLogin.prototype.collapseLoginBox=function(){if(0==this.iSpeed)this.oLoginBoxDiv.style.display="none",this.iSpeed=-20,this.resizeLoginBox(0,5,this.opt.sSelf+".collapseLoginBoxReady();")};HomepageLogin.prototype.collapseLoginBoxReady=function(){this.oContainerDiv.style.display="none";this.oHeaderBlock.className="normal";this.oArrowImg.src=this.oArrowImg.src.replace(/\.png/,"_up.png");this.bCollapsed=!0;this.iSpeed=0};
HomepageLogin.prototype.resizeLoginBox=function(a,b,c){var d=""==this.oContainerDiv.style.height?0:parseInt(this.oContainerDiv.style.height);d!=a?0<this.iSpeed&&d+this.iSpeed>a||0>this.iSpeed&&d+this.iSpeed<a?(this.oContainerDiv.style.height=a+"px","undefined"!=typeof c&&eval(c)):(this.oContainerDiv.style.height=d+this.iSpeed+"px",2<this.iSpeed?this.iSpeed-=2:-2>this.iSpeed&&(this.iSpeed+=2),setTimeout(this.opt.sSelf+".resizeLoginBox("+a+", "+b+", '"+("undefined"==typeof c?"null":c)+"')",b)):"undefined"!=
typeof c&&eval(c)};HomepageLogin.prototype.switchTo=function(a){if(this.sSelected!=a){setTimeout(this.opt.sSelf+".fadeButton('"+a+"', 255, 245);",50);setTimeout(this.opt.sSelf+".fadeButton('"+("merchant"==a?"affiliate":"merchant")+"', 245, 255);",50);for(var b=0;10>=b;b++)this.oLoginBoxDiv.className="merchant"==a?"m":"a";this.sSelected=a}};
HomepageLogin.prototype.fadeButton=function(a,b,c){if(c>b)b++;else if(c<b)b--;else return!1;"affiliate"==a?this.oAffiliateTabLink.parentNode.style.backgroundColor="#"+b.toString(16)+b.toString(16)+b.toString(16):this.oMerchantTabLink.parentNode.style.backgroundColor="#"+b.toString(16)+b.toString(16)+b.toString(16);setTimeout(this.opt.sSelf+".fadeButton('"+a+"', "+b+", "+c+");",50);return!0};

