var beginUrlString="/cws/convertedimages";var endUrlString="?format=jpg&quality=0.7&conversionType=image_resize&imageHeight=71&imageWidth=37&imageLayout=portrait";var state=false;function isIE(){var A=navigator.userAgent.toLowerCase();return A.indexOf("msie")!=-1;
}function Product(C,B,A){this.productName=C;this.productID=B;this.productImageURL=A;this.setPhone=function(F,E,D){this.productName=F;this.productID=E;this.productImageURL=D;};this.delPhone=function(){this.productName="";this.productID="";this.productImageURL="";
};}function setInnerHTML(C,B){var A=document.getElementById(C);if(A){A.innerHTML=B;}}function showBlock(C,B){var A=document.getElementById(C);if(A){A.style.display="block";}}function hideBlock(C,B){var A=document.getElementById(C);if(A){A.style.display="none";
}}function CompareBasket(){this.product1=new Product("","","");this.product2=new Product("","","");this.product3=new Product("","","");this.productswap=new Product("","","");this.productCount=0;this.preaddproductCount=0;this.compareURL="";this.showNoCompareLink="";
this.showCompareLink="";this.mainPhone="";this.tooltip_canAdd="";this.tooltip_canNotAdd="";this.tooltip_canRemove="";this.balloon_text_hasntbeenadded="";this.balloon_text_hasbeenadded="";this.balloon_text_hasremoved="";var A="@@";this.setPhone=function(F,I,E,D){var B="similar phones";
if(D!="left"){B="basket";}if(this.productCount==3||this.product1.productName==F||this.product2.productName==F){var C=document.getElementById("balloonPos_"+D);setInnerHTML("txt_"+D,(this.tooltip_canNotAdd).replace("<productname>",F));this.setPopupStyle(C,D,tempY,tempX);
return ;}ConvertedImageUrl=beginUrlString+E+endUrlString;E=ConvertedImageUrl;this.clearpopups();this.preaddproductCount=this.productCount;this.productCount++;this["product"+this.productCount].setPhone(F,I,E);if(document.getElementById("balloonPos_"+D)){var C=document.getElementById("balloonPos_"+D);
var H=(this.balloon_text_hasbeenadded).replace("<productname>",F);setInnerHTML("txt_"+D,H);this.setPopupStyle(C,D,tempY,tempX);if(this.productCount<=1){hideBlock("showcomparephonelink_"+D);}}if(this.preaddproductCount==3){if(typeof D!="undefined"){var G=document.getElementById("txt_"+D);
if(G){G.innerHTML=(this.balloon_text_hasntbeenadded).replace("<productname>",F);var C=document.getElementById("balloonPos_"+D);this.setPopupStyle(C,D,tempY,tempX);}}}this.setCompareBasket();this.redraw();};this.setPopupStyle=function(C,B,D,E){changeOpac(100,"balloonPos_"+B);
C.style.top=D+"px";C.style.left=E+"px";C.style.display="block";setTimeout("opacity('balloonPos_"+B+"', 100, 0, 500);",2500);};this.clearPlace=function(B){var C=this["product"+B].productName;showBlock("compare_add_"+this["product"+B].productName);hideBlock("compare_del_"+this["product"+B].productName);
this.fillUpList(B);if(B<=this.productCount){this.productCount=this.productCount-1;}this.setCompareBasket();this.redraw();};this.clearpopups=function(){hideBlock("balloonPos_1");hideBlock("balloonPos_2");hideBlock("balloonPos_3");hideBlock("balloonPos_left");
};this.delPhone=function(E,D){var B="similar phones";if(D!="left"){B="basket";}this.clearpopups();if(this.product1.productName==E){this.clearPlace(1);}else{if(this.product2.productName==E){this.clearPlace(2);}else{if(this.product3.productName==E){this.clearPlace(3);
}}}var C=document.getElementById("balloonPos_"+D);if(C){var F=(this.balloon_text_hasremoved).replace("<productname>",E);setInnerHTML("txt_"+D,F);this.setPopupStyle(C,D,tempY,tempX);if(document.getElementById("showcomparephonelink_"+D)){if(this.productCount>=2){showBlock("showcomparephonelink_"+D);
}else{hideBlock("showcomparephonelink_"+D);}}}};this.fillUpList=function(B){if(this.productCount==2&&B==1){this.moveProduct(2,1);this.product2.delPhone();this.product3.delPhone();}else{if(this.productCount==3&&B==1){this.moveProduct(2,1);this.moveProduct(3,2);
this.product3.delPhone();}else{if(this.productCount==3&&B==2){this.moveProduct(3,2);this.product3.delPhone();}else{this["product"+B].delPhone();}}}};this.moveProduct=function(B,C){this["productswap"]=this["product"+C];this["product"+C]=this["product"+B];this["product"+B]=this["productswap"];
};this.setContent=function(C,B){this[C]=B;};this.redrawPosition=function(C){var D=this["product"+C];var E="compare_phonebox_"+C+"_";var B=document.getElementById(E+"img");if(D.productName==""){B.style.cursor="default";B.src="/cws/images/compare_placeholder.jpg";
B.className="compare_placeholder";setInnerHTML(E+"name","");hideBlock(E+"removebutton");}else{B.style.cursor="";B.src=D.productImageURL;B.className="";setInnerHTML(E+"name",D.productName);showBlock(E+"removebutton");hideBlock("compare_add_"+D.productName);showBlock("compare_del_"+D.productName);
}};this.redraw=function(){if(this.productCount>=2){setInnerHTML("linktocomparebasket",this.showCompareLink);showBlock("filesize_note");}else{setInnerHTML("linktocomparebasket",this.showNoCompareLink);hideBlock("filesize_note");}if(this.productCount==3){this.refreshAltText(true);
showBlock("similarPhonesNoComparelinks");}else{this.refreshAltText(false);hideBlock("similarPhonesNoComparelinks");}if((this.mainPhone==this.product1.productName)||(this.mainPhone==this.product2.productName)||(this.mainPhone==this.product3.productName)){hideBlock("compare_setcurrentphone");
}else{if(this.productCount!=3){showBlock("compare_setcurrentphone");}}this.redrawPosition("1");this.redrawPosition("2");this.redrawPosition("3");};this.showComparebasket=function(){if(this.productCount>=2){var C=new Array();var B="";C[C.length]=this.product1.productName;
C[C.length]=this.product2.productName;if(this.productCount==3){C[C.length]=this.product3.productName;}C.sort();for(i=0;i<C.length;i++){B+=C[i]+" - ";}this.compareURL=this.compareURL+"&cmp_id0="+this.product1.productID+"&cmp_id1="+this.product2.productID+"&cmp_id2="+this.product3.productID;
location.href=this.compareURL;}};this.showComparebasketStandAlone=function(B){if(location.href.lastIndexOf("#p0")==-1){location.href=location.href+"#p0="+this.product1.productName.toLowerCase()+"&p1="+this.product2.productName.toLowerCase()+"&p2="+this.product3.productName.toLowerCase();
}popup.openLayer("compareproducts",B,"compareproducts",900,653,"","","",true);};this.setCompareBasket=function(){var D=A;for(var B=1;B<=3;B++){var C=this["product"+B];D+=C.productName+A+C.productID+A+C.productImageURL+A;}D=D+this.productCount+A;setCookie("CompareBasket",D,"","/","","");
};this.getCompareBasket=function(){var B="";if(getCookie("CompareBasket")){B=getCookie("CompareBasket");}else{(B="@@@@@@@@@@@@@@@@@@@@@@");}var E=B.split(A);for(var C=0;C<3;C++){var D=this["product"+(C+1)];D.productName=E[C*3+1];D.productID=E[C*3+2];D.productImageURL=E[C*3+3];
if(D.productImageURL.indexOf("convertedimages")==-1){ConvertedImageUrl=beginUrlString+D.productImageURL+endUrlString;D.productImageURL=ConvertedImageUrl;}}this.productCount=E[10];};this.refreshAltText=function(C){var B=document.getElementsByTagName("a");var D="";
for(i=0;i<B.length;i++){className=B[i].className;if(className=="linkadd"){if(C){B[i].title=this.getCleanCannotAddLabel(B[i].id,this.tooltip_canNotAdd);}else{B[i].title=this.tooltip_canAdd;}}}};this.getCleanCannotAddLabel=function(E,D){var B=E.slice(12);var C=D.replace("<productname>",B);
return C;};}function opacity(F,D,A,B){var C=Math.round(B/100);var E=0;if(D>A){for(i=D;i>=A;i--){setTimeout("changeOpac("+i+",'"+F+"')",(E*C));E++;}}else{if(D<A){for(i=D;i<=A;i++){setTimeout("changeOpac("+i+",'"+F+"')",(E*C));E++;}}}}function changeOpac(A,C){var B=document.getElementById(C).style;
if(B){B.opacity=(A/100);B.MozOpacity=(A/100);B.KhtmlOpacity=(A/100);if(A<=0){B.display="none";}}}if(!isIE()){document.captureEvents(Event.onclick);}document.onclick=getMouseXY;var tempX=0;var tempY=0;function getMouseXY(B){var A=function(){var C=navigator.userAgent.toLowerCase();
return C.indexOf("msie")!=-1;};if(A()){tempX=event.clientX+document.documentElement.scrollLeft;tempY=event.clientY+document.documentElement.scrollTop+10;}else{tempX=B.pageX;tempY=B.pageY+10;}tempX-=91;if(tempX<0){tempX=0;}if(tempY<0){tempY=0;}return true;}function swapColour(D,A,C){document.getElementById(D).src=A;
var E=getElementsByClassName("tr","colours")[0];allColourLinks=E.getElementsByTagName("a");for(var B=0;B<allColourLinks.length;B++){removeClass(allColourLinks[B],"current");}addClass(C,"current");return false;}function setSeSupportCookieFromProductZone(B){var A=new Date(2010,1,1);
setCookie("SeSupportID",B,A,"/","","");}function hasClass(A,B){return A.className&&A.className.search(B)>=0;}function getElementsByClassName(D,A){if(D=="*"){allElems=document.all||document.getElementsByTagName("*");}else{allElems=document.getElementsByTagName(D);
}var B=new Array();for(var C=0;C<allElems.length;C++){if(hasClass(allElems[C],A)){B[B.length]=allElems[C];}}return B;}var timer=0;var activeItem=-1;var RMitems;function restoreMediaByUrl(B,C){RMitems=B;var G=document.getElementById("pagecontent");var F=window.location.href;
var A=F.indexOf("#layerid=");if(A>-1){var H=F.substr(A).toLowerCase();var D=H.split("=");var E=D[1];if(E!=null){for(i=0;i<B.length;i++){if(unescape(B[i].id)==unescape(E)){activeItem=i;break;}}}}if(C=="low"){if(isFunction(popup.openLayer)){openRMLayer();}else{loadResource("script","text/javascript",contextRoot+"/js/popupLayerFunctions.js","tmpJsIncl",G,"openRMLayer");
}}else{openRMLayer();}}function openRMLayer(){if(activeItem!=-1){popup.openLayer(RMitems[activeItem].id,RMitems[activeItem].url,RMitems[activeItem].type,RMitems[activeItem].width,RMitems[activeItem].height,null,null,RMitems[activeItem].optParams);}}function formatURL(B){var A=B.indexOf("?");
var D=getCookie("cc")==""?getCookie("cc"):"gb";var C=getCookie("lc")==""?getCookie("lc"):"en";if(A==-1){B=B+"?cc="+D+"&lc="+C;}return B;}