
function dakisIsIE()
{return((navigator.userAgent.toLowerCase().indexOf("msie")!=-1)&&!window.opera)?true:false;}
var g_dakisGalleryImages=new Array();var g_dakisNbImageGalleries=0;function dakisCreateImageGallery(thumbnailClass,changeImageEvent,fullImageElementId,fullImageSuffix,selectedImageClass,textElementId)
{thumbnails=document.getElementsByClassName(thumbnailClass);firstThumbnail=null;if(g_dakisNbImageGalleries>0)
{fullImageElementId=fullImageElementId+(g_dakisNbImageGalleries+1).toString();}
fullImageElement=$(fullImageElementId);if(fullImageElement==null)
{alert("Gallery Image Error: The large gallery image element doesn't exist. Make sure an element has the id: "+fullImageElementId);return;}
if(fullImageElement.tagName.toLowerCase()!="img")
{alert("Gallery Image Error: The large gallery must be an image. It is actually a: "+fullImageElement.tagName);return;}
for(var i=0;i<thumbnails.length;i++)
{thumbnail=thumbnails[i];if(g_dakisGalleryImages.indexOf(thumbnail)==-1)
{g_dakisGalleryImages.push(thumbnail);thumbnail.galleryImageId=g_dakisNbImageGalleries;if(firstThumbnail==null)
{firstThumbnail=thumbnail;}
var extension=dakisGetFileExtension(thumbnail.src);var newExtension=fullImageSuffix+"."+extension;var largeFile=dakisSetFileExtension(thumbnail.src,newExtension);thumbnail.largeFile=largeFile;var image=new Image();image.src=largeFile;thumbnail[changeImageEvent]=function(){var largeFile=this.largeFile;var galleryImageId=this.galleryImageId
g_dakisGalleryImages.each(function(t){if(t.galleryImageId==galleryImageId)
{t.classNames().add(thumbnailClass);t.classNames().remove(selectedImageClass);}});this.classNames().add(selectedImageClass);this.classNames().remove(thumbnailClass);if(textElementId!=undefined&&$(textElementId)!=null)
{$(textElementId).innerHTML=this.alt;}
if($(fullImageElementId).src==largeFile)
{return;}
new Effect.Opacity(fullImageElementId,{from:1.0,to:0.6,duration:0.15,afterFinish:function(){$(fullImageElementId).src=largeFile;new Effect.Opacity(fullImageElementId,{from:0.6,to:1.0,duration:0.3});}});};}};if(firstThumbnail==null)
{alert("Gallery Image Error: No thumbnail found for the full image element id: "+fullImageElementId);}
firstThumbnail[changeImageEvent]();g_dakisNbImageGalleries++;}
var g_templateHoverImages={};function templateLoadHoverImage(image,hoverSrc,forceReload)
{if(!forceReload&&typeof(image.hoverImage)!="undefined"&&image.hoverImage!=null)
{return;}
if(typeof(image.src)=="undefined"||image.src==null)
{setTimeout(function(){templateLoadHoverImage(image,hoverSrc,forceReload);},100);return;}
var originalSrc=image.src;image.originalImage=new Image();image.originalImage.src=originalSrc;var hoverImage=g_templateHoverImages[hoverSrc];if(hoverImage==null)
{hoverImage=new Image();hoverImage.src=hoverSrc;g_templateHoverImages[hoverSrc]=hoverImage;}
image.hoverImage=hoverImage;image.hoverIndex=g_nbHoverImages;g_nbHoverImages++;}
function templateOnImageMouseHover(image,originalSrc,hoverSrc)
{if(typeof(originalSrc)=="undefined")
{if(typeof(image.originalImage)=="undefined")
{return;}
originalSrc=image.originalImage.src;hoverSrc=image.hoverImage.src;}
var queueName="templateHover"+image.hoverIndex;new Effect.Opacity(image,{from:1.0,to:0.6,duration:0.12,queue:{position:'end',scope:queueName},afterFinish:function(){image.src=hoverSrc;new Effect.Opacity(image,{from:0.6,to:1.0,duration:0.2,queue:{position:'end',scope:queueName}});}});}
function templateOnImageMouseOut(image,originalSrc,hoverSrc)
{if(typeof(originalSrc)=="undefined")
{if(typeof(image.originalImage)=="undefined")
{return;}
originalSrc=image.originalImage.src.replace(/&/g,"%26");hoverSrc=image.hoverImage.src.replace(/&/g,"%26");}
if(originalSrc==hoverSrc)
{return;}
var queueName="templateHover"+image.hoverIndex;new Effect.Opacity(image,{from:1.0,to:0.6,duration:0.12,queue:{position:'end',scope:queueName},afterFinish:function(){image.src=originalSrc;new Effect.Opacity(image,{from:0.6,to:1.0,duration:0.2,queue:{position:'end',scope:queueName}});}});}
function templateMakeSureUsingOriginalImageSrc(image)
{if(typeof(image)!="undefined"&&image!=null&&typeof(image.originalImage)!="undefined")
{image.src=image.originalImage.src;}}
function dakisButtonUpEvent(element)
{Element.setOpacity(element,1);}
function dakisButtonDownEvent(element,width)
{Element.setOpacity(element,0.75);}
function dakisBackToTop()
{var x1=x2=x3=0;var y1=y2=y3=0;if(document.documentElement){x1=document.documentElement.scrollLeft||0;y1=document.documentElement.scrollTop||0;}
if(document.body){x2=document.body.scrollLeft||0;y2=document.body.scrollTop||0;}
x3=window.scrollX||0;y3=window.scrollY||0;var x=Math.max(x1,Math.max(x2,x3));var y=Math.max(y1,Math.max(y2,y3));window.scrollTo(Math.floor(x/2),Math.floor(y/2));if(x>0||y>0){window.setTimeout("dakisBackToTop()",25);}}
function dakisLoadAdRotators(templateElementId)
{var id=0;var adRotators=document.getElementsByClassName("dakisAdRotator");adRotators.each(function(element)
{element.id="dakisAdRotator"+id;var advertiser=new DakisProductAdvertiser2(element.id,templateElementId);advertiser.imageWidth=g_dakisAdRotatorImageWidth;advertiser.imageHeight=g_dakisAdRotatorImageHeight;advertiser.delay=g_dakisAdRotatorDelay;advertiser.afterMerchandiseImported=dakisProcessImportedProduct;advertiser.start();id++;});}
function dakisLoadAdRotators2(templateElementId,host,retailer_guid,lang)
{var id=0;var adRotators=document.getElementsByClassName("dakisAdRotator");var firstIndex=0;if(g_dakisAdRotatorRandomOrder)
{firstIndex=Math.random()*100;}
for(var t=0;t<adRotators.length;t++)
{element=adRotators[t];element.id="dakisAdRotator"+id;var advertiser=new DakisProductAdvertiser2(element.id,templateElementId);advertiser.host=host;advertiser.retailer_guid=retailer_guid;advertiser.lang=lang;advertiser.imageWidth=g_dakisAdRotatorImageWidth;advertiser.imageHeight=g_dakisAdRotatorImageHeight;advertiser.delay=g_dakisAdRotatorDelay;advertiser.afterMerchandiseImported=dakisProcessImportedProduct;advertiser.firstIndex=firstIndex+t;advertiser.start();id++;};}
function dakisProcessImportedProduct(id,merchandise,nbMerchandises)
{if(merchandise.flag=="sale")
{var isMap=merchandise.MAP!=undefined&&merchandise.MAP==true;var regPriceElement=$(id+"_regpriceDiv");if(regPriceElement!=null&&!merchandise.hidePriceEnabled)
{regPriceElement.style.display="block";if(isMap)
{regPriceElement.innerHTML="see price in cart!";}}
if(isMap)
{var ourPriceElement=$(id+"_ourprice");if(ourPriceElement!=null)
{ourPriceElement.innerHTML=merchandise.regPrice;}}}}
function zoomToStore(index)
{var storeIndexArgName="index";var src=document.getElementById('dakisMapFrame').src;var storeIndexPos=src.indexOf(storeIndexArgName+"=");if(storeIndexPos!=-1)
{src=src.substr(0,storeIndexPos-1);}
src=src+"&"+storeIndexArgName+"="+index;document.getElementById('dakisMapFrame').src=src;}
function resizeToFitParentElement(element)
{var parentNode=element.parentNode;while(parentNode!=null)
{if(parentNode.tagName!="FONT"&&parentNode.tagName!="P"&&parentNode.style.height!=null&&parentNode.style.height.indexOf("px")!=-1)
{element.style.height=parentNode.style.height;if(parentNode.style.width!=null||element.offsetWidth==0)
{if(parentNode.clientWidth!=null&&parentNode.clientWidth!=0)
{element.style.width=parentNode.clientWidth;}
else if(parentNode.offsetWidth!=null&&parentNode.offsetWidth!=0)
{element.style.width=parentNode.offsetWidth;}
else if(parentNode.style.width!=null&&parentNode.style.width.indexOf("px")!=-1)
{element.style.width=parentNode.style.width;}}
break;}
parentNode=parentNode.parentNode;}}
function includeJsIfUndefined(testVar,jsPath)
{if(testVar==undefined)
{includeJs(jsPath);testVar="defined";}}
function includeJs(jsPath)
{document.write('<'+'script');document.write(' language="javascript"');document.write(' type="text/javascript"');document.write(' src="'+jsPath+'">');document.write('</'+'script'+'>');}
function redirectToPrintAppIfNeeded(serverUrl,lang,retailerGuid,appVersion)
{try
{var remote=isRemoteLayout;}
catch(e)
{redirectToPrintApp(serverUrl,lang,retailerGuid,appVersion);}}
function redirectToPrintApp(serverUrl,lang,retailerGuid,appVersion,layoutFile)
{window.location.replace(computePrintAppUrl(serverUrl,lang,retailerGuid,appVersion,layoutFile));}
function goToPrintApp(serverUrl,lang,retailerGuid,appVersion,layoutFile,params)
{window.location=computePrintAppUrl(serverUrl,lang,retailerGuid,appVersion,layoutFile,params);}
function computePrintAppUrl(serverUrl,lang,retailerGuid,appVersion,layoutFile,params)
{var baseUrl=getDocDomainDir();var pageFile=layoutFile;if(pageFile==null)
{pageFile=window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1);}
if(typeof(params)=="undefined"||params=="")
{params="";}
else
{params="&"+params;}
if(typeof(g_sessionId)=="undefined")
{g_sessionId="";}
var url=serverUrl+"/guid/"+retailerGuid+"/"+lang+"/photo/"+appVersion+"?"+"base_url="+baseUrl+"&page_file="+pageFile+"&page_version="+g_websiteVersion+"&lang="+lang+"&session_id="+g_sessionId+"&retailer_guid="+retailerGuid+
params;return url;}
function redirectToCashierIfNeeded(serverUrl,lang,retailerGuid,sessionId,layoutFile)
{try
{var remote=isRemoteLayout;}
catch(e)
{redirectToCashier(serverUrl,lang,retailerGuid,sessionId,layoutFile);}}
function goToCashier(serverUrl,lang,retailerGuid,sessionId,layoutFile)
{window.location=computeCashierAppUrl(serverUrl,lang,retailerGuid,sessionId,layoutFile);}
function redirectToCashier(serverUrl,lang,retailerGuid,sessionId,layoutFile)
{var url=computeCashierAppUrl(serverUrl,lang,retailerGuid,sessionId,layoutFile);window.location.replace(url);}
function computeCashierAppUrl(serverUrl,lang,retailerGuid,sessionId,layoutFile)
{var baseUrl=getDocDomainDir();var pageFile=layoutFile;if(pageFile==null)
{pageFile=window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1);}
var url=serverUrl+"/checkout?"+"base_url="+baseUrl+"&page_file="+pageFile+"&page_version="+g_websiteVersion+"&lang="+lang+"&session_id="+sessionId+"&retailer_guid="+retailerGuid;return url;}
function setElementClass(element,className)
{element.setAttribute("class",className);element.setAttribute("className",className);}
function bookmarkThisPage()
{if(document.all)
{window.external.AddFavorite(document.URL,document.title);}
else if(window.sidebar)
{window.sidebar.addPanel(document.title,document.URL,"")}}
function dakisPopupWindow(url,args,width,height,centered,menubar,location,scrollbars,resizable)
{if(g_designMode){return;}
var left=0;var top=0;if(width==0||height==0)
{width=screen.width;height=screen.height;}
if(centered)
{left=(screen.width-width)/2;top=(screen.height-height)/2;}
var params='width='+width+',height='+height+',left='+left+',top='+top+', menubar='+menubar+', toolbar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable+',location='+location;if(args!='')
{url+='?'+args;}
var popup=window.open(url,window.location.href+"_popup",params);popup.focus();}
function winopen(url,width,height,args)
{var left=(screen.width-width)/2;var top=(screen.height-height)/2;var params='width='+width+',height='+height+',left='+left+',top='+top+'menubar=no,scrollbars=yes,resizable=no,location=no'
var popup=window.open(url+'?'+args,'popup',params);popup.focus();}
function winopenResizable(url,width,height,args)
{var left=(screen.width-width)/2;var top=(screen.height-height)/2;var params='width='+width+',height='+height+',left='+left+',top='+top+'menubar=no,scrollbars=yes,resizable=yes,location=no'
var popup=window.open(url+'?'+args,'popup',params);popup.focus();}
function flashAppOpen()
{flashAppOpenArgs('');}
function flashAppOpenProduct(productGuid)
{flashAppOpenArgs('skipL=true&p1='+productGuid);}
function flashAppOpenPL(plGuid)
{flashAppOpenArgs('pl='+plGuid);}
function flashAppOpenDM(dmGuid)
{flashAppOpenArgs('dm='+dmGuid);}
function templateOnLink(url)
{if(url.indexOf('http://')==-1)
{refreshVisibleContentDivFromHref(url);}}
DakisFlashObject=Class.create();DakisFlashObject.prototype={objectWidth:0,objectHeigth:0,htmlElementId:'dhe_flash_object',created:false,cssUrl:'none',flashUrl:'',className:'dhe_flash_object',callbackObj:'',randomized:false,initialize:function(callbackObj,flashUrl,w,h,htmlElementId,cssUrl)
{this.callbackObj=callbackObj;this.flashUrl=this.getPublicUrl(flashUrl,{obj:callbackObj,cssUrl:cssUrl,language:g_dakisLang});this.objectWidth=w;this.objectHeigth=h;if(htmlElementId!==undefined){this.htmlElementId=htmlElementId;this.className=htmlElementId;}
if(cssUrl!==undefined)
this.cssUrl=cssUrl;},hideObject:function()
{$(this.htmlElementId).style.visibility="hidden";$(this.htmlElementId).style.display="none";removeOverlay();},promptObject:function()
{if(!this.created)
this.createObject();this.showObject();},createObject:function()
{var self=this;var someRand=Math.floor(Math.random()*10);this.addObjectDiv();var so=new SWFObject(this.flashUrl,"flashObj"+someRand,this.objectWidth,this.objectHeigth,"7","#FFFFFF");so.write(this.htmlElementId);this.created=true;},addObjectDiv:function()
{var bodyElem=document.getElementsByTagName("body")[0];var obj=document.createElement("div");obj.setAttribute('id',this.htmlElementId);obj.className=this.className;obj.style.zIndex='102';obj.style.position="absolute";obj.style.display="none";obj.style.visibility="hidden";bodyElem.appendChild(obj);},showObject:function()
{$(this.htmlElementId).style.visibility="visible";$(this.htmlElementId).style.display="block";this.positionMiddle();addOverlay();},positionMiddle:function()
{var element=$(this.htmlElementId);var windowHeight;var windowWidth;var scrolled;if(ie)
{if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight;windowWidth=document.documentElement.clientWidth;}
else{windowHeight=document.body.clientHeight;windowWidth=document.body.clientWidth;}
scrolled=document.documentElement.scrollTop;}
else
{windowHeight=self.innerHeight;windowWidth=self.innerWidth;scrolled=pageYOffset;}
element.style.top="0px";element.style.left="0px";element.style.top=Math.round(scrolled+windowHeight/2-element.clientHeight/2)+"px";element.style.left=Math.round(windowWidth/2-element.clientWidth/2)+"px";},getPublicUrl:function(fileName,params){if(params!==undefined)
return g_dakisServerUrl+fileName+'?'+$H(params).toQueryString();else
return g_dakisServerUrl+fileName;}};DakisDHEBanner=Class.create();Object.extend(DakisDHEBanner.prototype,DakisFlashObject.prototype);Object.extend(DakisDHEBanner.prototype,{imageDelay:5000,imagePath:'./../images/banner/',randomized:false,transparency:false,initialize:function(flashUrl,htmlElementId,imagePath,delay,transparency){this.flashUrl=flashUrl;this.imagePath=imagePath;this.imageDelay=delay;this.transparency=transparency;if(htmlElementId!==undefined)
{this.htmlElementId=htmlElementId;this.className=htmlElementId;var el=document.getElementById(htmlElementId);this.objectWidth=el.offsetWidth;this.objectHeight=el.offsetHeight;this.createObject();}},createObject:function()
{var so=new SWFObject(this.flashUrl,this.htmlElementId+"_flash",this.objectWidth,this.objectHeight,"8","#FFFFFF");if(this.transparency==true)
so.addParam('wmode','transparent');so.write(this.htmlElementId);this.created=true;},getJSReady:function(){return true;},getImagePath:function(){return this.imagePath;},getImageDelay:function(){return this.imageDelay;},getImageHeight:function(){return this.objectHeight;},getImageWidth:function(){return this.objectWidth;}});if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var g_curContentDivId=-1;var g_isAnimatingContent=0;var g_contentHeightTreshold=650;var g_contentHeaderHeight=34;function adjustContentDivHeight()
{if($('middleTableRightDiv_general')==null)
{return;}
$('middleTableRight').style.height="10px";}
function refreshVisibleContentDiv()
{var divId=getURLParam('divid');if(divId)
{switchContent(divId);}
else
{switchContent(g_firstDivId);}}
function refreshVisibleContentDivFromHref(href)
{if(g_designMode){return;}
var divId=getURLParamFromHref(href,'divid');if(divId)
{switchContent(divId);}
else
{switchContent(g_firstDivId);}
dakisBackToTop();}
var g_contentDivPrefix='div_leftMenuItem_';function switchContent(divNumber)
{var element=0;var index=0;var closeDownNeeded=0;if(g_isAnimatingContent==1)
{return;}
if(divNumber==g_curContentDivId)
{return;}
if(g_curContentDivId!=-1)
{if($(g_contentDivPrefix+g_curContentDivId))
{closeDownNeeded=1;}}
if(typeof g_lastDivId=="undefined")
{g_lastDivId=40;}
for(index=0;index<=g_lastDivId;index++)
{element=document.getElementById(g_contentDivPrefix+index);if(element)
{if(index==divNumber)
{if(g_curContentDivId==-1)
{Element.show(element);}
else
{if(closeDownNeeded==1)
{if(!g_designMode)
{g_isAnimatingContent=1;executeContentEffects($(g_contentDivPrefix+g_curContentDivId),element);height=$('middleTableRightDiv_general').offsetHeight;if(height!=undefined&&height!=null&&height!=0)
{$('middleTableRightDiv_general').style.height=height+'px';}}
else
{Element.hide($(g_contentDivPrefix+g_curContentDivId));Element.show(element);}
closeDownNeeded=0;}
else
{Element.show(element);}}
setLeftMenuSelected(index,1);}
else
{if(g_curContentDivId==-1){Element.hide(element);}
setLeftMenuSelected(index,0);}}}
g_curContentDivId=divNumber;}
function executeContentEffects(oldContent,newContent)
{new Effect.Parallel([new Effect.BlindUp(oldContent,{}),new Effect.BlindDown(newContent,{})],{duration:0.8,afterFinish:function(){onContentEffectsFinished();}});}
function onContentEffectsFinished()
{g_isAnimatingContent=0;$('middleTableRightDiv_general').style.height="";}
var g_leftMenuClassName="menuItemText";var g_leftMenuSelectedClassName="selectedMenuItemText";function setLeftMenuSelected(leftMenuId,selected)
{var leftMenuElement=document.getElementById('leftMenu_'+leftMenuId);var className=g_leftMenuClassName;if(selected){className=g_leftMenuSelectedClassName;}
if(leftMenuElement)
{leftMenuElement.setAttribute('class',className);leftMenuElement.setAttribute('className',className);}}
function getURLParam(strParamName)
{return getURLParamFromHref(window.location.href,strParamName);}
function getURLParamFromHref(strHref,strParamName)
{var strReturn="";if(strHref.indexOf("#")>-1)
{var strQueryString=strHref.substr(strHref.indexOf("#")).toLowerCase();var aQueryString=strQueryString.split("&");for(var iParam=0;iParam<aQueryString.length;iParam++)
{if(aQueryString[iParam].indexOf(strParamName+"=")>-1)
{var aParam=aQueryString[iParam].split("=");strReturn=aParam[1];break;}}}
return strReturn;}
function ExpandableMenu(nbMenuItems)
{this.menuItemStates=new Array(nbMenuItems);for(i=0;i<nbMenuItems;i++)
{this.menuItemStates[i]=-1;}
this.animate=1;this.toggleMenuItem=ExpandableMenu_toggleExpandableMenu;this.setMenuState=ExpandableMenu_setMenuState;this.collapseAll=ExpandableMenu_collapseAll;this.refreshMenuState=ExpandableMenu_refreshMenuState;}
function ExpandableMenu_toggleExpandableMenu(menuIndex)
{this.setMenuState(menuIndex,!this.menuItemStates[menuIndex]);}
function ExpandableMenu_collapseAll()
{for(i=0;i<this.menuItemStates.length;i++)
{this.setMenuState(i,0);}}
function ExpandableMenu_setMenuState(menuIndex,expanded)
{var elementPrefix='expandableMenuItem_';var element=document.getElementById(elementPrefix+menuIndex);var imgElement=document.getElementById(elementPrefix+menuIndex+'_img');var displayStr="";var imageSrc="expandedArrow.bmp";if(!expanded)
{displayStr="none";imageSrc="collapsedArrow.bmp";}
if(element)
{if(this.menuItemStates[menuIndex]==-1||this.animate==0)
{element.style.display=displayStr;}
else
{if(expanded)
{new Effect.OpenUp(elementPrefix+menuIndex,{duration:0.5,queue:'end'});}
else
{new Effect.CloseDown(elementPrefix+menuIndex,{duration:0.5,queue:'end'});}}
this.menuItemStates[menuIndex]=expanded;if(imgElement)
{imgElement.setAttribute('src',imageSrc);}}}
function ExpandableMenu_refreshMenuState()
{this.animate=0;for(i=0;i<this.menuItemStates.length;i++)
{this.setMenuState(i,this.menuItemStates[i]);}
this.animate=1;}
function getCookie(name){var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}
if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end));}
function setCookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
function deleteCookie(name,path,domain){if(getCookie(name))document.cookie=name+"="+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}
function getDocDomain()
{var domain=document.domain;var url=document.URL;var domainPos=url.indexOf(domain);var portBeginPos=url.indexOf(":",domainPos);if(portBeginPos==-1){return domain;}
var portEndPos=url.indexOf("/",portBeginPos);if(portEndPos==-1){return domain;}
domain=domain+":"+url.substring(portBeginPos+1,portEndPos);return domain;}
function getDocDomainDir()
{var url=document.URL;var lastSlashPos=url.lastIndexOf("/");var location=url.substring(0,lastSlashPos);return location+"/";}
function getBaseDocDomain()
{var docDomain=getDocDomain();var domains=docDomain.split(".");if(domains.length==2)
{return docDomain;}
var baseDomain="www."+domains[domains.length-2]+"."+domains[domains.length-1];return baseDomain;}
function dakisGetFileExtension(path)
{var extensionPos=path.lastIndexOf('.');if(extensionPos==-1)
{return"";}
return path.substring(extensionPos+1);}
function dakisSetFileExtension(path,extension)
{var extensionPos=path.lastIndexOf('.');if(extensionPos==-1)
{extensionPos=path.length;}
return path.substring(0,extensionPos)+extension}
function writeJsonCookie(name,value,days)
{if(days)
{var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else
var expires="";var parsedJson=$H(value).toJSON().gsub(",","~");document.cookie=name+"="+parsedJson+expires+"; path=/";}
function readJsonCookie(name)
{var cookies=document.cookie.split(';');var value=null;var cookie=cookies.find(function(c){var nameValuePair=c.split("=");return nameValuePair.first().strip()==name;});if(cookie!=null)
{var cookieValue=cookie.split("=").last();if(cookieValue.length>0)
{cookieValue=cookieValue.gsub("~",",");value=cookieValue.evalJSON();}}
return value;}
function eraseCookie(name)
{writeJsonCookie(name,"",-1);}
var g_designMode=false;var g_dakisAdRotatorImageWidth=60;var g_dakisAdRotatorImageHeight=60;var g_dakisAdRotatorDelay=13000;var g_dakisAdRotatorRandomOrder=false;var g_nbHoverImages=0;
function wireOnCartUpdated(cart)
{}
WireAjaxAPI={formatMoney:function(money,symbol,formatString)
{money=money.toString().replace(/\$|\,/g,'');if(isNaN(money))
{money="0";}
sign=(money==(money=Math.abs(money)));money=Math.floor(money*100+0.50000000001);cents=money%100;money=Math.floor(money/100).toString();if(cents<10)
{cents="0"+cents;}
for(var i=0;i<Math.floor((money.length-(1+i))/3);i++)
{money=money.substring(0,money.length-(4*i+3))+','+
money.substring(money.length-(4*i+3));}
returnedFormat=new String(formatString);s=money+'.'+cents;returnedFormat=returnedFormat.replace("%money",s);returnedFormat=returnedFormat.replace("%symbol",symbol);return((sign)?'':'-')+returnedFormat;},hashToQueryString:function(hash)
{if(Object.toQueryString==undefined)
{return Hash.toQueryString(hash);}
else
{return Object.toQueryString(hash);}},requestThroughScriptTag:function(host,controller,action,params,callback)
{if(callback==null||callback=="")
{alert("CALLBACK must be non null string, received an empty string");}
if(params instanceof Hash)
{params=WireAjaxAPI.hashToQueryString(params);}
params=params+"&token="+WireAjaxAPI.token;params=params+"&rnd="+Math.random();params=params+"&query_timestamp="+new Date().getTime();var url=host+"/"+controller+"/"+action+"?"+params;var headTag=document.getElementsByTagName("head").item(0);var scriptTag=document.createElement("script");scriptTag.setAttribute('src',url+"&jscript_callback="+callback);headTag.appendChild(scriptTag);},cart:null,token:"not specified"}
var DakisCart=Class.create();DakisCart.prototype={initialize:function()
{},init:function(sessionId,retailerGuid,lang,host)
{this.sessionId=sessionId;this.retailerGuid=retailerGuid;this.lang=lang;this.host=host;this.lastCartUpdateTimestamp=(new Date().getTime())-1;this.initialized=true;},update:function()
{if(!this.updating)
{var params=new Hash({retailer_guid:this.retailerGuid,session_id:this.sessionId,lang:this.lang});this.updating=true;WireAjaxAPI.requestThroughScriptTag(this.host,"cart","index",params,"WireAjaxAPI.cart.updateCart");}},buy:function(merchandiseId,returnToUrl)
{if(typeof(returnToUrl)=="undefined")
{returnToUrl="";}
var params=new Hash({retailer_guid:this.retailerGuid,session_id:this.sessionId,lang:this.lang,merchandise_id:merchandiseId,return_to_url:returnToUrl});this.updating=true;WireAjaxAPI.requestThroughScriptTag(this.host,"cart","add_item",params,"WireAjaxAPI.cart.updateCart");},buyWarranty:function(warranty_type,warranty_object_id,merchandise_id)
{if(!this.updating)
{var params=new Hash({retailer_guid:this.retailerGuid,session_id:this.sessionId,lang:this.lang,warranty_type:warranty_type,warranty_object_id:warranty_object_id,parent_object_id:merchandise_id});WireAjaxAPI.requestThroughScriptTag(this.host,"cart","add_item",params,"WireAjaxAPI.cart.afterCartWarranty");}},afterCartWarranty:function(cartResponse)
{var holder=$('warranty_holder');if(holder!=null&&g_textAfterAddWarrantyToCart!=null)
holder.update(g_textAfterAddWarrantyToCart);WireAjaxAPI.cart.updateCart(cartResponse);},changeItemQuantity:function(shoppingCartItemId,quantity)
{this.changeItem(shoppingCartItemId,{action:"set_item_quantity",quantity:quantity});},decrementItem:function(shoppingCartItemId,quantity)
{if(quantity==null||quantity>0)
this.changeItem(shoppingCartItemId,{action:"decrement_item",quantity:quantity});},incrementItem:function(shoppingCartItemId,quantity)
{if(quantity==null||quantity>0)
this.changeItem(shoppingCartItemId,{action:"increment_item",quantity:quantity});},removeItem:function(shoppingCartItemId)
{this.changeItem(shoppingCartItemId,{action:"remove_item"});},updateCart:function(cartResponse)
{this.updating=false;var queryTimestamp=parseInt(cartResponse.query_timestamp,10);if(queryTimestamp>this.lastCartUpdateTimestamp)
{cart=cartResponse.data;var element=$("promotion_pass_code");if(element!=null&&cart["promotion_pass_code"]!=null)
{element.value=cart["promotion_pass_code"];}
this.lastCartUpdateTimestamp=queryTimestamp;wireOnCartUpdated(cart);}},changeItem:function(shoppingCartItemId,options)
{if(!this.updating)
{options=$H(options);var action=options.unset("action");var params=new Hash({retailer_guid:this.retailerGuid,session_id:this.sessionId,lang:this.lang,shopping_cart_item_id:shoppingCartItemId});params=params.merge(options);this.updating=true;WireAjaxAPI.requestThroughScriptTag(this.host,"cart",action,params,"WireAjaxAPI.cart.updateCart");}},setPromotionPass:function(code)
{if(this.updating)
{window.setTimeout(200,function(){this.setPromotionPass(code);}.bind(this));}
else
{var params=new Hash({retailer_guid:this.retailerGuid,session_id:this.sessionId,lang:this.lang,promotion_pass_code:code});this.updating=true;WireAjaxAPI.requestThroughScriptTag(this.host,"cart","set_promotion_pass",params,"WireAjaxAPI.cart.updateCart");}},sessionId:0,retailerGuid:"0",lang:"en",host:"",initialized:false,lastCartUpdateTimestamp:0,updating:false}
WireAjaxAPI.cart=new DakisCart();var g_importers=[];var DakisProductAdvertiser2=Class.create();DakisProductAdvertiser2.prototype={initialize:function(containerElementId,productTemplateElementId)
{this.containerElementId=containerElementId;this.productTemplateElementId=productTemplateElementId;},start:function()
{this.loadProducts();},setTimer:function()
{setTimeout((function(){this.showNextProduct()}).bind(this),this.delay);},showNextProduct:function()
{if(this.getNbProducts()<=1)
{return;}
containerElement=$(this.containerElementId);curProduct=containerElement.childNodes[this.curDisplayedIndex];new Effect.Fade(curProduct,{queue:'end',duration:0.5,afterFinish:(function(){this.showNextProductAfterFade()}).bind(this)});},showNextProductAfterFade:function()
{containerElement=$(this.containerElementId);nbProducts=this.getNbProducts();this.curDisplayedIndex=(this.curDisplayedIndex+1)%nbProducts;curProduct=containerElement.childNodes[this.curDisplayedIndex];new Effect.Appear(curProduct,{queue:'end',duration:0.5});this.setTimer();},getNbProducts:function()
{containerElement=$(this.containerElementId);return containerElement.childNodes.length;},loadProducts:function()
{containerElement=$(this.containerElementId);containerElement.innerHTML="";containerElement.style.display="none";var importer=new DakisShowcasedMerchandiseImporter(this.productTemplateElementId,this.containerElementId);importer.host=this.host;importer.serverAction="merchandise";importer.imageWidth=this.imageWidth;importer.imageHeight=this.imageHeight;importer.tags="advertised";importer.maxMerchandises=7;importer.retailer_guid=this.retailer_guid;importer.lang=this.lang;importer.afterMerchandiseImported=this.afterMerchandiseImported;importer.afterFinish=(this.afterAllProductImported).bind(this);importer.start();},afterAllProductImported:function()
{containerElement=$(this.containerElementId);nbProducts=containerElement.childNodes.length;for(i=0;i<nbProducts;i++)
{containerElement.childNodes[i].style.display="none";}
containerElement.style.display="";this.curDisplayedIndex=parseInt(this.firstIndex%nbProducts);containerElement.childNodes[this.curDisplayedIndex].style.display="";this.setTimer();},delay:5000,imageWidth:100,imageHeight:100,containerElementId:null,productTemplateElementId:null,host:null,lang:'en',retailer_guid:null,curDisplayedIndex:0,firstIndex:0};var DakisShowcasedMerchandiseImporter=Class.create();DakisShowcasedMerchandiseImporter.prototype={initialize:function(templateHtmlElementId,containerHtmlElementId)
{dakisAssert($(templateHtmlElementId)!==undefined,"DakisShowcasedMerchandiseImporter: templateHtmlElementId is undefined!");dakisAssert($(containerHtmlElementId)!==undefined,"DakisShowcasedMerchandiseImporter: containerHtmlElementId is undefined!");this.htmlTemplate=$(templateHtmlElementId).innerHTML;this.htmlTemplate=this.htmlTemplate.replace("<!--","");this.htmlTemplate=this.htmlTemplate.replace("-->","");this.containerId=containerHtmlElementId;},start:function()
{var options=new Hash({retailer_guid:this.retailer_guid,lang:this.lang,presentation:"overview",count:this.maxMerchandises,output_format:"json",tags:this.tags});g_importers[this.containerId]=this;WireAjaxAPI.requestThroughScriptTag(this.host,"merchandise","",options,"g_importers['"+this.containerId+"'].importMerchandises");},afterMerchandiseImported:function(id,merchandise,nbMerchandises)
{},afterFinish:function()
{},importMerchandises:function(response)
{decision_models=response["data"]["decision_models"];if(decision_models==null||decision_models.length==0)
{return;}
this.specsDefinitions=response["data"]["decision_models"][0]["products"][0]["specs"];this.currency=response["data"]["definitions"]["currency"];k=0;merch_length=response["data"]["page"]["count"];for(var i=0;i<decision_models.length;i++)
{merchandises=decision_models[i]["products"];for(var j=0;j<merchandises.length;j++)
{this.createMerchandise(merchandises[j],k,merch_length);k++;}}
this.afterFinish();},createMerchandise:function(merchandiseInfo,id,nbMerchandises)
{var merchandise=new DakisMerchandise(merchandiseInfo.guid);merchandise.setName(merchandiseInfo.brand+" "+merchandiseInfo.text);merchandise.setSpecs(merchandiseInfo.specs.categories[0].specs,this.specsDefinitions);merchandise.setRegPrice(WireAjaxAPI.formatMoney(merchandiseInfo.regular_price,this.currency.symbol,this.currency.format));merchandise.setSalePrice(WireAjaxAPI.formatMoney(merchandiseInfo.final_price,this.currency.symbol,this.currency.format));merchandise.setSaleText(merchandiseInfo.display_text);merchandise.imageWidth=this.imageWidth;merchandise.imageHeight=this.imageHeight;merchandise.setImageUrl(merchandiseInfo["images"][0]);merchandise.setHidePriceEnabled(merchandiseInfo.hide_price=="1");var flag="default";if(Math.abs(parseFloat(merchandiseInfo.final_price)-parseFloat(merchandiseInfo.regular_price))>0.01)
{flag="sale";}
merchandise.setFlag(flag);merchandise.setMAP(merchandiseInfo.map);this.importMerchandise(merchandise,merchandiseInfo.guid,id,nbMerchandises);},importMerchandise:function(merchandise,guid,id,nbMerchandises)
{var html=this.htmlTemplate;var idStr=this.containerId+"DakisProduct"+id;html=this.replaceTag(html,"Id",idStr);html=this.replaceTag(html,"Name",merchandise.name);html=this.replaceTag(html,"Specs",merchandise.specs);html=this.replaceTag(html,"RegPrice",merchandise.regPrice);html=this.replaceTag(html,"SalePrice",merchandise.salePrice);html=this.replaceTag(html,"SaleText",merchandise.saleText);html=this.replaceTag(html,"ImageUrl",merchandise.imageUrl);html=this.replaceTag(html,"Guid",guid);html=stringReplace(html,"<!--","");html=stringReplace(html,"-->","");var flag=merchandise.flag;if(flag=="default")
{flag="featured";}
html=this.replaceTag(html,"Flag",flag);var element=document.createElement("div");element.innerHTML=html;$(this.containerId).appendChild(element);this.afterMerchandiseImported(idStr,merchandise,nbMerchandises);},replaceTag:function(text,tag,value)
{return stringReplace(text,"#dakisProduct"+tag+"#",value);},imageWidth:100,imageHeight:100,maxMerchandises:50,serverAction:"merchandise",specsDefinitions:null,containerId:null,tags:null,lang:null,retailer_guid:null,host:null,htmlTemplate:"",currency:null};var DakisMerchandise=Class.create();DakisMerchandise.prototype={initialize:function(productGuid)
{this.productGuid=productGuid;this.hidePriceEnabled=false;},load:function()
{this.getMerchandiseInformation();},setName:function(name)
{this.name=name;},setSpecs:function(specs)
{var specHtml="";for(var i=0;i<specs.length;i++)
{var values=Object.values(specs[i].values);var valueHtml="<p>-";var curValueCount=0;for(var j=0;j<values.length;j++)
{if(this.isSpecValid(values[j].text))
{if(curValueCount>0)
{valueHtml+=",";}
valueHtml+=" "+values[j].text;if(specs[i].measure_unit!=null)
{valueHtml+=" "+specs[i].measure_unit;}
curValueCount++;}}
valueHtml+="</p>";if(curValueCount>0)
{specHtml+=valueHtml;}}
this.specs=specHtml;},setRegPrice:function(price)
{if(this.hidePriceEnabled)
{this.regPrice="";}
else
{this.regPrice=price;}},setSalePrice:function(price)
{if(this.hidePriceEnabled)
{this.salePrice="";}
else
{this.salePrice=price;}},setSaleText:function(text)
{this.saleText=text;},setImageUrl:function(url)
{url=url.replace("%width",this.imageWidth);url=url.replace("%height",this.imageHeight);this.imageUrl=url;},setFlag:function(flag)
{this.flag=flag;},setHidePriceEnabled:function(enabled)
{this.hidePriceEnabled=enabled;if(enabled)
{this.regPrice="";this.salePrice="";}},setMAP:function(MAP)
{this.MAP=MAP;},productGuid:null,name:"",regPrice:"",salePrice:"",saleText:"",specs:"",imageUrl:"",flag:"",MAP:false,regPriceBindingId:"",salePriceBindingId:"",nameBindingId:"",specsBindingId:"",flagBingingId:"",imageUrlBindingId:"",imageWidth:100,imageHeight:100,onLoadCompleted:function(dakisMerchandise)
{this.updateHtml();},onMerchandiseInformationCompleted:function(infoJsonString)
{var info=eval('('+infoJsonString+')');this.setName(info.name);this.setRegPrice(info.regPrice);this.setSalePrice(info.salePrice);this.setSaleText(info.saleDisplayText);this.setImageUrl(info.imageUrl);this.setSpecs(info.specs);this.setFlag(info.flag);this.setMAP(info.map);this.setHidePriceEnabled(info.hide_price=="1");this.onLoadCompleted(this);},updateHtml:function()
{if($(this.nameBindingId)!==undefined)
{$(this.nameBindingId).innerHTML=this.name;}
if($(this.specsBindingId)!==undefined)
{$(this.specsBindingId).innerHTML=this.specs;}
if($(this.regPriceBindingId)!==undefined)
{$(this.regPriceBindingId).innerHTML=this.regPrice;}
if($(this.salePriceBindingId)!==undefined)
{$(this.salePriceBindingId).innerHTML=this.salePrice;}
if($(this.imageUrlBindingId)!==undefined)
{$(this.imageUrlBindingId).src=this.imageUrl;}
if($(this.flagUrlBindingId)!==undefined)
{$(this.flagUrlBindingId).innerHTML=this.flag;}},isSpecValid:function(spec)
{if(spec==null||spec==""||spec=="non applicable"||spec=="not applicable"||spec=="unknown")
{return false;}
return true;}};function dakisAssert(condition,message)
{if(condition===false)
{if(g_dakisDebug===true)
{alert("ASSERTION FAILED: "+message);}
g_dakisTrace.traceError(message);}}
function stringReplace(string,oldValue,newValue)
{var parts=string.split(oldValue);var newString=parts.join(newValue);return newString;}
var isIE=document.all&&navigator.userAgent.indexOf("Opera")==-1;var RedBox2={showInline:function(id,dimensions)
{this.showOverlay();this.moveWindowContents(id);this.setWindowPosition(dimensions);new Effect.Appear('RB_window',{duration:0.4,queue:'end'});},loading:function(dimensions)
{$('page_loader').show();},addHiddenContent:function(id,dimensions)
{this.showOverlay();this.removeChildrenFromNode($('RB_window'));this.moveChildren($(id),$('RB_window'));Element.hide('page_loader');this.setWindowPosition(dimensions);Element.show('RB_window');},close:function()
{Element.hide('RB_window');Element.hide('RB_overlay');this.showSelectBoxes();},showOverlay:function()
{if($('RB_redbox'))
{}
else
{new Insertion.Top(document.body,'<div id="RB_redbox" align="center"><div id="RB_window" style="display: none;"></div><div id="RB_overlay" style="display: none;"></div></div>');new Insertion.Bottom('RB_redbox','<div id="RB_loading" style="display: none"></div>');}
this.setOverlaySize();this.hideSelectBoxes();Element.show('RB_overlay');},setOverlaySize:function()
{if(window.innerHeight&&window.scrollMaxY)
{yScroll=window.innerHeight+window.scrollMaxY;}
else if(document.body.scrollHeight>document.body.offsetHeight)
{yScroll=document.body.scrollHeight;}
else
{yScroll=document.body.offsetHeight;}
$("RB_overlay").style['height']=yScroll+"px";},getScrollYPos:function()
{var ypos=0;if(isIE)
ypos=document.documentElement.scrollTop;else
ypos=window.pageYOffset;if(ypos==null)
ypos=0;return ypos;},setWindowPosition:function(dimensions)
{if(dimensions===undefined)
dimensions={};var pagesize=this.getPageSize();var rb_window=$('RB_window');var rb_redbox=$('RB_redbox');var width=dimensions.width;var height=dimensions.height;if(width===undefined)
{rb_window.style['width']='auto';width=rb_window.getDimensions().width;}
else
{rb_window.style['width']=width+'px';}
if(height===undefined)
{rb_window.style['height']='auto'
height=rb_window.getDimensions().height;}
else
{rb_window.style['height']=height+'px';}
rb_window.style['left']=((pagesize[0]-width)/2)+"px";if(Element.getStyle(rb_redbox,'position')=='absolute')
{rb_window.style['top']=(this.getScrollYPos()+(pagesize[1]-height)/2)+"px";}
else if(Element.getStyle(rb_redbox,'position')=='fixed')
{rb_window.style['top']=((pagesize[1]-height)/2)+"px";}},getPageSize:function(){var de=document.documentElement;var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;arrayPageSize=new Array(w,h)
return arrayPageSize;},removeChildrenFromNode:function(node)
{while(node.hasChildNodes())
{node.removeChild(node.firstChild);}},moveChildren:function(source,destination)
{while(source.hasChildNodes())
{source.firstChild.hide();destination.appendChild(source.firstChild);}},cloneWindowContents:function(id)
{var content=$(id).cloneNode(true);content.style['display']='block';$('RB_window').appendChild(content);this.setWindowPosition();},moveWindowContents:function(id)
{var content=$(id);if(content.parentNode.id!=='RB_window')
{this.moveChildren($('RB_window'),document.body);content.parentNode.removeChild(content);$('RB_window').appendChild(content);Element.show(id);}
this.setWindowPosition();},hideSelectBoxes:function()
{selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="hidden";}},showSelectBoxes:function()
{selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="visible";}}}
function initializeFlashBanners(flashRotatorFile)
{
var imagePath = "./bannerImages/";
if( typeof(g_dakisBannerImagePath) != "undefined" )
{
imagePath = g_dakisBannerImagePath;
}
var dakisBanner = $("dakisBanner");
if( dakisBanner != null )
{
resizeToFitParentElement(dakisBanner);
flashBanner = new DakisDHEBanner(flashRotatorFile,"dakisBanner",imagePath, 7000, g_dakisBannerIsTransparent);
}
}
function initializeCartIndicator()
{
var nbItemElement = $('dakisCartIndicatorNbItems');
var subtotalElement = $('dakisCartIndicatorSubtotal');
// need to get the cart indicator data from the wire?
if( nbItemElement != null || subtotalElement != null )
{
WireAjaxAPI.cart.update();
}
}
function showCurrentSection()
{
g_contentHeaderHeight = 90;
adjustContentDivHeight();
refreshVisibleContentDiv();
if( $('middleTableRightDiv_general_switching') != null )
{
$('middleTableRightDiv_general_switching').style.visibility = "visible";
}
}
function onCartUpdated(cart)
{
var nbItemElement = $('dakisCartIndicatorNbItems');
var subtotalElement = $('dakisCartIndicatorSubtotal');
if( nbItemElement != null )
{
nbItemElement.innerHTML = cart.total_items;
}
if( subtotalElement != null )
{
subtotalElement.innerHTML = WireAjaxAPI.formatMoney(cart.sub_total, cart.currency.symbol, cart.currency.format);
}
// if the cart content is visible, update!
if( typeof(updateCartContent) != "undefined" )
{
updateCartContent(cart);
}
}
function compareSelectedProducts()
{
var params = "?";
var comparison = readComparison();
comparison.values.each( function( guid ){
params += "catalog[product_guids][]="+guid+"&";
});
if( comparison.values.length > 1 )
{
window.location = g_comparisonPageFile+params;
}
else if( comparison.values.length == 1 )
{
window.location = g_specsheetPageFile+params;
}
}
function resetComparison()
{
eraseCookie( g_comparisonCookieName );
$$( "input.comparison" ).each( function(checkbox){ checkbox.enable(); checkbox.checked = false; } );
}
function recoverComparison()
{
var comparison = readComparison();
comparison.ids.each( function(checkboxId){
var element = $(checkboxId);
if( element != null )
$(checkboxId).checked = true;
});
disableRemaining( comparison.ids, comparison.css );
}
function onComparisonChecked( checkbox )
{
// first, store or remove compared product in client side cookie
var comparison = readComparison();
comparison.ids = comparison.ids.reject( function( checkboxId ){ return checkboxId == checkbox.id } );
comparison.values = comparison.values.reject( function( value ){ return value == checkbox.value } );
if( checkbox.checked )
{
comparison.values.push( checkbox.value );
comparison.ids.push( checkbox.id );
}
if( comparison.css == null || comparison.css == "" )
{
comparison.css = checkbox.className.split(" ").find( function(e){
return e.indexOf( "comparable" ) != -1;
});
}
if( comparison.ids.length == 0 )
comparison.css = "";
writeJsonCookie( g_comparisonCookieName, comparison, 1 );
// secondly, disable uncomparable products (this can happen when using the product search)
// and also disable any other comparable product if we reach 3 products
disableRemaining( comparison.ids, comparison.css );
}
function disableRemaining( ids, comparableCss )
{
$$( "input.comparison" ).each( function(checkbox){
var disabled = false;
if( comparableCss != null && comparableCss.length > 0 && !checkbox.hasClassName( comparableCss ) )
disabled = true;
if( !disabled && ids.length >= 3 && !ids.include( checkbox.id ))
disabled = true;
if( disabled )
checkbox.disable();
else
checkbox.enable();
});
}
function readComparison()
{
return readJsonCookie( g_comparisonCookieName ) || { 'ids':[], 'values':[], 'css':"" };
}
function onSpecClick( specId, dmGuid )
{
params = new Hash({ include_description: true,
count: 1000,
lang: g_lang,
include_values: false,
output_format: "json" } );
params = Object.toQueryString(params) + "&spec_ids[]="+specId + "&decision_model_guids[]="+dmGuid;
WireAjaxAPI.requestThroughScriptTag( g_dakisWireServer, "specification", "", params, 'specClickCallback');
}
function specClickCallback( wiredata )
{
spec = Object.values(wiredata["data"]["specifications"])[0]["categories"][0]["specs"][0];
if( spec != null )
{
var dialog = $("popup_dialog");
dialog.select( ".popup_dialog_header").first().update( spec.text );
dialog.select( ".popup_dialog_body").first().update( spec.description );
dialog.select( ".popup_dialog_footer").first().update(
new Element( "a", { href:"#" } ).update( g_textClose ).observe( "click", function(e){ e.stop(); RedBox2.close(); } )
);
RedBox2.showInline( 'popup_dialog', { width:640 } );
}
}
function alertAddToCart( productImageSrc, productText, merchandise_id, json_warranty )
{
// warranty
var warrantyArray = null;
if(json_warranty != '')
warrantyArray = eval('(' + json_warranty + ')');
// show add to cart dialog
var dialog = $("popup_dialog");
dialog.select( ".popup_dialog_header").first().update( g_textProductAddedToCart );
dialog.select( ".popup_dialog_body").first().update( createProductInfoTable( productImageSrc, productText ) );
dialog.select( ".popup_dialog_footer").first().update( new Element("span", {id:'warranty_holder'})
).insert( "&nbsp;", { position:"bottom" }
).insert( new Element( "a", { href:"#", style:"margin-right:6px;" } ).update( g_textContinueShopping ).observe( "click", function(e){ e.stop(); RedBox2.close(); } )
).insert( "&nbsp;", { position:"bottom" }
).insert(new Element( "a", { href: g_shoppingCartPageFile } ).update( g_textGoToCart ).observe( "click", function(e){ RedBox2.close(); } ),{ position:"bottom" }
);
if(warrantyArray != null)
{
$('warranty_holder').update( createWarrantyDropDown(warrantyArray)
).insert( "&nbsp;", { position:"bottom" }
).insert( new Element( "a", { href:"#", style:"margin-right:6px; cursor:pointer;" } ).update( g_textAddWarrantyToCart ).observe( "click", function(e){ e.stop(); processWarranty(merchandise_id); } ) ) ;
}
RedBox2.showInline( 'popup_dialog', { width:640 } );
$$('#RB_window select').each(function(elem){elem.style.visibility = "visible";});
}
function createProductInfoTable( imageSrc, text )
{
/* <table class="popup_product" style="display:none;">
<tr>
<td><p class="image_container"><img src=""></p></td>
<td><p class="text_container"></p></td>
</tr>
</table> */
var pTable = "<table class=\"popup_product\">";
pTable += "<tr>";
pTable += "<td><p class=\"image_container\"><img src=\"" + imageSrc + "\"></p></td>";
pTable += "<td><p class=\"text_container\">" + text + "</p></td>";
pTable += "</tr>";
pTable += "</table>";
return pTable;
}
function createWarrantyDropDown( warrantyArray )
{
if( warrantyArray == '' )
return null;
var html = "<select id='curent_item_warranties' style='width: 160px;'>";
html += "<option>" + g_textWarrantySelect + "</option>";
warrantyArray.each( function( warrantyObj ){
var price = WireAjaxAPI.formatMoney( warrantyObj['price'], cart.currency.symbol, cart.currency.format );
html += "<option value=" + warrantyObj['type'] + "_" + warrantyObj['id'] + ">" + warrantyObj['text'] + " - " + g_textWarrantyPrice + ": " + price + "</option>";
});
html += "</select>";
return html;
}
function processWarranty(merchandise_id)
{
var warranty = $('curent_item_warranties').value;
re = new RegExp(/^(ProductLineWarranty|MerchandiseWarranty)_\d+$/);
if( re.exec(warranty) != null )
{
var warranty_type = warranty.split('_')[0];
var warranty_id = warranty.split('_')[1];
WireAjaxAPI.cart.buyWarranty( warranty_type, warranty_id, merchandise_id );
}
}
function showLargeProductImage( imageElement, title )
{
// show add to cart dialog
var dialog = $("popup_dialog");
dialog.select( ".popup_dialog_header").first().update( title );
var imgElement = $(imageElement);
dialog.select( ".popup_dialog_body").first().update(
new Element( "p", { "class": "large_image_container" } ).update(
new Element( "img", { src:imgElement.src, alt:title } )
)
);
dialog.select( ".popup_dialog_footer").first().update(
new Element( "a", { href:"#" } ).update( g_textClose ).observe( "click", function(e){ e.stop(); RedBox2.close(); } )
);
RedBox2.showInline( 'popup_dialog' );
}
function dakisGoToPrintApp(appVersion, params, printAppServerUrl)
{
var layout = "index.html";
if( appVersion == "photo_prints_flash" )
{
layout = "onlinePrintFlash.html";
}
else if(appVersion == "gifts")
{
layout = "onlinePrintGift.html";
}
else if(appVersion == "gifts_flash")
{
layout = "onlinePrintGiftFlash.html";
}
else if(appVersion == "gift_editing")
{
layout = "onlinePrintGift.html";
}
if (!printAppServerUrl) {
printAppServerUrl = "http://photominator.mydakis.com";
}
goToPrintApp(printAppServerUrl, g_lang, "89373220-fa0c-012c-e3d0-001b631c2c70", appVersion, layout, params);
}
function dakisGoToCashierApp()
{
goToCashier("http://cashier.mydakis.com", g_lang, "89373220-fa0c-012c-e3d0-001b631c2c70", g_sessionId, "cashier.html");
}
var g_comparisonCookieName = "dakisComparison";
var g_giftCatalogPage = "gift_catalog.html";
wireOnCartUpdated = onCartUpdated;
