MiniWishListJS={langId:"-1",storeId:"",catalogId:"",userType:"",cookieAge:"90",setCommonParameters:function(langId,storeId,catalogId,userType){this.langId=langId;this.storeId=storeId;this.catalogId=catalogId;this.userType=userType;},setValueToCookie:function(cookieKey,cookieValue,cookieAge){var newValue=cookieValue;if(newValue!=null&&newValue!="undefined"&&newValue!=""){var currentValue=dojo.cookie(cookieKey);if(newValue!=currentValue){dojo.cookie(cookieKey,null,{expires:-1,path:"/"});cookieAge=parseInt(cookieAge);dojo.cookie(cookieKey,newValue,{expires:cookieAge,path:"/"});}}},clearFromCookie:function(cookieKey){var currentValue=dojo.cookie(cookieKey);if(currentValue!=null&&currentValue!="undefined"){dojo.cookie(cookieKey,null,{expires:-1,path:"/"});}},migrateUnregisteredUserWL:function(){wc.service.declare({id:"migrateUnregisteredUserWL",actionId:"migrateUnregisteredUserWL",url:getAbsoluteURL()+"AjaxMigrateUnregisterWishList",formId:"",successHandler:function(serviceResponse){var userId=serviceResponse.userId;var updateCookie=serviceResponse.updateCookie;if(updateCookie=="true"){MiniWishListJS.saveGUIdToCookieForWL(userId);}},failureHandler:function(serviceResponse){return false;}});var cmdParams=[];cmdParams.langId=this.langId;cmdParams.storeId=this.storeId;cmdParams.catalogId=this.catalogId;cmdParams.userType=this.userType;wc.service.invoke("migrateUnregisteredUserWL",cmdParams);},saveGUIdToCookieForWL:function(userId){var guestUserId=dojo.cookie("unRegWishListClientId");if(this.userType=="G"){this.setValueToCookie("unRegWishListClientId",userId,this.cookieAge);}}};
