function createNamespace(D){var C=D.split(".");var A=window;for(var B=0;B<C.length;B++){if(typeof A[C[B]]=="undefined"){A[C[B]]=new Object()}A=A[C[B]]}return A}createNamespace("limeade.services");limeade.services.sendRequest=function(B,I,K,D,E,G){var H=limeade.services.createXMLHTTPObject();if(!H){return}var A=(D)?"POST":"GET";var J=(E==false)?E:true;var C=new Date();var F="";if(!G||G!=true){if(A=="GET"){F=(B.indexOf("?")==-1)?"?nocache=":"&nocache=";F=F+C.getTime();B=B+F}else{if(A=="POST"){D+="&nocache="+C.getTime()}}}H.open(A,B,J);H.setRequestHeader("User-Agent","XMLHTTP/1.0");if(D){H.setRequestHeader("Content-type","application/x-www-form-urlencoded")}H.onreadystatechange=function(){limeade.services.HandleResponse(H,K,I)};if(H.readyState==4){return}H.send(D);if(!J){limeade.services.HandleResponse(H,K,I)}};limeade.services.HandleResponse=function(A,C,B){if(A.readyState!=4){return}if(A.status==401||(A.responseText.indexOf('div id="loginbox1" align="center"')!=-1&&A.responseText.indexOf('<div id="ctl00_bcr_Login1___Login1"')!=-1)){limeade.browserdetect.SessionTimedOut();return}if(A.status!=200&&A.status!=304&&A.status!=0){limeade.browserdetect.ConnectionFailed(A.status);return}else{limeade.browserdetect.HideErrorBar();C(A,B)}};limeade.services.XMLHttpFactories=[function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];limeade.services.createXMLHTTPObject=function(){var A=null;for(var B=0;B<limeade.services.XMLHttpFactories.length;B++){try{A=limeade.services.XMLHttpFactories[B]()}catch(C){continue}break}return A};limeade.services.reloadPage=function(){window.location=window.location};limeade.services.trim=function(A){return A.replace(/^\s+|\s+$/g,"")};limeade.services.trimNonBreakSpaces=function(A){return A.replace("&nbsp;","")};limeade.services.containsDOM=function(A,C){var B=false;do{if((B=A==C)){break}C=C.parentNode}while(C!=null);return B};limeade.services.checkMouseLeave=function(B,A){if(B.contains&&A.toElement){return !B.contains(A.toElement)}else{if(A.relatedTarget){return !limeade.services.containsDOM(B,A.relatedTarget)}}};limeade.services.createXMLHttpRequest=function(){if(window.ActiveXObject){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}else{if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest()}}};limeade.services.preloadImages=function(){var A=new Array();for(i=0;i<limeade.services.preloadImages.length;i++){A[i]=new Image();A[i].src=limeade.services.preloadImages.arguments[i]}};limeade.services.getBody=function(D,C,B,E){if(!E){E=C.length}var A=D.indexOf(C);var F=D.lastIndexOf(B);return D.slice(A+E,F)};limeade.services.hideElement=function(A){if(A!=null){A.style.visibility="hidden";A.style.display="none"}};limeade.services.showElement=function(A){if(A!=null){A.style.visibility="visible";A.style.display=""}};limeade.services.findPos=function(A){var B=curtop=0;if(A.offsetParent){B=A.offsetLeft;curtop=A.offsetTop;while(A=A.offsetParent){B+=A.offsetLeft;curtop+=A.offsetTop}}return[B,curtop]};limeade.services.findPosX=function(B){var A=limeade.services.findPos(B);return A[0]};limeade.services.findPosY=function(B){var A=limeade.services.findPos(B);return A[1]};limeade.services.findPosition=function(E,D){var M=E.offsetHeight;var K=limeade.services.findPos(E);var L=K[0];var B=K[1];L=L-20;var C=460;if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){C=window.innerHeight}if(navigator.appName.indexOf("Microsoft")!=-1){if(document.documentElement.clientHeight){C=document.documentElement.clientHeight}else{C=document.body.offsetHeight}}}var I,H;if(self.pageYOffset){H=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){H=document.documentElement.scrollTop}else{if(document.body){H=document.body.scrollTop}}}var G=H;var A=H+C;var J=B-(D/2);var F=B+(D/2);if(G>J){J=G+5}else{if(F>A){J=B-D-M}}return[L,J]};limeade.services.getQueryVariable=function(A){var C=window.location.search.substring(1);var D=C.split("&");for(var B=0;B<D.length;B++){var E=D[B].split("=");if(E[0]==A){return E[1]}}return null};limeade.services.getElementByClassTitle=function(F,D,A,G){if(D==null){D=document}if(A==null){A="*"}var C=D.getElementsByTagName(A);var B=C.length;var E=new RegExp("(^|\\s)"+F+"(\\s|$)");for(i=0;i<B;i++){if(E.test(C[i].className)&&(C[i].title==G)){return C[i]}}return null};limeade.services.nullFunction=function(B,A){};limeade.services.getElementsByClassName=function(D,E){var G=new Array();var F=D.getElementsByTagName("*");for(var C=0;C<F.length;C++){if(F[C].className.indexOf(" ")>=0){var B=F[C].className.split(" ");for(var A=0;A<B.length;A++){if(B[A]==E){G.push(F[C])}}}else{if(F[C].className==E){G.push(F[C])}}}return G};limeade.services.ValidateNumber=function(A){if(A==""){return -1}else{if(isNaN(A)){return 2}else{if(A.indexOf(".")>-1){if(limeade.services.trim(A.substring(A.indexOf("."),A.length-1)).length==0){return 3}else{return 5}}else{if(parseInt(A)>=0){return 1}else{return 4}}}}};limeade.services.DecrementASPControlId=function(G,D){var F=G.length;var B=D.indexOf(G+"_ctl");if(B==-1){return D}var A=D.substring(B+F+4,B+F+6);var C=parseInt(A,10);C=C-1;var E="";if(C<=9){E="0"}C=C+"";E=E+C;D=D.replace(G+"_ctl"+A,G+"_ctl"+E);return D};createNamespace("limeade.calendar");limeade.calendar.monthLabels=new Array("January","February","March","April","May","June","July","August","September","October","November","December");limeade.calendar.CalDayLabels=new Array("S","M","T","W","T","F","S");limeade.calendar.setFieldValueDisplay=function(A,B){if(B.getUTCDate()<10){document.getElementById(A).value=limeade.calendar.monthLabels[B.getUTCMonth()]+" 0"+B.getDate()+", "+B.getUTCFullYear()}else{document.getElementById(A).value=limeade.calendar.monthLabels[B.getUTCMonth()]+" "+B.getDate()+", "+B.getUTCFullYear()}};limeade.calendar.SetDate=function(D,B,A){limeade.calendar.setFieldValueDisplay(D,B);var C=$find(A);if(C!=null){C.set_selectedDate(B)}};limeade.calendar.ShowNextWeek=function(C,E,F,G,D){Year=parseInt(document.getElementById(E).value);Month=parseInt(document.getElementById(F).value);Day=parseInt(document.getElementById(G).value);if(C==true){Day=Day+7}else{Day=Day-7}var A=new Date(Year,Month,Day);var H=new Date(Year,Month,Day+6);document.getElementById(E).value=A.getFullYear();document.getElementById(F).value=A.getMonth();document.getElementById(G).value=A.getDate();var B=limeade.calendar.monthLabels[A.getMonth()]+" "+A.getDate()+" to "+monthLabels[H.getMonth()]+" "+H.getDate();document.getElementById(D).innerHTML=B;return false};createNamespace("limeade.controls");limeade.controls.ChangeMyPlanTab=function(A){if(A>0&&A<=2){var B=$find("ctl00_ctl00_bcr_TabContainerMyPlan");A-=1;if(B!=null){B.set_activeTab(B.get_tabs()[A])}}return false};limeade.controls.ChangeMyResultsTab=function(A){if(A>0&&A<=7){var B=$find("ctl00_ctl00_bcr_LifeAreasTabContainer");A-=1;if(B!=null){B.set_activeTab(B.get_tabs()[A])}}return false};limeade.controls.OnChange=function(E){var A=document.getElementById(E.id+"_TB");var C=document.getElementById(E.id+"_LB");var B=C.selectedIndex;if(B!=-1){var D=C.options[B].value;if((D.indexOf("add new units")!=-1)||(D.indexOf("add new activity")!=-1)){A.value="";A.focus()}}return true};limeade.controls.SaveButtonReset=function(A){if(A!=null&&A.value!="Save"){A.style.backgroundColor="";A.style.color="";A.value="Save"}};limeade.controls.AdjustDailyViewDown=function(A){var B=document.getElementById(A.id.replace(/DailyViewDown/,"NumericDaily"));var C=document.getElementById(A.id.replace(/DailyViewDown/,"SaveTrackingDataButton"));limeade.controls.AdjustDailyView(B,-1,C)};limeade.controls.AdjustDailyViewUp=function(A){var B=document.getElementById(A.id.replace(/DailyViewUp/,"NumericDaily"));var C=document.getElementById(A.id.replace(/DailyViewUp/,"SaveTrackingDataButton"));limeade.controls.AdjustDailyView(B,1,C)};limeade.controls.AdjustDailyView=function(B,C,A){if(B!=null){var D=0;if(B.value!=""){D=(parseFloat(B.value)+C)}if(D>=0){B.value=D}limeade.controls.SaveButtonReset(A)}};limeade.controls.NumericDailyChanged=function(A){var B=document.getElementById(A.id.replace(/NumericDaily/,"SaveTrackingDataButton"));limeade.controls.SaveButtonReset(B)};createNamespace("limeade.browserdetect");limeade.browserdetect.displayBrowserWarning=function(A){limeade.browserdetect.IE6=((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1))?true:false;limeade.browserdetect.IE7=((document.all)&&(navigator.appVersion.indexOf("MSIE 7.")!=-1))?true:false;limeade.browserdetect.IE8=((document.all)&&(navigator.appVersion.indexOf("MSIE 8.")!=-1))?true:false;limeade.browserdetect.FF3=((navigator.userAgent.indexOf("Firefox/3")!=-1))?true:false;limeade.browserdetect.FF2=((navigator.userAgent.indexOf("Firefox/2")!=-1))?true:false;limeade.browserdetect.FF1=((navigator.userAgent.indexOf("Firefox/1")!=-1))?true:false;if(!limeade.browserdetect.IE6&&!limeade.browserdetect.IE7&&!limeade.browserdetect.IE8&&!limeade.browserdetect.FF1&&!limeade.browserdetect.FF2&&!limeade.browserdetect.FF3){var B=document.getElementById(A);B.style.display="block";B.style.visibility="visible"}};limeade.browserdetect.ConnectionFailed=function(A){var B=document.getElementById("IncompatibleBrwsrLbl");if(B!=null){switch(A){case 408:B.innerHTML="Your connection has timed out. Please ensure you're connected to the internet and try again.";break;default:B.innerHTML="Unable to connect to the internet right now. Please ensure you're connected to the internet and try again.";break}limeade.services.showElement(B);B.style.display="block"}};limeade.browserdetect.SessionTimedOut=function(){var A=document.getElementById("IncompatibleBrwsrLbl");if(A!=null){A.innerHTML='You are not signed in! <a href="/BrandedLogin.aspx"  style="color:Black;">Click here</a> to sign in again.';limeade.services.showElement(A);A.style.display="block"}};limeade.browserdetect.HideErrorBar=function(){if(document.getElementById("IncompatibleBrwsrLbl")!=null){if(document.getElementById("IncompatibleBrwsrLbl").innerHTML.indexOf("For the best experience")==-1){limeade.services.hideElement(document.getElementById("IncompatibleBrwsrLbl"))}}};createNamespace("limeade.incentives");limeade.incentives.showIncentivePts=function(){limeade.services.showElement(document.getElementById("WellPoints"))};limeade.incentives.updatepoints=function(){limeade.services.sendRequest("/Incentives/ManageIncentives.aspx?op=calculate",null,limeade.services.nullFunction,null,true)};createNamespace("limeade.web.ui.grid");limeade.web.ui.grid.HighlightRow=function(A){A.className="hightlighrow MyPlanGoal"};limeade.web.ui.grid.DeHighlightRow=function(A){A.className="normalrow MyPlanGoal"};createNamespace("limeade.web.ui.messages");limeade.web.ui.messages.DismissMsg=function(B,C){limeade.services.hideElement(C);var A="/User/DismissMessage.aspx?msg="+B;limeade.services.sendRequest(A,null,limeade.services.nullFunction)};createNamespace("limeade.popups");limeade.popups.popupDelay=400;limeade.popups.closePopupDelay=800;limeade.popups.closeGoalTimer;limeade.popups.showAddToPlanButton="true";limeade.popups.currentlocation="";limeade.popups.showGoalTimer;limeade.popups.mode="edit";limeade.popups.HandleResourcePageChange=function(B,C){var D=C[2];var A=B.responseText;A=A.replace("ShowNextResource(","ShowNextResource("+C[0]+","+C[1]+",");D.html(A)};limeade.popups.HidePopup=function(){if($(".popupMenu")){$(".popupMenu").hide()}if(document.getElementById("viewyourplan")!=null){limeade.services.hideElement(document.getElementById("viewyourplan"))}};limeade.popups.HideGoal=function(){clearTimeout(limeade.popups.showGoalTimer);clearTimeout(limeade.popups.closeGoalTimer);limeade.popups.HidePopup()};limeade.popups.HideGoalWithDelay=function(A){if(A.tagName!="INPUT"){limeade.popups.HidePopupWithDelay()}};limeade.popups.HidePopupWithDelay=function(){clearTimeout(limeade.popups.showGoalTimer);clearTimeout(limeade.popups.closeGoalTimer);limeade.popups.closeGoalTimer=setTimeout("limeade.popups.HidePopup();",limeade.popups.closePopupDelay)};function HideResource(){limeade.popups.HideGoal()}limeade.popups.ShowChallengePreviewDelay=function(C,B){if(C.id!="PopupGoal"){var A=new Date();if(!C.id){C.id="tempId"+A.getTime()}C.onmouseout=function(){limeade.popups.HidePopupWithDelay()};clearTimeout(limeade.popups.showGoalTimer);clearTimeout(limeade.popups.closeGoalTimer);limeade.popups.showGoalTimer=setTimeout('limeade.popups.ShowChallengePreviewWithID("'+C.id+'",'+B+")",limeade.popups.popupDelay)}else{clearTimeout(limeade.popups.closeGoalTimer)}};limeade.popups.ShowChallengePreviewWithID=function(B,A){B=document.getElementById(B);limeade.popups.ShowChallengePreview(B,A)};limeade.popups.ShowChallengePreview=function(E,D){limeade.popups.ShowTemporaryPopup(E,'<center><img align="absmiddle" src="/Images/spinner.gif" />&nbsp;<font color="#000000"></center>',"");if(E.id!="PopupGoal"){clearTimeout(limeade.popups.closeGoalTimer);var C=new Date();var B="/Challenges/AjaxChallengeDetails.aspx";var A="c="+encodeURIComponent(D);limeade.services.sendRequest(B,new Array(E),limeade.popups.HandleGoalStateChange,A,true,false);return true}};limeade.popups.ShowTemporaryPopup=function(C,B,D){var A='<div id="shadow-container">';A+='<div class="shadow1">';A+='<div class="shadow2">';A+='<div class="shadow3">';A+='      <div class="brandingBorderColor" style="z-index: 200; width: 335px; background-color: rgb(255, 255, 255); border-width: 4px; border-style: solid;">';A+='          <table cellspacing="0" cellpadding="0" border="0" width="100%" style="padding-left: 5px; padding-right: 5px;">';A+="              <tbody><tr>";A+='                  <td height="32" style="background-repeat: no-repeat;">';A+='                      <table cellspacing="0" border="0" width="325px">';A+="                          <tbody><tr>";A+='                              <td nowrap="nowrap" width="89%" style="padding-top: 5px;"><font class="HeaderColor" style="font-size: 14px;"><b>'+D+"</b></font></td>";A+='                              <td><a style="" align="right" onclick="javascript:limeade.popups.HideGoal()" href="javascript:void(0);">close</a></td>';A+="                          </tr>";A+="                          <tr>";A+='                              <td width="85%" colspan="2"><div style="border-top: 1px solid grey; height: 1px; line-height: 1px; width: 100%;"></div></td>';A+="                          </tr>";A+="                          </tbody></table>";A+="                  </td>";A+="              </tr>";A+="              <tr>";A+='                  <td height="150">';A+=B;A+="	                </td>";A+="              </tr>";A+="              <tr>";A+='              <td style="text-align: right; padding-right: 10px; padding-bottom: 10px;">';A+="              </td>";A+="              </tr>";A+="          </tbody>";A+="      </table>";A+="      </div>";A+="  </div>";A+="</div>";A+="</div>";A+="</div>";limeade.popups.DisplayPopup(C,A)};limeade.popups.ShowGoalDelay=function(F,D,B,G,E,A){window.planbtn=A;if(!window.planbtn){limeade.popups.showAddToPlanButton="true"}else{limeade.popups.showAddToPlanButton=window.planbtn}if(F.id!="PopupGoal"){var C=new Date();if(!F.id){F.id="tempId"+C.getTime()}F.onmouseout=function(){limeade.popups.HidePopupWithDelay()};clearTimeout(limeade.popups.showGoalTimer);clearTimeout(limeade.popups.closeGoalTimer);limeade.popups.showGoalTimer=setTimeout('limeade.popups.ShowGoalWithID("'+F.id+'",'+D+",'"+escape(B)+"','"+G+"','"+E+"')",limeade.popups.popupDelay)}else{clearTimeout(limeade.popups.closeGoalTimer)}};limeade.popups.ShowGoal=function(F,C,B,G,E){if(F.id!="PopupGoal"){clearTimeout(limeade.popups.closeGoalTimer);var D=new Date();var A="/MyResults/AjaxGoal.aspx?g="+encodeURIComponent(C)+"&p="+encodeURIComponent(G)+"&e="+encodeURIComponent(E)+"&target="+encodeURIComponent(F.id)+"&addplanbtn="+encodeURIComponent(limeade.popups.showAddToPlanButton)+"&loc="+encodeURIComponent(limeade.popups.currentlocation);limeade.services.sendRequest(A,new Array(F),limeade.popups.HandleGoalStateChange,null,true,true);return true}};limeade.popups.ShowGoalWithID=function(D,B,A,E,C){D=document.getElementById(D);limeade.popups.ShowGoal(D,B,A,E,C)};limeade.popups.ShowTargetDelay=function(F,C,A,G,E,D){if(D=="true"){limeade.popups.mode="create"}else{limeade.popups.mode="edit"}if(F.id!="PopupGoal"){var B=new Date();if(!F.id){F.id="tempId"+B.getTime()}F.onmouseout=function(){limeade.popups.HidePopupWithDelay()};clearTimeout(limeade.popups.showGoalTimer);clearTimeout(limeade.popups.closeGoalTimer);limeade.popups.showGoalTimer=setTimeout('limeade.popups.ShowTargetWithID("'+F.id+'",'+C+",'"+escape(A)+"','"+G+"','"+E+"')",limeade.popups.popupDelay)}else{clearTimeout(limeade.popups.closeGoalTimer)}};limeade.popups.ShowTarget=function(F,C,B,G,E){if(F.id!="PopupGoal"){clearTimeout(limeade.popups.closeGoalTimer);var D=new Date();var A="/MyPlan/AjaxTarget.aspx?g="+encodeURIComponent(C)+"&p="+encodeURIComponent(G)+"&e="+encodeURIComponent(E)+"&target="+encodeURIComponent(F.id)+"&mode="+encodeURIComponent(limeade.popups.mode)+"&loc="+encodeURIComponent(limeade.popups.currentlocation)+"&nocache="+D.getTime();limeade.services.sendRequest(A,new Array(F),limeade.popups.HandleGoalStateChange,null,true,true);return true}};limeade.popups.ShowTargetWithID=function(D,B,A,E,C){D=document.getElementById(D);limeade.popups.ShowTarget(D,B,A,E,C)};function ShowPopupDelay(C,A){var B=new Date();if(!C.id){C.id="tempId"+B.getTime()}if(C.id!="PopupGoal"&&(C.className=="PopupLink"||C.className=="CommonButtonSmallText")){C.onmouseout=function(){limeade.popups.HidePopupWithDelay()};clearTimeout(limeade.popups.showGoalTimer);clearTimeout(limeade.popups.closeGoalTimer);ShowPopupWithID(C.id,A)}else{clearTimeout(limeade.popups.closeGoalTimer)}}function ShowPopupWithID(B,A){B=document.getElementById(B);ShowPopup(B,A)}function ShowPopup(B,A){if(B.id!="PopupGoal"){clearTimeout(limeade.popups.closeGoalTimer);limeade.services.sendRequest(A,new Array(B),limeade.popups.HandleGoalStateChange,null,true,true);return true}}function ShowHealthRiskCriteria(A,C){var B="/myresults/ajaxhealthriskcriteria.aspx?r="+encodeURIComponent(C);ShowPopupDelay(A,B)}function ShowResourceDelay(G,F,E,D,B,A){clearTimeout(limeade.popups.showGoalTimer);clearTimeout(limeade.popups.closeGoalTimer);if(E.className&&E.className.toLowerCase()=="popuplink"){var C=new Date();if(!E.id){E.id="resLink"+C.getTime()}E.onclick=function(){ShowResource(G,F,E,D,B,A)};E.onmouseout=function(){limeade.popups.HidePopupWithDelay()};limeade.popups.showGoalTimer=setTimeout('ShowResourceWithID("'+G+'",'+F+",'"+E.id+"','"+escape(D)+"',"+B+",'"+A+"')",limeade.popups.popupDelay)}}function ShowResourceWithID(F,E,D,C,B,A){D=document.getElementById(D);ShowResource(F,E,D,C,B,A)}function ShowResource(H,G,F,E,C,B){if(F.className.toLowerCase()!="popupmenu"){var D=$(F).parents(".popupMenu:first");if(D.is(":visible")){ShowNextResource(H,G,E,C,B,D)}else{var A="/MyResults/AjaxResource.aspx?r="+encodeURIComponent(E)+"&p="+encodeURIComponent(H)+"&e="+encodeURIComponent(G)+"&save="+encodeURIComponent(C)+"&status="+encodeURIComponent(B);limeade.services.sendRequest(A,new Array(F),limeade.popups.HandleGoalStateChange,null,true,true)}}return true}function ShowNextResource(F,E,D,C,A){var B=$(".popupMenu").is(":visible");return ShowNextResource(F,E,D,C,A,B)}function ShowNextResource(G,F,E,D,B,C){var A="/MyResults/AjaxResource.aspx?r="+encodeURIComponent(E)+"&save="+encodeURIComponent(D)+"&status="+encodeURIComponent(B);if(typeof G!="undefined"){A+="&p="+encodeURIComponent(G)}if(typeof F!="undefined"){A+="&e="+encodeURIComponent(F)}limeade.services.sendRequest(A,new Array(G,F,C),limeade.popups.HandleResourcePageChange);return true}function AssociateGoalWithDimension(C,I,F,D,B){var A=document.getElementById("lstBxRelatedDimensions");var J=A.selectedIndex;if(J!=-1){limeade.services.showElement(document.getElementById("spinningassociate"));document.getElementById("associategoaltodim").disabled="true";var G=A.options[J].text;var E=A.options[J].value;var H="/MyPlan/UpdateGoalResource.aspx?g="+encodeURIComponent(C)+"&d="+encodeURIComponent(G)+"&r="+encodeURIComponent(E);limeade.services.sendRequest(H,new Array(F,D,I,C,B),HandleAssociateResourcesStateChange)}}function AddGoalToPlan(B){limeade.services.showElement(document.getElementById("spinning"));limeade.services.hideElement(document.getElementById("viewyourplan"));var A="/MyResults/AjaxAddGoalToPlan.aspx?g="+encodeURIComponent(B);limeade.services.sendRequest(A,null,HandleAddToPlanStateChange)}function HandleAddToPlanStateChange(A){limeade.services.hideElement(document.getElementById("spinning"));limeade.services.showElement(document.getElementById("viewyourplan"));document.getElementById("viewyourplan").style.display="inline";document.getElementById("addgoaltoplan").disabled="true";document.getElementById("addgoaltoplan").value=A.responseText}function HandleAssociateResourcesStateChange(C,A){var B=document.getElementById("associategoaltodim");if(C.responseText.indexOf("Success")!=-1){B.value="Updating resource...";var D=document.getElementById(A[2]);limeade.popups.ShowGoal(D,A[3],A[4],A[0],A[1])}else{B.disabled=false}limeade.services.hideElement(document.getElementById("spinningassociate"))}limeade.popups.DisplayPostBackPopup=function(B,G,C){var E=document.getElementById(G);var A=document.getElementById(C);if(!B||!E||!A){return}A.onclick=function(){E.style.display="none"};var D=limeade.services.findPos(B);var F=D[1]+B.offsetHeight+4;E.style.position="absolute";E.style.top=F+"px";E.style.left="35%";E.style.display="block"};limeade.popups.DisplayPopup=function(F,J,A){var G=document.getElementById("PopupGoal");G.innerHTML=J;var I=$(F).position();var E=I.left+$(F).width();var B=I.top-($(G).height()/2);var C=$(window).scrollTop();var H=$(window).width();var D=$(window).height();if(E+$(G).width()>H){E=H-$(G).width()-14}if((B+$(G).height())>(D+C)){B=C+D-$(G).height()-14}G.style.position="absolute";G.style.left=E+"px";G.style.top=B+"px";G.style.display="inline";limeade.services.showElement(G);G.onmouseover=F.onmouseover;if(!A){if(navigator.userAgent.indexOf("Firefox")!=-1){G.onmouseout=function(K){if(limeade.services.checkMouseLeave(this,K)){limeade.popups.HideGoalWithDelay(this)}}}else{G.onmouseout=function(){if(limeade.services.checkMouseLeave(this,event)){limeade.popups.HideGoalWithDelay(this)}}}}};limeade.popups.HandleGoalStateChange=function(B,A){limeade.popups.DisplayPopup(A[0],B.responseText)};createNamespace("limeade.answers");limeade.answers.xmlHttp;limeade.answers.myid=0;limeade.answers.ajaxlocked=false;limeade.answers.starImages=new Array("/User/images/0star.gif","/User/images/1star.gif","/User/images/2star.gif","/User/images/3star.gif","/User/images/4star.gif","/User/images/5star.gif");limeade.answers.nullStarMessage="/User/images/0.gif";limeade.answers.starMap=new Array("0,0,0,0","7,0,23,20","24,0,41,20","42,0,59,20","60,0,77,20","78,0,95,20");limeade.answers.starMessages=new Array("images/0.gif","images/1.gif","images/2.gif","images/3.gif","images/4.gif","images/5.gif","images/saved.gif");limeade.answers.savedRatings=new Array();limeade.answers.changedRatings=new Array();limeade.answers.starTwinkler=new Array();limeade.answers.msgTwinkler=new Array();limeade.answers.isRatingsBarChanged=false;limeade.answers.delayTime=5;limeade.services.preloadImages(limeade.answers.starImages);limeade.services.preloadImages(limeade.answers.starMessages);limeade.answers.SaveRatingAjax=function(D,C,B){rating=B;var A="AjaxAnswer.aspx?id="+encodeURIComponent(D)+"&Rating="+encodeURIComponent(B);limeade.answers.myid=D;limeade.answers.isRatingsBarChanged=true;limeade.answers.ajaxlocked=true;limeade.services.sendRequest(A,null,limeade.answers.HandleStateChange)};limeade.answers.HandleStateChange=function(A){limeade.answers.SwapStarMsg(limeade.answers.myid,rating);limeade.answers.ShowAnswerState(limeade.answers.myid);limeade.answers.HandleContinueButtonVisibility();limeade.answers.ajaxlocked=false};limeade.answers.SwapStars=function(B,A){document.images["stars."+B].style.cursor="hand";if(A==undefined){if(limeade.answers.changedRatings[B]==1){document.images["stars."+B].src=limeade.answers.starImages[limeade.answers.savedRatings[B]]}else{document.images["stars."+B].src=limeade.answers.starImages[0]}}else{document.images["stars."+B].src=limeade.answers.starImages[A]}};limeade.answers.SwapStarMsg=function(B,A){if(A==undefined){if(limeade.answers.changedRatings[B]==1){document.images["messages."+B].src=limeade.answers.starMessages[limeade.answers.savedRatings[B]]}else{document.images["messages."+B].src=limeade.answers.nullStarMessage}}else{document.images["messages."+B].src=limeade.answers.starMessages[A]}};limeade.answers.ShowAnswerState=function(A){document.images["answer."+A].src=limeade.answers.starMessages[6]};limeade.answers.SaveStarsAjax=function(B,A){if(limeade.answers.ajaxlocked==true){return}if((A==1)||(A==2)||(A==3)||(A==4)||(A==5)){limeade.answers.savedRatings[B]=A;limeade.answers.changedRatings[B]=1;limeade.answers.SaveRatingAjax(B,"onetofive",A)}else{alert("Answer Value out of the bound, Values can only be 1/2/3/4/5. Current answer value: "+A)}};limeade.answers.HandleContinueButtonVisibility=function(){var A=0;var H=0;var G=document.getElementById("ctl00_bcr_GridView1");var E=getElementsByClass("FivePtDiv",G,"div");for(var C=0;C<E.length;C++){if(E[C].style.visibility=="visible"){A++}}for(var F in limeade.answers.savedRatings){if((parseInt(F,10)!=0)&&(!isNaN(F))){H++}}var D;var B;if(document.getElementById){D=document.getElementById("ctl00_bcr_Continue1");B=document.getElementById("ctl00_bcr_Continue2")}else{if(document.all){D=document.all.ctl00_bcr_Continue1;B=document.all.ctl00_bcr_Continue2}}if(A==H){if(D!=undefined){D.disabled=false}if(B!=undefined){B.disabled=false}setVisibility("ctl00_bcr_Continue1",1);setVisibility("ctl00_bcr_Continue2",1)}else{if(D!=undefined){D.disabled=true}if(B!=undefined){B.disabled=true}setVisibility("ctl00_bcr_Continue1",0);setVisibility("ctl00_bcr_Continue2",0)}};limeade.answers.StarMouseOver=function(B,A){if(limeade.answers.starTwinkler[B]!=0){window.clearTimeout(limeade.answers.starTwinkler[B]);limeade.answers.starTwinkler[B]=0}if(limeade.answers.msgTwinkler[B]!=0){window.clearTimeout(limeade.answers.msgTwinkler[B]);limeade.answers.msgTwinkler[B]=0}limeade.answers.SwapStars(B,A);limeade.answers.SwapStarMsg(B,A)};limeade.answers.StarMouseOut=function(A){limeade.answers.starTwinkler[A]=window.setTimeout("limeade.answers.SwapStars('"+A+"')",limeade.answers.delayTime);limeade.answers.msgTwinkler[A]=window.setTimeout("limeade.answers.SwapStarMsg('"+A+"')",limeade.answers.delayTime)};limeade.answers.DisplayStarsAjax=function(D,C){var A="stars."+D;limeade.answers.starTwinkler[D]=0;limeade.answers.msgTwinkler[D]=0;document.write("<map name='starmap"+D+"'>");var B=0;for(B=1;B<6;B++){document.write("<area shape=rect coords='"+limeade.answers.starMap[B]+"' onmouseover=\"limeade.answers.StarMouseOver('"+D+"',"+B+');" onmouseout="limeade.answers.StarMouseOut(\''+D+"');\" onclick=\"limeade.answers.SaveStarsAjax('"+D+"',"+B+');" >')}document.write("</map>");document.write("<img vspace=2 title = '' src='"+limeade.answers.starImages[C]+"'");document.write(" border=0 usemap='#starmap"+D);document.write("' id='"+A+"'>")};limeade.answers.DisplayMsgAjax=function(A,D,G,F,E,C,B,I){var H="messages."+A;if(D==undefined){document.write("<img align='center' vspace=2 src='"+limeade.answers.nullStarMessage+"'")}else{document.write("<img vspace=2 src='"+limeade.answers.starMessages[D]+"'")}document.write("' id='"+H+"'>")};limeade.answers.DisplayAnswerStateAjax=function(C,A){var B="answer."+C;if((A==undefined)||(A==0)){document.write("<img align='center' vspace=2 src='images/question.gif'")}else{document.write("<img vspace=2 src='"+limeade.answers.starMessages[A]+"'")}document.write("' id='"+B+"'>")};function getElementsByAttribute(H,I,J,D){var E=(I=="*"&&document.all)?document.all:H.getElementsByTagName(I);var C=new Array();var G=(typeof D!="undefined")?new RegExp("(^|\\s)"+D+"(\\s|$)"):null;var A;var F;for(var B=0;B<E.length;B++){A=E[B];F=A.getAttribute(J);if(typeof F=="string"&&F.length>0){if(typeof D=="undefined"||(G&&G.test(F))){C.push(A)}}}return C}function getElementsByClass(G,E,A){var D=new Array();if(E==null){E=document}if(A==null){A="*"}var C=E.getElementsByTagName(A);var B=C.length;var F=new RegExp("(^|\\s)"+G+"(\\s|$)");for(i=0,j=0;i<B;i++){if(F.test(C[i].className)){D[j]=C[i];j++}}return D}function setVisibility(A,C){if(document.getElementById){var B=document.getElementById(A)}else{if(document.all){x=document.all[A]}}}xMousePos=0;yMousePos=0;xMousePosMax=0;yMousePosMax=0;xMouseLast=0;yMouseLast=0;function getScrollingPosition(){var A=[0,0];if(typeof window.pageYOffset!="undefined"){A=[0,0]}else{if(typeof document.documentElement.scrollTop!="undefined"&&document.documentElement.scrollTop>0){A=[document.documentElement.scrollLeft,document.documentElement.scrollTop]}else{if(typeof document.body.scrollTop!="undefined"){A=[document.body.scrollLeft,document.body.scrollTop]}}}return A}function mouseMove(B){B=B||window.event;var A=mouseCoords(B)}function mouseCoords(A){xMouseLast=xMousePos;yMouseLast=yMousePos;if(A.pageX||A.pageY){xMousePos=A.pageX;yMousePos=A.pageY;xMousePosMax=window.innerWidth+window.pageXOffset;yMousePosMax=window.innerHeight+window.pageYOffset;return{x:A.pageX,y:A.pageY}}if(document.body){xMousePos=A.clientX+document.body.scrollLeft-document.body.clientLeft;yMousePos=A.clientY+document.body.scrollTop-document.body.clientTop;xMousePosMax=document.body.clientWidth+document.body.scrollLeft;yMousePosMax=document.body.clientHeight+document.body.scrollTop;return{x:A.clientX+document.body.scrollLeft-document.body.clientLeft,y:A.clientY+document.body.scrollTop-document.body.clientTop}}}function at_display(A){win=window.open();for(var B in A){win.document.write(B+" = "+A[B]+"<br>")}}function at_show_aux(A,F){var D=document.getElementById(A);var E=document.getElementById(F);var C=(E.at_position=="y")?D.offsetHeight+0:0;var B=(E.at_position=="x")?D.offsetWidth+2:0;for(;D;D=D.offsetParent){if(D.className!="CommonTitleBar"){C+=D.offsetTop;B+=D.offsetLeft}}B-=141;E.style.position="absolute";E.style.top=C+"px";E.style.left=B+"px";limeade.services.showElement(E)}function at_show(){p=document.getElementById(this["at_parent"]);c=document.getElementById(this["at_child"]);at_show_aux(p.id,c.id);clearTimeout(c.at_timeout)}function at_hide(){c=document.getElementById(this["at_child"]);c.at_timeout=setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'",333)}function at_click(){p=document.getElementById(this["at_parent"]);c=document.getElementById(this["at_child"]);if(c.style.visibility!="visible"){at_show_aux(p.id,c.id)}else{c.style.visibility="hidden"}return false}function at_attach(C,E,B,A,D){p=document.getElementById(C);c=document.getElementById(E);p.at_parent=p.id;c.at_parent=p.id;p.at_child=c.id;c.at_child=c.id;p.at_position=A;c.at_position=A;c.style.position="absolute";c.style.visibility="hidden";if(D!=undefined){p.style.cursor=D}switch(B){case"click":p.onclick=at_click;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;break;case"hover":p.onmouseover=at_show;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;break}}createNamespace("limeade.graphs");limeade.graphs.DataReceived=function(B,A){document.getElementById(A[0]).innerHTML=limeade.services.getBody(B.responseText,"<!--StartGraphDisplay-->","<!--EndGraphDisplay-->",25)};limeade.graphs.ShowHealthRisk=function(A){document.getElementById("HealthRiskDimensionGraph").innerHTML=A.responseText};createNamespace("limeade.goals");limeade.goals.HideCreateGoal=function(){e1=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_PanelAddANewGoal");if(e1!=null){limeade.services.hideElement(e1);e1.style.height="0px"}e2=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_CreateNewGoalUpdatePanel");if(e2!=null){limeade.services.hideElement(e2);e2.style.height="0px"}var B=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_PanelCreateGoal");if(B!=null){limeade.services.hideElement(B);e2.style.height="0px"}var A=document.getElementById("CustomGoalDiv");if(A!=null){A.style.height="0px";limeade.services.hideElement(A)}document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalRow").value="";document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalId").value=""};limeade.goals.ShowCreateGoal=function(){var B=document.getElementById("CustomGoalDiv");if(B!=null){B.style.height="0px";limeade.services.hideElement(B)}var G=document.getElementById("CreateGoalDiv");if(G!=null){G.style.height="auto";limeade.services.showElement(G);G.style.display="inline"}var D=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_PanelCreateGoal");limeade.services.hideElement(D);var F=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_CreateNewGoalUpdatePanel");if(F!=null){F.style.height="auto";limeade.services.showElement(D);F.style.display="block"}var E=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_PanelAddANewGoal");if(E!=null){F.style.height="auto";limeade.services.showElement(E);E.style.display="inline"}var A=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_Top20Goals");if(A!=null){}limeade.services.showElement(document.getElementById("CreateGoalClose"));document.getElementById("CreateGoalClose").style.display="inline";limeade.services.hideElement(document.getElementById("CustomGoalClose"));var C=$find("ctl00_ctl00_bcr_TabContainerMyPlan");C.set_activeTab(C.get_tabs()[0])};limeade.goals.ShowCustomGoal=function(){var A=document.getElementById("CreateGoalDiv");if(A!=null){A.style.height="0px";limeade.services.hideElement(A)}A=document.getElementById("CustomGoalDiv");if(A!=null){A.style.height="auto";limeade.services.showElement(A);A.style.display="inline"}A=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_PanelCreateGoal");if(A!=null){A.style.height="auto";limeade.services.showElement(A);A.style.display="inline"}limeade.services.hideElement(document.getElementById("CreateGoalClose"));limeade.services.showElement(document.getElementById("CustomGoalClose"));document.getElementById("CustomGoalClose").style.display="inline"};limeade.goals.SetRelatedGoalId=function(B){var A=document.getElementById(B.id.replace(/RGCCreateGoal/,"GoalIdHidden")).value;document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalId").value=A;document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalRow").value=B.id.replace(/RGCCreateGoal/,"pnlGoalRow")};limeade.goals.SetImageRelatedGoalId=function(B){var A=document.getElementById(B.id.replace(/RGImageCreateGoal/,"GoalIdHidden")).value;document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalId").value=A;document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalRow").value=B.id.replace(/RGImageCreateGoal/,"pnlGoalRow")};limeade.goals.DisableImproveThisAndSpin=function(A){A.disabled=true;A.value="Adding goal..."};limeade.goals.ImproveGoalThroughRecommendation=function(A,B){limeade.services.sendRequest("/MyPlan/ManageGoals.aspx?&op=improve&dim="+encodeURIComponent(B),new Array(A),limeade.goals.DimensionImproved)};limeade.goals.DimensionImproved=function(C,B){var D=document.getElementById(B[0].id.replace("btnImproveThis","divImproveThis"));if(D){limeade.services.showElement(D)}var A=limeade.services.getBody(C.responseText,"<!--StartLoginBoxDisplay-->","<!--EndLoginBoxDisplay-->",27);if(A=="1"){B[0].value="Added Goal to Plan"}else{if(A=="0"){B[0].value="Goal already in Plan"}}};limeade.goals.InitSelection=function(A,D,B){var C=document.getElementById(A);B="false";if(B=="true"){document.getElementById("Goaltracker_Numeric").style.backgroundColor="#D6D6D6";document.getElementById("Goaltracker_weekly").style.backgroundColor="#D6D6D6";document.getElementById("Goaltracker_Journal").style.backgroundColor="#D6D6D6";document.getElementById("Goaltracker_FivePoint").style.backgroundColor="#D6D6D6";document.getElementById("Goaltracker_FivePointSmileys").style.backgroundColor="#D6D6D6";document.getElementById("Goaltracker_BinaryTracker").style.backgroundColor="#D6D6D6";C.style.backgroundColor="#CEFF9C";document.getElementById(D).value=C.id}else{limeade.goals.ActivateSelection(C,D,B)}};limeade.goals.ActivateSelection=function(C,D,A){A="false";if(A=="false"){document.getElementById("Goaltracker_Numeric").style.backgroundColor="transparent";document.getElementById("Goaltracker_weekly").style.backgroundColor="transparent";document.getElementById("Goaltracker_Journal").style.backgroundColor="transparent";document.getElementById("Goaltracker_FivePoint").style.backgroundColor="transparent";document.getElementById("Goaltracker_FivePointSmileys").style.backgroundColor="transparent";document.getElementById("Goaltracker_BinaryTracker").style.backgroundColor="transparent";C.style.backgroundColor="#CEFF9C";document.getElementById(D).value=C.id;var B=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblPromptFirst");var E=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblPromptLast");document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_txtUnits_TB").value="";limeade.goals.SetStandardTrackerUnits();switch(C.id){case"Goaltracker_Numeric":B.innerHTML="How many";E.innerHTML="today?";break;case"Goaltracker_weekly":B.innerHTML="How many";E.innerHTML="this week?";break;case"Goaltracker_FivePointSmileys":case"Goaltracker_FivePoint":B.innerHTML="Rating for";E.innerHTML="today?";limeade.goals.SetRatingTrackerUnits();break;case"Goaltracker_Journal":B.innerHTML="How is your";E.innerHTML="?";limeade.goals.SetJournalTrackerUnits();break;case"Goaltracker_BinaryTracker":B.innerHTML="Did you";E.innerHTML="today?";limeade.goals.SetBinaryTrackerUnits();break}}};limeade.goals.SetStandardTrackerUnits=function(){var A=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_txtUnits_LB");A.options.length=0;limeade.goals.AddItem("calories","calories",A);limeade.goals.AddItem("cigarettes","cigarettes",A);limeade.goals.AddItem("drinks","drinks",A);limeade.goals.AddItem("hours","hours",A);limeade.goals.AddItem("minutes","minutes",A);limeade.goals.AddItem("miles","miles",A);limeade.goals.AddItem("add new units...","add new units...",A)};limeade.goals.SetBinaryTrackerUnits=function(){var A=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_txtUnits_LB");A.options.length=0;limeade.goals.AddItem("exercise","exercise",A);limeade.goals.AddItem("run","run",A);limeade.goals.AddItem("bike","bike",A);limeade.goals.AddItem("smoke","smoke",A);limeade.goals.AddItem("drink","drink",A);limeade.goals.AddItem("walk","walk",A);limeade.goals.AddItem("add new activity...","add new activity...",A)};limeade.goals.SetRatingTrackerUnits=function(){var A=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_txtUnits_LB");A.options.length=0;limeade.goals.AddItem("stress","stress",A);limeade.goals.AddItem("energy level","energy level",A);limeade.goals.AddItem("healthy eating","healthy eating",A);limeade.goals.AddItem("self-leadership","self-leadership",A);limeade.goals.AddItem("concern for others","concern for others",A);limeade.goals.AddItem("life balance","life balance",A);limeade.goals.AddItem("sleep","sleep",A);limeade.goals.AddItem("add new units...","add new units...",A)};limeade.goals.SetJournalTrackerUnits=function(){var A=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_txtUnits_LB");A.options.length=0;limeade.goals.AddItem("day","day",A);limeade.goals.AddItem("job","job",A);limeade.goals.AddItem("family life","family life",A);limeade.goals.AddItem("eating","eating",A);limeade.goals.AddItem("add new units...","add new units...",A)};limeade.goals.AddItem=function(C,A,D){var B=document.createElement("option");D.options.add(B);B.text=C;B.value=A};limeade.goals.HighlightSelection=function(B,C,A,D){A="false";if(A=="false"){if(document.getElementById(C).value==null||document.getElementById(C).value==""){document.getElementById(C).value="Goaltracker_Numeric"}if(document.getElementById(C).value!=B.id){if(D==true){B.style.backgroundColor="#CEFF9C";B.style.cursor="hand"}else{B.style.backgroundColor="transparent"}}else{B.style.cursor="default"}}return true};limeade.goals.ReloadAfterGoalAdded=function(A){window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?status=added&goalname="+escape(A)};limeade.goals.SetToCenter=function(E,B,D){var F=document.getElementById(E);var H=document.getElementById(B);var C=getScrollingPosition();if(D=="true"){H.style.display="inline";H.style.position="absolute";H.style.left=limeade.services.findPosX(F)+(F.offsetWidth/2)+"px";H.style.top=limeade.services.findPosY(F)-(F.offsetHeight*1.5)-(H.offsetHeight/2)+"px"}else{var G=F.parentNode;var A=0;while(G.parentNode){if(G.style.display.toLowerCase()=="inline"){break}else{if(G.style.position=="absolute"){break}}G=G.parentNode}H.style.display="inline";H.style.position="absolute";H.style.left=limeade.services.findPosX(F)-limeade.services.findPosX(G)+(F.offsetWidth/2)+"px";H.style.top=limeade.services.findPosY(F)-limeade.services.findPosY(G)-(F.offsetHeight*1.5)-(H.offsetHeight/2)+"px"}};createNamespace("limeade.myplan");limeade.myplan.postbackChecker="";limeade.myplan.AddStandardGoal=function(A){var I=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_Top20Goals");var D=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalKeywords").value;var H=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalId");var G=I.options[I.selectedIndex].value;var C=I.options[I.selectedIndex].innerHTML;var B=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_RFVGoalName");if(G==0){B.style.display="inline"}else{var F=limeade.myplan.replacementID();I.remove(I.selectedIndex);limeade.myplan.AddNewGoal(G,C,B,F)}var E="?op=add&goaltype=standard&g="+encodeURIComponent(G)+"&caldate="+limeade.myplan.trackerDate().format("MM/dd/yyyy");limeade.services.sendRequest("/MyPlan/ManageGoals.aspx"+E,new Array(F),limeade.myplan.GoalAdded,null)};limeade.myplan.AddCustomGoal=function(A){var N=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_txtBoxCreateGoalName");var B=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_RFVCustomGoalName");var C=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_RFVGoalUnits");var D=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCustomError");var O=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalTracker");var M=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalIcon");var H=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalKeywords");var F=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalResource");var L=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalId");var E="Type the name of your new Goal here.";var K="NumericTrackingDailyView";var J=limeade.myplan.replacementID();var P=true;var G=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_txtUnits_TB");if(N.value==E||limeade.services.trim(N.value)==""){B.style.display="inline";D.innerHTML="You must enter a goal name.";P=false}else{B.style.display="none"}if(limeade.services.trim(G.value)==""){C.style.display="inline";P=false}else{C.style.display="none"}if(P){switch(O.value){case"Goaltracker_Numeric":K="NumericTrackingDailyView";break;case"Goaltracker_weekly":K="NumericTrackingWeeklyView";break;case"Goaltracker_Journal":K="Microjournal";break;case"Goaltracker_FivePoint":K="FivePointScale";break;case"Goaltracker_FivePointSmileys":K="FivePointScaleSmileys";break;case"Goaltracker_BinaryTracker":K="BinaryTracker";break}if(document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalRow").value!=""){var Q=document.getElementById(document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_lblCreateGoalRelatedGoalRow").value);if(Q){limeade.services.hideElement(Q)}}var I="?op=add&goaltype=custom&gname="+encodeURIComponent(N.value)+"&units="+encodeURIComponent(G.value)+"&tool="+encodeURIComponent(K)+"&kw="+encodeURIComponent(H.value)+"&res="+encodeURIComponent(F.value)+"&icon="+encodeURIComponent(M.value)+"&caldate="+encodeURIComponent(limeade.myplan.trackerDate().format("MM/dd/yyyy"));if(L.value!="0"&&L.value!=""){I=I+"&relatedid="+L.value}if(limeade.myplan.AddNewGoal(L.value,N.value,B,J)){N.value="";G.value="";limeade.myplan.WatermarkBlur(N,E);limeade.goals.ActivateSelection(document.getElementById("Goaltracker_Numeric"),O.id,"");limeade.services.sendRequest("/MyPlan/ManageGoals.aspx"+I,new Array(J),limeade.myplan.GoalAdded,null)}else{D.innerHTML=" Goal already exists.";B.style.display="inline"}}};limeade.myplan.AddNewGoal=function(J,F,D,C){if(!limeade.myplan.GoalExists(F)){D.style.display="none";var E=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_GridView1").getElementsByTagName("tbody")[0];var G=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabPanelTrackProgress_BulkEditGridView1").getElementsByTagName("tbody")[0];var M=document.getElementById("Grid1GoalRow").cloneNode(true);var H=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_GoalCountHidden");var A=new Date();M.id="MyPlan_"+C;limeade.myplan.renameElementsInGoalRow(M,C);var K=limeade.services.getElementsByClassName(M,"SubHeaderColor");K[0].innerHTML=F;if(H.value==0){if(E.hasChildNodes()){E.removeChild(E.firstChild)}if(G.hasChildNodes()){G.removeChild(G.firstChild)}}E.appendChild(M);limeade.goals.HideCreateGoal();var L=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_goalstatus");var I=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_lblGoalModifiedStatus");var B=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_status");I.innerHTML='Added the goal "'+F+'" to your plan.&nbsp;Would you like to <a href="#" onclick="javascript:limeade.controls.ChangeMyPlanTab(2); return false;" >track your progress</a>?';if(B){limeade.services.hideElement(B)}limeade.services.showElement(L);H.value=Number(H.value)+1;return true}else{return false}};limeade.myplan.ShowOrHideOverThreeGoals=function(){var B=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_GoalCountHidden");var A=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_status");if(A){if(B.value>3){limeade.services.showElement(A)}}};limeade.myplan.GoalAdded=function(A,F){var R=limeade.services.getBody(A.responseText,"<!--StartGoalIdDisplay-->","<!--EndGoalIdDisplay-->",25);var D=limeade.services.getBody(A.responseText,"<!--StartResourceDisplay-->","<!--EndResourceDisplay-->",27);var Y=limeade.services.getBody(A.responseText,"<!--StartIconDisplay-->","<!--EndIconDisplay-->",23);var f=limeade.services.getBody(A.responseText,"<!--StartNameDisplay-->","<!--EndNameDisplay-->",23);var H=limeade.services.getBody(A.responseText,"<!--StartUseCountDisplay-->","<!--EndUseCountDisplay-->",27);var B=limeade.services.getBody(A.responseText,"<!--StartForumUrlDisplay-->","<!--EndForumUrlDisplay-->",27);var K=limeade.services.getBody(A.responseText,"<!--StartChallengeGoalDisplay-->","<!--EndChallengeGoalDisplay-->",32);var M=limeade.services.getBody(A.responseText,"<!--StartEditableTargetDisplay-->","<!--EndEditableTargetDisplay-->",33);var X=limeade.services.getBody(A.responseText,"<!--StartEditTargetPromptDisplay-->","<!--EndEditTargetPromptDisplay-->",35);var d=limeade.services.getBody(A.responseText,"<!--StartTitleDisplay-->","<!--EndTitleDisplay-->",24);var e=document.getElementById("MyPlan_"+F[0]);var T=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"GoalTitle");var Z=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"ViewForumButton");var N=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"myGoalsChallenge");var a=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"lblChallengeSeparator");var S=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"GoalResources");var G=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"resPanel");var P=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"pnlResource");var C=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"lblUseCount");var V=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"GoalForum");var J=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_EmployerID");var Q=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_ProviderID");document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"GoalIdHidden").value=R;document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"GoalNameHidden").value=f;if(N!=null&&a!=null){if(K=="1"){limeade.services.showElement(N);N.href="/Challenges/CreateChallenge.aspx?g="+encodeURIComponent(R);limeade.services.showElement(a)}}if(Z!=null){Z.src="/Images/"+Y}if(V!=null){V.href=B}if(S!=null){S.onclick=function(){limeade.popups.ShowGoal(this,R,f,Q.value,J.value,"false");return false};S.onmouseover=function(){limeade.popups.ShowGoalDelay(this,R,f,Q.value,J.value,"false");return false}}if(C!=null){C.innerHTML=H}if(G!=null){if(D!=null&&limeade.services.trim(D)!=""){G.innerHTML=D;limeade.services.showElement(P)}}if(e!=null){e.id="MyPlan_"+R}var E=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabPanelTrackProgress_BulkEditGridView1").getElementsByTagName("tbody")[0];var I=document.createElement("TR");I.className="normalrow TrackProgressGoal";I.onmouseover=function(){limeade.web.ui.grid.HighlightRow(this);this.className="hightlighrow TrackProgressGoal";return false};I.onmouseout=function(){limeade.web.ui.grid.DeHighlightRow(this);this.className="normalrow TrackProgressGoal";return false};I.id="TrackProgress_"+R;var U=document.createElement("TD");U.style.border="lightgrey 1px solid";U.style.verticalAlign="top";U.style.width="100%";U.innerHTML=limeade.services.getBody(A.responseText,"<!--StartTrackingDisplay-->","<!--EndTrackingDisplay-->",27);I.appendChild(U);limeade.myplan.renameElementsInGoalRow(I,F[0]);limeade.myplan.WireUpControls(I);if(E.rows.length>0){if(E.rows[0].innerHTML.indexOf("To automatically Create Your Plan based on your Well-Being Assessment Results, click")!=-1){E.rows[0].style.display="none"}}E.appendChild(I);var O="ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"EditTargetPrefix";var b=document.getElementById(O);O="ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"EditTargetLink2";var W=document.getElementById(O);O="ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_"+F[0]+"EditTargetSuffix2";var L=document.getElementById(O);if(M=="1"){limeade.services.showElement(b);W.onclick=function(){limeade.popups.ShowTarget(this,R,f,Q.value,J.value,"false");return false};W.onmouseover=function(){limeade.popups.ShowTargetDelay(this,R,f,Q.value,J.value,"false");return false};limeade.services.showElement(W);limeade.services.showElement(L);T.innerHTML=d}};limeade.myplan.SetTargetClick=function(B,E){var D=document.getElementById("goalname").innerHTML;var F=document.getElementById("ismorebetter");var H=F.options[F.selectedIndex].value;F=document.getElementById("frequency");var G=F.options[F.selectedIndex].value;var A=document.getElementById("goaltarget").value;document.getElementById("settarget").disabled=true;document.getElementById("saving").style.visibility="visible";document.getElementById("saving").style.display="inline";var C="/MyPlan/ManageGoals.aspx?op=settarget&g="+E+"&mb="+H+"&freq="+G+"&target="+A;limeade.services.sendRequest(C,new Array(B,E,D),limeade.myplan.SetTargetCallback)};String.prototype.endsWith=function(A){return(this.match(A+"$")==A)};limeade.myplan.SetTargetCallback=function(J,I){limeade.popups.HidePopup();var K=limeade.services.getBody(J.responseText,"<!--StartTitleDisplay-->","<!--EndTitleDisplay-->",24);K=K.trim();var H=limeade.services.getBody(J.responseText,"<!--StartAmountUnitsDisplay-->","<!--EndAmountUnitsDisplay-->",30);H=H.trim();var L=limeade.myplan.GetGoalTitleElementByGoalId(I[2],I[1]);if(L){L.innerHTML=K}var D=limeade.services.getBody(J.responseText,"<!--StartEditTargetPromptDisplay-->","<!--EndEditTargetPromptDisplay-->",35);var F=null;var E=I[0].indexOf("EditTargetLink2");if(E==-1){E=I[0].indexOf("SetTargetLink");if(E!=-1){var G=document.getElementById(I[0]);var B=I[0].replace(/SetTargetLink/,"EditTargetPrompt");$("#"+I[0]).before('<span id="'+B+'"></span>');F=document.getElementById(B);G.innerHTML="edit";$("#"+I[0]).after(")");var A=I[0].replace(/SetTargetLink/,"EditTargetLink");G.id=A}else{F=document.getElementById(I[0].replace(/EditTargetLink/,"EditTargetPrompt"))}}else{var C=$("#TrackProgress_"+I[1]).find("span[id*='EditTargetPrompt']");if(C){F=C[0]}}if(F){F.innerHTML=D}if(K.endsWith(" this week")){K=K.substr(0,K.length-10)}$(".WeeklyActivityItem a[id*="+I[1]+"]").text(K)};limeade.myplan.WatermarkFocus=function(A,B){if(A.value==B){A.value="";A.className=""}};limeade.myplan.WatermarkBlur=function(A,B){if(A.value==""){A.value=B;A.className="watermarked"}};limeade.myplan.GoalChange=function(C){var A=C.selectedIndex;var B=C.options[A].value;if(B==-2){limeade.goals.ShowCustomGoal()}else{document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_RFVGoalName").style.display="none"}};limeade.myplan.customNameChanged=function(){document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_CreateNewGoal_RFVCustomGoalName").style.display="none"};limeade.myplan.replacementID=function(){var C=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_AddCountHidden");var B=Number(C.value)+2;if(B<10){B="0"+B}C.value=Number(C.value)+1;var A="GridView1_ctl"+B+"_";return A};limeade.myplan.renameElementsInGoalRow=function(D,A){var C=D.getElementsByTagName("*");for(var B=0;B<C.length;B++){if(C[B].id){C[B].id=C[B].id.replace(/GridView1_ctl\d*_/gi,A)}if(C[B].name){C[B].name=C[B].name.replace(/GridView1_ctl\d*_/gi,A)}}};limeade.myplan.GoalExists=function(A){var C=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_GridView1");var D=limeade.services.getElementsByClassName(C,"SubHeaderColor");for(var B=0;B<D.length;B++){if(D[B].innerHTML==A){return true}}return false};limeade.myplan.GetGoalTitleElementByNameUnits=function(B,A){if(B.toLowerCase().indexOf(A.toLowerCase())!=-10){A="times"}var D=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_GridView1");var F=limeade.services.getElementsByClassName(D,"SubHeaderColor");for(var C=0;C<F.length;C++){var E=F[C].innerHTML.indexOf(B);if(E!=-1){if(A!=""){if(F[C].innerHTML.indexOf(A)!=-1){return F[C]}}else{return F[C]}}}return null};limeade.myplan.GetGoalTitleElementByGoalId=function(A,F){var E=document.getElementById("MyPlan_"+F);var D=limeade.services.getElementsByClassName(E,"SubHeaderColor");for(var B=0;B<D.length;B++){var C=D[B].innerHTML.indexOf(A);if(C!=-1){return D[B]}}return null};limeade.myplan.ActiveTabChanged=function(A,B){limeade.popups.HideGoal();limeade.myplan.ManageTabViews(A.get_activeTabIndex())};limeade.myplan.ManageTabViews=function(E){var B=document.getElementById("divMyGoals");var F=document.getElementById("divCalendar");var D=document.getElementById("divDoneTrackingMyGoals");var C=document.getElementById("divDoneTrackProgress");var A=document.getElementById("MyPlanIntroduction");if(E==1){limeade.services.showElement(F);limeade.services.showElement(C);limeade.services.hideElement(B);limeade.services.hideElement(D);A.appendChild(F)}else{limeade.services.hideElement(F);limeade.services.showElement(B);limeade.services.showElement(D);limeade.services.hideElement(C);A.appendChild(B)}};limeade.myplan.resetgoals=function(A,B){if(A!=null){limeade.myplan.DisplayControlValues(A);if(B!=null){limeade.myplan.DisplayControlValues(B)}}};limeade.myplan.DisplayControlValues=function(D){var E="";var C=D.getElementsByTagName("*");for(var B=0;B<C.length;B++){if(C[B].id){if((C[B].id.indexOf("FivePointScaleHowAreYou_Rating1Saved")!=-1)||(C[B].id.indexOf("FivePointScaleSmileysView1_Rating1Saved")!=-1)){var A=C[B].id.substring(0,C[B].id.length-6);limeade.myplan.SetSmileyById(A,0)}if(C[B].id.indexOf("FivePointScale_Star_")!=-1){document.getElementById(C[B].id.replace(/FivePointScale.*/,"FivePointScale_A")).title="0";limeade.myplan.ratingMouseOut(C[B])}if(C[B].id.indexOf("CompletedGoalLink")!=-1){C[B].href="#"}if(C[B].id.indexOf("TrackingTool1_BinaryTracker1_ImgYesNo")!=-1){document.getElementById(C[B].id.replace(/ImgYesNo/,"yesNoToggle")).value="-1";limeade.myplan.DeHighLightBinaryTracker(C[B])}if(C[B].id.indexOf("TrackingTool1_MessageText")!=-1){C[B].value="";limeade.myplan.WatermarkBlur(C[B],"Type your journal entry here.")}if(C[B].id.indexOf("WeeklyViewDateRange")!=-1){limeade.myplan.resetNumericWeekly(C[B],limeade.myplan.trackerDate())}if(C[B].id.indexOf("SaveTrackingDataButton")!=-1){limeade.controls.SaveButtonReset(C[B])}if(C[B].id.indexOf("NumericDaily")!=-1){C[B].value="0"}}}};limeade.myplan.WireUpControls=function(D){var C="";var B=null;if(!D){B=document.getElementsByTagName("*")}else{B=D.getElementsByTagName("*")}for(var A=0;A<B.length;A++){if(B[A].id){if(B[A].id.indexOf("FivePointScale_Star_")!=-1){B[A].onclick=function(){limeade.myplan.SaveStars(this);return false};B[A].onmouseover=function(){limeade.myplan.ratingMouseOver(this);return false};B[A].onmouseout=function(){limeade.myplan.ratingMouseOut(this);return false};B[A].title=B[A].id.charAt(B[A].id.length-1)}if(B[A].id.indexOf("FivePointScaleHowAreYou_Rating")!=-1){B[A].onclick=limeade.myplan.SaveHowAreYouSmileys}if(B[A].id.indexOf("MessageText")!=-1){B[A].style.width="185px";B[A].style.height="45px"}}}};limeade.myplan.resetNumericWeekly=function(H,C){if(H!=null){if(H.firstChild!=null){if(C!=null){var A=new Date();var D=-6;A=new Date(C.getFullYear(),C.getMonth(),C.getDate()-0+D);H.firstChild.data=limeade.calendar.monthLabels[A.getMonth()]+" "+A.getUTCDate()+" to "+limeade.calendar.monthLabels[C.getMonth()]+" "+C.getUTCDate();var G=document.getElementById(H.id.replace("WeeklyViewDateRange","WeekStartYear"));var B=document.getElementById(H.id.replace("WeeklyViewDateRange","WeekStartMonth"));var E=document.getElementById(H.id.replace("WeeklyViewDateRange","WeekStartDay"));if(G!=null){G.value=A.getFullYear()}if(B!=null){B.value=A.getMonth()}if(E!=null){E.value=A.getUTCDate()}for(var I=1;I<=7;I++){var F=document.getElementById(H.id.replace("WeeklyViewDateRange","Weekday"+I));if(F!=null){F.value=""}}limeade.myplan.setWeekDayLetters(A,H.id.replace("WeeklyViewDateRange",""))}}}};limeade.myplan.numericWeeklyChanged=function(A){var B=document.getElementById(A.id.replace(/TrackingTool1_.*/,"TrackingTool1_SaveTrackingDataButton"));limeade.controls.SaveButtonReset(B)};limeade.myplan.AcceptGoalClick=function(E,D){var B;var A=document.getElementById(E.id.replace(D,"RelatedGoalsHidden")).value;if(A!="True"){B=document.getElementById(E.id.replace(D,"GoalNameHidden")).value}else{var G=document.getElementById(E.id.replace(/AcceptTop3GoalLink/,"relatedNames")).value;var C=G.split("|");var F=parseInt(document.getElementById(E.id.replace(/AcceptTop3GoalLink/,"relatedindx")).value);B=C[F]}limeade.services.sendRequest("/MyPlan/ManageGoals.aspx?op=goalexists&gname="+encodeURIComponent(B),new Array(E,D,B),limeade.myplan.AcceptGoalCallback)};limeade.myplan.AcceptGoalCallback=function(B,D){var Z;var T;var R=limeade.services.getBody(B.responseText,"<!--StartLoginBoxDisplay-->","<!--EndLoginBoxDisplay-->",27);if(R=="1"){alert('"'+D[2]+'" - Goal is already accepted on your plan.');return}var V=D[0];var G=D[1];var L=document.getElementById(V.id.replace(G,"RelatedGoalsHidden")).value;var C=document.getElementById(V.id.replace(G,"AcceptGoalPanel"));var Q=document.getElementById(V.id.replace(G,"GoalAcceptedPanel"));var a=document.getElementById(V.id.replace(G,"GoalIdHidden")).value;var Y=document.getElementById(V.id.replace(G,"pnlGoalRow"));if(L=="True"){var I=document.getElementById(V.id.replace(/AcceptTop3GoalLink/,"relatedNames")).value;var S=I.split("|");var W=parseInt(document.getElementById(V.id.replace(/AcceptTop3GoalLink/,"relatedindx")).value);Z=S[W];var F=document.getElementById(V.id.replace(/AcceptTop3GoalLink/,"relatedTitles")).value;var J=F.split("|");T=J[W]}else{Z=document.getElementById(V.id.replace(G,"GoalNameHidden")).value}var E=document.getElementById(V.id.replace(/TabMyGoals_.*/,"TabMyGoals_status"));var O=document.getElementById(V.id.replace(/TabMyGoals_.*/,"TabMyGoals_goalstatus"));var X=document.getElementById(V.id.replace(/TabMyGoals_.*/,"TabMyGoals_lblGoalModifiedStatus"));var N=$find("ctl00_ctl00_bcr_TabContainerMyPlan");if(L!="True"){limeade.services.hideElement(C);limeade.services.showElement(Q)}X.innerHTML='Accepted the goal "'+Z+'". &nbsp;Would you like to <a href="#" onclick="javascript:limeade.controls.ChangeMyPlanTab(2); return false;" >track your progress</a>?';if(E){limeade.services.hideElement(E)}limeade.services.showElement(O);if(L=="True"){var A=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_GridView1").getElementsByTagName("tbody")[0];var M=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabPanelTrackProgress_BulkEditGridView1").getElementsByTagName("tbody")[0];var H=document.getElementById("Grid1GoalRow").cloneNode(true);var U=new Date();var P=limeade.myplan.replacementID();H.id="MyPlan_"+a;limeade.myplan.renameElementsInGoalRow(H,P);var K=limeade.services.getElementsByClassName(H,"SubHeaderColor");K[0].innerHTML=T;A.insertBefore(H,Y.parentNode.parentNode);A.removeChild(Y.parentNode.parentNode);limeade.services.sendRequest("/MyPlan/ManageGoals.aspx?g="+encodeURIComponent(a)+"&op=accept&gname="+encodeURIComponent(Z),new Array(P),limeade.myplan.GoalAdded)}else{limeade.services.sendRequest("/MyPlan/ManageGoals.aspx?g="+encodeURIComponent(a)+"&op=accept&gname="+encodeURIComponent(Z),null,limeade.services.nullFunction)}};limeade.myplan.AccomplishChallengeGoal=function(A,C){var B="Congratulations! Click 'OK' to complete the challenge and see your challenge record.";if(confirm(B)){limeade.services.sendRequest("/MyPlan/ManageGoals.aspx?cid="+encodeURIComponent(A)+"&op="+encodeURIComponent(C),null,limeade.services.nullFunction);return true}else{return false}};limeade.myplan.DeleteGoalClick=function(W,C,F,B,V,G,I){var T=document.getElementById(W.id.replace(F,"IsChallengeHidden")).value;var a=document.getElementById(W.id.replace(F,"GoalIdHidden")).value;var Z=document.getElementById(W.id.replace(F,"GoalNameHidden")).value;var H=document.getElementById(W.id.replace(F,"GoalVisibility")).value;var X=document.getElementById(W.id.replace(F,"GoalTargetHidden")).value;var M=document.getElementById(W.id.replace(F,"TrackTargetHidden")).value;var S=document.getElementById(W.id.replace(F,"AmountUnitsHidden")).value;var D=document.getElementById(W.id.replace(/TabMyGoals_.*/,"TabMyGoals_status"));var O=document.getElementById(W.id.replace(/TabMyGoals_.*/,"TabMyGoals_goalstatus"));var Y=document.getElementById(W.id.replace(/TabMyGoals_.*/,"TabMyGoals_lblGoalModifiedStatus"));var E;var N;var J="delete";var K=true;if(C=="0"){if(H=="1"){if(T=="True"){E="Are you sure you want to stop tracking this Challenge Goal?"}else{E="Are you sure you want to stop tracking this goal?"}}N='The goal "'+Z+'" has been removed from your plan.';J="delete"}else{if(H=="1"){if(T=="True"){if(G.toLowerCase()=="false"){E="Congratulations! Do you want to stop tracking this challenge goal?";N='Congratulations! You completed the goal "'+Z+'".';J="accomplish"}else{if(G.toLowerCase()=="true"){E="Sorry, this challenge ended on: "+V+".\n";E+='You cannot complete or receive an award for: "'+Z+'".';E+="\n\n";E+='If you would like to remove this challenge goal from your plan, please click "Delete."';E+="\n\n";N='To remove "'+Z+'" from your plan, please click "Delete."';J="";K=false}}}else{E="Congratulations! Do you want to stop tracking this goal?";N='Congratulations! You completed the goal "'+Z+'".';J="accomplish"}}}var U=true;if(H=="1"){if(K==true){U=confirm(E)}else{if(K==false){alert(E);U=false;if(D){limeade.services.hideElement(D)}limeade.services.showElement(O);Y.innerHTML=N}}}if(U){var P=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabMyGoals_GridView1").getElementsByTagName("tbody")[0];var R=document.getElementById(W.id.replace(F,"pnlGoalRow"));P.removeChild(R.parentNode.parentNode);var Q=document.getElementById("TrackProgress_"+a);if(Q){var L=document.getElementById("ctl00_ctl00_bcr_TabContainerMyPlan_TabPanelTrackProgress_BulkEditGridView1").getElementsByTagName("tbody")[0];L.removeChild(Q)}if(D){limeade.services.hideElement(D)}limeade.services.showElement(O);var A=document.getElementById(W.id.replace(/TabMyGoals_.*/,"TabMyGoals_GoalCountHidden"));A.value-=1;if(A.value==0){N='You have no goals. To Create Your Plan based on your Well-Being Assessment Results, click <a href="/MyPlan/index.aspx?mode=createplan">here</a>.';limeade.services.hideElement(document.getElementById(W.id.replace(/TabMyGoals_.*/,"TabMyGoals_closeBtn")))}Y.innerHTML=N;limeade.services.sendRequest("/MyPlan/ManageGoals.aspx?g="+encodeURIComponent(a)+"&op="+encodeURIComponent(J),null,limeade.services.nullFunction)}return false};limeade.myplan.TurnOnChallengeBinaryTracker=function(C,B,D,F,E){var A=document.getElementById("yesNoToggle");if(A.value!="1"){A.value="1";limeade.myplan.HighLightChallengeBinaryTracker(C);document.getElementById("ChallengeCompletedStatus").innerHTML='<img align="absmiddle" src="/Images/spinner.gif" />';limeade.services.sendRequest("/MyPlan/ManageGoals.aspx?cid="+encodeURIComponent(D)+"&op=accomplishevent",new Array(B,D,C,A,F,E),limeade.myplan.OneTimeEventAccomplished)}};limeade.myplan.UndoOneTimeEventCompletion=function(A,D,C,B){document.getElementById("ChallengeCompletedStatus").innerHTML='<img align="absmiddle" src="/Images/spinner.gif" />';limeade.services.sendRequest("/MyPlan/ManageGoals.aspx?inId="+encodeURIComponent(D)+"&op=undocompletion&cid="+encodeURIComponent(C),new Array(C,B,A,D),limeade.myplan.UndoOneTimeEventCallback)};limeade.myplan.OneTimeEventAccomplished=function(D,B){var A=limeade.services.getBody(D.responseText,"<!--StartLoginBoxDisplay-->","<!--EndLoginBoxDisplay-->",27);if(A.toLowerCase()=="true"){var E=B[5];if(E&&E!=""){var C='<font style="font-size: 12px; line-height: 14px;"> ';C+="Completed - you've earned "+B[0]+"! ";C+='(<a style=""';C+='id="Challenge'+B[1]+'_UndoComplete"';C+="onclick=\"limeade.myplan.UndoOneTimeEventCompletion(this,'"+E+"','"+B[1]+"','"+B[0]+"'); return false;\"";C+='href="javascript:void(0);">';C+="Undo</a>)";C+="</font> ";document.getElementById("ChallengeCompletedStatus").innerHTML=C;limeade.services.hideElement(document.getElementById("refreshlink"))}else{document.getElementById("ChallengeCompletedStatus").innerHTML="Completed - you've earned "+B[0]+"!</span>";limeade.services.showElement(document.getElementById("refreshlink"))}}else{}};limeade.myplan.UndoOneTimeEventCallback=function(E,C){var B=limeade.services.getBody(E.responseText,"<!--StartLoginBoxDisplay-->","<!--EndLoginBoxDisplay-->",27);if(B.toLowerCase()=="true"){var F="";var D='<tr id="ChallengeStatus">';D+='<td style="width: 50px;">';D+='<input type="image" ';D+='id="Challenge'+C[0]+'_BinaryTracker1_ImgYesNo" ';D+="onclick=\"limeade.myplan.TurnOnChallengeBinaryTracker(this,'"+C[1]+"','"+C[0]+"','"+F+"','"+C[3]+"'); return false;\" ";D+='onmouseout="limeade.myplan.DeHighLightChallengeBinaryTracker(this); return false;" ';D+='onmouseover="limeade.myplan.HighLightChallengeBinaryTracker(this); return false;" ';D+='src="/myplan/images/BinaryTrackerUnCheckMarked.gif" ';D+='style="border-width: 0px; outline: medium none;"></td><td style="width: 100%;"> ';D+='<font class="HeaderColor" style="font-size: 12px; font-weight: bold;" id="ChallengeCompletedStatus">Did you complete this?</font>';D+="</td>";D+="</tr>";$("#ChallengeStatus").replaceWith(D);$("#yesNoToggle").val="0";var A=document.getElementById("yesNoToggle");A.value="0";$("#ChallengeUndo").hide()}else{}};limeade.myplan.TurnOnBinaryTracker=function(E){E.src="/myplan/images/BinaryTrackerCheckMarked.gif";var C=document.getElementById(E.id.replace(/ImgYesNo/,"BinarySaved"));var B=document.getElementById(E.id.replace(/ImgYesNo/,"BinarySavedNo"));var A=document.getElementById(E.id.replace(/ImgYesNo/,"yesNoToggle"));A.value="1";C.style.color="";B.style.color="lightgrey";var D=document.getElementById(E.id.replace(/BinaryTracker1_ImgYesNo.*/,"TrackingGoalId"));limeade.tracking.SaveTrackingData("1",D.value,E);return false};limeade.myplan.TurnOnYesLink=function(E){var C=document.getElementById(E.id.replace(/BinarySaved/,"ImgYesNo"));var B=document.getElementById(E.id.replace(/BinarySaved/,"BinarySavedNo"));var A=document.getElementById(E.id.replace(/BinarySaved/,"yesNoToggle"));C.src="/myplan/images/BinaryTrackerCheckMarked.gif";A.value="1";E.style.color="";B.style.color="lightgrey";var D=document.getElementById(E.id.replace(/BinaryTracker1_BinarySaved.*/,"TrackingGoalId"));limeade.tracking.SaveTrackingData("1",D.value,E);return false};limeade.myplan.TurnOnNoLink=function(E){var C=document.getElementById(E.id.replace(/BinarySavedNo/,"ImgYesNo"));var B=document.getElementById(E.id.replace(/BinarySavedNo/,"BinarySaved"));var A=document.getElementById(E.id.replace(/BinarySavedNo/,"yesNoToggle"));C.src="/myplan/images/BinaryTrackerUnCheckMarked.gif";A.value="0";B.style.color="lightgrey";E.style.color="";var D=document.getElementById(E.id.replace(/BinaryTracker1_BinarySavedNo.*/,"TrackingGoalId"));limeade.tracking.SaveTrackingData("0",D.value,E);return false};limeade.myplan.HighLightChallengeBinaryTracker=function(A){A.src="/myplan/images/BinaryTrackerCheckMarked.gif"};limeade.myplan.HighLightBinaryTracker=function(C){C.src="/myplan/images/BinaryTrackerCheckMarked.gif";var B=document.getElementById(C.id.replace(/ImgYesNo/,"BinarySaved"));var A=document.getElementById(C.id.replace(/ImgYesNo/,"BinarySavedNo"));B.style.color="";A.style.color="lightgrey";return false};limeade.myplan.DeHighLightChallengeBinaryTracker=function(B){var A=document.getElementById("yesNoToggle");if(A.value!="1"){B.src="/myplan/images/BinaryTrackerUnCheckMarked.gif"}};limeade.myplan.DeHighLightBinaryTracker=function(D){var A=document.getElementById(D.id.replace(/ImgYesNo/,"yesNoToggle"));var C=document.getElementById(D.id.replace(/ImgYesNo/,"BinarySaved"));var B=document.getElementById(D.id.replace(/ImgYesNo/,"BinarySavedNo"));if(A.value!="1"){D.src="/myplan/images/BinaryTrackerUnCheckMarked.gif";C.style.color="lightgrey";if(A.value=="0"){B.style.color=""}}return false};limeade.myplan.HighLightYesLink=function(C){var B=document.getElementById(C.id.replace(/BinarySaved/,"ImgYesNo"));var A=document.getElementById(C.id.replace(/BinarySaved/,"BinarySavedNo"));B.src="/myplan/images/BinaryTrackerCheckMarked.gif";C.style.color="";A.style.color="lightgrey"};limeade.myplan.HighLightNoLink=function(C){var A=document.getElementById(C.id.replace(/BinarySavedNo/,"ImgYesNo"));var B=document.getElementById(C.id.replace(/BinarySavedNo/,"BinarySaved"));A.src="/myplan/images/BinaryTrackerUnCheckMarked.gif";C.style.color="";B.style.color="lightgrey"};limeade.myplan.DeHighLightYesLink=function(C){var A=document.getElementById(C.id.replace(/BinarySaved/,"yesNoToggle"));var B=document.getElementById(C.id.replace(/BinarySaved/,"BinarySavedNo"));if(A.value!="1"){C.style.color="lightgrey";document.getElementById(C.id.replace(/BinarySaved/,"ImgYesNo")).src="/myplan/images/BinaryTrackerUnCheckMarked.gif";if(A.value=="0"){B.style.color=""}}};limeade.myplan.DeHighLightNoLink=function(D){var B=document.getElementById(D.id.replace(/BinarySavedNo/,"ImgYesNo"));var A=document.getElementById(D.id.replace(/BinarySavedNo/,"yesNoToggle"));var C=document.getElementById(D.id.replace(/BinarySavedNo/,"BinarySaved"));if(A.value=="1"){B.src="/myplan/images/BinaryTrackerCheckMarked.gif";C.style.color=""}if(A.value!="0"){D.style.color="lightgrey"}};limeade.myplan.setWeekDayLetters=function(A,C){var D=new Date();for(var E=0;E<=6;E++){D=new Date(A.getFullYear(),A.getMonth(),A.getDate()-0+E);var B=document.getElementById(C+"dayltr"+(E+1));if(B!=null){if(B.firstChild!=null){B.firstChild.data=limeade.calendar.CalDayLabels[D.getDay()]}}}};limeade.myplan.PopupClicked=function(A,B){while(A.parentNode){if(A.id.indexOf(B)!=-1||A.id.indexOf("GoalResources")!=-1||A.id.indexOf("timeStampButton")!=-1){return true}A=A.parentNode}return false};limeade.myplan.SaveStars=function(A){var C=document.getElementById(A.id.replace(/FivePointScale.*/,"TrackingGoalId"));var B=document.getElementById(A.id.replace(/FivePointScale.*/,"FivePointScale_A"));var D=parseFloat(A.id.charAt(A.id.length-1));B.title=D;limeade.tracking.SaveTrackingData(D,C.value,A);return false};limeade.myplan.ratingMouseOver=function(D){var B=parseFloat(D.id.charAt(D.id.length-1));for(var C=1;C<=5;C++){var A=document.getElementById(D.id.substring(0,D.id.length-1)+C);if(C<=B){A.className="ratingItem Filled"}else{A.className="ratingItem Empty"}}};limeade.myplan.ratingMouseOut=function(D){var E=document.getElementById(D.id.replace(/FivePointScale.*/,"FivePointScale_A"));var B=parseFloat(E.title);for(var C=1;C<=5;C++){var A=document.getElementById(D.id.substring(0,D.id.length-1)+C);if(C<=B){A.className="ratingItem Filled"}else{A.className="ratingItem Empty"}}};limeade.myplan.SaveSmileys=function(B){var A=document.getElementById(B.id.replace(/FivePointScaleSmileysView1_Rating.*/,"TrackingGoalId"));var C=parseFloat(B.id.charAt(B.id.length-1));limeade.tracking.SaveTrackingData(C,A.value,B);limeade.myplan.SetSmileys(B);return false};limeade.myplan.trackerDate=function(){var B=new Date();var A=document.getElementById("ctl00_ctl00_bcr_txtMyPlanCalendar");if(A!=null){B=new Date(A.value)}return B};limeade.myplan.SaveHowAreYouSmileys=function(){var A=parseFloat(this.id.charAt(this.id.length-1));limeade.tracking.SaveTrackingData(A,null,this,true);limeade.myplan.SetSmileys(this);return false};limeade.myplan.SetSmileys=function(B){var A=B.id.substring(0,B.id.length-1);limeade.myplan.SetSmileyById(A,B.id.charAt(B.id.length-1))};limeade.myplan.SetSmileyById=function(B,A){var D=B+A;for(i=1;i<=5;i++){var C=document.getElementById(B+i);if(C.id!=D){C.src=C.src.replace(/smileyroll/,"smiley");this.onmouseout="this.src = '"+C.src+"'"}else{C.onmouseout=null}}};limeade.myplan.SaveButtonClicked=function(A){var C=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"TrackingGoalId"));var G=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"TrackingToolHidden"));var E=true;var D="";switch(G.value){case"Microjournal":case"MicroJournal":D=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"MessageText")).value;if(D=="Type your journal entry here."){D=""}break;case"NumericTrackingDailyView":D=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"NumericDaily")).value;var F=limeade.services.ValidateNumber(D);if(F!=1&&F!=5){var B=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"numericErrorText"));switch(F){case -1:B.innerHTML=" Value required.";break;case 2:B.innerHTML=" Valid number required.";break;case 3:B.innerHTML=" Invalid decimal number.";break;case 4:B.innerHTML=" Value less than zero.";break}limeade.services.showElement(document.getElementById(A.id.replace(/SaveTrackingDataButton/,"RFVNumericError")));E=false}D=Math.round(D);break;case"NumericTrackingWeeklyView":var N=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"WeeklyView1_Weekday1")).value;var M=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"WeeklyView1_Weekday2")).value;var L=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"WeeklyView1_Weekday3")).value;var K=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"WeeklyView1_Weekday4")).value;var J=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"WeeklyView1_Weekday5")).value;var I=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"WeeklyView1_Weekday6")).value;var H=document.getElementById(A.id.replace(/SaveTrackingDataButton/,"WeeklyView1_Weekday7")).value;D=N+","+M+","+L+","+K+","+J+","+I+","+H;break}if(E){A.style.color="white";A.style.backgroundColor="black";A.value="Saved!";limeade.services.hideElement(document.getElementById(A.id.replace(/SaveTrackingDataButton/,"RFVNumericWarning")));limeade.services.hideElement(document.getElementById(A.id.replace(/SaveTrackingDataButton/,"RFVNumericError")));limeade.tracking.SaveTrackingData(D,C.value,A)}return false};limeade.myplan.NumberHasFocus=function(A){limeade.services.hideElement(document.getElementById(A.id.replace(/NumericDaily/,"RFVNumericWarning")))};limeade.myplan.NumberLostFocus=function(B){var D=limeade.services.ValidateNumber(B.value);var C=document.getElementById(B.id.replace(/NumericDaily/,"RFVNumericWarning"));if(D==5){B.value=Math.round(B.value);var A=document.getElementById(B.id.replace(/NumericDaily/,"numericWarningText"));A.innerHTML=" Decimal number rounded.";limeade.services.showElement(C)}else{limeade.services.hideElement(C);limeade.services.hideElement(document.getElementById(B.id.replace(/NumericDaily/,"RFVNumericError")))}};limeade.myplan.IsNewTrackingData=function(B){if(B.value=="NewData"){initPopUp();var A=new Date();showPopWin("NewTrackingData.aspx?nocache="+A.getTime(),427,390,limeade.services.reloadPage)}};limeade.myplan.SetIncrementalDate=function(G,A,D){var F=document.getElementById(G);var C=false;if(F!=null){var E=new Date(F.value);var B=new Date();E.setDate(E.getDate()+A);if(E<=B){limeade.calendar.SetDate(G,E,D);C=true}}return C};limeade.myplan.checkNewActivity=function(D){var C=document.getElementById(D.id.replace(/chkNewActivity.*/i,"TrackingTool1_TrackingGoalId")).value;var B=document.getElementById(D.id.replace(/chkNewActivity.*/i,"HistoricDataGraphID_HistoricDataUpdatePanel"));var A=document.getElementById("newActivityDiv");B.innerHTML=A.innerHTML;limeade.services.sendRequest("/Sync/HealthVaultSync.aspx?synchactdata=true",new Array(C,B),limeade.myplan.UpdateChart)};limeade.myplan.UpdateChart=function(F,C){var D=C[1];var B=document.getElementById(D.id.replace(/HistoricDataGraphID_HistoricDataUpdatePanel/,"GraphMonth"));var A="/Chart/HistoricChartGenerate.aspx";var E="goalId="+C[0];if(B!=null){E+="&months="+B.value}else{E+="&months=1"}A+="?"+E;limeade.services.sendRequest(A,new Array(D),limeade.tracking.ReloadGraph,null)};createNamespace("limeade.tracking");limeade.tracking.ReloadGraph=function(B,A){A[0].innerHTML=limeade.services.getBody(B.responseText,"<!--StartChartDisplay-->","<!--EndChartDisplay-->");if(A[1]==false){$(A[0]).find("#HistoricDataGraphGenerate_pnlShowMonthLinks").remove()}};limeade.tracking.DataSaved=function(B,E){var G="/Chart/HistoricChartGenerate.aspx";var F="";var L=null;var W=null;var U=true;if(E[2]==true){L=document.getElementById(E[0].id.replace(/FivePointScaleHowAreYou_Rating.*/,"HDGHowAreYou_HistoricDataUpdatePanel"));W=document.getElementById(E[0].id.replace(/FivePointScaleHowAreYou_Rating.*/,"HDGHowAreYou_GraphMonth"));F="howAreYou=true"}else{F="goalId="+E[1];L=document.getElementById(E[0].id.replace(/TrackingTool1_.*/,"HistoricDataGraphID_HistoricDataUpdatePanel"));W=document.getElementById(E[0].id.replace(/TrackingTool1_.*/,"GraphMonth"))}if(L){var D=$(L).find("table tbody").children("tr:first-child").children("td");if(W!=null){F+="&months="+W.value}var V=$(D).children("input:first-child");var P=$(V).next();if(V.val()!=""&&P.val()!=""){F+="&s="+V.val()+"&e="+P.val()}if($(L).find("div[id*=_HistoryIcon]").size()==0){F+="&i=false"}G+="?"+F;if($(D).children("div").size()!=2){U=false}limeade.services.sendRequest(G,new Array(L,U),limeade.tracking.ReloadGraph,null)}var K=jQuery.trim(limeade.services.getBody(B.responseText,"<!--StartChallengePoints-->","<!--EndChallengePoints-->",27));var R=jQuery.trim(limeade.services.getBody(B.responseText,"<!--StartChallengeId-->","<!--EndChallengeId-->",23));var Q=jQuery.trim(limeade.services.getBody(B.responseText,"<!--StartChallengeTrackingTotal-->","<!--EndChallengeTrackingTotal-->"));var H=jQuery.trim(limeade.services.getBody(B.responseText,"<!--StartChallengePercentComplete-->","<!--EndChallengePercentComplete-->"));var O=$(R).html();if(K&&K!=""&&O&&O!=""){var I="p="+K;I+="&cid="+O;var N="/myresults/challengecomplete.aspx";N+="?"+I;ShowPopup(E[0],N);var J=$(E[0]).parents(".CommonListArea");var T=J.children("table:first");var A=T.children("tbody:first");var C=A.children("tr:last-child");var M=C.children("td:last-child");var S=M.text();if(S&&S!=""){M.html("Congratulations! - you've completed the challenge and earned "+K+".")}}if(Q&&Q!=""){$(".challengetotal"+E[1]).html(Q)}if(H&&H!=""){$(".unitsSuffix"+E[1]).html(H)}};limeade.tracking.UpdateChartFromLink=function(F){var C=F.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;var B="/Chart/HistoricChartGenerate.aspx";var E="months="+F.innerHTML;var A=null;if(C.id.indexOf("HDGHowAreYou")==-1){var D=document.getElementById(C.id.replace(/HistoricDataGraphID_.*/,"TrackingTool1_TrackingGoalId"));E+="&goalid="+D.value;A=document.getElementById(C.id.replace(/HistoricDataGraphID_.*/,"GraphMonth"))}else{E+="&howAreYou=true";A=document.getElementById(C.id.replace(/HistoricDataUpdatePanel.*/,"GraphMonth"))}A.value=encodeURIComponent(F.innerHTML);B+="?"+E;limeade.services.sendRequest(B,new Array(C),limeade.tracking.ReloadGraph,null);return false};limeade.tracking.SaveTrackingData=function(D,G,C,H){var B=limeade.myplan.trackerDate().format("MM/dd/yyyy");var A="/MyPlan/SaveTrackingData.aspx";var I="toolVal="+encodeURIComponent(D);I+="&goalId="+encodeURIComponent(G);I+="&trackedDate="+encodeURIComponent(B);if(H){I+="&how="+encodeURIComponent(H)}A+="?"+I;var F=document.getElementById(C.id.replace(/TrackingTool1_.*/,"AcceptGoalPanel").replace(/TabPanelTrackProgress_BulkEditGridView1/,"TabMyGoals_GridView1"));var E=document.getElementById(C.id.replace(/TrackingTool1_.*/,"GoalAcceptedPanel").replace(/TabPanelTrackProgress_BulkEditGridView1/,"TabMyGoals_GridView1"));limeade.services.hideElement(F);limeade.services.showElement(E);limeade.services.sendRequest(A,new Array(C,G,H),limeade.tracking.DataSaved,null)};var dateFormat=function(){var A=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,B=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,D=/[^-+\dA-Z]/g,C=function(F,E){F=String(F);E=E||2;while(F.length<E){F="0"+F}return F};return function(J,V,R){var G=dateFormat;if(arguments.length==1&&(typeof J=="string"||J instanceof String)&&!/\d/.test(J)){V=J;J=undefined}J=J?new Date(J):new Date();if(isNaN(J)){throw new SyntaxError("invalid date")}V=String(G.masks[V]||V||G.masks["default"]);if(V.slice(0,4)=="UTC:"){V=V.slice(4);R=true}var T=R?"getUTC":"get",O=J[T+"Date"](),E=J[T+"Day"](),K=J[T+"Month"](),Q=J[T+"FullYear"](),S=J[T+"Hours"](),N=J[T+"Minutes"](),U=J[T+"Seconds"](),P=J[T+"Milliseconds"](),F=R?0:J.getTimezoneOffset(),I={d:O,dd:C(O),ddd:G.i18n.dayNames[E],dddd:G.i18n.dayNames[E+7],m:K+1,mm:C(K+1),mmm:G.i18n.monthNames[K],mmmm:G.i18n.monthNames[K+12],yy:String(Q).slice(2),yyyy:Q,h:S%12||12,hh:C(S%12||12),H:S,HH:C(S),M:N,MM:C(N),s:U,ss:C(U),l:C(P,3),L:C(P>99?Math.round(P/10):P),t:S<12?"a":"p",tt:S<12?"am":"pm",T:S<12?"A":"P",TT:S<12?"AM":"PM",Z:R?"UTC":(String(J).match(B)||[""]).pop().replace(D,""),o:(F>0?"-":"+")+C(Math.floor(Math.abs(F)/60)*100+Math.abs(F)%60,4),S:["th","st","nd","rd"][O%10>3?0:(O%100-O%10!=10)*O%10]};return V.replace(A,function(H){return H in I?I[H]:H.slice(1,H.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(A,B){return dateFormat(this,A,B)};var limchallenges=createNamespace("limeade.challenges");var limcreatechallenge=createNamespace("limeade.challenges.createchallenge");limchallenges.toggleUnitsValidator=function(){var B=document.getElementById("ctl00_bcr_rbNumber");if(B!=null){var A=document.getElementById("ctl00_bcr_RFVUnits");if(B.checked){ValidatorEnable(A,true)}else{ValidatorEnable(A,false)}}};limchallenges.clientValidate=function(C){var B;if(C.id.indexOf("txtNewParticipant")!=-1){B=C.id.replace(/bp___v___ctl00_ctl00_bcr_txtNewParticipant/gi,"")}else{if(C.id.indexOf("ctl00_bcr_txtLimeadeChallenger")!=-1){B=C.id.replace(/ctl00_bcr_txtLimeadeChallenger/gi,"")}}C.value=limeade.services.trim(C.value);if(C.value!=""){$("#NotEnoughUsers").hide();var A="/Challenges/ValidateUserNameOrEmail.aspx?user="+encodeURIComponent(C.value);try{limeade.services.sendRequest(A,new Array(B),limchallenges.userNameEmailValidated,null,false)}catch(D){return}}};limchallenges.userNameEmailValidated=function(A,C){if(A.responseText.length!=0){var B=limeade.services.getBody(A.responseText,"<!--StartDisplay-->","<!--EndDisplay-->",19);var D=$("#UserNotFound"+C[0]);if(D!=null){if(B.indexOf("True")!=-1){$(D).hide()}else{$(D).show()}}}};limchallenges.validateUnits=function(){var A=document.getElementById("challTrackingTypeRow");var D=document.getElementById("ctl00_bcr_rbWeight");if(D&&D.checked){return true}if(A.style.visibility=="visible"){var C=document.getElementById("ctl00_bcr_rbNumber");var E=document.getElementById("ctl00_bcr_rbYesNo");var B;if(C&&C.checked){B=document.getElementById("ctl00_bcr_cmbUnits_TB")}else{if(E&&E.checked){B=document.getElementById("ctl00_bcr_cmbYesNo_TB")}}if(limeade.services.trim(B.value)==""){document.getElementById("ctl00_bcr_RFVChallengeUnits").style.display="inline";window.scrollTo(0,240);return false}else{document.getElementById("ctl00_bcr_RFVChallengeUnits").style.display="none"}}return true};limchallenges.validateAllUsernames=function(){var G=document.getElementById("ctl00_bcr_NotifyPanel");var A=document.getElementById("inviteesDiv");var C=true;if(A!=null&&A.style.visibility=="hidden"){C=true}else{if(G!=null){var D=limeade.services.getElementsByClassName(G,"invitee");var E=0;for(var B=0;B<D.length;B++){D[B].value=limeade.services.trim(D[B].value);if(D[B].value!=""){limchallenges.clientValidate(D[B]);var F=document.getElementById("UserNotFound"+D[B].id.replace(/ctl00_bcr_txtLimeadeChallenger/gi,""));if(F.style.visibility=="visible"){C=C&&false}else{C&&true}E+=1}}if(E==0){limeade.services.showElement(document.getElementById("NotEnoughUsers"));C=false}}}return C};limchallenges.endDateValidate=function(C,B){var D=new Date(B.Value);var A=new Date();if(D<A){B.IsValid=false}else{B.IsValid=true}};limcreatechallenge.CreatePreviewChallenge=function(q,E){var AF=Page_ClientValidate();var T=limchallenges.validateAllUsernames();var f=limchallenges.validateUnits();Page_IsValid=Page_IsValid&&T&&f;if(Page_IsValid){document.getElementById("btnCreateChallenge").disabled=true;limeade.services.hideElement(document.getElementById("lnkPreviewChallenge"));var B=document.getElementById("statusText");if(E=="preview"){B.innerHTML="Previewing Challenge..."}else{if(E=="create"){B.innerHTML="Creating Challenge..."}}document.getElementById("loading").style.visibility="visible";document.getElementById("loading").style.display="inline";var F;var K=document.getElementById("ctl00_bcr_hiddenGoalId").value;if(K&&K!="-1"){F=document.getElementById("ctl00_bcr_lblExistingChallengeName").firstChild.data}else{F=document.getElementById("ctl00_bcr_txtWhatIsChallenge").value}var C=limeade.services.trim(document.getElementById("ctl00_bcr_hiddenChallengeType").value);var e=document.getElementById("ctl00_bcr_txtChallengeEndDate").value;var y=document.getElementById("ctl00_bcr_txtPersonalMessage").value;var n=0;var s="";var AH="";var A=0;var m;var W="";var X="";var z=1;var a="";var P=1;var AG=GetHtmlEditorValue();var AJ="";var h="";var o=document.getElementById("ctl00_bcr_rbTeamChallenge");var r=(o!=null&&o.checked)?true:false;var I=document.getElementById("ctl00_bcr_rbTargetMinimum");var R=document.getElementById("ctl00_bcr_rbTargetHighest");var AC=document.getElementById("ctl00_bcr_rbTargetLowest");var AD=document.getElementById("ctl00_bcr_rbWeight");var l=document.getElementById("ctl00_bcr_rbOneTimeEvent");var AA=document.getElementById("ctl00_bcr_rbNumber");var w=document.getElementById("ctl00_bcr_cmbUnits_TB");var N=document.getElementById("ctl00_bcr_cmbYesNo_TB");var G=document.getElementById("ctl00_bcr_txtLeastNumber");var AI=document.getElementById("ctl00_bcr_txtLeastDays");var H=document.getElementById("ctl00_bcr_rbYesNo");var g=document.getElementById("ctl00_bcr_cmbWeightUnits");var v=document.getElementById("ctl00_bcr_cmbWeightChange");if(AD&&AD.checked){n=4}else{if(I&&I.checked){n=4}else{if(R&&R.checked){n=0}else{if(AC&&AC.checked){n=1}else{if(l&&l.checked){n=5;s=4;AJ=document.getElementById("ctl00_bcr_OneTimeLocation").value;h=document.getElementById("ctl00_bcr_OneTimeWebLink").value}}}}}if(n!=5){if(AD&&AD.checked){s=2;AH=g.value;if(v){A=v.value}}else{if(AA&&AA.checked){s=0;AH=w.value;if(I&&I.checked){A=G.value}}else{if(H&&H.checked){s=3;AH=N.value;if(I&&I.checked){A=AI.value}}}}}var b=null;if(C.toLowerCase()=="employer"){b=document.getElementById("ctl00_bcr_chkOpenEmployerChallenge");if(b&&!b.checked){P=0}}else{b=document.getElementById("ctl00_bcr_chkOpenPersonalChallenge");if(b&&!b.checked){P=0}}var k=document.getElementById("ctl00_bcr_rbAwardIncentives");var Y=document.getElementById("ctl00_bcr_rbAwardSomethingElse");var u=document.getElementById("ctl00_bcr_txtIncentivePts");var O=document.getElementById("ctl00_bcr_txtReward");var d="";var Q=document.getElementById("inviteeList");var t=document.getElementById("promoteToMe");var S=document.getElementById("promoteToAll");if(C.toLowerCase()=="employer"){if(k&&k.checked){m=0;W=u.value}else{if(Y&&Y.checked){m=1;X=O.value}}limeade.services.hideElement(document.getElementById("promoteAllPersonal"));limeade.services.showElement(document.getElementById("promoteAllCompany"))}else{W=0;m=1;X=O.value;limeade.services.hideElement(t);limeade.services.showElement(S);limeade.services.hideElement(document.getElementById("promoteAllCompany"));limeade.services.showElement(document.getElementById("promoteAllPersonal"))}var M=document.getElementById("ctl00_bcr_rbInvitation");var U=document.getElementById("ctl00_bcr_rbAllUsers");if(M&&M.checked){z=1}else{if(U&&U.checked){z=2}}if(C.toLowerCase()!="employer"){z=0}if(z==2||z==0){var L=document.getElementById("ctl00_bcr_NotifyPanel");if(L!=null){Q.innerHTML="";var AB=limeade.services.getElementsByClassName(L,"invitee");for(var AE=0;AE<AB.length;AE++){AB[AE].value=limeade.services.trim(AB[AE].value);if(AB[AE].value!=""){a+=AB[AE].value+",";var Z=document.createElement("li");Z.className="LinkColor";var V=document.createElement("span");V.style.color="#000";V.innerHTML=AB[AE].value;Z.appendChild(V);Q.insertBefore(Z,Q.firstChild)}}if(a.length>0){a=a.substring(0,a.length-1)}limeade.services.showElement(S);limeade.services.hideElement(t)}}else{if(C.toLowerCase()=="employer"){a=document.getElementById("ctl00_bcr_txtLimeadeChallengerA").value}else{a=document.getElementById("ctl00_bcr_hiddenCurrentUsername").value}document.getElementById("confirmYourEmail").innerHTML=a;limeade.services.showElement(t);limeade.services.hideElement(S)}var J="/challenges/ajaxchallenges.aspx";var D="act="+encodeURIComponent(E);D+="&end="+encodeURIComponent(e);D+="&track="+encodeURIComponent(s);D+="&target="+encodeURIComponent(A);D+="&strategy="+encodeURIComponent(n);D+="&name="+encodeURIComponent(F);D+="&units="+encodeURIComponent(AH);D+="&rewardtype="+encodeURIComponent(m);D+="&rewarddesc="+encodeURIComponent(X);D+="&points="+encodeURIComponent(W);D+="&open="+encodeURIComponent(P);D+="&promo="+encodeURIComponent(z);D+="&msg="+encodeURIComponent(y);D+="&invitees="+encodeURIComponent(a);D+="&about="+encodeURIComponent(AG);D+="&location="+encodeURIComponent(AJ);D+="&url="+encodeURIComponent(h);D+="&employer="+(C.toLowerCase()=="employer"?"true":"false");D+="&isteamchallenge="+encodeURIComponent(r);limeade.services.sendRequest(J,new Array(F,e,P,E,s,r),limcreatechallenge.challengeCreated,D)}};limcreatechallenge.challengeCreated=function(I,L){if(I.responseText.length!=0){if(L[3]=="create"){var M=I.responseText.replace("success!","");var E=window.location.toString();E=E.replace(/info\/.*/gi,"info");var N=/(?:\d*\.\d*\.\d*\.\d*)/gi;var H=N.exec(E);if(H!=null){E=E.replace(/\d*\.\d*\.\d*\.\d*.*/gi,H)}E=E.replace(/com\/.*/gi,"com");E=E.replace(/localhost\/.*/gi,"localhost");var C=document.getElementById("lnkViewChallengeStatus");C.href="/Challenges/"+M+"/default.aspx";document.getElementById("challengeName").innerHTML=L[0];document.getElementById("challengeEndDate").innerHTML=L[1];if(L[4]==4){document.getElementById("challengeVerb").innerHTML="happening on"}var F=document.getElementById("ctl00_bcr_pnlPublicChallengeCreated");if(L[2]==1){limeade.services.showElement(F);var D=document.getElementById("lnkPublicChallengeLink");D.innerHTML=C.href;D.href=C.href}else{limeade.services.hideElement(F)}var O=document.getElementById("ctl00_bcr_pnlChallengeExists");var K=document.getElementById("pnlChallengeDetails");var A=document.getElementById("pnlChallengeCreated");var G=document.getElementById("ctl00_rcr_SampleChallengesPanel");limeade.services.hideElement(G);limeade.services.hideElement(O);limeade.services.hideElement(K);limeade.services.showElement(A);window.scrollTo(0,210)}else{if(L[3]=="preview"){initPopUp();var B=new Date();var J;if(L[5]==true){J="EmailTeamChallengePreview.html"}else{J="EmailGoalChallengePreview.html"}showPopWin("/user/emailpreview.aspx?f="+J+"&t=Challenge Email Preview&nocache="+B.getTime(),567,522,limeade.services.reloadPage);document.getElementById("btnCreateChallenge").disabled=false;limeade.services.showElement(document.getElementById("lnkPreviewChallenge"));limeade.services.hideElement(document.getElementById("loading"))}}}};limcreatechallenge.calendarClicked=function(){var E=$find("challEndDate");if(E!=null){var C=document.getElementById("dayNumber");if(C!=null){var B=new Date();var A=1000*60*60*24;var D=Math.ceil((E.get_selectedDate().getTime()-B.getTime())/(A));C.innerHTML=D}}};limcreatechallenge.ChallengeTypeChanged=function(D){var B=document.getElementById("minTracking");var N=document.getElementById("highestTracking");var I=document.getElementById("lowestTracking");var A=document.getElementById("challTrackingTypeRow");var L=document.getElementById("challengeTrackingDiv");var K=document.getElementById("lblTrackingNumberText");var O=document.getElementById("lblTrackingDaysText");var F=document.getElementById("txtLeastNumberDiv");var U=document.getElementById("txtLeastDaysDiv");var E=document.getElementById("ctl00_bcr_cmbUnits_TB");var V=document.getElementById("ctl00_bcr_cmbYesNo_TB");var X=document.getElementById("ctl00_bcr_cmbYesNo");var Q=document.getElementById("OneTimeEventDetails");var W=document.getElementById("WeightLossChallengeDetails");var R=document.getElementById("ctl00_bcr_divDatePrefix");var Z=document.getElementById("standardexamples");var M=document.getElementById("onetimeexamples");var C=document.getElementById("ctl00_bcr_RFVLeastNumber");var P=document.getElementById("ctl00_bcr_RegExpLeastNumber");var T=document.getElementById("ctl00_bcr_RFVLeastDays");var J=document.getElementById("ctl00_bcr_RegExpLeastDays");var H=document.getElementById("ctl00_bcr_rbNumber");var S=document.getElementById("ctl00_bcr_rbYesNo");if(C!=null){ValidatorEnable(C,false)}if(T!=null){ValidatorEnable(T,false)}if(P!=null){ValidatorEnable(P,false)}if(J!=null){ValidatorEnable(J,false)}var Y=document.getElementById("ctl00_bcr_cmbUnits_LBC");var G=document.getElementById("ctl00_bcr_cmbYesNo_LBC");if(Y!=null){Y.style.left="";Y.style.top=""}if(G!=null){G.style.left="";G.style.top=""}if(R!=null){R.innerHTML="from today through"}switch(D){case"minimum":limeade.services.showElement(B);limeade.services.showElement(A);limeade.services.hideElement(N);limeade.services.hideElement(I);B.appendChild(A);A.style.height="208px";limeade.services.hideElement(Q);limeade.services.hideElement(W);if(X){X.parentNode.style.paddingLeft="0px"}limeade.services.showElement(F);limeade.services.showElement(U);if(H&&H.checked){C.enabled=true;P.enabled=true}if(S&&S.checked){T.enabled=true;J.enabled=true}limcreatechallenge.highestTrackerUnits();break;case"weight":limeade.services.hideElement(A);limeade.services.hideElement(I);limeade.services.hideElement(Q);limeade.services.showElement(W);if(X){X.parentNode.style.paddingLeft="0px"}limeade.services.hideElement(F);limeade.services.hideElement(U);E.value="pounds";limcreatechallenge.nonHighestTrackerUnits();break;case"lowest":limeade.services.hideElement(B);limeade.services.showElement(A);limeade.services.showElement(I);limeade.services.hideElement(N);I.appendChild(A);A.style.height="155px";N.innerHTML=B.innerHTML;limeade.services.hideElement(Q);limeade.services.hideElement(W);if(X){X.parentNode.style.paddingLeft="0px"}limeade.services.hideElement(F);limeade.services.hideElement(U);limcreatechallenge.nonHighestTrackerUnits();break;case"highest":limeade.services.hideElement(B);limeade.services.showElement(N);limeade.services.hideElement(I);limeade.services.showElement(A);N.appendChild(A);A.style.height="155px";limeade.services.hideElement(Q);limeade.services.hideElement(W);if(X){X.parentNode.style.paddingLeft="0px"}limeade.services.hideElement(F);limeade.services.hideElement(U);limcreatechallenge.highestTrackerUnits();break;case"onetime":limeade.services.hideElement(B);limeade.services.hideElement(N);limeade.services.hideElement(I);limeade.services.hideElement(A);limeade.services.showElement(Q);limeade.services.hideElement(W);limeade.services.hideElement(A);if(R!=null){R.innerHTML="from today through"}break}};limcreatechallenge.highestTrackerUnits=function(){var A=document.getElementById("ctl00_bcr_cmbUnits_LB");A.options.length=0;limeade.goals.AddItem("hours","hours",A);limeade.goals.AddItem("minutes","minutes",A);limeade.goals.AddItem("miles","miles",A);limeade.goals.AddItem("add new units...","add new units...",A);var B=document.getElementById("ctl00_bcr_cmbYesNo_LB");B.options.length=0;limeade.goals.AddItem("exercise","exercise",B);limeade.goals.AddItem("run","run",B);limeade.goals.AddItem("bike","bike",B);limeade.goals.AddItem("walk","walk",B);limeade.goals.AddItem("add new activity...","add new activity...",B)};limcreatechallenge.nonHighestTrackerUnits=function(){var A=document.getElementById("ctl00_bcr_cmbUnits_LB");A.options.length=0;limeade.goals.AddItem("calories","calories",A);limeade.goals.AddItem("cigarettes","cigarettes",A);limeade.goals.AddItem("drinks","drinks",A);limeade.goals.AddItem("hours","hours",A);limeade.goals.AddItem("minutes","minutes",A);limeade.goals.AddItem("miles","miles",A);limeade.goals.AddItem("add new units...","add new units...",A);var B=document.getElementById("ctl00_bcr_cmbYesNo_LB");B.options.length=0;limeade.goals.AddItem("exercise","exercise",B);limeade.goals.AddItem("run","run",B);limeade.goals.AddItem("bike","bike",B);limeade.goals.AddItem("smoke","smoke",B);limeade.goals.AddItem("drink","drink",B);limeade.goals.AddItem("walk","walk",B);limeade.goals.AddItem("add new activity...","add new activity...",B)};limcreatechallenge.challengePromotionChanged=function(H,E){var D=document.getElementById("divPromoInvite");var G=document.getElementById("divPromoAll");var C=document.getElementById("lnkAddMorePeople");var B=document.getElementById("inviteesDiv");var A=document.getElementById("yourEmailAddress");var F=document.getElementById("sendersEmailAddress");switch(H){case"all":if(E=="employer"){limeade.services.hideElement(D);limeade.services.showElement(G)}else{if(E=="personal"){limeade.services.showElement(C);limeade.services.showElement(B);D.innerText="Send the invitation to:";limeade.services.showElement(D)}}limeade.services.showElement(F);limeade.services.hideElement(A);break;case"invite":if(E=="employer"){limeade.services.hideElement(G);limeade.services.showElement(D);limeade.services.showElement(A)}else{if(E=="personal"){limeade.services.hideElement(C);limeade.services.hideElement(D);limeade.services.hideElement(B);limeade.services.hideElement(document.getElementById("NotEnoughUsers"));limeade.services.hideElement(A)}}limeade.services.hideElement(F);break}};limcreatechallenge.enableRewardValidator=function(C){var B=document.getElementById("ctl00_bcr_RFVIncentReward");var A=document.getElementById("ctl00_bcr_RFVIncentSomeElse");switch(C){case"incentiveReward":if(B!=null){B.enabled=true}if(A!=null){ValidatorEnable(A,false)}break;case"somethingReward":if(A!=null){A.enabled=true}if(B!=null){ValidatorEnable(B,false)}break}};limcreatechallenge.setUpSampleChallenge=function(R,Y,e,U,E,A,P,K,C){var G=document.getElementById("ctl00_bcr_RFVLeastNumber");var Z=document.getElementById("ctl00_bcr_RegExpLeastNumber");var f=document.getElementById("ctl00_bcr_RFVLeastDays");var S=document.getElementById("ctl00_bcr_RegExpLeastDays");var M=document.getElementById("ctl00_bcr_txtWhatIsChallenge");var X=document.getElementById("ctl00_bcr_rbTargetMinimum");var W=document.getElementById("ctl00_bcr_rbTargetHighest");var a=document.getElementById("ctl00_bcr_rbTargetLowest");var V=document.getElementById("ctl00_bcr_rbOneTimeEvent");var F=document.getElementById("ctl00_bcr_rbWeight");var O=document.getElementById("ctl00_bcr_rbNumber");var d=document.getElementById("ctl00_bcr_rbYesNo");var J=document.getElementById("ctl00_bcr_txtLeastNumber");var k=document.getElementById("ctl00_bcr_txtLeastDays");var D=document.getElementById("ctl00_bcr_cmbUnits_TB");var I=document.getElementById("ctl00_bcr_cmbYesNo_TB");var B=document.getElementById("ctl00_bcr_rbAwardIncentives");var Q=document.getElementById("ctl00_bcr_txtIncentivePts");var T=document.getElementById("ctl00_bcr_rbAwardSomethingElse");var N=document.getElementById("ctl00_bcr_txtReward");var L=document.getElementById("ctl00_bcr_rbInvitation");var h=document.getElementById("ctl00_bcr_rbAllUsers");if(B!=null){B.checked=false}if(T!=null){T.checked=false}if(Q!=null){Q.value=""}if(a!=null){a.checked=false}if(F!=null){F.checked=false}if(V!=null){V.checked=false}if(X!=null){X.checked=false}if(W!=null){W.checked=false}O.checked=false;d.checked=false;N.value="";if(J!=null){J.value=""}if(k!=null){k.value=""}D.value="";I.value="";M.value=R;switch(Y){case"min":X.checked=true;limcreatechallenge.ChallengeTypeChanged("minimum");break;case"highest":W.checked=true;limcreatechallenge.ChallengeTypeChanged("highest");break;case"lowest":a.checked=true;limcreatechallenge.ChallengeTypeChanged("lowest");break;case"weight":F.checked=true;limcreatechallenge.ChallengeTypeChanged("weight");break;case"onetime":V.checked=true;limcreatechallenge.ChallengeTypeChanged("onetime");break}switch(U){case"number":O.checked=true;if(J!=null){J.value=E}D.value=e;limcreatechallenge.trackerChanged("number");limchallenges.validateUnits();break;case"binary":d.checked=true;if(k!=null){k.value=E}I.value=e;limcreatechallenge.trackerChanged("binary");limchallenges.validateUnits();break;case"uselastnumber":D.value="";if(G!=null){ValidatorEnable(G,false)}if(f!=null){ValidatorEnable(f,false)}if(Z!=null){ValidatorEnable(Z,false)}if(S!=null){ValidatorEnable(S,false)}var b;if(C=="personal"){b="5"}else{if(C=="company"){b="0"}}var H=document.getElementById("ctl00_bcr_cmbWeightChange");for(var g=0;g<H.length;g++){if(H[g].value==b){H[g].selected=true}}break}switch(A){case"points":B.checked=true;Q.value=P;limcreatechallenge.enableRewardValidator("incentiveReward");break;case"customreward":if(T!=null){T.checked=true}N.value=P;limcreatechallenge.enableRewardValidator("somethingReward");break;default:}};limcreatechallenge.trackerRadioBtn=function(B){var A=document.getElementById(B);if(A!=null){A.checked=true}};limcreatechallenge.trackerChanged=function(F){var I=document.getElementById("ctl00_bcr_RFVLeastNumber");var D=document.getElementById("ctl00_bcr_RegExpLeastNumber");var E=document.getElementById("ctl00_bcr_RFVLeastDays");var C=document.getElementById("ctl00_bcr_RegExpLeastDays");var G=document.getElementById("ctl00_bcr_txtLeastNumber");var H=document.getElementById("ctl00_bcr_txtLeastDays");var A=document.getElementById("ctl00_bcr_cmbUnits_TB");var B=document.getElementById("ctl00_bcr_cmbYesNo_TB");var J=document.getElementById("ctl00_bcr_rbTargetMinimum");if(I!=null){ValidatorEnable(I,false)}if(E!=null){ValidatorEnable(E,false)}if(D!=null){ValidatorEnable(D,false)}if(C!=null){ValidatorEnable(C,false)}switch(F){case"number":if(J.checked){if(I!=null){I.enabled=true}if(D!=null){D.enabled=true}}else{ValidatorEnable(I,false);ValidatorEnable(D,false)}if(E!=null){ValidatorEnable(E,false);ValidatorEnable(C,false)}if(G!=null){G.readOnly=false}if(A!=null){A.readOnly=false}if(H!=null){H.readOnly=true}if(B!=null){B.readOnly=true}break;case"binary":if(J.checked){if(E!=null){E.enabled=true}if(C!=null){C.enabled=true}}else{ValidatorEnable(E,false);ValidatorEnable(C,false)}if(I!=null){ValidatorEnable(I,false);ValidatorEnable(D,false)}if(G!=null){G.readOnly=true}if(A!=null){A.readOnly=true}if(H!=null){H.readOnly=false}if(B!=null){B.readOnly=false}break}};limeade.myplan.usernameIndex=1;limcreatechallenge.addMorePeople=function(){var E=document.getElementById("ctl00_bcr_NotifyPanel");if(E!=null){var B=document.createElement("DIV");B.setAttribute("id","User"+limeade.myplan.usernameIndex);var I=document.createElement("DIV");I.style.paddingLeft="18px";I.style.width="100%";I.style.clear="both";var H=document.createElement("SPAN");H.setAttribute("id","UserNotFound"+limeade.myplan.usernameIndex);H.style.paddingLeft="2px";H.style.fontWeight="normal";H.style.fontSize="8pt";H.style.display="none";H.style.color="black";var C=document.createElement("img");C.setAttribute("src","/images/icon-error.gif");C.setAttribute("align","absBottom");H.appendChild(C);H.innerHTML+="Sign in name or email not found.";I.appendChild(H);var A=document.createElement("DIV");A.style.styleFloat="left";A.style.cssFloat="left";var J=document.createElement("img");J.style.borderWidth="0px";J.setAttribute("src","/Images/icon-user.gif");A.appendChild(J);A.innerHTML+="&nbsp;";var F=document.createElement("DIV");F.style.styleFloat="left";var G=document.createElement("INPUT");G.className="invitee";G.setAttribute("id","ctl00_bcr_txtLimeadeChallenger"+limeade.myplan.usernameIndex);G.setAttribute("onblur","limchallenges.clientValidate(this);");G.style.fontWeight="bold";G.style.width="325px";G.style.height="15px";var D=document.createElement("a");D.setAttribute("href","#");D.setAttribute("onclick","limchallenges.removeUserBox(this); return false;");D.innerHTML="x";D.title="remove user";D.style.textDecoration="none";D.setAttribute("id","closeUser"+limeade.myplan.usernameIndex);F.appendChild(G);F.innerHTML+="&nbsp;";F.appendChild(D);F.innerHTML+="<br />";B.appendChild(I);B.appendChild(A);B.appendChild(F);E.appendChild(B);document.getElementById("ctl00_bcr_txtLimeadeChallenger"+limeade.myplan.usernameIndex).focus();limeade.myplan.usernameIndex+=1}};limchallenges.removeUserBox=function(A){var B=document.getElementById(A.id.replace(/closeUser/gi,"User"));var C=document.getElementById("ctl00_bcr_NotifyPanel");if(C!=null&&B!=null){C.removeChild(B)}};var limhome=createNamespace("limeade.home");limhome.showAddContentPanel=function(){$(this).hide("slow")};function submitDismissMessage(A,C,B){if(B&&$("#"+C)!=null){$("#"+C).fadeOut("slow")}else{panel=document.getElementById(C);if(panel){panel.style.display="none"}}limeade.services.sendRequest(A,null,limeade.services.nullFunction)}function detectFileSelection(B,A,D){var E=document.getElementById(B).value;if(E.length>5){if(E.indexOf(":")&&E.indexOf(".")){if(document.getElementById(A).click){document.getElementById(A).click()}else{document.getElementById(A).onclick()}if(D!=null){var C=document.getElementById(D);if(C){C.style.display="block";C.style.visibility="visible"}}}}};