if(typeof YAHOO.HL=="undefined"){window.YAHOO.HL={}}YAHOO.HL.login={formObj:null,hostName:"http://www.healthline.com",toggle:function(b){var d=document.getElementById("loginbox");if(d.style.display=="block"){d.style.display="none";if(document.getElementById("error")){document.getElementById("error").innerHTML=""}YAHOO.util.Event.removeListener(document,"click",YAHOO.HL.login.close,this,true);YAHOO.util.Event.removeListener(document.getElementById("closeloginbox"),"click",YAHOO.HL.login.closelib,this,true)}else{var c=document.getElementById("signin");
var a=YAHOO.util.Dom.getXY(c);d.style.display="block";a[0]=a[0]-175;a[1]=a[1]+c.offsetHeight+7;YAHOO.util.Dom.setXY(d,a);YAHOO.util.Event.addListener(document,"click",YAHOO.HL.login.close,this,true);YAHOO.util.Event.addListener(document.getElementById("closeloginbox"),"click",YAHOO.HL.login.closelib,this,true)}},sendrequest:function(a){var b=hlFormValidator.is_valid(a);if(b==""){YAHOO.HL.login.formObj=a;YAHOO.util.Connect.asyncRequest("GET","/myhealthline/login?email="+a.email.value+"&password="+a.password.value,YAHOO.HL.login,null)
}else{if(!document.getElementById("error")){YAHOO.HL.login.createErrorDiv(a)}document.getElementById("error").innerHTML='<div class="loginbox-err"><div class="lb-err-box"><img class="spr-erroricon" src="/images/clear.gif" alt=""/></div><div class="lb-err-msg-box">'+b+'</div><div class="clear"></div></div>'}},success:function(o){JSONobj=eval("("+o.responseText+")");if(JSONobj.status==false){if(!document.getElementById("error")){YAHOO.HL.login.createErrorDiv(YAHOO.HL.login.formObj)}var jsonmsg=JSONobj.message;
var jsonmsg_href_pos=jsonmsg.indexOf("href");if(jsonmsg_href_pos>=0){var jsonmsg_tmp1=jsonmsg.substring(0,jsonmsg_href_pos+6);var jsonmsg_tmp2=jsonmsg.substring(jsonmsg_href_pos+6,jsonmsg.length);jsonmsg=jsonmsg_tmp1.concat(YAHOO.HL.login.hostName,jsonmsg_tmp2)}document.getElementById("error").innerHTML='<div class="loginbox-err"><div class="lb-err-box"><img class="spr-erroricon" src="/images/clear.gif" alt=""/></div><div class="lb-err-msg-box">'+jsonmsg+'</div><div class="clear"></div></div>'}else{window.location.href=YAHOO.HL.login.hostName+"/myhealthline"
}},createErrorDiv:function(b){var a=document.createElement("div");a.id="error";a.className="field-error";b.insertBefore(a,b.firstChild)},close:function(d){var f=document.getElementById("loginbox");var b=document.getElementById("signin");var a=document.getElementById("siLink");var c=YAHOO.util.Event.getTarget(d);if(c==b||c==a){return}while(c=YAHOO.HL.login.node_parent(c)){if(c==f||c==b){YAHOO.util.Event.stopPropagation(d);return}}f.style.display="none"},closelib:function(a){var b=document.getElementById("loginbox");
b.style.display="none"},node_parent:function(b){var a=(b.parentElement!=undefined)?b.parentElement:b.parentNode;return a}};
