function formSubmit(c,b){if(b){for(var a in b){if(b[a]!=null){document.getElementById(a).value=b[a]}}}frm=document.getElementById(c);frm.submit()}function InPlaceEdit_Show(o,l,d,a,g){if(a==null){return}var q="hid_txt_"+a;if(document.getElementById(q)){return}var h=document.getElementById(o);if(h==null){return}var p=h.innerHTML;var n=p;var f=document.getElementById(g);if(f!=null){n=f.innerHTML}var e="";var c=document.getElementById(l);if(c!=null){e=c.innerHTML}if(d!=null){d["#the content#"]=n;for(var b in d){var m=d[b];if(m!=null){e=e.replace(new RegExp(b,"g"),m)}}}e=e.concat('');e=e.concat('');h.innerHTML=e;return}function InPlaceEdit_Cancel(d){if(d==null){return}var a=document.getElementById("hid_txt_"+d);if(a==null){return}var b=document.getElementById("hid_inplaceid_"+d);if(b==null){return}var c=document.getElementById(b.value);if(c==null){return}c.innerHTML=unescape(a.value)}function showElement(c,a){var b=document.getElementById(c);if(a==null){a="block"}b.style.display=a}function showElementInline(c,a){var b=document.getElementById(c);if(a==null){a="inline"}b.style.display=a}function hideElement(b){var a=document.getElementById(b);a.style.display="none"}function clearInput(b){var a=document.getElementById(b);a.value=""}function setInput(c,b){var a=document.getElementById(c);a.value=b}function setInputFocus(b){var a=document.getElementById(b);a.focus()}function addEvtListener(obj,evt,fn,cap){if(obj.addEventListener){obj.addEventListener(evt,fn,cap)}else{if(obj.attachEvent){obj.attachEvent("on"+evt,fn)}else{eval("obj.on"+evt+"="+fn)}}}function trim(a){return a.replace(/^\s*|\s*$/g,"")}function loadPage(a,b){if(b){window.parent.window.location.href=a}else{window.location.href=a}}var pubPriHelpWin;function showPubPriHelp(b){try{pubPriHelpWin.focus()}catch(a){pubPriHelpWin=window.open(b,"","top=100,left=200,height=300,width=500,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")}}function pubPriHelpWinClosed(){pubPriHelpWin=null}var itemVotingHelpWin;function showItemVotingHelp(){try{itemVotingHelpWin.focus()}catch(a){itemVotingHelpWin=window.open("/ht/html/itemVotingHelp.html","","top=100,left=200,height=300,width=500,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")}}function itemVotingHelpWinClosed(){itemVotingHelpWin=null}var pagePurposeHelpWin;function pagePurposeHelpWinClosed(){pagePurposeHelpWin=null}var htmlTagsHelpWin;function showHtmlTagsHelp(){try{htmlTagsHelpWin.focus()}catch(a){htmlTagsHelpWin=window.open("/ht/html/htmlTagSupportGuide.html","","top=100,left=200,height=500,width=500,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")}}function htmlTagsHelpWinClosed(){htmlTagsHelpWin=null}function scale_to_fit(b,a){var c=a*1;if(b.classname=="processed"){return}if(b.height>b.width&&b.height>c){b.width=parseInt(b.width*c/b.height);b.classname="processed"}else{if(b.width>=b.height&&b.width>c){b.width=c;b.classname="processed"}else{}}b.style.visibility="visible"}function onLoadForScaling(c,a){var b=document.getElementById(c);if(b==null){return}if(b.height==0&&b.width==0){setTimeout("scale_to_fit(document.getElementById('"+c+"'), "+a+")",500)}else{scale_to_fit(document.getElementById(c),a)}}function findPosX(a){var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}function URLEncode(e){var g="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()";var b="0123456789ABCDEF";var f="";for(var c=0;c255){alert("Unicode Character '"+d+"' cannot be encoded using standard URL encoding.\n(URL encoding only supports 8-bit characters.)\nA space (+) will be substituted.");f+="+"}else{f+="%";f+=b.charAt((a>>4)&15);f+=b.charAt(a&15)}}}}return f}function URLDecode(){var a="0123456789ABCDEFabcdef";var e=document.URLForm.F2.value;var d="";var b=0;while(b]+>/gi,"")}function escapeHTML(a){var c=document.createElement("div");var b=document.createTextNode(a);c.appendChild(b);return c.innerHTML}function unescapeHTML(b){var a=document.createElement("div");a.innerHTML=stripTags(b);return a.childNodes[0].nodeValue}function limitCharacters(c,b){var a=c.value.length;if(a>b){c.value=c.value.substring(0,b)}}function isI18N(b){if(b==null){return false}for(var a=0;a255){return true}}return false}function addBookmark(a,b){if(window.sidebar){window.sidebar.addPanel(b,a,"")}else{if(document.all){window.external.AddFavorite(a,b)}else{alert("Sorry, your browser doesn't support bookmarks")}}}function validateImageFile(a,b,n,e,h){if(typeof b=="undefined"){b=true}if(typeof h=="undefined"){h="Invalid image. Please upload a file ending with JPG, JPEG, GIF, or PNG."}var m=document.getElementById(a).value;if(m==""){if(b){document.getElementById(e).innerHTML=h;setInputFocus(a)}return(!b)}var f=true;if(navigator.appVersion.indexOf("MSIE")>=0){var g=navigator.appVersion.split("MSIE");var l=parseFloat(g[1]);if(l<7){f=(m.indexOf(":")==1)}}if(!f){document.getElementById(e).innerHTML="Please specify a valid path";setInputFocus(a);return false}if(!(m=="")&&f){var c=m;var o=c.lastIndexOf(".");if(o!=-1){c=c.substr(o+1).toLowerCase()}else{c=""}if((c=="jpeg")||(c=="jpg")||(c=="gif")||(c=="png")){if(typeof n!="undefined"&&n!=null){var d=document.getElementById(n);d.value=m}if(typeof e!="undefined"&&e!=null){document.getElementById(e).innerHTML=""}return true}if(typeof e!="undefined"&&e!=null){document.getElementById(e).innerHTML=h}setInputFocus(a);return false}}function showUserPagesCall(d,c){var b=document.getElementById("myPagesLink");var a=document.getElementById("myPagesDefContainer").innerHTML;showPopupAboveRight(b,300,160,a,true,-35,158,"popUpMyPagesDiv","popUpMyPagesContent");formSubmitAJAX("/za/userPages",null,"showUserPagesCallback")}function showUserPagesCallback(f,d){if(f.firstChild){var c="";for(var e=0;e= 5) try { xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (exception1) { try { xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (exception2) { xmlhttp = false; } } @else xmlhttpRequest = false; @end @*/ if(!xmlHttpRequest&&typeof XMLHttpRequest!="undefined"){try{xmlHttpRequest=new XMLHttpRequest()}catch(exception){xmlHttpRequest=false}}return xmlHttpRequest}var requestsArray=new Array();var MAX_REQUEST_SIZE=5;function processResponse(index){var request=requestsArray[index];if(request.httpRequester.readyState==4){if(request.httpRequester.status==200){try{request.complete=true;var xmlResponse=request.httpRequester.responseXML;var resultStatus=xmlResponse.getElementsByTagName("result")[0].firstChild.nodeValue;if(resultStatus==0){var results=xmlResponse.getElementsByTagName("results")[0];eval(request.callbackMethod)(results,request.callbackParams);try{var trackNodes=xmlResponse.getElementsByTagName("track");if(trackNodes!=null&&trackNodes.length>0){var track=trackNodes[0].firstChild.nodeValue;if(typeof popv!="undefined"&&track!=null&&track.length>0){setTimeout("popv(eval("+track+"))",5)}}var operationEle=xmlResponse.getElementsByTagName("operation");if(operationEle&&operationEle.length>0){var operation=operationEle[0].firstChild.nodeValue;if(typeof tcLink!="undefined"&&operation!=null&&operation!=""){setTimeout("tcLink(true,'"+operation+"')",5)}}}catch(trackError){}}else{if(resultStatus==3){if(!request.ignoreError){document.location.href="/za/activity-limited"}else{eval(request.callbackMethod)(null,request.callbackParams)}}else{if(resultStatus==2){if(!request.ignoreError){alert("Oops! You need to be logged in to do this. The page will refresh after you click ok");document.location.reload()}else{eval(request.callbackMethod)(null,request.callbackParams)}}else{if(!request.ignoreError){alert("Oops! Something went wrong. Error code: CL-1. The page will refresh after you click ok");document.location.reload()}else{eval(request.callbackMethod)(null,request.callbackParams)}}}}}catch(error){if(!request.ignoreError){alert("Oops! Something went wrong. Error code: CL-2. The page will refresh after you click ok");document.location.reload()}else{eval(request.callbackMethod)(null,request.callbackParams)}}}else{if(request.httpRequester.status!=0){if(!request.ignoreError){alert("Oops! Something went wrong. Error code: CL-3. The page will refresh after you click ok");document.location.reload()}else{eval(request.callbackMethod)(null,request.callbackParams)}}}}}function initialize(b){var c=requestsArray[b];if(c.varMap){for(var a in c.varMap){if(c.varMap[a]!=null){if(c.postValueStr==""){c.postValueStr=a+"="+encodeURIComponent(c.varMap[a])}else{c.postValueStr+="&"+a+"="+encodeURIComponent(c.varMap[a])}}}}}function initializeForm(a){var d=requestsArray[a];if(d.formid){var c=document.getElementById(d.formid);for(var b=0;b0){p.style.height=this.height+"px"}if(this.width>0){p.style.width=this.width+"px";q.style.width=(this.width+9)+"px"}q.style.position="absolute";if(this.yPosition){q.style.top=(this.yPosition)+"px"}if(this.xPosition){q.style.left=(this.xPosition)+"px"}}q.style.display="block"};this.closePopup=function(){hideElement(this.popUpDivId)}}function getViewWidth(){var a;if(navigator.appVersion.indexOf("MSIE")>=0){if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){a=parseInt(document.documentElement.clientWidth)}else{a=parseInt(document.getElementsByTagName("body")[0].clientWidth)}}else{a=parseInt(window.innerWidth)}return a}function getViewHeight(){var a;if(navigator.appVersion.indexOf("MSIE")>=0){if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){a=parseInt(document.documentElement.clientHeight)}else{a=parseInt(document.getElementsByTagName("body")[0].clientHeight)}}else{a=parseInt(window.innerHeight)}return a}function onMouseMovedPopup(b){var a=popupArray[b];clearTimeout(a.blanktimeout)}function onMouseOutPopup(b){var a=popupArray[b];if(a.mouseOutTime==undefined){a.blanktimeout=setTimeout("hideElement('"+a.popUpDivId+"')",500)}else{a.blanktimeout=setTimeout("hideElement('"+a.popUpDivId+"')",a.mouseOutTime)}a.srcEle.onmouseout="";a.srcEle.onmousemove=""}function calcXCoordinates(c,e,d,b){var a=findPosX(c);if(!b){a+=c.offsetWidth}if(typeof d!="undefined"){a+=d}if(a<0){a=0}return a}function calcYCoordinates(b,a,c){var d;if(a>0){d=findPosY(b)+b.offsetHeight-a}else{d=findPosY(b)+b.offsetHeight}if(typeof c!="undefined"){d+=c}if(d<0){d=0}return d}function showPopupAboveRight(g,c,h,e,d,a,f,l,b){showAndReturnPopupAboveRight(g,c,h,e,d,a,f,l,b)}function showAndReturnPopupAboveRight(l,d,n,f,e,b,h,o,c,a,g){if(typeof o=="undefined"||o==null){o="popUpDiv"}if(typeof c=="undefined"||c==null){c="popUpContent"}hideSelectBoxes();var m=new KaboodlePopup(l,d,n,e,b,h,o,c,false,a,g);m.populateHtml(f);m.showPopup();return m}function showAndReturnPopupAboveLeft(h,c,m,e,d,a,g,n,b,f){if(typeof n=="undefined"||n==null){n="popUpDiv"}if(typeof b=="undefined"||b==null){b="popUpContent"}hideSelectBoxes();var l=new KaboodlePopup(h,c,m,d,a,g,n,b,true,false,f);l.populateHtml(e);l.showPopup();return l}function hideSelectBoxes(){if(navigator.appVersion.indexOf("MSIE")>=0){var d=navigator.appVersion.split("MSIE");var a=parseFloat(d[1]);if(a<7&&document.body.filters){var c=document.getElementsByTagName("SELECT");if(c!=null){for(var b=0;b=0){var c=navigator.appVersion.split("MSIE");var a=parseFloat(c[1]);if(a<7&&document.body.filters){var b=document.getElementsByTagName("SELECT");if(b!=null){for(k=0;k=0){var d=navigator.appVersion.split("MSIE");var a=parseFloat(d[1]);if(a<7&&document.body.filters){for(i=0;i0){f=f.replaceAll(" ","-")}_gaq.push(["_trackEvent","Search","Product","/search/"+f]);document.getElementById(a).action="/search/";document.getElementById(a).submit()}else{if(document.getElementById(e).value=="collage"){document.getElementById(a).action="/search-styleboard/";document.getElementById(a).submit()}else{if(document.getElementById(e).value=="page"){document.getElementById(a).action="/search-list/";document.getElementById(a).submit()}else{if(document.getElementById(e).value=="user"){document.getElementById(a).action="/search-people/";document.getElementById(a).submit()}else{if(document.getElementById(e).value=="retailer"){document.getElementById(a).action="/search-store/";document.getElementById(a).submit()}}}}}}}}function callOnEnterKey(event,callBack){if(event.keyCode==13){eval(callBack)}}function getCookie_c(c){var b=document.cookie;var e=c+"=";var d=b.indexOf("; "+e);if(d==-1){d=b.indexOf(e);if(d!=0){return null}}else{d+=2}var a=document.cookie.indexOf(";",d);if(a==-1){a=b.length}return unescape(b.substring(d+e.length,a))}function setCookie_c(b,d,a,f,c,e){document.cookie=b+"="+escape(d)+((a)?"; expires="+a.toGMTString():"")+((f)?"; path="+f:"")+((c)?"; domain="+c:"")+((e)?"; secure":"")}function deleteCookie_c(a,c,b){if(getCookie_c(a)){document.cookie=a+"="+((c)?"; path="+c:"")+((b)?"; domain="+b:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function checkIfBrowserSupportCookies(){if(document.cookie!=null&&document.cookie!=""){return true}else{setCookie_c("hp","0");if(getCookie_c("hp")){deleteCookie_c("hp");return true}else{return false}}}function clearActionText(){if(document.getElementById("actionDivId")){document.getElementById("actionDivId").style.display="none"}}function generateAJAXResponseHTML(b){var a="";for(var c=0;c0){var bitlyResObj=eval("("+bitlyResponse+")");url=bitlyResObj.data.url}}catch(e){}eval(callbackParams.callbackFn)(url,callbackParams.cParams)}function validateFormField(e,a,c){if(e!=null&&trim(e)!=""){var d=new Object();d.fieldValue=e;d.fieldType=a;var b=new Object();b.errorId=c;formSubmitAJAX("/za/validate-field",d,"validateFormFieldCallback",b,true)}}function validateFormFieldCallback(d,b){var a=d.getElementsByTagName("fieldError");try{if(a.length>0){var e=a[0].firstChild.nodeValue;document.getElementById(b.errorId).innerHTML=e;document.getElementById(b.errorId).style.display=""}else{document.getElementById(b.errorId).innerHTML="";document.getElementById(b.errorId).style.display="none"}}catch(c){}}function showNFPopuup(d){var c=document.getElementById("NFPopUp_"+d);var b=document.getElementById("NFImg_"+d);var a=b.offsetLeft-2*b.offsetWidth;var e=b.offsetTop+b.offsetHeight;c.style.position="absolute";c.style.top=e+"px";c.style.left=a+"px";c.style.display=""}function showNFPopup(d){var c=document.getElementById("NFPopUp_"+d);var b=document.getElementById("NFImg_"+d);var a=b.offsetLeft-b.offsetWidth;var e=b.offsetTop+b.offsetHeight;c.style.position="absolute";c.style.top=e+"px";c.style.left=a+"px";c.style.display=""}function closeNFPopuup(a){hideElement("NFPopUp_"+a)}var userMiniProfilePopup;function showMiniProfilePopup(a,c,b){hideMiniProfilePopup();document.getElementById("umppscreenName").innerHTML=c;document.getElementById("umppuserLists").href="/member/"+c+"/lists";document.getElementById("umppuserFriends").href="/member/"+c+"/friends";document.getElementById("umppuserGroups").href="/member/"+c+"/groups";document.getElementById("umppuserPolls").href="/member/"+c+"/polls";document.getElementById("umppuserPhotos").href="/member/"+c+"/photos";document.getElementById("umppuserBrands").href="/member/"+c+"/stores";document.getElementById("umppuserBlogazine").href="/member/"+c+"/blogs";document.getElementById("umppuserStyleboards").href="/member/"+c+"/styleboards";if(document.getElementById("umppminiPopupAddFriendImg")!=null){document.getElementById("umppminiPopupAddFriendImg").href="javascript:checkForFriendAJAX('"+b+"','"+c+"','addFriend');";document.getElementById("umppminiPopupAddFriendLnk").href="javascript:checkForFriendAJAX('"+b+"','"+c+"','addFriend');";document.getElementById("umppcomposeMessagePopupImg").href="javascript:checkForFriendAJAX('"+b+"','"+c+"','sendMessage');";document.getElementById("umppcomposeMessagePopupLnk").href="javascript:checkForFriendAJAX('"+b+"','"+c+"','sendMessage');"}userMiniProfilePopup=new KaboodlePopup(a,141,220,false,-110,170,"umppuserMiniProfilePopup","umppuserMiniProfilePopup",false,false);userMiniProfilePopup.showPopup()}function hideMiniProfilePopup(){document.getElementById("umppscreenName").innerHTML="#";document.getElementById("umppuserLists").href="#";document.getElementById("umppuserFriends").href="#";document.getElementById("umppuserGroups").href="#";document.getElementById("umppuserPolls").href="#";document.getElementById("umppuserPhotos").href="#";document.getElementById("umppuserBrands").href="#";document.getElementById("umppuserBlogazine").href="#";document.getElementById("umppuserStyleboards").href="#";if(document.getElementById("umppminiPopupAddFriendImg")!=null){document.getElementById("umppminiPopupAddFriendImg").href="#";document.getElementById("umppminiPopupAddFriendLnk").innerHTML="Add as a Friend";document.getElementById("umppcomposeMessagePopupLnk").innerHTML="Send Message";document.getElementById("umppminiPopupAddFriendLnk").href="#";document.getElementById("umppcomposeMessagePopupImg").href="#";document.getElementById("umppcomposeMessagePopupLnk").href="#"}if(userMiniProfilePopup!=null){userMiniProfilePopup.closePopup()}}function checkForFriendAJAX(c,e,b){var d=new Object();d.userUid=c;d.action="userFriendCheck";var a=new Object();a.friendUid=c;a.next=b;a.friendScreenName=e;formSubmitAJAX("/za/userProfile",d,"addFriendMiniProfileCallback",a)}function addFriendMiniProfileCallback(d,c){var a=d.getElementsByTagName("isFriend");if(a.length>0){var b=generateAJAXResponseHTML(a[0].childNodes);if(b=="false"){if(c.next=="addFriend"){var e=new Object();e.friendUid=c.friendUid;e.ajax="true";formSubmitAJAX("/za/inviteInSystemFriend",e,"userFriendCallback")}else{if(c.next=="sendMessage"){document.getElementById("umppcomposeMessagePopupLnk").innerHTML="User is not your friend."}}}else{if(c.next=="addFriend"){document.getElementById("umppminiPopupAddFriendLnk").innerHTML="User is already your friend."}else{if(c.next=="sendMessage"){showComposeMessagePopup(null,null,c.friendScreenName)}}}}}function userFriendCallback(b,a){document.getElementById("umppminiPopupAddFriendLnk").innerHTML="Request Pending"}var sendButtonClicked=false;function showComposeMessagePopup(f,d,e,b,c,l){var a=new Object();a.action="getPopupView";if(c!=null&&typeof c!="undefined"){a.contentTheme=c}if(l!=null&&typeof l!="undefined"){a.currentUrl=l}if(f!=null&&typeof f!="undefined"){a.replyTo=f.to;a.subject=f.subject;a.retailerName=f.retailerName}populateEntityMapInfo(a,d);if(e!=null&&typeof e!="undefined"){a.toSN=e;a.to=e}if(b!=null&&typeof b!="undefined"){a.allowNonFriend=b}var h=new Object();var g=document.getElementById("messageSpinner").innerHTML;showAndReturnPopupAboveRight(null,-1,-1,g,false,850,300,"messagePopup","messagePopupContent",true);formSubmitAJAX("/za/compose-message",a,"getComposeMessageCallback",h)}function cm_split(a){return a.split(/,\s*/)}function cm_extractLast(a){return cm_split(a).pop()}function getComposeMessageCallback(results,callbackParams){var evalScript=results.getElementsByTagName("evalScript");if(evalScript.length>0){var evalString=generateAJAXResponseHTML(evalScript[0].childNodes);eval(evalString)}var view=results.getElementsByTagName("view");if(view.length>0){var htmlValue=generateAJAXResponseHTML(view[0].childNodes);document.getElementById("messagePopupContent").innerHTML=htmlValue}var recaptcha=results.getElementsByTagName("recaptchaEnabled");if(recaptcha.length>0){var recaptchaEnabled=generateAJAXResponseHTML(recaptcha[0].childNodes);if(recaptchaEnabled=="true"){var recaptchaKey=generateAJAXResponseHTML(results.getElementsByTagName("recaptchaPublickey")[0].childNodes);$.getScript("http://www.google.com/recaptcha/api/challenge?k="+recaptchaKey);$.getScript("http://www.google.com/recaptcha/api/js/recaptcha_ajax.js",function(){Recaptcha.create(recaptchaKey,"recaptcha_image",{theme:"custom",custom_theme_widget:"recaptcha_image",lang:"en"})})}}$(".has_placeholder").keyup(function(eventObject){if(this.value!=""){$(this).parent().children(".placeholder").hide()}else{$(this).parent().children(".placeholder").show()}});if(!$.fn.emailsSelect){defineEmailsSelect()}if(friendsIdNameList){$("#msgToID1").emailsSelect({autocomplete:{appendTo:".sharePopup .newPopupContent",itemClass:"ddItem",labelprop:"username",itemtemplate:'{username}',source:friendsIdNameList}})}}function defineEmailsSelect(){(function(d,e){var b=function(f,g){if(typeof(g)!="function"){throw"Not a function"}var h=Array.prototype.slice.call(arguments,2);return function(){var l=h.concat(Array.prototype.slice.call(arguments));return g.apply(f,l)}};var a=function(g,f){return g.replace(/\{([^\}]+)\}/gi,function(l,h){return typeof(f[h])=="undefined"?h:f[h]})};var c=function(g,h){if(!g.is("input[type=text]")){d.error("$.emailsSelect: Element is not a text input");return null}this.options=h;g.wrap('
').closest("label").append('').closest(".emailsSelectWrap").prepend('Error test here');var f=g.attr("placeholder");f=h.placeholder||f;g.attr("placeholder","").closest("label").find(".fieldplaceholder").text(f);g.bind({focus:b(this,this.focusHandler,g),blur:b(this,this.blurHandler,g),paste:b(this,this.pasteHandler,g),keyup:b(this,this.keyupHandler,g),keydown:b(this,this.keydownHandler,g)});g.closest(".emailsSelectWrap").click(b(this,function(l){l.focus();return false},g));if(h.autocomplete){this.createAutocomplete(g,h.autocomplete)}if(!!h.value){this.setVal(g,h.value)}return{getvalue:b(this,this.getVal,g),setvalue:b(this,this.setVal,g)}};c.prototype={selectedItems:null,options:null,focusHandler:function(g,f){this.toggleError(g,false);g.closest("label").find(".fieldplaceholder").hide()},blurHandler:function(g,f){this.toggleError(g,false);if(!d.trim(g.val())){g.closest("label").find(".fieldplaceholder").show()}},pasteHandler:function(g,f){this.toggleError(g,false)},keyupHandler:function(g,f){var h=d.trim(g.val());if(h&&({";":true,",":true})[h[h.length-1]]){g.val(h.replace(/[;,]/gi,""));this.addItem(g)}},removeItem:function(g,h){this.toggleError(g,false);if(h){if(this.selectedItems){var f=h.data("item.emailsSelect").value+","}var l=d("#msgToID").val();l=l.replace(f,"");d("#msgToID").val(l);delete this.selectedItems[h.data("item.emailsSelect")];h.remove()}return false},validate:function(f,h){var g=true;if(!!this.options.validate){if(typeof(this.options.validate)=="function"){g=this.options.validate(h)}else{if(typeof(this.options.validate)=="string"){g=new RegExp(this.options.validate,"i").test(h)}else{if(!!this.options.validate&&typeof(this.options.validate.test)=="function"){g=this.options.validate.test(h)}}}g=typeof(g)==e?true:!!g}this.toggleError(f,!g?"Please enter a valid Email address":!!g);return g},addItem:function(g,f){var m=d.extend({value:d.trim(g.val())},(f||{}));this.selectedItems=this.selectedItems||{};if(m&&(f||this.validate(g,m.value))){var h=d(a((this.options.tagtemplate||c.defaults.tagtemplate),m));h.appendTo(g.closest(".emailsSelectWrap").find(".items")).find(".emailsSelectItemCloseBtn").click(b(this,this.removeItem,g,h));var l=d("#msgToID").val();l=l+g.val()+",";d("#msgToID").val(l);h.data("item.emailsSelect",m);g.val("").focus();this.selectedItems[m.value]=true}},keydownHandler:function(g,f){this.toggleError(g,false);var h;switch(f.which){case 13:case 9:if(g.val()==""){h=true;break}case 32:h=false;this.addItem(g);break;case 8:h=this.checkRemove(g);default:console.log(f.which);break}return h},checkRemove:function(g){var l=g.val();if(l.length==0){var h=g.closest(".emailsSelectWrap").find(".items").children().last();var f=h.data("item.emailsSelect");if(h.length>0&&!!f){this.removeItem(g,h);g.val(f.value);return false}}return true},toggleError:function(g,h){var f=g.closest(".emailsSelectWrap").toggleClass("error",!!h);if(typeof(h)=="string"&&!!h){f.find(".errorBubble").text(h)}},getVal:function(f){var g=[];f.closest(".emailsSelectWrap").find(".items").children().each(function(){var h=d(this).data("item.emailsSelect");if(h&&"value" in h){g.push(h.value)}});return g},setVal:function(h,n){var g=[];if(typeof(n)=="string"||n instanceof String){g=n.split(new RegExp("["+(this.options.separator||"").replace(/([\.\[\]\{\}\(\)\-\_])/ig,"\$1")+"]","i"))}else{if(n instanceof Array){g=n}}for(var m=0,f=g.length;m').addClass(h.itemClass).data("item.autocomplete",o).append(a((h.itemtemplate||c.defaults.autocomplete.itemtemplate),o)).appendTo(l.addClass("emailsSelectAutocomplete"+(h.listClass||"")))}}}};c.defaults={placeholder:"",value:"",separator:",",validate:"^\\w[a-z0-9\\-_\\.]*\\@\\w[a-z0-9\\-_\\.]*\\.\\w\\w+$",tagtemplate:'{value}x',autocomplete:{itemClass:"",labelprop:"label",itemtemplate:"{label}"}};c.create=function(g,f){var h=g.data("emailsSelect");if(!h){var l=d.extend({},this.defaults,f);if(!("autocomplete" in (f||{}))){delete l.autocomplete}h=new this(g,l);if(h){g.data("emailsSelect",h)}}return h};c.callMethod=function(h,f,g){var l=h.data("emailsSelect");if(l){if(typeof(l[f])=="function"){return l[f].apply(l,g)}else{d.error("$.emailsSelect has no method "+f)}}else{d.error("Element "+h.selector+" is not an $.emailsSelect")}};d.fn.emailsSelect=function(f){if(typeof(f)=="object"||!f){return this.each(function(){return c.create(d(this),f)})}else{if(typeof(f)=="string"){return this.each(function(){return c.callMethod(d(this),f,Array.prototype.slice.call(arguments,1))})}else{d.error("$.emailsSelect: not supported")}}}})(jQuery)}function hideComposeMessagePopup(){hideSmartInputFloater();document.getElementById("messagePopupContent").innerHTML="";hideElement("messagePopup")}function sendNewMessage(f,d,m,e,p,n,l,g){if(f=="sendShareMsg"){$("#errorToField").html("");$("#msgDescriptionID_error").html("");var b=$("#msgToID1").val();if(b.trim()!=""){var c=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!c.test(b)){$("#errorToField").html("Enter valid email id");return}b=","+b}var h=$("#msgToID").val();$("#msgToID").val(h+b);if($("#msgToID").val().trim()==""){$("#errorToField").html("Message recipients cannot be blank");return}if($("#msgDescriptionID").val().trim()==""){$("#msgDescriptionID_error").html("Message body cannot be blank");return}}var a=new Object();a.action=f;a.subject=document.getElementById("msgSubjectID").value;a.description=document.getElementById("msgDescriptionID").value;if(p!=null&&typeof p!="undefined"){a.currentUrl=p}if(f=="sendShareMsg"){a.recaptcha_challenge_field=$("#recaptcha_challenge_field").val();a.recaptcha_response_field=$("#recaptcha_response_field").val()}if(d!=null&&typeof d!="undefined"&&d!=""){a.replyTo=d;a.to=d;if(l!=null&&typeof l!="undefined"&&l!=""){a.retailerName=l}}else{if(document.getElementById("msgToID")){a.to=document.getElementById("msgToID").value}}populateEntityMapInfo(a,m);if(n!=null&&typeof n!="undefined"&&n!=""){a.to=n;a.toSN=n}if(g!=null&&typeof g!="undefined"&&g!=""){a.contentTheme=g}if(e!=null&&typeof e!="undefined"){a.allowNonFriend=e}var o=new Object();hideElement("msgSendBtns");showElement("msgSendSpinner");if(f!=null&&typeof f!="undefined"&&f=="sendUserMsg"){sendButtonClicked=true}formSubmitAJAX("/za/compose-message",a,"sendNewMessageCallback",o)}function sendNewMessageCallback(d,c){var a=d.getElementsByTagName("view"); if(a.length>0){var b=generateAJAXResponseHTML(a[0].childNodes);document.getElementById("messagePopupContent").innerHTML=b;$("#msgToID1").emailsSelect({autocomplete:{appendTo:".sharePopup .newPopupContent",itemClass:"ddItem",labelprop:"username",itemtemplate:'{username}',source:friendsIdNameList}});var e=generateAJAXResponseHTML(d.getElementsByTagName("recaptchaEnabled")[0].childNodes);if(e=="true"){var f=generateAJAXResponseHTML(d.getElementsByTagName("recaptchaPublickey")[0].childNodes);$.getScript("http://www.google.com/recaptcha/api/challenge?k="+f);$.getScript("http://www.google.com/recaptcha/api/js/recaptcha_ajax.js",function(){Recaptcha.create(f,"recaptcha_image",{theme:"custom",custom_theme_widget:"recaptcha_image",lang:"en"})})}$(".has_placeholder").keyup(function(g){if(this.value!=""){$(this).parent().children(".placeholder").hide()}else{$(this).parent().children(".placeholder").show()}})}else{hideComposeMessagePopup();if(!loggedIn){_gaq.push(["_trackEvent","Share","Non-Logged-in",""])}else{_gaq.push(["_trackEvent","Share","Logged-in",""])}}}function populateEntityMapInfo(b,a){if(a!=null&&typeof a!="undefined"){if(typeof a.entityId!="undefined"&&a.entityId!=""){b.entityId=a.entityId}if(typeof a.entityType!="undefined"&&a.entityType!=""){b.entityType=a.entityType}if(typeof a.storeDomain!="undefined"&&a.storeDomain!=""){b.storeDomain=a.storeDomain}if(typeof a.allFans!="undefined"&&a.allFans!=""){b.allFans=a.allFans;if(b.allFans){b.to="All Fans"}}if(typeof a.articleId!="undefined"&&a.articleId!=""){b.articleId=a.articleId}if(typeof a.itemId!="undefined"&&a.itemId!=""){b.itemId=a.itemId}if(typeof a.currentUrl!="undefined"&&a.currentUrl!=""){b.currentUrl=a.currentUrl}if(typeof a.entityName!="undefined"&&a.entityName!=""){b.entityName=a.entityName}if(typeof a.entityIdHex!="undefined"&&a.entityIdHex!=""){b.entityIdHex=a.entityIdHex}if(typeof a.channelUFName!="undefined"&&a.channelUFName!=""){b.channelUFName=a.channelUFName}if(typeof a.sectionUFName!="undefined"&&a.sectionUFName!=""){b.sectionUFName=a.sectionUFName}if(typeof a.contentType!="undefined"&&a.contentType!=""){b.contentType=a.contentType}}}function removeDefaultText(a){hideElement("inputTextBox");showElement("inputTextArea");if(document.getElementById("msgToID")){document.getElementById("msgToID").focus()}}function addDefaultTextIfEmpty(b){if(document.getElementById("msgToID")){var a=document.getElementById("msgToID").value;if(a.length==0){hideElement("inputTextArea");showElement("inputTextBox")}}}function closeClicked(){hideElement("showfriendscreen");showElement("sharescreen")}var selectedFollowersForMessage=0;var limitFollowers=false;function selectAllFriends(a){if(a){$("#friendsData > li").each(function(b){$(this).addClass("selected")});$("#selectAllUsers").attr("onClick","javascript:selectAllFriends(false);")}else{$("#friendsData > li").each(function(b){$(this).removeClass("selected")});$("#selectAllUsers").attr("onClick","javascript:selectAllFriends(true);")}}function selectAll(b){var a=document.getElementById("friendsData");var e=a.getElementsByTagName("input");if(e!=null){selectedFollowersForMessage=0;for(var d=0;d10){var c=e.length-1;while(selectedFollowersForMessage>10){if(e[c].type=="checkbox"&&e[c].checked){e[c].checked=false;selectedFollowersForMessage=selectedFollowersForMessage-1;c=c-1}}}if(limitFollowers&&!b){selectedFollowersForMessage=0}}}function showFriendsScreen(b){limitFollowers=b;selectedFollowersForMessage=0;var c=document.getElementById("msgToID").value;var a=document.getElementById("friendsData");if(a!=null){var e=a.getElementsByTagName("input");if(e!=null){for(var d=0;de[d].value.length&&c.substring(0,c.indexOf(","))==e[d].value){e[d].checked=true}else{if(c.substring(c.lastIndexOf(",")+2)==e[d].value){e[d].checked=true}else{e[d].checked=false}}}}}if(limitFollowers&&e[d].checked){selectedFollowersForMessage=selectedFollowersForMessage+1}}}}}hideElement("sharescreen");showElement("showfriendscreen");if(limitFollowers){if(selectedFollowersForMessage>10){showElement("max10errormessage")}else{hideElement("max10errormessage")}}}function validateAndUpdateFollowerNumber(a){if(limitFollowers){if(a.checked){if(selectedFollowersForMessage>=10){showElement("max10errormessage");a.checked=false}else{selectedFollowersForMessage=selectedFollowersForMessage+1}}else{selectedFollowersForMessage=selectedFollowersForMessage-1;if(selectedFollowersForMessage<=10){hideElement("max10errormessage")}}}}function doneChoosing(c,b){if(limitFollowers&&selectedFollowersForMessage>10){return}if(c==document.getElementById("msgToID").value){document.getElementById("msgToID").value=""}if(b==document.getElementById("msgToID").value){document.getElementById("msgToID").value=""}var d=document.getElementById("msgToID").value;var a=document.getElementById("friendsData");var f=a.getElementsByTagName("input");if(d.indexOf(",")!=-1){if(trim(d.substring(d.lastIndexOf(",")+1))==""){d=d.substring(0,d.lastIndexOf(","))}}if(f!=null){for(var e=0;ef[e].value.length&&d.substring(0,d.indexOf(","))==f[e].value){d=d.substring(d.indexOf(",")+2)}else{if(d.substring(d.lastIndexOf(",")+2)==f[e].value){d=d.substring(0,d.lastIndexOf(","))}}}}}else{if(d.length==0){d=f[e].value}else{if(d.indexOf(f[e].value)==-1){d+=", "+f[e].value}else{if(f[e].value==d||d.indexOf(",")!=-1&&((d.length>f[e].value.length&&d.substring(0,f[e].value.length+1)==(f[e].value+","))||(d.substring(d.lastIndexOf(",")+2)==f[e].value)||(d.indexOf(", "+f[e].value+",")!=-1))){continue}else{d+=", "+f[e].value}}}}}}document.getElementById("msgToID").value=d;if(d!=""&&document.getElementById("errorToField")!=null){hideElement("errorToField")}}hideElement("showfriendscreen");showElement("sharescreen");if(document.getElementById("msgToID").value.length==0){hideElement("inputTextArea");showElement("inputTextBox")}else{hideElement("inputTextBox");showElement("inputTextArea")}}function getMatch(a,b){var c='';if(b=="n"){if(document.getElementById("next-btn")){document.getElementById("next-btn").innerHTML=c}}else{if(document.getElementById("prev-btn")){document.getElementById("prev-btn").innerHTML=c}}queryString+="&startIndex="+a;document.getElementById("fb_form").action=queryString;document.location.href=queryString}function getItem(c,b){var a="";if(typeof b!="undefined"&&(b==true||b=="true")){a+="/store"}a+="/"+document.getElementById("userName").value;a+="/"+document.getElementById("listName").value;if(c!=""){a+="?"+c}window.location.href=a}function getPreviousNextFB(b,c){var a="/"+document.getElementById("userName").value;a+="/"+b;if(c!=""){a+=c}window.location.href=a}function searchTextFocus(d,a,g){var e="st";if(g){e+=g}var c=document.getElementById(e).value;var b="Search for ";if(c=="item"||c=="Items"){b+="products"}else{if(c=="page"){b+="lists"}else{if(c=="collage"){b+="styleboards"}else{if(c=="user"){b+="people"}else{if(c=="deal"){b+="sales"}else{if(c=="retailer"){b+="stores"}}}}}}var f=d;if(g){f+=g}if(document.getElementById(f).value==b){document.getElementById(f).value=""}document.getElementById(f).style.fontStyle="normal";onFocusTopSearchbox(f,a)}function searchTextBlur(q,d,f){var h="st";if(f){h+=f}var m=document.getElementById(h).value;var n="Search for ";var o="products";var e="lists";var g="styleboards";var l="people";var c="sales";var b="stores";var p;if(m=="item"||m=="Items"){p=o}else{if(m=="page"){p=e}else{if(m=="collage"){p=g}else{if(m=="user"){p=l}else{if(m=="deal"){p=c}else{if(m=="retailer"){p=b}}}}}}var a=q;if(f){a+=f}if(((document.getElementById(a).value==n+o||document.getElementById(a).value==n+e||document.getElementById(a).value==n+g||document.getElementById(a).value==n+c||document.getElementById(a).value==n+b||document.getElementById(a).value==n+l)||document.getElementById(a).value==""||document.getElementById(a).value.length<=0)){$("#searchPlaceHolderId").attr("value",n+p);$("#search_range .text").text(p);document.getElementById(q).value="";searchBoxBlur();return false}document.getElementById(a).style.fontStyle="normal";return true}function onFocusTopSearchbox(n,a){if(typeof topSearchACOptions=="undefined"){var m;try{m=document.standardCreateElement("script")}catch(b){m=document.createElement("script")}m.type="text/javascript";m.src="http://cn2.kaboodle.com/ht/scripts/searchAutoCompleteList.js?v="+a;document.getElementsByTagName("head")[0].appendChild(m)}if(typeof YAHOO=="undefined"||typeof YAHOO.widget.AutoComplete=="undefined"){var l;var h;var g;var f;var d;var c;try{l=document.standardCreateElement("script");h=document.standardCreateElement("script");g=document.standardCreateElement("script");f=document.standardCreateElement("script");d=document.standardCreateElement("script");c=document.standardCreateElement("script")}catch(b){l=document.createElement("script");h=document.createElement("script");g=document.createElement("script");f=document.createElement("script");d=document.createElement("script");c=document.createElement("script")}l.type="text/javascript";l.src="http://cn2.kaboodle.com/ht/scripts/yui/yahoo-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(l);h.type="text/javascript";h.src="http://cn2.kaboodle.com/ht/scripts/yui/dom/dom-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(h);g.type="text/javascript";g.src="http://cn2.kaboodle.com/ht/scripts/yui/event/event-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(g);f.type="text/javascript";f.src="http://cn2.kaboodle.com/ht/scripts/yui/animation/animation-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(f);d.type="text/javascript";d.src="http://cn2.kaboodle.com/ht/scripts/yui/datasource/datasource-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(d);c.type="text/javascript";c.src="http://cn2.kaboodle.com/ht/scripts/yui/autocomplete/autocomplete-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(c)}pollAndLoadSearchAutoComplete(n,"topSearchACSection")}var topSearchAC=null;function pollAndLoadSearchAutoComplete(a,b){if(typeof YAHOO=="undefined"||typeof YAHOO.widget.AutoComplete=="undefined"||typeof topSearchACOptions=="undefined"){window.setTimeout(function(){pollAndLoadSearchAutoComplete(a,b)},200)}else{if(topSearchAC==null){topSearchAC=new YAHOO.widget.AutoComplete(a,b,new YAHOO.util.LocalDataSource(topSearchACOptions));topSearchAC.minQueryLength=0;topSearchAC.allowBrowserAutocomplete=false;topSearchAC.autoHighlight=false;topSearchAC.maxResultsDisplayed=15;topSearchAC.queryMatchContains=true}}}String.prototype.replaceAll=function(c,d){var a=this;var b=a.indexOf(c);while(b!=-1){a=a.replace(c,d);b=a.indexOf(c)}return a};function toggleTopSearchMode(a){$(".searchvariants").toggleClass("kHidden");$(a).toggleClass("hot")}function tmOver(d){var a=document.getElementById("navTab"+d);var e=document.getElementById("popNavDiv");if(document.getElementById("topNavdd"+d)){var c=document.getElementById("topNavdd"+d).innerHTML;if(navigator.appVersion.indexOf("MSIE")>=0){var f=navigator.appVersion.split("MSIE");var b=parseFloat(f[1]);if(b==6||b==8){showAndReturnPopupAboveLeft(a,-1,-1,c,true,1,-7,"popNavDiv","popNavContent",0)}else{if(b==7){showAndReturnPopupAboveLeft(a,-1,-1,c,true,0,-7,"popNavDiv","popNavContent",0)}}}else{showAndReturnPopupAboveLeft(a,-1,-1,c,true,1,-8,"popNavDiv","popNavContent",0)}}}function tmOut(){var a=document.getElementById("popNavContent");if(a){a.innerHTML="";hideElement("popNavDiv")}}function topnav(){$("div.header-global-tabs ul li").hover(function(){name=$(this).attr("id")});$("div#popNavDiv").hover(function(){$("li#"+name+" a").addClass("on")},function(){$("li#"+name+" a").removeClass("on")})}function topnavIE(){$("ul.sn li:last-child").each(function(){$(this).addClass("last")});$("div.popNav").css("padding-bottom","3px")}function loadJS(c,b,a){var f=document.createElement("script");f.setAttribute("type","text/javascript");var d=c;if(b!=""){d+="?v="+b}f.setAttribute("src",d);var e=document.getElementById(a);if(e&&typeof f!="undefined"){e.appendChild(f)}}function heartingAction(e,c,d,l,h,g,b){var a=new Object();a.entityId=e;a.entityType=c;a.userRating="1";a.blogId=d;a.storeId=l;var f=new Object();f.uniqueId=g;f.entityType=c;f.loadPageforNLI=b;if(h!=""&&h!=" "){a.oldRating=h;f.oldRating=h}else{a.oldRating="-1";f.oldRating="-1"}if(document.getElementById(g+"_spanHeartLink")){document.getElementById(g+"_spanHeartLink").innerHTML="loading...";document.getElementById(g+"_spanHeartSpinning").style.display="inline"}formSubmitAJAX("/za/universalAction",a,"heartingActionCB",f)}function heartingActionCB(c,f){var a=c.getElementsByTagName("isUserLoggedIn")[0].firstChild.nodeValue;if(a=="false"||!a){var b=f.loadPageforNLI;location.href=b}else{var e=c.getElementsByTagName("isActivityLimited")[0].firstChild.nodeValue;if(e=="true"){var d=c.getElementsByTagName("activityRedirect")[0].firstChild.nodeValue;location.href=d}else{actionAlreadyTaken=c.getElementsByTagName("actionAlreadyTaken")[0].firstChild.nodeValue;if(actionAlreadyTaken=="true"){if(f.entityType=="10"||f.entityType=="13"){actionText="Yay! I'm a fan!"}else{if(f.entityType=="1"){actionTaken=c.getElementsByTagName("actionTaken")[0].firstChild.nodeValue;if(actionTaken=="alreadyFollowing"){actionText="Already Following"}else{if(actionTaken=="following"){actionText="Following"}else{if(actionTaken=="requested"){actionText="Request Pending"}else{if(actionTaken=="BlockedUser"){actionText="User has blocked you"}else{if(actionTaken=="YouBlockedUser"){actionText="You have blocked this user"}}}}}}else{if(f.entityType=="11"){if(c.getElementsByTagName("isadmin")[0].firstChild){isAdmin=c.getElementsByTagName("isadmin")[0].firstChild.nodeValue;if(isAdmin=="true"){actionText="You're an admin"}else{actionText="You heart this"}}else{actionText="You heart this"}}else{actionText="You heart this"}}}}else{if(f.entityType=="10"||f.entityType=="13"){actionText="Yay! I'm a fan!"}else{if(f.entityType=="1"){actionText="Invite pending"}else{actionText="Hearted";trackHeartingEvent(f.entityType)}}}if(actionAlreadyTaken=="false"||f.oldRating=="-1"){if(c.getElementsByTagName("totalRating")[0].firstChild){returnValue=c.getElementsByTagName("totalRating")[0].firstChild.nodeValue;document.getElementById(f.uniqueId+"_spanHeart").innerHTML=returnValue}}document.getElementById(f.uniqueId+"_spanHeartLink").innerHTML=actionText;$("#"+f.uniqueId+"_spanHeartLink").addClass("hearted");document.getElementById(f.uniqueId+"_spanHeartSpinning").style.display="none"}}}function fixElements(){if($("div.k-footer-cross-links div.moduleOneSixth").length){$("div.k-footer-cross-links div.moduleOneSixth:last").each(function(){$(this).addClass("last")})}}function showAddToWSLPopUp(a){var c="#"+a+"_overlay";var b="#"+a+"_id";var d="#"+a+"_listId";var f=new Object();f.action="GET_OPTIN_STATE";f.divId=a;f.itemId=$(b).html();f.listId=$(d).html();var e=new Object();e.divId=a;formSubmitAJAX("/za/addToWeeklyShoppingList",f,"showAddToWSLPopUpCallBack",e,null,null,null,"POST")}function showAddToWSLPopUpCallBack(g,n){var e=g.getElementsByTagName("addToListPopUp");if(e.length>0){document.getElementById("addToWeeklyListPopUp").innerHTML=generateAJAXResponseHTML(e[0].childNodes)}var q=n.divId;var h="#"+n.divId+"_overlay";var p=$("#"+n.divId+"_title").html();var d=$("#"+n.divId+"_expiryDate").html();var m=$("#"+n.divId+"_description").html();var l=$("#"+n.divId+"_price").html();var o=$("#"+n.divId+"_availableOnline").html();var c="";if($("#"+n.divId+"_customLink")&&$("#"+n.divId+"_customLink").html()!=""){c=unescapeHTML($("#"+n.divId+"_customLink").html())}var b;if($(h).parents("div.overlayWrap").length>0){b=$(h).parents("div.overlayWrap").children("a").children("img").attr("src");if(typeof b=="undefined"){b=$(h).parents("div.overlayWrap").children("div.itemPic").children("a").children("img").attr("src")}}if($(h).parents("div.articleGridCont").length>0){b=$(h).parents("div.articleGridCont").children("div.holderout").children("div.holderin").children("div.imgWrap").children("a").children("img").attr("src")}if(typeof b=="undefined"){b=$("#"+n.divId+"_title").parents("div.itemPic").children("a").children("img").attr("src")}if(document.getElementById("titleDiv")){document.getElementById("titleDiv").innerHTML=p}if(document.getElementById("imgEle")){document.getElementById("imgEle").src=b;document.getElementById("imgEle").title=p;document.getElementById("imgEle").alt=p}if(document.getElementById("endDateEle")){document.getElementById("endDateEle").innerHTML=d}if(document.getElementById("priceDiv")){document.getElementById("priceDiv").innerHTML=l}if(document.getElementById("summaryDiv")){document.getElementById("summaryDiv").innerHTML=m}if(document.getElementById("buyItText")){if(c!=""&&(o=="Y"||o=="y"||o=="true"||o==true)){document.getElementById("buyItAnchor").innerHTML=c;showElement("buyItText")}else{hideElement("buyItText")}}if(document.getElementById("addToListLink")){document.getElementById("addToListLink").href="javascript:addToWeeklyShoppingListPopupUH('"+q+"','addToListLink');"}if(document.getElementById("close-link")){document.getElementById("close-link").href="javascript:closeWLAddItemPopup('WSLPopUpItemDiv');"}if(document.getElementById("contestDiv")){if(document.getElementById("showOptin").value=="true"){hideElement("contestDiv")}else{showElement("contestDiv")}}var f=document.getElementById(q);var a=document.getElementById("weekly-item-container").innerHTML;document.getElementById("weekly-item-container").innerHTML="";showAndReturnPopupAboveRight(f,-1,-1,a,false,560,350,"WSLPopUpItemDiv","WSLPopUpItemContent",true)}function addToWeeklyShoppingListPopupUH(b,a){var f=new Object();var d="#"+b+"_overlay";var c="#"+b+"_id";var e="#"+b+"_listId";f.divId=d;f.title=$("#"+b+"_title").html();f.itemId=$(c).html();f.listId=$(e).html();f.weeklyItemComment=document.getElementById("weeklyItemComment").value;f.action="COPY_WEEKLY_ITEM";if(document.getElementById("enterContest")){f.enterContest=document.getElementById("enterContest").checked}var h=new Object();h.divId=b;var g='';if(a!=null&&typeof a!="undefined"){h.srcDivId=a;h.srcHtml=document.getElementById(a).innerHTML;document.getElementById(a).innerHTML=g}formSubmitAJAX("/za/addToWeeklyShoppingList",f,"addToWeeklyShoppingListPopupCallback",h,null,null,null,"POST")}function addToWeeklyShoppingListPopupCallback(e,h){var c=document.getElementById(h.divId);var g=e.getElementsByTagName("listOverFlow");var m="";var f=false;if(h.srcDivId!=null&&typeof h.srcDivId!="undefined"){document.getElementById(h.srcDivId).innerHTML=h.srcHtml}if(g.length!=0){var a=generateAJAXResponseHTML(g[0].childNodes);if(a){closeWLAddItemPopup("WSLPopUpItemDiv");var g=e.getElementsByTagName("listOverFlow");if(document.getElementById("maxErrorMyListUrl")){var b=e.getElementsByTagName("pageUrl");var n=generateAJAXResponseHTML(b[0].childNodes);document.getElementById("maxErrorMyListUrl").href=n}showListMaxItemsPopUp()}}else{closeWLAddItemPopup("WSLPopUpItemDiv");if(h.divId!=null&&h.divId!=""){linkElement=document.getElementById("addToListAnchor_"+h.divId);if(linkElement){linkElement.innerHTML=" Just added!";linkElement.style.color="#535353"}}if(e.firstChild){for(var d=0;d')}else{m=this.createElement("IFRAME")}m.id=this.AUTH_IFRAME_ID;m.name=this.AUTH_IFRAME_ID;m.src=a+"&ncl="+this.noCloseLink;m.scrolling="no";m.frameBorder="0";m.allowTransparency="true";m.style.cssText="border: 0px; width: "+b+"px; height: "+l+"px; background-color: transparent; display:block;";h.appendChild(m);if(typeof this.parentId!="undefined"){document.getElementById(this.parentId).appendChild(h)}else{this.getBody().appendChild(h);centerElement(h,l,b)}h.style.visibility="visible"};this.removeAuthWindow=function(){var a=document.getElementById(this.AUTH_ELEMENT_ID);if(a){if(typeof this.parentId!="undefined"){document.getElementById(this.parentId).removeChild(a)}else{this.getBody().removeChild(a)}}};this.createElement=function(a){try{var b=document.standardCreateElement(a);if(typeof(b)=="object"){return b}}catch(c){}return document.createElement(a)};this.getBody=function(){var a=null;try{a=document.getElementsByTagName("body")[0]}catch(b){a=document.body}return a}}var kaboodleAuthenticatePopup=new AuthenticatePopup();function showKAuthPopup(m,l,e,f,h,b,g,d){var c="";if(l!=null&&l.length>0){c="&postReg="+l;c=c+"&postreg="+l}var a="";if(d){var n=d;for(param in n){a=a+"&"+param+"="+n[param]}}if(!g){g=""}if(m){window.parent.location="/za/login?p_ret="+g+c+a}else{window.parent.location="/za/signup?p_ret="+g+c+a}}function closeKAuthPopup(){var a=window.parent.kaboodleAuthenticatePopup;if(a==undefined){a=kaboodleAuthenticatePopup}a.removeAuthWindow()}function redirectFromAuthPopup(a){window.parent.location.href=a}function kAuthPopupSuccessCB(isUserReg,HDMJumpUrl){closeKAuthPopup();var authObj=window.parent.kaboodleAuthenticatePopup;if(authObj==undefined){authObj=kaboodleAuthenticatePopup}if(typeof authObj.callbackMethod!="undefined"&&authObj.callbackMethod!=null){eval(authObj.callbackMethod)(isUserReg)}else{if(typeof authObj.returnUrl!="undefined"&&authObj.returnUrl!=null){window.location.href=window.location.protocol+"//"+window.location.hostname+authObj.returnUrl}else{var urlToGO=window.location.protocol+"//"+window.location.hostname;if(isUserReg){urlToGO+="/za/choose-brands?postreg=hp"}else{urlToGO+="/my"}if(hdmSSOConfig.ssoEnabled&&!hdmSSOConfig.isAdmin&&HDMJumpUrl!=""){urlToGO=HDMJumpUrl+encodeURIComponent(urlToGO)}window.location.href=urlToGO}}}function shareEntity(b,d,c,g,f){var e=new Object();e.entityId=b;e.entityType=d;e.entityName=c;e.sharedOn=g;e.source=f;var a=new Object();a.entityId=e.entityId;a.sharedOn=g;formSubmitAJAX("/za/trackEntitySharing",e,"shareEntityCB",a)}function shareEntityCB(b,a){}function centerElement(d,e,b){var c=getViewWidth();var a=getViewHeight();if(e>a){a=(e-a)/2}else{a=(a-e)/2}if(c<940){c=180}else{c=(c-b)/2}d.style.position="absolute";d.style.left=c+"px";if(navigator.userAgent.indexOf("Safari")>=0){d.style.top=(a+parseInt(document.body.scrollTop))+"px"}else{d.style.top=(a+parseInt(document.documentElement.scrollTop))+"px"}}function createAffiliateExitForm(c,f,m,e){var d=new Date();var n="item."+d.getTime();var b=document.createElement("form");b.id=n;b.action="/za/exitPageRedirect";b.method="post";b.target="_blank";var o=document.createElement("input");o.setAttribute("type","hidden");o.setAttribute("name","buyItLink");o.setAttribute("value",c);b.appendChild(o);var h=document.createElement("input");h.setAttribute("type","hidden");h.setAttribute("name","externalDomain");h.setAttribute("value",f);b.appendChild(h);if(e!=""){var g=document.createElement("input");g.setAttribute("type","hidden");g.setAttribute("name","exitTrackingData");g.setAttribute("value",e);b.appendChild(g)}if(m!=""){var a=m.split("&");if(a.length>0){for(var l=0;l0){var errorMessage=generateAJAXResponseHTML(results.getElementsByTagName("validationError")[0].childNodes);if(callbackParams.popup){document.getElementById("entityCommentPopupError_"+callbackParams.entityId).innerHTML=errorMessage;hideElement("addEntityCommentPopupSpinner_"+callbackParams.entityId);showElement("addEntityCommentPopupBtn_"+callbackParams.entityId);showElement("addEntityCommentPopupCancelLink_"+callbackParams.entityId)}else{document.getElementById("entityCommentError_"+callbackParams.entityId).innerHTML=errorMessage;if(callbackParams.hidden){showElement("addEntityCommentCancelLink_"+callbackParams.entityId)}showElement("addEntityCommentBtn_"+callbackParams.entityId);hideElement("addEntityCommentSpinner_"+callbackParams.entityId)}return}callbackParams.commentId=generateAJAXResponseHTML(results.getElementsByTagName("commentId")[0].childNodes);callbackParams.commentHTML=generateAJAXResponseHTML(results.getElementsByTagName("comment")[0].childNodes);eval(callbackParams.func)(callbackParams);if(callbackParams.popup){hideCommentPopupDiv(callbackParams.entityId);hideElement("addEntityCommentPopupSpinner_"+callbackParams.entityId);showElement("addEntityCommentPopupBtn_"+callbackParams.entityId);showElement("addEntityCommentPopupCancelLink_"+callbackParams.entityId);document.getElementById("entityCommentPopupError_"+callbackParams.entityId).innerHTML=""}else{if(callbackParams.hidden){hideElement("addComment_"+callbackParams.entityId);showElement("addEntityCommentCancelLink_"+callbackParams.entityId)}document.getElementById("entityCommentText_"+callbackParams.entityId).value="";$("#entityCommentText_"+callbackParams.entityId).textlimit("#textCommentSize_"+callbackParams.entityId,1000);showElement("addEntityCommentBtn_"+callbackParams.entityId);document.getElementById("entityCommentError_"+callbackParams.entityId).innerHTML="";hideElement("addEntityCommentSpinner_"+callbackParams.entityId);if($("#addCommentIcon_"+callbackParams.entityId).size()>0){showElement("addCommentIcon_"+callbackParams.entityId)}}}function deleteEntityComment(c,b,d,g,h,a){var f=new Object();f.action="deleteComment";f.entityId=b;f.entityType=d;f.commentId=c;if(a&&a!=""){f.parentEntityId=a}var e=new Object();e.delFunc=h;e.commentId=c;e.source=g;e.entityId=b;formSubmitAJAX("/za/entity-comment",f,"deleteEntityCommentCallback",e)}function deleteEntityCommentCallback(results,callbackParams){eval(callbackParams.delFunc)(callbackParams)}function hideCommentPopupDiv(a){hideElement("addCommentPopup");$("#addCommentPopup").find('div[id*="Hearting"]').hide();document.getElementById("entityCommentPopupError_"+a).innerHTML="";document.getElementById("entityCommentTextPopup_"+a).value="";$("#entityCommentTextPopup_"+a).textlimit("#textPopupCommentSize_"+a,1000)}function showCommentPopupDiv(a,b){document.getElementById("entityCommentTextPopup_"+a).value="";if(b){$("#addCommentPopup").find('div[id*="Hearting"]').show()}showElement("addCommentPopup");centerElement(document.getElementById("addCommentPopup"),0,1200)}function K4Dialog(b,a){this.ciPopupDiv;this.dialogId=b;this.dialogTitle=null;this.isModalOpen=false;this._dialogTitleVisible=false;if(!this.ciPopupDiv){$("body").append("
");this.ciPopupDiv=$("#"+this.dialogId);this.ciPopupDiv.dialog({autoOpen:false})}this.ciPopupDiv.addClass("clearfix");this.ciPopupDiv.dialog("option","dialogClass",null);this.ciPopupDiv.dialog("option","draggable",false);this.ciPopupDiv.dialog("option","resizable",false);this.ciPopupDiv.dialog("option","closeOnEscape",false);this.ciPopupDiv.dialog("option","minHeight",0);this.ciPopupDiv.dialog("option","maxHeight",400);this.ciPopupDiv.dialog("option","height","auto");this.ciPopupDiv.dialog("option","minWidth",0);this.ciPopupDiv.dialog("option","maxWidth",600);this.ciPopupDiv.dialog("option","closeText","");this.widget=this.ciPopupDiv.dialog("widget");this.dialogTitle=jQuery(this.widget.children()[0]);this.dialogTitle.detach();this.dialogTitle.attr("visible",false);if(a){if(a.title){this.ciPopupDiv.dialog("option","title",a.title);if(a.titleClass){this.dialogTitle.addClass(a.titleClass)}this.ciPopupDiv.before(this.dialogTitle);this.dialogTitle.attr("visible",true)}if(a.contentClass){this.ciPopupDiv.addClass(a.contentClass)}if(a.dialogClass){this.ciPopupDiv.dialog("option","dialogClass",a.dialogClass)}if(a.draggable){this.ciPopupDiv.dialog("option","draggable",true)}if(a.resizable){this.ciPopupDiv.dialog("option","resizable",true)}if(a.closeOnEscape){this.ciPopupDiv.dialog("option","closeOnEscape",true)}if(a.minHeight){this.ciPopupDiv.dialog("option","minHeight",a.minHeight)}if(a.maxHeight){this.ciPopupDiv.dialog("option","maxHeight",a.maxHeight)}if(a.height){this.ciPopupDiv.dialog("option","height",a.height)}if(a.minWidth){this.ciPopupDiv.dialog("option","minWidth",a.minWidth)}if(a.maxWidth){this.ciPopupDiv.dialog("option","maxWidth",a.maxWidth)}if(a.width){this.ciPopupDiv.dialog("option","width",a.width)}if(a.closeText){this.ciPopupDiv.dialog("option","closeText",a.closeText)}if(a.zIndex){this.ciPopupDiv.dialog("option","zIndex",a.zIndex)}}this.appendElement=function(c){this.ciPopupDiv.append(c)};this.bindEvent=function(c,d){this.ciPopupDiv.bind(c,d)};this.unbindEvent=function(c){this.ciPopupDiv.unbind(c)};this.triggerEvent=function(c,d){this.ciPopupDiv.trigger(c,d)};this.openDialog=function(c){if(c){this.isModalOpen=true;$("body").append('
');$("#k4dialog_modal_overlay").height(jQuery(document).height());$("#k4dialog_modal_overlay").width(jQuery(document).width());$("#k4dialog_modal_overlay").css("z-index",this.ciPopupDiv.dialog("option","zIndex")-1)}this.ciPopupDiv.dialog("open")};this.closeDialog=function(){if(this.isModalOpen){$("#k4dialog_modal_overlay").remove()}this.ciPopupDiv.dialog("close")};this.disableDialog=function(c){this.ciPopupDiv.dialog("option","disabled",c)};this.killDialog=function(){this.ciPopupDiv.remove()};this.width=function(c){if(c){this.ciPopupDiv.dialog("option","width",c)}else{return this.ciPopupDiv.dialog("option","width")}};this.height=function(c){if(width){this.ciPopupDiv.dialog("option","height",c)}else{return this.ciPopupDiv.dialog("option","height")}};this.setTitle=function(d,c){if(d){this.ciPopupDiv.dialog("option","title",d);if(c){this.dialogTitle.addClass(c)}if(!this.isTitleVisible()){this.ciPopupDiv.before(this.dialogTitle);this.dialogTitle.attr("visible",true)}}else{return this.ciPopupDiv.dialog("option","title")}};this.isTitleVisible=function(){return this.dialogTitle.attr("visible")};this.isDialogOpen=function(){return this.ciPopupDiv.dialog("isOpen")};this.setInlineDialogStyle=function(c){this.widget.css(c)};this.positionRelative=function(e,g,d,f,c){this.widget.position({my:e,at:g,of:d,collision:f,using:c})};this.positionAbsolute=function(d,c){this.ciPopupDiv.dialog("option","position",[d,c])};this.getDialogOffset=function(){return this.widget.offset()}}var k4CatHover;function K4CatalogItemPopup(a){if(k4CatHover&&k4CatHover!="undefined"){return k4CatHover}this.enterTimeout=500;this.leaveTimeout=500;if(a){if(a.enterTimeout){this.enterTimeout=a.enterTimeout}if(a.leaveTimeout){this.leaveTimeout=a.leaveTimeout}}this._k4CatalogDivId="catalogItemHoverDiv";this._k4CatalogContentIFrameId="catalogItemHoverContentIFrame";this._k4CatalogDivSpinnerId="catalogHoverSpinner";this._k4CatalogLeftArrowId="catalogHoverLeftArrow";this._k4CatalogRightArrowId="catalogHoverRightArrow";this.ciDialog;this.ciPopupSpinner;this.ciPopupContentIFrame;this.ciPopupLeftArrow;this.ciPopupRightArrow;this.currentTarget=null;this.loadedCatalogItemId=null;this.popupTimer=null;this._catalogLoadedContents=new Array();if(!this.ciDialog){var a={contentClass:"prodHoverBorder clearfix",zIndex:"99998",width:"400px"};this.ciDialog=new K4Dialog(this._k4CatalogDivId,a);this.ciDialog.setInlineDialogStyle({position:"absolute"});this.ciDialog.bindEvent("mouseleave",function(){k4CatHover.clearTimer();k4CatHover.startTimer("k4CatHover.hide();",k4CatHover.leaveTimeout)});this.ciDialog.bindEvent("mouseenter",function(){k4CatHover.clearTimer()});this.ciDialog.appendElement("");this.ciDialog.appendElement("");this.ciDialog.appendElement("");this.ciPopupLeftArrow=$("#"+this._k4CatalogLeftArrowId);this.ciPopupRightArrow=$("#"+this._k4CatalogRightArrowId);this.ciDialog.appendElement("");this.ciPopupSpinner=$("#"+this._k4CatalogDivSpinnerId);var b="