/* Simple JavaScript Inheritance * By John Resig http://ejohn.org/ * MIT Licensed. */ // Inspired by base2 and Prototype (function(){ var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; // The base Class implementation (does nothing) this.JClass = function(){}; // Create a new JClass that inherits from this JClass JClass.extend = function(prop) { var _super = this.prototype; // Instantiate a base class (but only create the instance, // don't run the init constructor) initializing = true; var prototype = new this(); initializing = false; // Copy the properties over onto the new prototype for (var name in prop) { // Check if we're overwriting an existing function prototype[name] = typeof prop[name] == "function" && typeof _super[name] == "function" && fnTest.test(prop[name]) ? (function(name, fn){ return function() { var tmp = this._super; // Add a new ._super() method that is the same method // but on the super-class this._super = _super[name]; // The method only need to be bound temporarily, so we // remove it when we're done executing var ret = fn.apply(this, arguments); this._super = tmp; return ret; }; })(name, prop[name]) : prop[name]; } // The dummy class constructor function JClass() { // All construction is actually done in the init method if ( !initializing && this.init ) this.init.apply(this, arguments); } // Populate our constructed prototype object JClass.prototype = prototype; // Enforce the constructor to be what we expect JClass.prototype.constructor = JClass; // And make this class extendable JClass.extend = arguments.callee; return JClass; }; })(); function dakisIsIE() {return((navigator.userAgent.toLowerCase().indexOf("msie")!=-1)&&!window.opera)?true:false;} function fakeFunction() {} 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.length==0) {alert("Gallery Image Error: The large gallery image element doesn't exist. Make sure an element has the id: "+fullImageElementId);return;} if(fullImageElement[0].nodeName.toLowerCase()!="img") {alert("Gallery Image Error: The large gallery must be an image. It is actually a: "+fullImageElement.tagName);return;} for(var i=0;i0) {$("#"+textElementId).html(this.alt);} if($("#"+fullImageElementId).attr("src")==largeFile) {return;} $("#"+fullImageElementId).attr("src",largeFile);};}};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;jQuery(image).fadeTo(120,0.6,function(){image.src=hoverSrc;jQuery(image).fadeTo(200,1.0);});} 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;jQuery(image).fadeTo(120,0.6,function(){image.src=originalSrc;jQuery(image).fadeTo(200,1.0);});} 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).css("opacity",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=jQuery(".dakisAdRotator");var firstIndex=0;if(g_dakisAdRotatorRandomOrder) {firstIndex=Math.random()*100;} for(var t=0;t0&&!merchandise.hidePriceEnabled) {regPriceElement.show();if(isMap) {regPriceElement.html("see price in cart!");}} if(isMap) {var ourPriceElement=$("#"+id+"_ourprice");if(ourPriceElement.length>0) {ourPriceElement.html(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('');} function redirectToPrintAppIfNeeded(serverUrl,lang,retailerGuid,appVersion) {try {var remote=isRemoteLayout;} catch(e) {redirectToPrintAppWhenReady(serverUrl,lang,retailerGuid,appVersion);}} function redirectToPrintAppWhenReady(serverUrl,lang,retailerGuid,appVersion) {if(typeof(g_websiteVersion)!="undefined"&&typeof(g_sessionId)!="undefined"&&g_sessionId!=0){redirectToPrintApp(serverUrl,lang,retailerGuid,appVersion);} else{setTimeout(function(){redirectToPrintAppWhenReady(serverUrl,lang,retailerGuid,appVersion);},100);}} function parseParams(merchandiseId) {var additional_params='gift_merchandise_id='+merchandiseId;jQuery("input.parametric").each(function(i,s){s=jQuery(s);if(s.attr("type")=="number"||s.attr("type")=="text"||(s.attr("type")=="radio"&&s.is(':checked'))) additional_params+='&'+s.attr("name")+'='+s.val();});dakisGoToPrintApp('gift_editing',additional_params);} 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=(typeof(g_baseURL)!=='undefined')?baseUrl=g_baseURL:getDocDomainDir();var pageFile=layoutFile;var baseRoute="/guid/"+retailerGuid+"/"+lang+"/photo/"+appVersion+"?";if(pageFile==null) {pageFile=window.location.pathname.substring(window.location.pathname.lastIndexOf("/")+1);} if(typeof(params)=="undefined"||params=="") {params="";} else {params="&"+params;if(appVersion=="pro_event") baseRoute="/guid/"+retailerGuid+"/"+lang+"/pro_event/login?";else if((params.lastIndexOf("gift_merchandise_id")!=-1)||(params.lastIndexOf("order_id")!=-1)) baseRoute="/guid/"+retailerGuid+"/"+lang+"/photo_gift/"+appVersion+"?";} if(appVersion=="photo_prints"){baseRoute="?";baseUrl=baseUrl.replace('://m.','://');params+="&cartUrl="+g_shoppingCartPageFile;} if(typeof(g_sessionId)=="undefined") {g_sessionId="";} var url=serverUrl+baseRoute+"base_url="+baseUrl+"&page_file="+pageFile+"&page_version="+g_websiteVersion+"&lang="+lang+"&session_id="+g_sessionId+"&retailer_guid="+retailerGuid+ params;if(typeof(g_gaLinker)!="undefined"&&g_gaLinker!=null) {url=g_gaLinker.decorate(url);} return url;} function redirectToCashierIfNeeded(serverUrl,lang,retailerGuid,sessionId,layoutFile) {try {var remote=isRemoteLayout;} catch(e) {redirectToCashierWhenReady(serverUrl,lang,retailerGuid,sessionId,layoutFile);}} function redirectToCashierWhenReady(serverUrl,lang,retailerGuid,sessionId,layoutFile) {if(typeof(g_websiteVersion)!="undefined"&&typeof(g_sessionId)!="undefined"&&g_sessionId!=0){redirectToCashier(serverUrl,lang,retailerGuid,sessionId,layoutFile);} else{setTimeout(function(){redirectToCashierWhenReady(serverUrl,lang,retailerGuid,sessionId,layoutFile);},100);}} 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;if(typeof(g_gaLinker)!="undefined"&&g_gaLinker!=null) {url=g_gaLinker.decorate(url);} return url;} function setElementClass(element,className) {jQuery(element).attr("class",className);jQuery(element).attr("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=JClass.extend({objectWidth:0,objectHeigth:0,htmlElementId:'dhe_flash_object',created:false,cssUrl:'none',flashUrl:'',className:'dhe_flash_object',callbackObj:'',randomized:false,init: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=DakisFlashObject.extend({imageDelay:5000,imagePath:'./../images/banner/',randomized:false,transparency:false,init: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="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}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.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=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(jQuery('#middleTableRightDiv_general').length==0) {return;} jQuery('#middleTableRight').height(10);} 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=jQuery("#"+g_contentDivPrefix+index);if(element.length>0) {if(index==divNumber) {if(g_curContentDivId==-1) {element.show();} else {if(closeDownNeeded==1) {if(!g_designMode) {g_isAnimatingContent=1;executeContentEffects(jQuery("#"+g_contentDivPrefix+g_curContentDivId),element);height=$('#middleTableRightDiv_general').height();if(height!=undefined&&height!=null&&height!=0) {jQuery('#middleTableRightDiv_general').height(height);}} else {jQuery("#"+g_contentDivPrefix+g_curContentDivId).hide();element.show();} closeDownNeeded=0;} else {element.show();}} setLeftMenuSelected(index,1);} else {if(g_curContentDivId==-1){element.hide();} setLeftMenuSelected(index,0);}}} g_curContentDivId=divNumber;} function executeContentEffects(oldContent,newContent) {jQuery(oldContent).hide(120,function(){jQuery(newContent).show(200);});} function onContentEffectsFinished() {g_isAnimatingContent=0;$('#middleTableRightDiv_general').css("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;iParam0) {cookieValue=cookieValue.replace(/~/g,",");value=cookieValue.evalJSON();}} return value;} function eraseCookie(name) {writeJsonCookie(name,"",-1);} (function($){var ajaxQueue=$({});$.ajaxQueue=function(ajaxOpts){var jqXHR,dfd=$.Deferred(),promise=dfd.promise();ajaxQueue.queue(doRequest);promise.abort=function(statusText){if(jqXHR){return jqXHR.abort(statusText);} var queue=ajaxQueue.queue(),index=$.inArray(doRequest,queue);if(index>-1){queue.splice(index,1);} dfd.rejectWith(ajaxOpts.context||ajaxOpts,[promise,statusText,""]);return promise;};function doRequest(next){jqXHR=$.ajax(ajaxOpts).done(dfd.resolve).fail(function(jqXHR,textStatus,errorThrown){console.log("fail");dfd.reject();}).then(next,next);} return promise;};})(jQuery);(function($){if(!$.support.cors&&$.ajaxTransport&&window.XDomainRequest){var httpRegEx=/^https?:\/\//i;var getOrPostRegEx=/^get|post$/i;var sameSchemeRegEx=new RegExp('^'+location.protocol,'i');var htmlRegEx=/text\/html/i;var jsonRegEx=/\/json/i;var xmlRegEx=/\/xml/i;$.ajaxTransport('* text html xml json',function(options,userOptions,jqXHR){if(options.crossDomain&&options.async&&getOrPostRegEx.test(options.type)&&httpRegEx.test(options.url)&&sameSchemeRegEx.test(options.url)){var xdr=null;var userType=(userOptions.dataType||'').toLowerCase();return{send:function(headers,complete){xdr=new XDomainRequest();if(/^\d+$/.test(userOptions.timeout)){xdr.timeout=userOptions.timeout;} xdr.ontimeout=function(){complete(500,'timeout');};xdr.onload=function(){var allResponseHeaders='Content-Length: '+xdr.responseText.length+'\r\nContent-Type: '+xdr.contentType;var status={code:200,message:'success'};var responses={text:xdr.responseText};try{if(userType==='html'||htmlRegEx.test(xdr.contentType)){responses.html=xdr.responseText;}else if(userType==='json'||(userType!=='text'&&jsonRegEx.test(xdr.contentType))){try{responses.json=$.parseJSON(xdr.responseText);}catch(e){status.code=500;status.message='parseerror';}}else if(userType==='xml'||(userType!=='text'&&xmlRegEx.test(xdr.contentType))){var doc=new ActiveXObject('Microsoft.XMLDOM');doc.async=false;try{doc.loadXML(xdr.responseText);}catch(e){doc=undefined;} if(!doc||!doc.documentElement||doc.getElementsByTagName('parsererror').length){status.code=500;status.message='parseerror';throw'Invalid XML: '+xdr.responseText;} responses.xml=doc;}}catch(parseMessage){throw parseMessage;}finally{complete(status.code,status.message,responses,allResponseHeaders);}};xdr.onprogress=function(){};xdr.onerror=function(){complete(500,'error',{text:xdr.responseText});};var postData='';if(userOptions.data){postData=($.type(userOptions.data)==='string')?userOptions.data:$.param(userOptions.data);} xdr.open(options.type,options.url);xdr.send(postData);},abort:function(){if(xdr){xdr.abort();}}};}});}})(jQuery);if(typeof(console)=="undefined"||typeof(console.log)=="undefined") {console={log:function(m){},error:function(m){},debug:function(m){}};} function dakisIncludeCss(url) {jQuery('head').append('');} var g_designMode=false;var g_dakisAdRotatorImageWidth=60;var g_dakisAdRotatorImageHeight=60;var g_dakisAdRotatorDelay=13000;var g_dakisAdRotatorRandomOrder=false;var g_nbHoverImages=0;var g_dakisBannerIsTransparent=true; function wireOnCartUpdated(cart) {} WireAjaxAPI={formatMoney:function(money,symbol,formatString) {if(typeof(symbol)=="undefined"||typeof(formatString)=="undefined") {return"";} if(money!=null) money=money.toString().replace(/\$|\,/g,'');else return"";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;i0) {var bodyElement=bodyList[0];var newdiv=document.createElement('div');newdiv.setAttribute('id','wait_message_div');newdiv.setAttribute('style','display: none; background-color: #555555; height: 200%; position: absolute; width: 100%; left: 0; top: 0; right: 0; bottom: 0; z-index: 100; opacity: 0.90; filter: alpha(opacity=90); zoom: 1;');newdiv.innerHTML="

PLEASE WAIT ...

";bodyElement.appendChild(newdiv);}} if(document.getElementById('wait_message_div')) {var waitMessageDiv=document.getElementById('wait_message_div');var scrollTop=document.body.scrollTop||document.documentElement.scrollTop;waitMessageDiv.style.top=scrollTop.toString()+"px";waitMessageDiv.style.display='block';} this.afterBuyFunction=afterBuyFunction;WireAjaxAPI.requestThroughScriptTag(this.host,"cart","add_item",params,function(result){WireAjaxAPI.cart.updateCartAndShowMessage(result);});}}},buyWarranty:function(warranty_type,warranty_object_id,merchandise_id) {if(!this.updating) {var params={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,function(result){WireAjaxAPI.cart.afterCartWarranty(result);});}},afterCartWarranty:function(cartResponse) {var holder=$('.warranty_holder');if(holder.length>0&&g_textAfterAddWarrantyToCart!=null) holder.html(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"});},updateCartFromTheWire:function() {var params={retailer_guid:this.retailerGuid,session_id:this.sessionId,lang:this.lang};this.updating=true;WireAjaxAPI.requestThroughScriptTag(this.host,"cart","index",params,function(result){WireAjaxAPI.cart.updateCart(result);});},updateCartWithEmptyData:function() {var currencySymbol=getCookie(this.currencySymbolCookie)||"";var emptyCartData={"sub_total":0.0,"currency":{"symbol":currencySymbol,"format":"%symbol%money","code":"","text":""},"items":{},"total_items":0};wireOnCartUpdated(emptyCartData);if(currencySymbol=="") {setTimeout(jQuery.proxy(function(){this.updateCartFromTheWire()},this),3000);}},updateCartAndShowMessage:function(cartResponse) {WireAjaxAPI.cart.updateCart(cartResponse);if(document.getElementById('wait_message_div')) {document.getElementById('wait_message_div').style.display='none';} if(this.afterBuyFunction!="") {eval(this.afterBuyFunction);this.afterBuyFunction="";}},updateCart:function(cartResponse) {this.updating=false;var queryTimestamp=parseInt(cartResponse.query_timestamp,10);if(queryTimestamp>this.lastCartUpdateTimestamp) {cart=cartResponse.data;var element=jQuery('#promotion_pass_code');if(element!=null&&cart["promotion_pass_code"]!=null) {element.value=cart["promotion_pass_code"];} this.lastCartUpdateTimestamp=queryTimestamp;wireOnCartUpdated(cart);} setCookie(this.currencySymbolCookie,cartResponse.data.currency.symbol)},changeItem:function(shoppingCartItemId,options) {if(!this.updating) {options=$H(options);var action=options.unset("action");var params={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,function(result){WireAjaxAPI.cart.updateCart(result);});}},setPromotionPass:function(code) {if(this.updating) {window.setTimeout(jQuery.proxy(function(){this.setPromotionPass(code);},this),200);} else {var params={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,function(result){WireAjaxAPI.cart.updateCart(result);});}},sessionId:0,retailerGuid:"0",lang:"en",host:"",initialized:false,lastCartUpdateTimestamp:0,updating:false,somethingAddedToCartCookie:"somethingAddedToCart",currencySymbolCookie:"currencySymbol"});WireAjaxAPI.cart=new DakisCart();var g_importers=[];var DakisProductAdvertiser2=JClass.extend({init:function(containerElementId,productTemplateElementId) {this.containerElementId=containerElementId;this.productTemplateElementId=productTemplateElementId;},start:function() {this.loadProducts();},setTimer:function() {setTimeout(jQuery.proxy(function(){this.showNextProduct()},this),this.delay);},showNextProduct:function() {if(this.getNbProducts()<=1) {return;} containerElement=$("#"+this.containerElementId);curProduct=$(containerElement.children()[this.curDisplayedIndex]);var self=this;curProduct.hide(500,function(){self.showNextProductAfterFade();});},showNextProductAfterFade:function() {containerElement=$("#"+this.containerElementId);nbProducts=this.getNbProducts();this.curDisplayedIndex=(this.curDisplayedIndex+1)%nbProducts;curProduct=$(containerElement.children()[this.curDisplayedIndex]);curProduct.show(500);this.setTimer();},getNbProducts:function() {containerElement=$("#"+this.containerElementId);return containerElement.children().length;},loadProducts:function() {containerElement=$("#"+this.containerElementId);containerElement.html("");containerElement.hide();var self=this;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=jQuery.proxy(this.afterMerchandiseImported,this);importer.afterFinish=jQuery.proxy(this.afterAllProductImported,this);importer.start();},afterAllProductImported:function() {containerElement=$("#"+this.containerElementId);nbProducts=containerElement.children().length;containerElement.children().hide();containerElement.show();this.curDisplayedIndex=parseInt(this.firstIndex%nbProducts);$(containerElement.children()[this.curDisplayedIndex]).show();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=JClass.extend({init:function(templateHtmlElementId,containerHtmlElementId) {dakisAssert(jQuery("#"+templateHtmlElementId).length>0,"DakisShowcasedMerchandiseImporter: templateHtmlElementId is undefined!");dakisAssert(jQuery("#"+containerHtmlElementId).length>0,"DakisShowcasedMerchandiseImporter: containerHtmlElementId is undefined!");this.htmlTemplate=jQuery("#"+templateHtmlElementId).html();this.htmlTemplate=this.htmlTemplate.replace("","");this.containerId=containerHtmlElementId;},start:function() {var options={wire_server:this.host,retailer_guid:this.retailer_guid,lang:this.lang,count:this.maxMerchandises,output_format:"json",tags:this.tags};if(location.search.indexOf("nocache")!=-1)options["nocache"]="1";g_importers[this.containerId]=this;var self=this;jQuery.getJSON("merchandises.php?"+jQuery.param(options)).success(function(result){self.importMerchandises(result);});},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;i0) {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);if(merchandiseInfo.regular_price!=merchandiseInfo.final_price) {strSaleText=' ';if((merchandiseInfo.saleText!=undefined)&&(merchandiseInfo.saleText!=null)&&(merchandise.saleText!='')) {strSaleText=merchandise.saleText+'
';} strOtherRebateText=' ';if((merchandiseInfo.other_rebate_text!=undefined)&&(merchandiseInfo.other_rebate_text!=null)) {strOtherRebateText=merchandiseInfo.other_rebate_text+'
';} strOtherRebateAmount=' ';if((merchandiseInfo.other_rebate_amount!=undefined)&&(merchandiseInfo.other_rebate_amount!=null)) {if(merchandiseInfo.other_rebate_amount!=0) {strOtherRebateAmount=WireAjaxAPI.formatMoney(merchandiseInfo.other_rebate_amount,this.currency.symbol,this.currency.format)+'
';}} strOtherRebateEnds=' ';if((merchandiseInfo.other_rebate_ends!=undefined)&&(merchandiseInfo.other_rebate_ends!=null)) {if(merchandiseInfo.other_rebate_ends!='') {strOtherRebateEnds='(ends on '+merchandiseInfo.other_rebate_ends+')'+'
';}} merchandise.setRotatorText('reg '+merchandise.regPrice+'
'+strSaleText+strOtherRebateText+strOtherRebateAmount+strOtherRebateEnds+merchandise.salePrice);} else {merchandise.setRotatorText(merchandise.salePrice);} 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,"RotatorText",merchandise.rotatorText);html=this.replaceTag(html,"ImageUrl",merchandise.imageUrl);html=this.replaceTag(html,"Guid",guid);html=stringReplace(html,"","");var flag=merchandise.flag;if(flag=="default") {flag="featured";} html=this.replaceTag(html,"Flag",flag);var element=document.createElement("div");jQuery(element).html(html);jQuery("#"+this.containerId).append(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=JClass.extend({init: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;i0) {valueHtml+=",";} valueHtml+=" "+values[j].text;if(typeof(specs[i].measure_unit)!="undefined"&&specs[i].measure_unit!=null) {valueHtml+=" "+specs[i].measure_unit;} curValueCount++;}} valueHtml+="

";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;},setRotatorText:function(text) {this.rotatorText=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:"",rotatorText:"",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(jQuery("#"+this.nameBindingId)!==undefined) {jQuery("#"+this.nameBindingId).html(this.name);} if(jQuery("#"+this.specsBindingId)!==undefined) {jQuery("#"+this.specsBindingId).html(this.specs);} if(jQuery("#"+this.regPriceBindingId)!==undefined) {jQuery("#"+this.regPriceBindingId).html(this.regPrice);} if(jQuery("#"+this.salePriceBindingId)!==undefined) {jQuery("#"+this.salePriceBindingId).html(this.salePrice);} if(jQuery("#"+this.imageUrlBindingId)!==undefined) {jQuery("#"+this.imageUrlBindingId).html(this.imageUrl);} if(jQuery("#"+this.flagUrlBindingId)!==undefined) {jQuery("#"+this.flagUrlBindingId).html(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){this.showOverlay();jQuery('#'+id).clone(true).css({display:'block'}).appendTo('#RB_window');jQuery("#RB_window").show(300);this.setWindowPosition();},addHiddenContent:function(id){jQuery("#RB_window").children().remove();jQuery('#'+id).children().appendTo('#RB_window');jQuery("#RB_loading").hide();jQuery("#RB_window").show(300);this.setWindowPosition();},loading:function(){this.showOverlay();jQuery('#RB_loading').show();this.setWindowPosition();},close:function(){jQuery(window).unbind("keyup",RedBox2.handleKeyUp);jQuery("#RB_window").hide(300).children().remove();jQuery("#RB_overlay").hide(300);},initContent:function(){if(jQuery('#RB_redbox').length){jQuery('#RB_redbox').children().remove();jQuery('#RB_redbox').html('');} else{jQuery('body').append('
');}},showOverlay:function(){this.initContent();jQuery("#RB_overlay").css({height:jQuery(document).height(),opacity:0.6}).show(300);},getScrollYPos:function(){var ypos=0;if(isIE) ypos=document.documentElement.scrollTop;else ypos=window.pageYOffset;if(ypos==null) ypos=0;return ypos;},setWindowPosition:function(){jQuery("#RB_window").css({width:'auto',height:'auto'});var left=(jQuery(window).width()-jQuery("#RB_window").width())/2;var top=(jQuery(window).height()-jQuery("#RB_window").height())/2-30+this.getScrollYPos();jQuery("#RB_window").css({left:left,top:top});jQuery(window).keyup(RedBox2.handleKeyUp);},handleKeyUp:function(e){if(e.keyCode==27){RedBox2.close();}}} function initializeFlashBanners(flashRotatorFile) { var imagePath = "./bannerImages/"; if( typeof(g_dakisBannerImagePath) != "undefined" ) { imagePath = g_dakisBannerImagePath; } var dakisBanner = jQuery('#dakisBanner'); if( dakisBanner.length > 0) { resizeToFitParentElement(dakisBanner); flashBanner = new DakisDHEBanner(flashRotatorFile,"dakisBanner",imagePath, 7000, g_dakisBannerIsTransparent); } } function initializeCartIndicator() { var nbItemElement = jQuery('#dakisCartIndicatorNbItems'); var subtotalElement = jQuery('#dakisCartIndicatorSubtotal'); // need to get the cart indicator data from the wire? if( nbItemElement.length > 0 || subtotalElement.length > 0 ) { WireAjaxAPI.cart.update(); } } function showCurrentSection() { g_contentHeaderHeight = 90; adjustContentDivHeight(); refreshVisibleContentDiv(); if( jQuery('#middleTableRightDiv_general_switching').length > 0 ) { jQuery('#middleTableRightDiv_general_switching').css("visibility", "visible"); } } function onCartUpdated(cart) { var nbItemElement = jQuery('#dakisCartIndicatorNbItems'); var subtotalElement = jQuery('#dakisCartIndicatorSubtotal'); if( nbItemElement.length > 0 ) { nbItemElement.html(cart.total_items); } if( subtotalElement.length > 0 ) { subtotalElement.html(WireAjaxAPI.formatMoney(cart.sub_total, cart.currency.symbol, cart.currency.format)); } // if the cart content is visible, update! if( typeof(updateCartContent) != "undefined" ) { updateCartContent(cart); } jQuery(document).trigger("cartUpdated", cart); } function compareSelectedProducts() { var params = "?"; var comparison = readComparison(); $.each(comparison.values, function (index, 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 () { $.removeCookie(g_comparisonCookieName); $('input .comparison').each(function (index, checkbox) { checkbox.prop('disabled', false); checkbox.checked = false; }); } function recoverComparison() { var comparison = readComparison(); $.each(comparison.ids, 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 = jQuery.grep(comparison.ids, function (checkboxId) { return checkboxId != checkbox.id; }); comparison.values = jQuery.grep(comparison.values, 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 = jQuery.inArray('comparable', checkbox.className.split(' ')); } if( comparison.ids.length == 0 ) comparison.css = ""; $.cookie(g_comparisonCookieName, comparison, {expires: 1, path: '/'}); // 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 (index, checkbox) { var disabled = false; if (comparableCss != null && comparableCss.length > 0 && !checkbox.hasClass(comparableCss) ) disabled = true; if (!disabled && ids.length >= 3 && !jQuery(checkbox.id, ids)) disabled = true; checkbox.prop('disabled', disabled); }); } function readComparison () { return $.cookie(g_comparisonCookieName) || {'ids': [], 'values': [], 'css': ''}; } function onSpecClick( specId, dmGuid ) { params = { include_description: true, count: 1000, lang: g_lang, include_values: false, output_format: "json", spec_ids: [specId], decision_model_guids: [dmGuid] }; WireAjaxAPI.requestThroughScriptTag( g_dakisWireServer, "specification", "", params, function(result){ specClickCallback(result, dmGuid); }); } function specClickCallback( wiredata, dmGuid ) { var spec = wiredata["data"]["specifications"][dmGuid]["categories"][0]["specs"][0]; if( spec != null ) { var dialog = $('#popup_dialog'); $("#popup_dialog .popup_dialog_header").first().html( spec.text ); $("#popup_dialog .popup_dialog_body").first().html( spec.description ); $("#popup_dialog .popup_dialog_footer").first().html(""+g_textClose+""); RedBox2.showInline( 'popup_dialog', { width:640 } ); } } function alertAddToCart( productImageSrc, productText, merchandise_id, json_warranty, accessoriesDivId ) { try { if(productImageSrc.indexOf("http://") == -1 && productImageSrc.indexOf("https://") == -1) productImageSrc = "http://" + productImageSrc; // warranty var warrantyArray = null; if(json_warranty != '') warrantyArray = eval('(' + json_warranty + ')'); // show add to cart dialog var dialog = $('#popup_dialog'); $("#popup_dialog .popup_dialog_header").first().html( g_textProductAddedToCart ); $("#popup_dialog .popup_dialog_body").first().html( createProductInfoTable( productImageSrc, productText ) ); $("#popup_dialog .popup_dialog_footer").first().html("") .append(" ") .append(""+g_textContinueShopping+"") .append(" ") .append(""+g_textGoToCart+""); if(warrantyArray != null) { $('.warranty_holder').html( createWarrantyDropDown(warrantyArray)) .append( " ", { position:"bottom" }) .append(""+g_textAddWarrantyToCart+""); } if( $("#accessory_section").length ) { $("#accessory_section").remove(); $("#accessory_hr").remove(); $("#accessory_separator").remove(); } if( accessoriesDivId !== undefined ) { if( $("#" + accessoriesDivId).length > 0 ) { $("#popup_dialog").first().append( "

" ); $("#accessory_section").first().append( $("#" + accessoriesDivId).html() ); $("#popup_dialog").first().css("width","800px"); } } RedBox2.showInline( 'popup_dialog', { width:640 } ); $('#RB_window select').css("visibility", "visible"); } catch(e) { // On some websites still using Prototype, we'll get error. // So instead of just failing, redirect to the cart. console.log("error adding to cart", e); window.location.href = g_shoppingCartPageFile; } } function createProductInfoTable( imageSrc, text ) { var pTable = ""; pTable += ""; pTable += ""; pTable += ""; pTable += ""; pTable += "

" + text + "

"; return pTable; } function createWarrantyDropDown( warrantyArray ) { if( warrantyArray == '' ) return null; var html = ""; return html; } function processWarranty(merchandise_id) { var warranty = $('.curent_item_warranties').last().val(); 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, text ) { $("#popup_dialog .popup_dialog_header").first().html( title ); var x = $("#popup_dialog .popup_dialog_body").first(); x.html("

"); var large_image_container = $('#large_image_container'); if (typeof(imageElement) != "undefined" && imageElement != null && imageElement.attr("src") != null) { large_image_container.html(""+title+""); } else if (typeof(text) != "undefined" ) { large_image_container.html( text ); } // END New code $("#popup_dialog .popup_dialog_footer").first().html(""+g_textClose+""); RedBox2.showInline( 'popup_dialog' ); } function switchProductImage( newSrc ) { $('#large_product_image').attr("src", newSrc.replace("%width", 500).replace("%height", 500)); $('#small_product_image').attr("src", newSrc.replace("%width", 400).replace("%height", 400)); } function dakisGoToPrintApp(appVersion, params, printAppServerUrl) { // use the new appVersion instead photo_prints... if(appVersion == "photo_prints") { printAppServerUrl = 'https://argus.mydakis.com'; } var layout = "onlinePrint.html"; if( appVersion == "photo_prints_flash" ) { layout = "#onlinePrintPageFile_flash_prints"; } else if(appVersion == "gifts") { layout = "onlinePrintGift.html"; } else if(appVersion == "gifts_flash") { layout = "#onlinePrintPageFile_flash_gifts"; } else if(appVersion == "gift_editing") { layout = "onlinePrintGift.html"; } if (!printAppServerUrl) { printAppServerUrl = "https://photominator.mydakis.com"; } goToPrintApp(printAppServerUrl, g_lang, "d84b4920-df00-0133-ac60-00163e7cc54c", appVersion, layout, params); } function dakisGoToCashierApp() { goToCashier("https://cashier.mydakis.com", g_lang, "d84b4920-df00-0133-ac60-00163e7cc54c", g_sessionId, "cashier.html"); } var DakisJITScript = { load: function(url) { var promise = DakisJITScript.promises[url]; if(promise == null) { jQuery.ajaxSetup({cache: true}); promise = jQuery.getScript(url); DakisJITScript.promises[url] = promise; } return promise; }, promises: {} }; var DakisRUA = { retailerGuid: 'd84b4920-df00-0133-ac60-00163e7cc54c', webAPPUrl: 'https://static.dakiscdn.com/rua/1/rua.html', photominatorUrl: 'https://photominator.mydakis.com', cashierUrl: 'https://cashier.mydakis.com', init: function(container, typeUI) { DakisRUA.container = jQuery(container)[0]; if(typeof(DakisRUA.container) == "undefined") throw new Error("DakisRUA: invalid container. Make sure to provide a valid element id."); if(DakisRUA.getStoredData("token") != null) { DakisRUA.updateUISignedIn(DakisRUA.getStoredData("firstName"), DakisRUA.getStoredData("lastName") ); } else { DakisRUA.updateUISignedOut(); } if( typeof(typeUI) == "undefined") { DakisRUA.typeUI = "popup"; } else { DakisRUA.typeUI = typeUI; } DakisRUA.initialized = true; }, isInitialized: function() { return DakisRUA.initialized; }, isSignedIn: function() { return (DakisRUA.getStoredData("token") != null); }, signOut: function() { if(typeof(ruaApp) == "undefined") { DakisRUA.onSignedOut(); } else { ruaApp.signOut(); } }, show: function() { if(!DakisRUA.isLoaded) DakisRUA.loadWebApp(); jQuery(".rua-overlay").show(); if(typeof(ruaApp) !== "undefined") { ruaApp.show(); } }, hide: function() { ruaApp.hide(); if( (typeof(currentApplication) !== "undefined") && (currentApplication == 'cashier') && (jQuery("#billing_address_content").length > 0) ) { window.location.reload(); } }, //***************************** // private getStoredData: function(name) { return getCookie(DakisRUA.getCookieNameFor(name)); }, storeData: function(name, value) { if( typeof(currentApplication) === 'undefined' ) { return setCookie(DakisRUA.getCookieNameFor(name), value); } else { return setCookie(DakisRUA.getCookieNameFor(name), value, null, "/"); } }, deleteStoredData: function(name) { return deleteCookie(DakisRUA.getCookieNameFor(name)); }, getCookieNameFor: function(cookieName) { return "ruaApp_" + cookieName + "_" + DakisRUA.retailerGuid; }, loadWebApp: function() { if( DakisRUA.typeUI == "popup" ) { dakisIncludeCss("https://static.dakiscdn.com/rua/1/css/popup.css"); } else { dakisIncludeCss("https://static.dakiscdn.com/rua/1/css/static.css"); } DakisJITScript.load("https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js").done(function(){ jQuery.ajax({ url: DakisRUA.webAPPUrl, crossDomain: true, cache: true, success: function(result) { jQuery.ajaxSetup({cache: true}); jQuery(DakisRUA.container).html(result); jQuery(DakisRUA.container).before("
"); jQuery(DakisRUA.container).append("
"); DakisRUA.initAppWhenLoaded(); }, error: function(result) { jQuery(DakisRUA.container).html("Unavailable. Please retry later."); } }); }); DakisRUA.isLoaded = true; }, initAppWhenLoaded: function() { // We need to wait until the rua html+script are // fully loaded. We have no choice but to check // whether the ruaApp global var exists... if(typeof(ruaApp) == "undefined") { window.setTimeout(function() { DakisRUA.initAppWhenLoaded(); }, 50); return; } DakisRUA.initApp(); }, initApp: function() { ruaApp.getStoredData = function(name){return DakisRUA.getStoredData(name);}; ruaApp.storeData = function(name, value){DakisRUA.storeData(name, value);}; ruaApp.deleteStoredData = function(name){DakisRUA.deleteStoredData(name);}; ruaApp.openProject = function(projectId) {DakisRUA.openProject(projectId);}; ruaApp.lang = g_lang; ruaApp.serverURL = (g_dakisWireServer+'/rua/').replace("http:", "https:"); ruaApp.retailerGuid = DakisRUA.retailerGuid; ruaApp.init(DakisRUA.container); jQuery(ruaApp).on("signedIn", function(e, params){ DakisRUA.onSignedIn(params.firstName, params.lastName, params.token); }); jQuery(ruaApp).on("signedOut", function(e, params){ DakisRUA.onSignedOut(); }); jQuery(ruaApp).on("nameChanged", function(e, params){ DakisRUA.onNameChanged(params.firstName, params.lastName); }); jQuery(ruaApp).on("visibleChanged", function(e, params){ if(!params.isVisible) { jQuery(".rua-overlay").hide(); } }); if( ( DakisRUA.typeUI != "popup" ) && (typeof(ruaApp) !== "undefined") ) { ruaApp.hideAfterSignIn = false; } ruaApp.show(); }, onSignedIn: function(firstName, lastName, token) { DakisRUA.updateUISignedIn(firstName, lastName ); var params = {login: "yes"}; params[DakisRUA.getCookieNameFor("token")] = token; params[DakisRUA.getCookieNameFor("firstName")] = firstName; params[DakisRUA.getCookieNameFor("lastName")] = lastName; DakisRUA.callTokenScripts(params).always( function() { if( typeof(currentApplication) !== "undefined" ) { switch( currentApplication ) { case 'photominator' : DakisRUA.ajaxPost( DakisRUA.photominatorUrl + "/set_shopping_cart_owner", { rua_token: token, printing_order_id: printingOrderID } ); break; case 'cashier': DakisRUA.ajaxPost( DakisRUA.cashierUrl + "/set_shopping_cart_owner", { rua_token: token, cashier_session_id: cashierSessionId } ).complete( function(){ window.location.reload();}); break; } } else { DakisRUA.ajaxPost( DakisRUA.cashierUrl + "/set_shopping_cart_owner", { rua_token: token, cashier_session_id: g_sessionId } ); } }); }, onSignedOut: function() { DakisRUA.updateUISignedOut(); DakisRUA.deleteStoredData("token"); var params = {logout: "yes"}; params[DakisRUA.getCookieNameFor("token")] = "x"; params[DakisRUA.getCookieNameFor("firstName")] = "x"; params[DakisRUA.getCookieNameFor("lastName")] = "x"; DakisRUA.callTokenScripts(params).always( function() { if( typeof(currentApplication) === 'undefined' ) { window.location.reload(); } else { window.location.assign( g_baseURL ); } }); }, onNameChanged: function(firstName, lastName) { jQuery(".rua-first-name").html(firstName); jQuery(".rua-last-name").html(lastName); var params = {login: "yes"}; params[DakisRUA.getCookieNameFor("firstName")] = firstName; params[DakisRUA.getCookieNameFor("lastName")] = lastName; DakisRUA.callTokenScripts(params) }, openProject: function( projectId ) { dakisGoToPrintApp( "gift_editing", "order_id=" + projectId ); }, getBaseURL: function() { return typeof(currentApplication) !== 'undefined' ? g_baseURL : getDocDomainDir(); }, updateUISignedOut: function() { jQuery(".rua-signed-in").hide(); jQuery(".rua-not-signed-in").show(); }, updateUISignedIn: function(firstName, lastName ) { jQuery(".rua-first-name").html(firstName); jQuery(".rua-last-name").html(lastName); jQuery(".rua-signed-in").show(); jQuery(".rua-not-signed-in").hide(); }, callTokenScripts: function(params) { var base = typeof(currentApplication) !== 'undefined' ? g_baseURL : getDocDomainDir(); return jQuery.when( DakisRUA.ajaxPost( base + "sign.php", params, true ), DakisRUA.ajaxPost( DakisRUA.photominatorUrl + "/set_rua_token", params, true ), DakisRUA.ajaxPost( DakisRUA.cashierUrl + "/set_rua_token", params, true ) ); }, ajaxPost: function( url, params, ignoreError ) { var promise = jQuery.ajax({ type: "POST", cache: false, xhrFields: { withCredentials: true }, crossDomain: true, url: url, data: params }); if(typeof(ignoreError) != "undefined" && ignoreError === true) { var defered = jQuery.Deferred(); promise.complete(function() { defered.resolve(); }); return defered; } else { return promise; } }, isLoaded: false, container: null, initialized: false }; function generateUUID(){ var d = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = (d + Math.random()*16)%16 | 0; d = Math.floor(d/16); return (c=='x' ? r : (r&0x3|0x8)).toString(16); }); return uuid; }; jQuery(window).load(function() { if(typeof(ga) != "undefined" && typeof(dakisShoppingCartInfo) != "undefined") { dakisSendAnalyticsECommerceInfo(dakisShoppingCartInfo); } }); function dakisSendAnalyticsECommerceInfo(cart) { ga('require', 'ecommerce'); ga('ecommerce:addTransaction', { 'id': cart.id, 'revenue': cart.total, 'shipping': cart.shipping, 'tax': cart.taxes }); jQuery.each(cart.items, function(i, item){ ga('ecommerce:addItem', { 'id': cart.id, 'name': item.name, 'sku': item.sku, 'category': item.category, 'price': item.price / item.quantity, 'quantity': item.quantity }); }); ga('ecommerce:send'); } var g_comparisonCookieName = "dakisComparison"; var g_giftCatalogPage = "#giftCatalogPageFile"; var g_packagesCatalogPage = "photo_factory.html"; var g_dakisBannerIsTransparent = true; wireOnCartUpdated = onCartUpdated;