var javascriptReady=false;var addToCartRefreshId=null;if(launchModalOnPageLoad===undefined){var launchModalOnPageLoad=false;var ModalPopupID=""}if(showVideoOnPageLoad===undefined){var showVideoOnPageLoad=false;var pageLoadVideoPath=""}function TrapEnterKey(event,exeFunction){var keyCode=(event.keyCode)?event.keyCode:(event.which)?event.which:event.charCode;if(keyCode==13){if(exeFunction){eval(exeFunction);return false}}}function HideImageOnError(a){a.style.display="none"}function DisplayContentModal(a){Melaleuca.Web.AjaxManager.DisplayContent(a,"Popup","GeneralMessageDisplayPopUp",false,ReturnDisplayContentModal)}function ReturnDisplayContentModal(a){getGeneralPopUp(a)}function DisplayPromotionModal(a){DisplayPromotion(a,"PopupFullWidth","FullPagePromotionPopUp","ProductStoreFlash",false)}function DisplayPromotion(a,c,e,d,b){Melaleuca.Web.AjaxManager.DisplayPromotionContentByID(a,c,e,d,b,ReturnDisplayPromotionModal)}function ReturnDisplayPromotionModal(returnVal){eval(returnVal)}function getFullPagePromotionPopUp(a){$get("FullPagePromotionPopUpContent").innerHTML=a;showModalPopup("FullPagePromotionPopUp")}function getGeneralMessageNoCloseContent(a){$get("GeneralMessageNoCloseContent").innerHTML=a;showModalPopup("popGeneralMessageCenterNoClose")}function selectCountryCulture(a){Melaleuca.Web.AjaxManager.SelectCountryCulture(a,returnSelectCountryCulture)}function returnSelectCountryCulture(a){window.location=a}function RadioButtonInRepeater_Click(a,c,b){re=new RegExp(a+".*"+c);for(i=0;i<document.forms[0].elements.length;i++){elm=document.forms[0].elements[i];if(elm.type=="radio"){if(re.test(elm.name)){elm.checked=false}}}b.checked=true}function PageManager(a){this.PageCountLinkArr=a}PageManager.prototype.SetPageCountLinkStyle=function(a){for(i=0;i<this.PageCountLinkArr.length;i++){this.PageCountLinkArr[i].className=(this.PageCountLinkArr[i].id==a.id)?"pageCountSelected":"pageCountNotSelected"}};function pageLoad(){javascriptReady=true;if(launchModalOnPageLoad){showModalPopup(ModalPopupID)}if(showVideoOnPageLoad){ViewVideo(pageLoadVideoPath)}}function showModalPopup(a){stopAddAnimation();$find(a).show();window.scrollTo(0,0)}function closeModalPopup(a){var b=$find(a);if(b){b.hide()}}function GoToPage(b,d){var c=b;var a="/";if(c.indexOf("/")==0&&c.length>1){c=b.substr(1).toLowerCase()}c=c.toLowerCase();switch(c){case"checkout":a="/ProductStore/Checkout.aspx";break;case"cart":a="/ProductStore/Cart.aspx";break;case"signin":a="/Shared/SignIn.aspx";break;case"mypreferences":a="/MyAccount/MyPreferences.aspx";break;case"productstore":a="/ProductStore/ProductStore.aspx";break;case"helpcenter":a="/HelpCenter/HelpCenter.aspx";break;case"introduction":a="/Introduction/Default.aspx";break;case"myfavorites":a="/ProductStore/MyFavorites.aspx";break;case"creditcard":a="/MarketPlace/Content.aspx?Page=Credit_Card";break;case"addmelaleucamastercard":a="/MyAccount/EditPaymethod.aspx?AddMelaleucaMasterCard=true";break;case"createwebaccount":a="/Shared/CreateWebAccessNew.aspx";default:a=b;break}if(d===undefined){window.location=a}else{window.open(a,d)}}function RedirectFromDropDown(a){if($get(a).options[$get(a).selectedIndex].value!="none"){location=$get(a).options[$get(a).selectedIndex].value}}function executeLinkButton(btnID){var btn=$get(btnID);if(btn){try{eval(btn.getAttribute("href"))}catch(err){window.location=btn.getAttribute("href")}}}function disableWebButton(a){var b=$get(a);if(b!=null){b.className="disabled"}}function getGeneralPopUp(a){$get("GeneralMessageContent").innerHTML=a;showModalPopup("GeneralMessageDisplayPopUp")}function getGeneralCenterNoClosePopUp(a){$get("GeneralMessageNoCloseContent").innerHTML=a;showModalPopup("popGeneralMessageCenterNoClose")}function gotoProductPage(b,a){cmCreateElementTag("Recommendation Click",a);window.location="/ProductStore/Product.aspx?sku="+b}String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};String.prototype.lTrim=function(){return this.replace(/^\s*/g,"")};String.prototype.rTrim=function(){return this.replace(/\s*$/g,"")};function GetValueFromControl(a){var b=$get(a);if(b!=null){return b.value}else{return null}}function getSelectedValueFromDropDown(a){var c=null;var b=$get(a);if(b!=null){c=b.options[b.selectedIndex].value}return c}function isBtnEnabled(a){if(a!=null&&a.className.search(/disabled/)==-1){return true}else{return false}}function addToCartRefresh(){try{if(addToCartRefreshId!=null){__doPostBack(addToCartRefreshId,"")}}catch(a){}}function rtnAddToCart(rtn){try{if(rtn.Analytics!=null){eval(rtn.Analytics)}if(rtn.Javascript!=null){eval(rtn.Javascript)}else{if(rtn.HtmlMessage!=null){alert(rtn.HtmlMessage)}}addToCartRefresh();if(rtn.Promotion!=null){eval(rtn.Promotion)}}catch(err){}}function browserWidth(){return window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null}function browserHeight(){return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null}var addToDestTweens=new Array();function AnimateAddToDest(b,c){try{elemBtn=b;elemBox=$get("animatedCartBox");elemDest=$get(c);startPos=WebForm_GetElementPosition(elemBtn);endPos=WebForm_GetElementPosition(elemDest);stopAddAnimation();elemBox.style.left=startPos.x;elemBox.style.top=startPos.y;elemBox.style.width=elemBtn.offsetWidth;elemBox.style.height=elemBtn.offsetHeight;elemBox.style.display="block";addToDestTweens[0]=t1=new Tween(elemBox.style,"left",null,startPos.x,endPos.x,0.8,"px");addToDestTweens[1]=t2=new Tween(elemBox.style,"top",null,startPos.y,endPos.y,0.8,"px");addToDestTweens[2]=t3=new Tween(elemBox.style,"width",null,elemBtn.offsetWidth,elemDest.offsetWidth,0.8,"px");addToDestTweens[3]=t4=new Tween(elemBox.style,"height",null,elemBtn.offsetHeight,elemDest.offsetHeight,0.8,"px");t2.onMotionFinished=function(){elemBox.style.display="none"};t1.start();t2.start();t3.start();t4.start()}catch(a){}}function stopAddAnimation(){elemBox=$get("animatedCartBox");elemBox.style.display="none";if(addToDestTweens.length>0){for(var a=0,b=addToDestTweens.length;a<b;a++){addToDestTweens[a].stop()}}}function findPosition(a){if(typeof(a.offsetParent)!="undefined"){for(var c=0,b=0;a;a=a.offsetParent){c+=a.offsetLeft;b+=a.offsetTop}return[c,b]}else{return[a.x,a.y]}}function Delegate(){}Delegate.create=function(g,e){var c=new Array();var b=arguments.length;for(var d=2;d<b;d++){c[d-2]=arguments[d]}return function(){var a=[].concat(arguments,c);e.apply(g,a)}};Tween=function(f,g,d,c,b,e,a){this.init(f,g,d,c,b,e,a)};var t=Tween.prototype;t.obj=new Object();t.prop="";t.func=function(e,a,g,f){return g*e/f+a};t.begin=0;t.change=0;t.prevTime=0;t.prevPos=0;t.looping=false;t._duration=0;t._time=0;t._pos=0;t._position=0;t._startTime=0;t._finish=0;t.name="";t.suffixe="";t._listeners=new Array();t.setTime=function(a){this.prevTime=this._time;if(a>this.getDuration()){if(this.looping){this.rewind(a-this._duration);this.update();this.broadcastMessage("onMotionLooped",{target:this,type:"onMotionLooped"})}else{this._time=this._duration;this.update();this.stop();this.broadcastMessage("onMotionFinished",{target:this,type:"onMotionFinished"})}}else{if(a<0){this.rewind();this.update()}else{this._time=a;this.update()}}};t.getTime=function(){return this._time};t.setDuration=function(a){this._duration=(a==null||a<=0)?100000:a};t.getDuration=function(){return this._duration};t.setPosition=function(c){this.prevPos=this._pos;var b=this.suffixe!=""?this.suffixe:"";this.obj[this.prop]=Math.round(c)+b;this._pos=c;this.broadcastMessage("onMotionChanged",{target:this,type:"onMotionChanged"})};t.getPosition=function(a){if(a==undefined){a=this._time}return this.func(a,this.begin,this.change,this._duration)};t.setFinish=function(a){this.change=a-this.begin};t.geFinish=function(){return this.begin+this.change};t.init=function(f,g,d,c,b,e,a){if(!arguments.length){return}this._listeners=new Array();this.addListener(this);if(a){this.suffixe=a}this.obj=f;this.prop=g;this.begin=c;this._pos=c;this.setDuration(e);if(d!=null&&d!=""){this.func=d}this.setFinish(b)};t.start=function(){this.rewind();this.startEnterFrame();this.broadcastMessage("onMotionStarted",{target:this,type:"onMotionStarted"})};t.rewind=function(a){this.stop();this._time=(a==undefined)?0:a;this.fixTime();this.update()};t.fforward=function(){this._time=this._duration;this.fixTime();this.update()};t.update=function(){this.setPosition(this.getPosition(this._time))};t.startEnterFrame=function(){this.stopEnterFrame();this.isPlaying=true;this.onEnterFrame()};t.onEnterFrame=function(){if(this.isPlaying){this.nextFrame();setTimeout(Delegate.create(this,this.onEnterFrame),0)}};t.nextFrame=function(){this.setTime((this.getTimer()-this._startTime)/1000)};t.stop=function(){this.stopEnterFrame();this.broadcastMessage("onMotionStopped",{target:this,type:"onMotionStopped"})};t.stopEnterFrame=function(){this.isPlaying=false};t.continueTo=function(a,b){this.begin=this._pos;this.setFinish(a);if(this._duration!=undefined){this.setDuration(b)}this.start()};t.resume=function(){this.fixTime();this.startEnterFrame();this.broadcastMessage("onMotionResumed",{target:this,type:"onMotionResumed"})};t.yoyo=function(){this.continueTo(this.begin,this._time)};t.addListener=function(a){this.removeListener(a);return this._listeners.push(a)};t.removeListener=function(d){var b=this._listeners;var c=b.length;while(c--){if(b[c]==d){b.splice(c,1);return true}}return false};t.broadcastMessage=function(){var b=new Array();for(var f=0;f<arguments.length;f++){b.push(arguments[f])}var g=b.shift();var d=this._listeners;var c=d.length;for(var f=0;f<c;f++){if(d[f][g]){d[f][g].apply(d[f],b)}}};t.fixTime=function(){this._startTime=this.getTimer()-this._time*1000};t.getTimer=function(){return new Date().getTime()-this._time};Tween.backEaseIn=function(g,e,l,k,f,j){if(h==undefined){var h=1.70158}return l*(g/=k)*g*((h+1)*g-h)+e};Tween.backEaseOut=function(g,e,l,k,f,j){if(h==undefined){var h=1.70158}return l*((g=g/k-1)*g*((h+1)*g+h)+1)+e};Tween.backEaseInOut=function(g,e,l,k,f,j){if(h==undefined){var h=1.70158}if((g/=k/2)<1){return l/2*(g*g*(((h*=(1.525))+1)*g-h))+e}return l/2*((g-=2)*g*(((h*=(1.525))+1)*g+h)+2)+e};Tween.elasticEaseIn=function(g,e,l,k,f,j){if(g==0){return e}if((g/=k)==1){return e+l}if(!j){j=k*0.3}if(!f||f<Math.abs(l)){f=l;var h=j/4}else{var h=j/(2*Math.PI)*Math.asin(l/f)}return -(f*Math.pow(2,10*(g-=1))*Math.sin((g*k-h)*(2*Math.PI)/j))+e};Tween.elasticEaseOut=function(g,e,l,k,f,j){if(g==0){return e}if((g/=k)==1){return e+l}if(!j){j=k*0.3}if(!f||f<Math.abs(l)){f=l;var h=j/4}else{var h=j/(2*Math.PI)*Math.asin(l/f)}return(f*Math.pow(2,-10*g)*Math.sin((g*k-h)*(2*Math.PI)/j)+l+e)};Tween.elasticEaseInOut=function(g,e,l,k,f,j){if(g==0){return e}if((g/=k/2)==2){return e+l}if(!j){var j=k*(0.3*1.5)}if(!f||f<Math.abs(l)){var f=l;var h=j/4}else{var h=j/(2*Math.PI)*Math.asin(l/f)}if(g<1){return -0.5*(f*Math.pow(2,10*(g-=1))*Math.sin((g*k-h)*(2*Math.PI)/j))+e}return f*Math.pow(2,-10*(g-=1))*Math.sin((g*k-h)*(2*Math.PI)/j)*0.5+l+e};Tween.bounceEaseOut=function(e,a,g,f){if((e/=f)<(1/2.75)){return g*(7.5625*e*e)+a}else{if(e<(2/2.75)){return g*(7.5625*(e-=(1.5/2.75))*e+0.75)+a}else{if(e<(2.5/2.75)){return g*(7.5625*(e-=(2.25/2.75))*e+0.9375)+a}else{return g*(7.5625*(e-=(2.625/2.75))*e+0.984375)+a}}}};Tween.bounceEaseIn=function(e,a,g,f){return g-Tween.bounceEaseOut(f-e,0,g,f)+a};Tween.bounceEaseInOut=function(e,a,g,f){if(e<f/2){return Tween.bounceEaseIn(e*2,0,g,f)*0.5+a}else{return Tween.bounceEaseOut(e*2-f,0,g,f)*0.5+g*0.5+a}};Tween.strongEaseInOut=function(e,a,g,f){return g*(e/=f)*e*e*e*e+a};Tween.regularEaseIn=function(e,a,g,f){return g*(e/=f)*e+a};Tween.regularEaseOut=function(e,a,g,f){return -g*(e/=f)*(e-2)+a};Tween.regularEaseInOut=function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e+a}return -g/2*((--e)*(e-2)-1)+a};Tween.strongEaseIn=function(e,a,g,f){return g*(e/=f)*e*e*e*e+a};Tween.strongEaseOut=function(e,a,g,f){return g*((e=e/f-1)*e*e*e*e+1)+a};Tween.strongEaseInOut=function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e*e*e*e+a}return g/2*((e-=2)*e*e*e*e+2)+a};OpacityTween.prototype=new Tween();OpacityTween.prototype.constructor=Tween;OpacityTween.superclass=Tween.prototype;function OpacityTween(e,b,d,a,c){this.targetObject=e;this.init(new Object(),"x",b,d,a,c)}var o=OpacityTween.prototype;o.targetObject={};o.onMotionChanged=function(a){var b=a.target._pos;var c=this.targetObject;c.style.opacity=b/100;c.style["-moz-opacity"]=b/100;if(c.filters){c.filters.alpha.opacity=b}};var openHeaders=new Array();var openDropDowns=new Array();var overcount=0;function DropDownOut(a,c,b){if(overcount<=0){c.className="normalheader";if(b.style.display!="none"){b.style.display="none";if(b.id=="MiniCartDropDown"){cmCreateElementTag("miniCartAction","miniCart","close-_-auto")}}}}function overdropdown(a){overcount++}function outdropdown(a,c,b){overcount--;if(overcount<=0){if(a.timer){clearTimeout(a.timer)}a.timer=setTimeout(function(){DropDownOut(a,c,b)},2000)}}function attachDropDownHooks(b,a){b.onmouseover=function(){overdropdown(this)};b.onmouseout=function(){outdropdown(this,b,a)};a.onmouseover=function(){overdropdown(this)};a.onmouseout=function(){outdropdown(this,b,a)};overcount=1}function closeDropDowns(a,d){var b=false;if(openHeaders.length>0){while(openHeaders.length>0){var e=openHeaders.pop();if(e!=a){e.className="normalheader"}}}if(openDropDowns.length>0){while(openDropDowns.length>0){var c=openDropDowns.pop();if(c!=d){c.style.display="none";if(c.id=="MiniCartDropDown"){b=true}}}}if(b){cmCreateElementTag("miniCartAction","miniCart","close-_-manual")}}var DoNotOpen=false;function OpenDropDown(c,d,b,a){if(!DoNotOpen){var f=$get(c);var e=$get(d);closeDropDowns(f,e);if(e.style.display=="none"||e.style.display==""){f.className="shadowheader";e.style.display="block";if(d=="MiniCartDropDown"){cmCreateElementTag("miniCartAction","miniCart","open")}b();if(a){attachDropDownHooks(f,e)}openHeaders.push(f);openDropDowns.push(e)}else{f.className="normalheader";e.style.display="none"}}}function CloseDropDownPopup(){var a=document.getElementsByName("dropDownPopupWrapper");for(var b=0;b<a.length;b++){a[b].innerHTML=""}}function processKitPromotion(a,g,k,b,f,d,c,j,e,l){if(e==undefined){e=-1}Melaleuca.Web.AjaxManager.ProcessKitPromotion(a,g,k,j,e,l,processPromotionReturn);b.innerHTML=b.innerHTML.replace(f,d);b.className="disabled";var h=$get("removePromoButton"+a+"_btn");if(h!=null){h.className="disabled"}}function AddFlashPromotionToCart(d,c,b,a){Melaleuca.Web.AjaxManager.ProcessFlashPromotion(a,d,c,processPromotionReturn)}function processPromotion(a,b,g,h,e,c,n,j,f,d){if(f==undefined){f=-1}var m=1;if(j!==undefined){var l=$get(j);if(l!=null){m=l.options[l.selectedIndex].text}}Melaleuca.Web.AjaxManager.ProcessPromotion(a,m,f,n,function(p){processPromotionReturn(p);d()});if(b!=null){b.innerHTML=b.innerHTML.replace(h,e);b.className="disabled";var k=$get("removePromoButton"+a+"_btn");if(k!=null){k.className="disabled"}}}function processPromotionBySku(b,d,c,a){Melaleuca.Web.AjaxManager.ProcessPromotionBySku(b,d,c,a,function(e){processPromotionReturn(e)})}function processPromotionReturn(arg){try{if(arg.Analytics!=null){eval(arg.Analytics)}if(arg.Javascript!=null){eval(arg.Javascript)}}catch(err){}}function RemovePromotionIDs(a){Melaleuca.Web.AjaxManager.RemovePromotions(a,removePromotionReturn)}function removePromotion(b,a){Melaleuca.Web.AjaxManager.RemovePromotion(b,a,removePromotionReturn)}function declinePromotionFromWebButton(a,b){Melaleuca.Web.AjaxManager.DeclinePromotionFromWebButton(a,b,removePromotionReturn)}function removePromotionReturn(arg){if(arg.Javascript!=null){eval(arg.Javascript)}}function processCouponPromotion(a){Melaleuca.Web.AjaxManager.ProcessCouponPromotion(a,window.location.href,processCouponPromotionReturn)}function processCouponPromotionReturn(arg){if(arg.Javascript!=null){eval(arg.Javascript)}if(arg.HtmlMessage!=null){var errorLabel=$get("couponErrorLabel");if(errorLabel!=null){errorLabel.innerHTML=arg.HtmlMessage}else{getGeneralPopUp(arg.HtmlMessage)}if(arg.RedirectURL!=null){window.location=arg.RedirectURL}}if(arg.Analytics!=null){eval(arg.Analytics)}}function CouponFocusBlurEventHandler(a,b){var c="";if(a){if(document.activeElement==a){if(a.value==b){a.value=c}}else{if(a.value==c){a.value=b}}}}if(!Array.prototype.find){Array.prototype.find=function(a){var b=false;for(i=0;i<this.length;i++){if(typeof(a)=="function"){if(a.test(this[i])){if(!b){b=[]}b.push(i)}}else{if(this[i]===a){if(!b){b=[]}b.push(i)}}}return b}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b){var a=this.length;var c=Number(arguments[1])||0;c=(c<0)?Math.ceil(c):Math.floor(c);if(c<0){c+=a}for(;c<a;c++){if(c in this&&this[c]===b){return c}}return -1}}if(!Array.prototype.toDeliminatedString){Array.prototype.toDeliminatedString=function(b){var d="";for(var c=0,a=this.length;c<a;c++){d+=this[c];if(c<(a-1)){d+=b}}return d}}function GetVideoName(b){var a=b;var c;if(b.length>0){if(b.indexOf("/")>-1){c=b.split("/");a=c[(c.length-1)]}}return a}function RevertBackDating(a){Melaleuca.Web.AjaxManager.RevertBackDating(a,returnBackDateSelection)}function BackDateSelection(b,a){Melaleuca.Web.AjaxManager.BackDateAction(b,a,returnBackDateSelection)}function returnBackDateSelection(a){if(a.BackDatingConfirmationContent){getGeneralCenterNoClosePopUp(a.BackDatingConfirmationContent)}else{if(a.BackDatingConfirmed!=undefined&&a.BackDatingConfirmed==true){if(a.RedirectUrl!=undefined&&a.RedirectUrl!=""){window.location=a.RedirectUrl}else{window.location.reload(true)}}}}function ResetBackDatePrompt(){Melaleuca.Web.AjaxManager.ResetBackDatePrompt(returnBackDateSelection)}function Toggle(a){var b=$get(a);$common.setVisible(b,!$common.getVisible(b))}function FormatPhone(b,c){var d=c.value.replace(/[^\d]/g,"");var a;switch(b){case 1:case 2:a=FormatPhoneUS(d);break;default:a=d;break}c.value=a}function FormatPhoneUS(c){var b="";var a=c.length;if(a>0){b="(";if(a<3){b+=c.substring(0,a)}else{b+=c.substring(0,3)+") ";if(a<6){b+=c.substring(3,a)}else{b+=c.substring(3,6)+" - "+c.substring(6,10)}}}return b}function FormatBirthdate(b,c){var d=c.value.replace(/[^\d]/g,"");var a;switch(b){case 1:case 2:a=FormatBirthdateUS(d);break;default:a=d;break}c.value=a}function FormatBirthdateUS(d){var a="";var c=d.length;if(c<2){a=d.substring(0,c)}else{a=d.substring(0,2)+"/";if(c<4){a+=d.substring(2,c)}else{a+=d.substring(2,4)+"/"+d.substring(4,8)}}return a}function IsValidEmail(a){var b=new RegExp(/^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/);return a.match(b)==a}function ReadQueryStringParameters(){var a=new Array();var e=window.location.search.substring(1);var d=e.split("&");for(var c=0;c<d.length;c++){var g=d[c].indexOf("=");if(g>0){var b=d[c].substring(0,g);var f=d[c].substring(g+1);a[b]=f}}return a}function textCounter(c,a,b){if(c.value.length>b){c.value=c.value.substring(0,b)}a.innerHTML=b-c.value.length}function appendCulture(a){var b;if(window.location.href.indexOf("culture=")>-1){var e=window.location.href;var c=window.location.href.indexOf("culture=")+8;e=(e.replace(e.substring(c,c+5),a));b=e}else{if(window.location.href.indexOf("?")>-1){var d=window.location.href;urlAddOn=(d+"&culture="+a);b=urlAddOn}else{b=window.location.href;b=(b+"?culture="+a);b.replace("melaleuca.com/?","melaleuca.com/Default.aspx?")}}return b}function EditTextBoxOnFocus(a,c,b){var e=$get(a);var d=$get(c);if(e.value==d.value){e.value="";e.className=b}}function EditTextBoxOnBlur(a,c,b){var e=$get(a);var d=$get(c);if(e.value==""){e.value=d.value;e.className=b}}function AddProductToCartFromFlash(c,b,a){Melaleuca.Web.AjaxManager.AddProductToCart(c,b,a,function(d){if(window.addToCartRefresh){addToCartRefresh()}})}function setupTextboxClientValidator(b,a){var c=new Object();c.isvalid=true;c.evaluationfunction=new Function("var isValid = checkTextBoxValidators( $get('"+b+"') ); toggleTextboxValidatorDisplay( isValid, $get('"+a+"' ), '' );return isValid; ");c.style=new Object();if(typeof Page_Validators!="undefined"&&Page_Validators!=null){Page_Validators.push(c)}}function checkTextBoxValidators(b){var a=true;if(b!=null&&b.Validators!=null){for(index in b.Validators){validator=b.Validators[index];if(validator.isvalid!=null){if(!validator.isvalid){a=false;break}}}}return a}function checkValidators(b,a){if(b!=null&&b.Validators!=null){for(index in b.Validators){validator=b.Validators[index];if(validator.isvalid!=null){if(!validator.isvalid){a.className="showErrorMessage";break}else{a.className=""}}}}}function toggleTextboxValidatorDisplay(c,a,b){if(!c){if(a!=null){a.className="showErrorMessage"}}else{if(a!=null){a.className=b}}};
