/* Copyright (c) 2008 Genseq Co. Uk. All rights reserved. */
YUI={};YUI.util=YAHOO.util;YUI.widget=YAHOO.widget;YUI.Dom=YAHOO.util.Dom;YUI.get=YAHOO.util.Dom.get;YUI.getBy=YAHOO.util.Dom.getElementsBy;YUI.getByClass=YAHOO.util.Dom.getElementsByClassName;YUI.addClass=YAHOO.util.Dom.addClass;YUI.removeClass=YAHOO.util.Dom.removeClass;YUI.hasClass=YAHOO.util.Dom.hasClass;YUI.getStyle=YAHOO.util.Dom.getStyle;YUI.setStyle=YAHOO.util.Dom.setStyle;YUI.generateId=YAHOO.util.Dom.generateId;YUI.Event=YAHOO.util.Event;YUI.Anim=YAHOO.util.Anim;YUI.Ease=YAHOO.util.Easing;YUI.Connect=YAHOO.util.Connect;YUI.DEBUG=0;YUI.ajaxInProgress=0;YUI.ajax=function(method,uri,callback,postData){if(YUI.ajaxInProgress < 1 && !uri.match(/\/groups[\/]/)){callback.timeout=200000}
YUI.ajaxInProgress++;var success=callback.success;callback.success=function(o){if(success){try{success(o)}
catch(err){logger(err)}}
YUI.ajaxInProgress--}
var failure=callback.failure;callback.failure=function(o){if(failure){try{failure(o);var serverStatusCode=o.status;if(serverStatusCode==0){showError(getMessageText("connection_error"))}else if(serverStatusCode==-1){showError(getMessageText("timeout_error"))}else if(serverStatusCode==503){showError(getMessageText("service_unavailable"))}}
catch(err){}}
YUI.ajaxInProgress--}
var upload=callback.upload;callback.upload=function(o){YUI.ajaxInProgress--;if(upload){upload(o)}}
try{resetServerSessionTimer()}catch(t){};YUI.Connect.asyncRequest(method,uri,callback,postData)}
YUI.style=function(el,styledef){for(var prop in styledef){if(prop){YUI.Dom.setStyle(el,prop,styledef[prop])}}}
YUI.onDOMReady=function(p_fn,p_obj,p_scope){YUI.Event.onDOMReady(p_fn,p_obj,p_scope)}
if(YAHOO.widget){YUI.Panel=YAHOO.widget.Panel || null;YUI.Overlay=YAHOO.widget.Overlay || null;YUI.Dialog=YAHOO.widget.Dialog || null;YUI.SimpleDialog=YAHOO.widget.SimpleDialog || null;YUI.Tooltip=YAHOO.widget.Tooltip || null}
if(YAHOO.lang && YAHOO.lang.JSON){YUI.JSON=YAHOO.lang.JSON}
if(YAHOO.util && YAHOO.util.Selector){YUI.Selector=YAHOO.util.Selector;YUI.query=YUI.Selector.query}
if(YUI.JSON){YUI.JSON.transaction_number=0;JSONparse=function(responsetext){var jsonObject;try{jsonObject=YUI.JSON.parse(responsetext)}
catch(e){if(responsetext.match(/login_form/) && responsetext.match(/\/account\/login_do/)){showWarning('Sorry, you have been logged out from your account. Please login and try again.', function(){window.location=window.location.protocol+'\/\/'+window.location.host+'/account/logout'})}
else if(responsetext.match(/site_is_offline/)){showWarning('Sorry, our web service is currently offline for routine maintenance. Please try again later.')}
else{if(YUI.DEBUG){responsetext=responsetext.replace('<','&lt;');responsetext=responsetext.replace('>','&gt;');responsetext=responsetext.replace('%','&amp;');responsetext=responsetext.replace('"','&quot;');showError(responsetext)}
else{showError('The server generated errors when processing data.<br>Please contact the <a href="mailto:MyFamilyHealth Customer Support <support@myfamilyhealth.com>"> site administrator </a> to report this problem.<br>Sorry for the inconvenience.')}}
notBusy();return null}
YUI.JSON.transaction_number++;return jsonObject}}(function(){if(!YAHOO.widget || !YAHOO.widget.DataTable) return;var DT=YAHOO.widget.DataTable, Dom=YAHOO.util.Dom;DT.prototype._setColumnWidth=function(oColumn, sWidth, sOverflow){oColumn=this.getColumn(oColumn);if(oColumn){sOverflow=sOverflow || 'hidden';if(!DT._bStylesheetFallback){var s;if(!DT._elStylesheet){s=document.createElement('style');s.type='text/css';DT._elStylesheet=document.getElementsByTagName('head').item(0).appendChild(s)}
if(DT._elStylesheet){s=DT._elStylesheet;var sClassname=".yui-dt-col-"+oColumn.getId();var rule=DT._oStylesheetRules[sClassname];if(!rule){if(s.styleSheet && s.styleSheet.addRule){s.styleSheet.addRule(sClassname,"overflow:"+sOverflow);s.styleSheet.addRule(sClassname,"width:"+sWidth);rule=s.styleSheet.rules[s.styleSheet.rules.length-1]} else if(s.sheet && s.sheet.insertRule){s.sheet.insertRule(sClassname+"{overflow:"+sOverflow+";width:"+sWidth+"}",s.sheet.cssRules.length);rule=s.sheet.cssRules[s.sheet.cssRules.length-1]} else{DT._bStylesheetFallback=true}
DT._oStylesheetRules[sClassname]=rule}
else{rule.style.overflow=sOverflow;rule.style.width=sWidth}
return}
DT._bStylesheetFallback=true}
if(DT._bStylesheetFallback){if(sWidth=="auto"){sWidth=""}
var rowslen=this._elTbody ? this._elTbody.rows.length:0;if(!this._aFallbackColResizer[rowslen]){var i,j,k;var resizerDef=['var colIdx=oColumn.getKeyIndex();', 'oColumn.getThEl().firstChild.style.width='];for(i=rowslen-1, j=2;i >=0;--i){resizerDef[j++]='this._elTbody.rows[';resizerDef[j++]=i;resizerDef[j++]='].cells[colIdx].firstChild.style.width=';resizerDef[j++]='this._elTbody.rows[';resizerDef[j++]=i;resizerDef[j++]='].cells[colIdx].style.width='}
resizerDef[j]='sWidth;';resizerDef[j+1]='oColumn.getThEl().firstChild.style.overflow=';for(i=rowslen-1, k=j+2;i >=0;--i){resizerDef[k++]='this._elTbody.rows[';resizerDef[k++]=i;resizerDef[k++]='].cells[colIdx].firstChild.style.overflow=';resizerDef[k++]='this._elTbody.rows[';resizerDef[k++]=i;resizerDef[k++]='].cells[colIdx].style.overflow='}
resizerDef[k]='sOverflow;';this._aFallbackColResizer[rowslen]=new Function('oColumn','sWidth','sOverflow',resizerDef.join(''))}
var resizerFn=this._aFallbackColResizer[rowslen];if(resizerFn){resizerFn.call(this,oColumn,sWidth,sOverflow);return}}}
else{}};DT.prototype._syncColWidths=function(){var scrolling=this.get('scrollable');if(this._elTbody.rows.length > 0){var allKeys=this._oColumnSet.keys, elRow=this.getFirstTrEl();if(allKeys && elRow &&(elRow.cells.length===allKeys.length)){var bUnsnap=false;if(scrolling &&(YAHOO.env.ua.gecko || YAHOO.env.ua.opera)){bUnsnap=true;if(this.get("width")){this._elTheadContainer.style.width="";this._elTbodyContainer.style.width=""}
else{this._elContainer.style.width=""}}
var i, oColumn, cellsLen=elRow.cells.length;for(i=0;i<cellsLen;i++){oColumn=allKeys[i];if(!oColumn.width){this._setColumnWidth(oColumn, "auto","visible")}}
for(i=0;i<cellsLen;i++){oColumn=allKeys[i];var newWidth=0;var overflow='hidden';if(!oColumn.width){var elTh=oColumn.getThEl();var elTd=elRow.cells[i];if(scrolling){var elWider=(elTh.offsetWidth > elTd.offsetWidth) ?
elTh.firstChild:elTd.firstChild;if(elTh.offsetWidth !==elTd.offsetWidth ||
elWider.offsetWidth < oColumn.minWidth){newWidth=Math.max(0, oColumn.minWidth, elWider.offsetWidth -(parseInt(Dom.getStyle(elWider,"paddingLeft"),10)|0) -(parseInt(Dom.getStyle(elWider,"paddingRight"),10)|0))}} else if(elTd.offsetWidth < oColumn.minWidth){overflow=elTd.offsetWidth ? 'visible':'hidden';newWidth=Math.max(0, oColumn.minWidth, elTd.offsetWidth -(parseInt(Dom.getStyle(elTd,"paddingLeft"),10)|0) -(parseInt(Dom.getStyle(elTd,"paddingRight"),10)|0))}}
else{newWidth=oColumn.width}
if(oColumn.hidden){oColumn._nLastWidth=newWidth;this._setColumnWidth(oColumn, '1px','hidden')} else if(newWidth){this._setColumnWidth(oColumn, newWidth+'px', overflow)}}
if(bUnsnap){var sWidth=this.get("width");this._elTheadContainer.style.width=sWidth;this._elTbodyContainer.style.width=sWidth}}}
this._syncScrollPadding()}})();(function(){if(!YAHOO.widget || !YAHOO.widget.DataTable) return;var util=YAHOO.util, ua=YAHOO.env.ua, Ev=util.Event, Dom=util.Dom, DT=YAHOO.widget.DataTable;DT.prototype._initTheadEls=function(){var i,j, l, elThead, elA11yThead, aTheads;if(!this._elThead){elThead=this._elThead=document.createElement('thead');elA11yThead=this._elA11yThead=document.createElement('thead');aTheads=[elThead, elA11yThead];Ev.addListener(elThead, "focus", this._onTheadFocus, this);Ev.addListener(elThead, "keydown", this._onTheadKeydown, this);Ev.addListener(elThead, "mouseover", this._onTableMouseover, this);Ev.addListener(elThead, "mouseout", this._onTableMouseout, this);Ev.addListener(elThead, "mousedown", this._onTableMousedown, this);Ev.addListener(elThead, "mouseup", this._onTableMouseup, this);Ev.addListener(elThead, "click", this._onTheadClick, this);Ev.addListener(elThead.parentNode, "dblclick", this._onTableDblclick, this);this._elTheadContainer.firstChild.appendChild(elA11yThead);this._elTbodyContainer.firstChild.appendChild(elThead)}
else{elThead=this._elThead;elA11yThead=this._elA11yThead;aTheads=[elThead, elA11yThead];for(i=0;i<aTheads.length;i++){for(j=aTheads[i].rows.length-1;j>-1;j--){Ev.purgeElement(aTheads[i].rows[j], true);aTheads[i].removeChild(aTheads[i].rows[j])}}}
var oColumn, oColumnSet=this._oColumnSet;var colTree=oColumnSet.tree;var elTheadCell, id;for(l=0;l<aTheads.length;l++){for(i=0;i<colTree.length;i++){var elTheadRow=aTheads[l].appendChild(document.createElement("tr"));id=(l===1) ? this._sId+"-hdrow"+i+"-a11y":this._sId+"-hdrow"+i;elTheadRow.id=id;for(j=0;j<colTree[i].length;j++){oColumn=colTree[i][j];elTheadCell=elTheadRow.appendChild(document.createElement("th"));if(l===0){oColumn._elTh=elTheadCell}
id=(l===1) ? this._sId+"-th"+oColumn.getId()+"-a11y":this._sId+"-th"+oColumn.getId();elTheadCell.id=id;elTheadCell.yuiCellIndex=j;this._initThEl(elTheadCell,oColumn,i,j,(l===1))}
if(l===0){if(i===0){Dom.addClass(elTheadRow, DT.CLASS_FIRST)}
if(i===(colTree.length-1)){Dom.addClass(elTheadRow, DT.CLASS_LAST)}}}
if(l===0){var aFirstHeaders=oColumnSet.headers[0];var aLastHeaders=oColumnSet.headers[oColumnSet.headers.length-1];for(i=0;i<aFirstHeaders.length;i++){Dom.addClass(Dom.get(this._sId+"-th"+aFirstHeaders[i]), DT.CLASS_FIRST)}
for(i=0;i<aLastHeaders.length;i++){Dom.addClass(Dom.get(this._sId+"-th"+aLastHeaders[i]), DT.CLASS_LAST)}
var foundDD=(util.DD) ? true:false;var needDD=false;if(this._oConfigs.draggableColumns){for(i=0;i<this._oColumnSet.tree[0].length;i++){oColumn=this._oColumnSet.tree[0][i];if(foundDD){elTheadCell=oColumn.getThEl();Dom.addClass(elTheadCell, DT.CLASS_DRAGGABLE);var elDragTarget=DT._initColumnDragTargetEl();oColumn._dd=new YAHOO.widget.ColumnDD(this, oColumn, elTheadCell, elDragTarget)}
else{needDD=true}}}
for(i=0;i<this._oColumnSet.keys.length;i++){oColumn=this._oColumnSet.keys[i];if(oColumn.resizeable){if(foundDD){elTheadCell=oColumn.getThEl();Dom.addClass(elTheadCell, DT.CLASS_RESIZEABLE);var elThLiner=elTheadCell.firstChild;var elThResizer=elThLiner.appendChild(document.createElement("div"));elThResizer.id=this._sId+"-colresizer"+oColumn.getId();oColumn._elResizer=elThResizer;Dom.addClass(elThResizer,DT.CLASS_RESIZER);var elResizerProxy=DT._initColumnResizerProxyEl();oColumn._ddResizer=new YAHOO.util.ColumnResizer(this, oColumn, elTheadCell, elThResizer.id, elResizerProxy);var cancelClick=function(e){Ev.stopPropagation(e)};Ev.addListener(elThResizer,"click",cancelClick)}
else{needDD=true}}}
if(needDD){}}
else{}}
for(var g=0, h=this._oColumnSet.keys.length;g<h;g++){if(this._oColumnSet.keys[g].hidden){var oHiddenColumn=this._oColumnSet.keys[g];var oHiddenThEl=oHiddenColumn.getThEl();oHiddenColumn._nLastWidth=oHiddenThEl.offsetWidth -(parseInt(Dom.getStyle(oHiddenThEl,"paddingLeft"),10)|0) -(parseInt(Dom.getStyle(oHiddenThEl,"paddingRight"),10)|0);this._setColumnWidth(oHiddenColumn.getKeyIndex(), "1px")}}
if(ua.webkit && ua.webkit < 420){var oSelf=this;setTimeout(function(){oSelf._elThead.style.display=""},0);this._elThead.style.display='none'}}})();
function getText(root){root=YUI.get(root);var i=root.firstChild;var ret=[];while(i){ret.push(i.nodeValue);i=i.nextSibling}
return ret.join(' ')}
var popup_window=null;function refitWindow(){if(isPopup()){var bd=YUI.Dom.getRegion('someWindow');window.resizeTo(bd.right,bd.bottom+bd.top+30)}}
function getXmlTemplate(templateUrl,subs,callback){var template={header:'', body:'', footer:'', script:'', window:null, width:null, height:null, modal:null, no_close_button:0}
var loadingTimeout=null;loadingTimeout=setTimeout(function(){loadingTimeout=null;isBusy()},200);YUI.ajax('GET', templateUrl,{success:function(o){if(loadingTimeout){clearTimeout(loadingTimeout)}
else{notBusy()}
var xml=o.responseXML;if(xml !=undefined){template.header=xml.getElementsByTagName('header');if(template.header.length){template.header=getText(template.header[0])}
else{template.header=''}
template.body=xml.getElementsByTagName('body');if(template.body.length){template.body=getText(template.body[0])}
else{template.body=''}
template.footer=xml.getElementsByTagName('footer');if(template.footer.length){template.footer=getText(template.footer[0])}
else{template.footer=''}
template.script=xml.getElementsByTagName('script');var scripts;for(var j=0;j < template.script.length;j++){scripts+=getText(template.script[j])}
template.script=scripts;if(subs){for(var n in subs){var re=new RegExp(n.replace(/([\\\[\]\{\}\,\(\)\?\|\^\$\.])/g, "\\$1"), 'g');var sub=subs[n];if(template.header){template.header=template.header.replace(re, sub)}
if(template.body){template.body=template.body.replace(re, sub)}
if(template.footer){template.footer=template.footer.replace(re, sub)}
if(template.script){template.script=template.script.replace(re, sub)}}}
template.window=xml.getElementsByTagName('window')[0];if(template.window){template.width=template.window.getAttribute('width');template.height=template.window.getAttribute('height');template.modal=template.window.getAttribute('modal');if(template.window.getAttribute('no_close_button')){template.no_close_button=template.window.getAttribute('no_close_button')}}
if(callback){callback(template)}}}})}
function panelFromTemplate(templateUrl,subs,callback){getXmlTemplate(templateUrl,subs,function(template){var panel=YUI.get('panel_container');panel.innerHTML=template.body;panel.style.display='block';panel.style.visibility='visible';if(template.script){window.eval(template.script)}
if(callback){callback()}})}
function dialogFromTemplate(templateUrl,subs,close_callback){getXmlTemplate(templateUrl,subs,function(template){if(!template.width){template.width='400px'}
var window_width=getWindowWidth();if(isPopup() || parseInt(template.width,10) > window_width){if(template.height=='auto'){template.height='200'}
if(isPopup()){if(template.footer){template.body=[template.body, '<div class="footer_div">', template.footer, '</div>'].join('')}
document.body.innerHTML='<div id="someWindow"><div class="bd">'+template.body+'</div></div>';if(template.header){template.header=template.header.replace(/\n/g,'');template.header=template.header.replace(/<.+?>/g,' ');template.header=template.header.replace(/\s+/g,' ');document.title=template.header}
if(template.script){window.eval(template.script)}
refitWindow()}
else{if(popup_window){popup_window.close()}
popup_window=window.open('/iframe/tree/tree?'+makeQueryString({popup:1, subs:encodeURI(YUI.JSON.stringify(subs)), template:templateUrl}), 'popup_window', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width='+parseInt(template.width,10)+',height='+parseInt(template.height,10))}} else{showWindow(template.header,template.body,template.footer,{width:template.width, height:'auto', modal:template.modal, onclose:close_callback, no_close_button:template.no_close_button});if(template.script){window.eval(template.script)}}})}
function showWindow(title,body,footer,opts){if(!YUI.Panel) return;if(!document.getElementById('someWindow')){configurations=new Array();configurations['width']='400px';configurations['draggable']=true;configurations['dragOnly']=true;configurations['underlay']='none';configurations['zIndex']=15;configurations['visible']=false;configurations['constraintoviewport']=true;if(opts.no_close_button){configurations['close']=false}
myWindow=new YUI.Panel("someWindow", configurations);myWindow.hideEvent.subscribe(function(){if(opts.onclose){opts.onclose()}});myWindow.cfg.queueProperty("keylisteners", new YUI.util.KeyListener(document,{keys:27},{fn:function(){myWindow.hide();destroyAllBubbleTips()}, scope:myWindow, correctScope:true}));myWindow.render(document.body);myWindow.oldHide=myWindow.hide;myWindow.hide=function(){myWindow.setBody('');myWindow.oldHide();if(myWindow.onclose){myWindow.onclose();myWindow.onclose=null}}}
myWindow.hide();if(opts){if(opts.width){myWindow.cfg.setProperty('width', opts.width)}
if(opts.height){myWindow.cfg.setProperty('height', opts.height)}
if(opts.modal){opts.modal=true}
else{opts.modal=false}
if(opts.no_close_button){myWindow.cfg.setProperty('close', false)}else{myWindow.cfg.setProperty('close', true)}
myWindow.cfg.setProperty('modal', opts.modal)}
if(footer){body=[body, '<div class="footer_div">', footer, '</div>'].join('')}
myWindow.setHeader(title);myWindow.setBody(body);myWindow.render(document.body);myWindow.center();myWindow.show();if(opts)
myWindow.onclose=opts.onclose;else
myWindow.onclose=null}
function closeWindow(){if(typeof myWindow !='undefined'){myWindow.hide()}
if(popup_window){popup_window.close()}
if(isPopup()){window.close()}
if(typeof restoreOldClickedButtonContent !='undefined'){restoreOldClickedButtonContent()}}
function confirmDialog(texts,callback){if(!YUI.Panel) return;var title=texts["title"] || "";var body=texts["body"] || "";var ok_text=texts["ok_text"] || "OK";var cancel_text=texts["cancel_text"] || "Cancel";if(!document.getElementById('confirmWindow')){confirmationWindow=new YUI.Panel("confirmWindow",{close:true, width:'400px', draggable:true, dragOnly:true, modal:true, underlay:'none', zIndex:3, visible:false, constraintoviewport:true});confirmationWindow.cfg.queueProperty("keylisteners", new YUI.util.KeyListener(document,{keys:27},{fn:function(){confirmationWindow.hide();destroyAllBubbleTips()}, scope:confirmationWindow, correctScope:true}));confirmationWindow.render(document.body)}
confirmationWindow.hide();confirmationWindow.setHeader(title);confirmationWindow.setBody('<img src="/images/question_icon_large.gif" class="child_window_icon"><div class="padding10">'+body+'</div><div class="child_window_button_div"><button id=confirmDialog_ok_btn>'+ok_text+'</button><button id=confirmDialog_cancel_btn>'+cancel_text+'</button></div>');confirmationWindow.render(document.body);confirmationWindow.center();confirmationWindow.show();notBusy();YUI.get('confirmWindow').onclick=function(e){var evt=e || window.event;var target=YUI.Event.getTarget(evt);if(target){switch(target.id){case 'confirmDialog_ok_btn':confirmationWindow.hide();callback('ok');break;case 'confirmDialog_cancel_btn':confirmationWindow.hide();callback('cancel');break}}}}
function showError(text,callback){showCustomAlert('Error!',text,callback)}
function showWarning(text,callback){showCustomAlert('Warning!',text,callback)}
function showCustomAlert(header,text,callback){if(!YUI.Panel) return;if(!document.getElementById('errWindow')){errorWindow=new YUI.Panel("errWindow",{close:false, width:'400px', draggable:false, dragOnly:true, underlay:'none', zIndex:500, visible:false, constraintoviewport:true});errorWindow.cfg.queueProperty("keylisteners", new YUI.util.KeyListener(document,{keys:27},{fn:function(){hide_all();destroyAllBubbleTips()}, scope:errorWindow, correctScope:true}));errorWindow.render(document.body)}
errorWindow.hide();if(callback){customAlertCallback=callback}
else{customAlertCallback=function(){}}
errorWindow.setHeader(header);errorWindow.setBody('<img src="/images/error_icon_large.gif" class="child_window_icon"><div class="showerror_text">'+text+'</div><div class="child_window_button_div"><button id="closeShowError">OK</button></div>');errorWindow.render(document.body);errorWindow.bringToTop();errorWindow.center();errorWindow.show();notBusy();var iframe_over_flash=document.getElementById("iframe_put_over_flash");var err_window_div=document.getElementById("errWindow_c");if(iframe_over_flash!=null && err_window_div!=null){iframe_over_flash.style.width="402px";iframe_over_flash.style.height=err_window_div.offsetHeight;iframe_over_flash.style.top=err_window_div.style.top;iframe_over_flash.style.left=err_window_div.style.left;iframe_over_flash.style.display="block"}
YUI.get('closeShowError').onclick=function(){if(callback){callback()}
hide_all()}}
function hide_all(){errorWindow.hide();var iframe=document.getElementById("iframe_put_over_flash");var err_window_div=document.getElementById("errWindow_c");if(iframe!=null){iframe.style.display="none"}
if(err_window_div!=null){err_window_div.style.top="0px"}}
function randomElementId(){var n=0;while(YUI.get('randomElementId_'+n)){n++}
return 'randomElementId_'+n}
function coachMark(el,parent,nostretch){el=YUI.get(el);if(!el) return;if(typeof coachMarkOverlay !='undefined'){coachMarkOverlay.destroy()}
var xy=YUI.Dom.getXY(el);var width=el.offsetWidth;var height=el.offsetHeight;var stretch=0;if(!nostretch){if(width > 100){stretch=width-100;if(stretch > 200){stretch=200}}}
var cx=parseInt(xy[0]+(width/2));var cy=parseInt(xy[1]+(height/2));var x=cx-70-(stretch/2);var y=cy-58;if(!YUI.get('coachMarkWin')){coachMarkOverlay=new YUI.Overlay('coachMarkWin',{width:'140px', zIndex:40});YUI.Event.addListener(document.body,'mousedown', function(e){coachMarkOverlay.hide()})}
YUI.getByClass('hd',null,null,function(el){YUI.Event.addListener(el,'mousedown', function(e){YUI.Event.removeListener(el,'mousedown',arguments.callee);coachMarkOverlay.hide()})});var divs={coachmark_top_left:{}, coachmark_bottom_left:{}, coachmark_left:{}, coachmark_inner_top_left:{}, coachmark_inner_bottom_left:{}, coachmark_top_right:{left:stretch+60+'px'}, coachmark_bottom_right:{left:stretch+60+'px'}, coachmark_right:{left:stretch+102+'px'}, coachmark_inner_bottom_right:{left:stretch+86+'px'}}
if(stretch){divs.coachmark_top={width:stretch+'px'};divs.coachmark_bottom={width:stretch+'px'}}
var topDiv=makeElement('div');for(var n in divs){var d=makeElement('div',{className:n});for(var m in divs[n]){d.style[m]=divs[n][m]}
topDiv.appendChild(d)}
coachMarkOverlay.setBody(topDiv);if(!parent){parent=document.body}
coachMarkOverlay.render(parent);coachMarkOverlay.cfg.setProperty('xy',[x , y]);coachMarkOverlay.show();return coachMarkOverlay}
var bubbleTipIdList={};function makeBubbleFunction(cssClassPrefix,bubbleWidth){return function(el,txt,location,tipId){el=YUI.get(el);if(!el) return;var xy=YUI.Dom.getXY(el);var width=el.offsetWidth;var height=el.offsetHeight;if(!location){var xalign='r';var yalign='t'}
else{var xalign=location.charAt(1);var yalign=location.charAt(0)}
if((xy[0]+width+bubbleWidth) >=getWindowWidth()){if((xy[0] - bubbleWidth) <=0){xalign='i'} else{xalign='l'}}
else if((xy[0] - bubbleWidth) <=0){xalign='r'}
if((xy[1]+height+300) >=getWindowHeight()){yalign='t'}
else if((xy[1] - 300) <=0){yalign='b'}
location=yalign+xalign;if(!tipId){tipId=randomElementId()}
if(!YUI.get(tipId)){var bubble_tip_overlay=new YUI.Overlay(tipId,{width:bubbleWidth+'px', zIndex:200});bubble_tip_overlay.do_not_destroy=0;bubble_tip_overlay.safe_destroy=function(e){if(bubble_tip_overlay && !bubble_tip_overlay.do_not_destroy){YUI.get(tipId).overlayObject=null;bubble_tip_overlay.div=null;setTimeout(function(){try{if(bubble_tip_overlay !=null){bubble_tip_overlay.destroy()}}
catch(err){}
bubble_tip_overlay=null},100)}
if(arguments.callee){YUI.Event.removeListener(document.body,'mousedown',arguments.callee)}
delete bubbleTipIdList[tipId]}
YUI.Event.addListener(document.body,'mousedown',bubble_tip_overlay.safe_destroy)}
else{var bubble_tip_overlay=YUI.get(tipId).overlayObject}
YUI.getByClass('hd',null,null,function(el){YUI.Event.addListener(el,'mousedown', function(e){YUI.Event.removeListener(el,'mousedown',arguments.callee);try{bubble_tip_overlay.safe_destroy()}
catch(err){}})});if(!bubbleTipIdList[tipId]){bubbleTipIdList[tipId]=bubble_tip_overlay}
var ctx;var bd;switch(location){case 'tl':ctx=[el, 'br', 'tl'];bd='<div class="'+cssClassPrefix+'_tl_spacer"></div><div class="'+cssClassPrefix+'_tl"><div>'+txt+'</div></div>';break;case 'tr':ctx=[el, 'bl', 'tr'];bd='<div class="'+cssClassPrefix+'_tr_spacer"></div><div class="'+cssClassPrefix+'_tr"><div>'+txt+'</div></div>';break;case 'ti':ctx=[el, 'bl', 'tl'];bd='<div class="'+cssClassPrefix+'_tl_spacer"></div><div class="'+cssClassPrefix+'_ti"><div>'+txt+'</div></div>';break;case 'bl':ctx=[el, 'tr', 'bl'];bd='<div class="'+cssClassPrefix+'_bl"><div>'+txt+'</div></div><div class="'+cssClassPrefix+'_bl_spacer"></div>';break;case 'br':ctx=[el, 'tl', 'br'];bd='<div class="'+cssClassPrefix+'_br"><div>'+txt+'</div></div><div class="'+cssClassPrefix+'_br_spacer"></div>';break;case 'bi':ctx=[el, 'tl', 'bl'];bd='<div class="'+cssClassPrefix+'_bi"><div>'+txt+'</div></div><div class="'+cssClassPrefix+'_bl_spacer"></div>';break}
bubble_tip_overlay.setBody(bd);bubble_tip_overlay.render(document.body);bubble_tip_overlay.cfg.setProperty('context', ctx);bubble_tip_overlay.show();var tipDiv=YUI.get(tipId);tipDiv.overlayObject=bubble_tip_overlay;bubble_tip_overlay.div=tipDiv;return bubble_tip_overlay}}
bubbleTip=makeBubbleFunction('bubbletip',200);bubbleHint=makeBubbleFunction('hint',300);_tourTip=makeBubbleFunction('tourhint',261);function tourTip(el,txt,location){var tip_object=_tourTip(el,txt,location);if(tip_object){tip_object.do_not_destroy=1} else{}
return tip_object}
function destroyAllBubbleTips(force){for(var n in bubbleTipIdList){try{if(force){bubbleTipIdList[n].do_not_destroy=0}
bubbleTipIdList[n].safe_destroy()}
catch(err){}}
bubbleTipIdList={}}
function bubbleTipIntelligent(el,txt,location){destroyAllBubbleTips();var tip;var close_timer;var open_timer=setTimeout(function(){tip=bubbleTip(el,txt,location);YUI.Event.removeListener(tip.div.id);YUI.Event.addListener(tip.div,'mousedown',function(e){YUI.Event.stopPropagation(e);return false});YUI.Event.addListener(tip.div,'mouseover',function(){if(close_timer){clearTimeout(close_timer)}});YUI.Event.addListener(tip.div,'mouseout',function(){close_timer=setTimeout(function(){if(tip !=null){tip.safe_destroy();tip=null}},700)});tip.bringToTop()}, 500);YUI.Event.addListener(el,'mouseover',function(){if(close_timer){clearTimeout(close_timer)}});YUI.Event.addListener(el,'mouseout',function(){if(open_timer){clearTimeout(open_timer)}
if(tip){close_timer=setTimeout(function(){if(tip !=null){tip.safe_destroy();tip=null}},700)}});return tip}
function bubbleTipMouseOver(el,txt,location){var tip=bubbleTip(el,txt,location);YUI.Event.addListener(el,'mouseout',function(){if(tip){tip.safe_destroy();tip=null}});tip.bringToTop();return tip}
function coachTip(el,txt,location){var c=coachMark(el);if(c){c.bringToTop()}
var b=bubbleHint(el,txt,location,'coach_tip_bubble');if(b && b.cfg){b.bringToTop()}}
function getWindowHeight(){if(typeof(window.innerHeight)=='number'){return window.innerHeight} else if(document.documentElement &&(document.documentElement.clientHeight)){return document.documentElement.clientHeight} else if(document.body &&(document.body.clientHeight)){return document.body.clientHeight}
return}
function getWindowWidth(){if(typeof(window.innerWidth)=='number'){return window.innerWidth} else if(document.documentElement &&(document.documentElement.clientWidth)){return document.documentElement.clientWidth} else if(document.body &&(document.body.clientWidth)){return document.body.clientWidth}}
function restrictHeight(id, bottomOffset){if(bottomOffset==undefined){bottomOffset=80}
YUI.get(id).style.height=(getWindowHeight()-YUI.get(id).offsetTop-bottomOffset)+'px';return}
function fillHeight(id,reserve){var height=getWindowHeight();var dy=YUI.get(id).offsetTop;height -=dy;height -=reserve;YUI.get(id).style.height=height+'px'}
function packElementsHeight(htmlElements){var reserved=20;if(isInIframe()){reserved=0}
var pack=function(){for(var i=0,l=htmlElements.length;i<l;i++){fillHeight(htmlElements[i],reserved)}}
pack();YUI.Event.addListener(window,'resize',pack)}
function packMgenoBody(just_pack){var reserved=20;if(isInIframe()){reserved=0}
var bd=YUI.get('mgeno_body');var ct=YUI.getByClass('content','div',bd)[0];var dy=bd.offsetTop;var pack=function(){var bdHeight=bd.offsetHeight;var ctHeight=ct.offsetHeight;var height=getWindowHeight();height -=dy;height -=reserved;if(height > bdHeight){bd.style.height=height+'px';bdHeight=height}
if(ctHeight > bdHeight){bd.style.height=ctHeight+'px'}}
pack();if(just_pack){setTimeout(pack,200);setTimeout(pack,2000);return}
YUI.Event.addListener(window,'resize',pack);YUI.Event.addListener(document.body,'click',function(){setTimeout(pack,200)})}
function horizontalExpand(id){YUI.get(id).style.width=YUI.get(id).parentNode.offsetWidth - YUI.get(id).offsetLeft+'px'}
function maskDiv(el){el=YUI.get(el);var mask;mask=new YUI.Overlay('divMask');mask.render(el);mask.callResizeHandler=function(){mask.resizeHandler()}
YUI.Event.addListener(window,'resize',mask.callResizeHandler);mask.safeDestroy=function(){YUI.Event.removeListener(window,'resize',mask.callResizeHandler);YUI.Event.removeListener(window,'scroll',mask.callResizeHandler);mask.destroy();background_loading--}
div=YUI.get('divMask');YUI.style(div,{background:'black', position:'absolute', top:'0px', left:'0px', opacity:0.6, zIndex:499});div.divMask=mask;mask.resizeHandler=function(){div.style.height=el.offsetHeight+'px';div.style.width=el.offsetWidth+'px';YUI.Dom.setXY(div,YUI.Dom.getXY(el))}
background_loading++;mask.bringToTop();mask.show();mask.resizeHandler();return mask}
var background_loading=0;var nowIsBusy=0;function maskDivMultiple(el){background_loading++;el=YUI.get(el);YUI.style(el,{background:"url(/images/ajax_loader_report.gif) top right no-repeat"});el.hide=function(){YUI.style(el,{background:"none"});background_loading--};return el}
var defaultBusyParent;function setDefaultBusyParent(el){el=YUI.get(el);if(el){defaultBusyParent=el}}
function isBusy(txt,parent){if(!nowIsBusy){nowIsBusy=1;background_loading++}
if(!YUI.Panel) return;if(!txt){txt=''}
if(!parent){if(!defaultBusyParent){defaultBusyParent=document.body}
parent=defaultBusyParent}
else{parent=YUI.get(parent)}
if(!YUI.get('busyWait')){busyMask=new YUI.Panel("busyWait",{close:false, underlay:'none', fixedcenter:true, draggable:false, zIndex:500, visible:false});busyMask.resizeHandler=function(){if(busyMask.cfg.getProperty('visible')){var parentHeight=parent.offsetHeight;var windowHeight=YUI.Dom.getViewportHeight();if(parentHeight > windowHeight){parentHeight=windowHeight - YUI.Dom.getY(parent)}
var y=(parentHeight/2) - 40;if(YAHOO.env.ua.ie && YAHOO.env.ua.ie < 7){y+=YUI.Dom.getDocumentScrollTop()}
div.style.width=parent.offsetWidth+'px';div.style.top=y+'px'}}
busyMask.callResizeHandler=function(){busyMask.resizeHandler()}
YUI.Event.addListener(window,'resize',busyMask.callResizeHandler);if(YAHOO.env.ua.ie && YAHOO.env.ua.ie < 7){YUI.Event.addListener(window,'scroll',busyMask.callResizeHandler)}}
busyMask.setBody('<img src="/images/spinner2.gif"/><div id="busy_message">'+txt+'</div>');busyMask.render(document.body);var mask=maskDiv(parent);var div=YUI.get('busyWait');YUI.style(div,{position:'fixed', textAlign:'center', margin:0, padding:0});if(YAHOO.env.ua.ie && YAHOO.env.ua.ie < 7){div.style.position='absolute'}
busyMask.divMask=mask;busyMask.safeDestroy=function(){YUI.Event.removeListener(window,'resize',busyMask.callResizeHandler);YUI.Event.removeListener(window,'scroll',busyMask.callResizeHandler);mask.safeDestroy();busyMask.destroy()}
busyMask.bringToTop();busyMask.show();busyMask.resizeHandler()}
function notBusy(){if(nowIsBusy){nowIsBusy=0;background_loading--}
if(YUI.get('busyWait')){busyMask.safeDestroy()}}
function mouseX(e){if(e.pageX) return e.pageX;else if(e.clientX)
return e.clientX+(document.documentElement.scrollLeft ?
document.documentElement.scrollLeft:document.body.scrollLeft);else return null}
function mouseY(e){if(e.pageY) return e.pageY;else if(e.clientY)
return e.clientY+(document.documentElement.scrollTop ?
document.documentElement.scrollTop:document.body.scrollTop);else return null}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload !='function'){window.onload=func} else{window.onload=function(){oldonload();func()}}}
var lastDragged=false;function panAble(parent,target){var p=YUI.get(parent);var t=YUI.get(target);YUI.style(p,{cursor:'url(/images/open_hand.cur), pointer'});var p_cursor=p.style.cursor;if(t){t.drag=false;t.offsetX=0;t.offsetY=0;t.pan=function(x,y){t.style.left=(parseInt(this.style.left)+x)+"px";t.style.top=(parseInt(this.style.top)+y)+"px"}
var start_drag=function(e){e=e || window.event;YUI.style(p,{cursor:'url(/images/closedhand.cur), pointer'});t.offsetX=mouseX(e);t.offsetY=mouseY(e);t.drag=true;lastDragged=false;return false}
var stop_drag=function(){p.style.cursor=p_cursor;t.drag=false;return false}
var blur_drag=function(e){e=e || window.event;var region=YUI.Dom.getRegion(p);var x=mouseX(e);var y=mouseY(e);if(y < region.top ||
x < region.left ||
y > region.bottom ||
x > region.right){t.drag=false}
return false}
p.onmousedown=start_drag;p.onmouseup=stop_drag;p.onmouseout=blur_drag;p.onmousemove=function(e){e=e || window.event;if(!t.drag){return true};lastDragged=true;var x=mouseX(e);var y=mouseY(e);if(x !=t.offsetX || y !=t.offsetY){t.pan(x-t.offsetX,y-t.offsetY);t.offsetX=x;t.offsetY=y}
YUI.Event.stopEvent(e);return false}}}
function makeQueryString(hashObj, qstring){if(!qstring){var qstring=''} else if(qstring[qstring.length -1] !='&'){qstring+='&'}
for(var x in hashObj){if(x){qstring+=x+'='+encodeURIComponent(hashObj[x])+'&'}}
return qstring}
function daysInMonth(month,year){month--;return 32 - new Date(year, month, 32).getDate()}
function validateDate(day, month, year){day=parseInt(day,10);month=parseInt(month,10);month--;var d=new Date();d.setFullYear(year,month,day);if(day !=d.getDate() ||
month !=d.getMonth() ||
year !=d.getFullYear()){return 0}
return 1}
function makeElement(tagName, attributes, childContent){var el;if(YAHOO.env.ua.ie){var txt='<'+tagName+' ';if(attributes){if(attributes.name) txt+='name="'+attributes.name+'" ';if(attributes.value) txt+='value="'+attributes.value+'" ';if(attributes.checked) txt+='checked ';if(attributes.selected) txt+='selected '}
txt+=' />';el=document.createElement(txt)} else{el=document.createElement(tagName)}
for(var n in attributes){if(n=='style'){var styles=attributes[n];for(var s in styles){el.style[s]=styles[s]}}
else{el[n]=attributes[n]}}
if(typeof childContent=='string'){el.appendChild(document.createTextNode(childContent))}
else if(typeof childContent=='object'){el.appendChild(childContent)}
return el}
function isInIframe(){var path=document.URL;if(path.match(/iframe/)){return 1}
return 0}
function isPopup(){var path=document.URL;if(path.match(/\?popup=1/)){return 1}
return 0}
function zoomRect(from, to, callback){from=YUI.get(from);to=YUI.get(to);var d=document.createElement('div');YUI.style(d,{border:'1px dotted black', position:'absolute', width:from.offsetWidth+'px', height:from.offsetHeight+'px', zIndex:200});document.body.appendChild(d);YUI.Dom.setXY(d,YUI.Dom.getXY(from));var anim=new YAHOO.util.Motion(d,{points:{to:YUI.Dom.getXY(to)}, width:{to:to.offsetWidth}, height:{to:to.offsetHeight}}, 0.2);anim.onComplete.subscribe(function(){document.body.removeChild(d);if(callback){callback()}})
anim.animate()}
var getPageScroll=function(){var x=0;var y=0
if(window.scrollY){y=parseInt(window.scrollY,10)}
else if(document.documentElement && document.documentElement.scrollTop){y=parseInt(document.documentElement.scrollTop,10)}
else if(document.body && document.body.scrollTop){y=parseInt(document.body.scrollTop,10)}
if(window.scrollX){x=parseInt(window.scrollX,10)}
else if(document.documentElement && document.documentElement.scrollLeft){x=parseInt(document.documentElement.scrollLeft,10)}
else if(document.body && document.body.scrollLeft){x=parseInt(document.body.scrollLeft,10)}
return[x,y]};function imageFade(el,images,spec){var time=1, pause=1, effect, onload, onstart;if(spec){time=spec.time || time;pause=spec.pause || pause;effect=spec.effect;onload=spec.onload;onstart=spec.onstart}
el=YAHOO.util.Dom.get(el);pause *=1000;var idx=0;var bImg=document.createElement('img');bImg.style.position='absolute';bImg.src=el.src;el.parentNode.appendChild(bImg);var anim=new YAHOO.util.Motion(bImg,{opacity:{to:0}},time);var loop=function(){var xy=YAHOO.util.Dom.getXY(el);YAHOO.util.Dom.setXY(bImg,xy);YAHOO.util.Dom.setStyle(bImg,'opacity',1);if(effect){effect(anim,el,bImg)}
bImg.src=el.src;idx++;if(idx >=images.length){idx=0}
el.src=images[idx];if(onstart){onstart(el,idx)}
anim.animate()}
anim.onComplete.subscribe(function(){if(onload){onload(el,idx)}
setTimeout(loop,pause)});loop();return anim}
var fadeEffect={zoom:function(anim,el,bImg){var xy=YAHOO.util.Dom.getXY(el);bImg.style.width=el.offsetWidth+'px';bImg.style.height=el.offsetHeight+'px';anim.attributes.points={to:[xy[0]-(el.offsetWidth/4), xy[1]-(el.offsetHeight/4)]};anim.attributes.width={to:el.offsetWidth*1.5};anim.attributes.height={to:el.offsetHeight*1.5}}, slight_zoom:function(anim,el,bImg){var xy=YAHOO.util.Dom.getXY(el);bImg.style.width=el.offsetWidth+'px';bImg.style.height=el.offsetHeight+'px';anim.attributes.points={to:[xy[0]-(el.offsetWidth/16), xy[1]-(el.offsetHeight/16)]};anim.attributes.width={to:el.offsetWidth*1.125};anim.attributes.height={to:el.offsetHeight*1.125}}, drop:function(anim,el,bImg){var xy=YAHOO.util.Dom.getXY(el);anim.attributes.points={to:[xy[0], xy[1]+(el.offsetHeight/2)]}}, smoke:function(anim,el,bImg){var xy=YAHOO.util.Dom.getXY(el);bImg.style.width=el.offsetWidth+'px';bImg.style.height=el.offsetHeight+'px';anim.attributes.points={to:[xy[0]-(el.offsetWidth/8), xy[1]-(el.offsetHeight)]};anim.attributes.width={to:el.offsetWidth*1.25};anim.attributes.height={to:el.offsetHeight*1.25}}, slide:function(anim,el,bImg){var xy=YAHOO.util.Dom.getXY(el);anim.attributes.points={to:[xy[0]+(el.offsetWidth/2), xy[1]]}}, shrink:function(anim,el,bImg){var xy=YAHOO.util.Dom.getXY(el);bImg.style.width=el.offsetWidth+'px';bImg.style.height=el.offsetHeight+'px';anim.attributes.points={to:[xy[0]+(el.offsetWidth/4), xy[1]+(el.offsetHeight/4)]};anim.attributes.width={to:el.offsetWidth*0.5};anim.attributes.height={to:el.offsetHeight*0.5}}, flip:function(anim,el,bImg){var xy=YAHOO.util.Dom.getXY(el);bImg.style.width=el.offsetWidth+'px';bImg.style.height=el.offsetHeight+'px';anim.attributes.points={to:[xy[0], xy[1]+el.offsetHeight]};anim.attributes.height={to:0}}, flip_left:function(anim,el,bImg){var xy=YAHOO.util.Dom.getXY(el);bImg.style.width=el.offsetWidth+'px';bImg.style.height=el.offsetHeight+'px';anim.attributes.points={to:[xy[0], xy[1]]};anim.attributes.width={to:0}}, flip_right:function(anim,el,bImg){var xy=YAHOO.util.Dom.getXY(el);bImg.style.width=el.offsetWidth+'px';bImg.style.height=el.offsetHeight+'px';anim.attributes.points={to:[xy[0]+el.offsetWidth, xy[1]]};anim.attributes.width={to:0}}}
var last_tip;var new_tip;function chartTip(){if(complete_labels[arguments[0][0]])
arguments[0][0]=complete_labels[arguments[0][0]];arguments[0]=arguments[0][0]+arguments[0][1];tt_Tip(arguments,null)}

function log(msg){addToLog({text:msg, backgroundColor:"#eeff00"});maxRow=50}
var messages=[];var maxRow=1;var log_success_message_bgcolor="#FFFEE1";var log_process_started_message_bgcolor="#edf5ff";var log_failed_message_bgcolor="#DD4477";var text_color="#333";function addToLog(message){if(message.isRequest)
background_loading++;else
background_loading--;var log_window_element=YUI.get("log_window");if(!log_window_element)
return;var messageDiv=makeElement('div');messageDiv.id=randomElementId();messageDiv.innerHTML=message.text;messageDiv.style.display="none";log_window_element.appendChild(messageDiv);var show_duration=.1;var hide_duration=.5;if(messageDiv.backgroundColor==log_process_started_message_bgcolor ||
message.isRequest){YUI.addClass(messageDiv, "loading_log");show_duration=1;hide_duration=2}
var changeColor=new YAHOO.util.ColorAnim(messageDiv.id,{color:{to:text_color}}, show_duration);var hide=new YAHOO.util.ColorAnim(messageDiv.id,{color:{to:"#000"}}, hide_duration);changeColor.onStart.subscribe(function(){messageDiv.style.display="block"});changeColor.onComplete.subscribe(function(){hide.animate()});hide.onComplete.subscribe(function(){messages.shift();if(messages.length >=maxRow){messages[maxRow-1].animate()}});hide.onComplete.subscribe(function(){log_window_element.removeChild(messageDiv)});messages.push(changeColor);if(messages.length <=maxRow){changeColor.animate()}}
function logger(){var currentTime=new Date();var caller=(arguments.callee && arguments.callee.caller)?arguments.callee.caller.name:"";var error_message="Message='"+arguments[0]+"' \nlogger CALLER='"+caller+"' \n'Error Time="+currentTime+"\n STACK TRACE="+printStackTrace().join('\n\n');emailToTechSupport("Javascript error",error_message)};
site_url="";function isInteger(n){return(n==parseInt(n))}
function strictlyInteger(n){return(n===parseInt(n))}
function openPath(address){window.location=address}
function visible(element_to_show){YUI.removeClass(element_to_show, "hide")}
function invisible(element_to_hide){YUI.addClass(element_to_hide, "hide")}
function isInvisible(element_to_check){return YUI.hasClass(element_to_check, "hide")}
function mousePoint(currid){document.getElementById(currid).style.cursor='pointer'}
function mouseNormal(currid){document.getElementById(currid).style.cursor='default'}function setCookie(name, value, options){var today=new Date();today.setTime(today.getTime());if(options.expires){options.expires=options.expires * 1000 * 60 * 60}
var expires_date=new Date(today.getTime()+(options.expires));document.cookie=name+"="+escape(value)+((options.expires) ? ";expires="+expires_date.toGMTString():"")+((options.path) ? ";path="+options.path:"")+((options.domain) ? ";domain="+options.domain:"")+((options.secure) ? ";secure":"")}
function getCookie(check_name){var a_all_cookies=document.cookie.split(';');var a_temp_cookie='';var cookie_name='';var cookie_value='';for(i=0;i < a_all_cookies.length;i++){a_temp_cookie=a_all_cookies[i].split('=');cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g, '');if(cookie_name==check_name){if(a_temp_cookie.length > 1){cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''))}
return cookie_value}
a_temp_cookie=null;cookie_name=''}
return null}
function deleteCookie(name, path, domain){if(getCookie(name)){document.cookie=name+"="+((path) ? ";path="+path:"")+((domain) ? ";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}
function clearCookies(){deleteCookie("current_pid", '/', '');deleteCookie("first_time_loaded",'/','');deleteCookie("partner_key",'/','')}
var selectedFriend;function compileInnerHTML(el, content){el=YUI.get(el);if(!el) return;var scriptRegExp=new RegExp('<script[^\/]*?>(.|\n)*?<\/script>','g');var scripts=content.match(scriptRegExp);content=content.replace(scriptRegExp,'');el.innerHTML=content;if(scripts){for(var i=0;i<scripts.length;i++){var script_content=scripts[i].replace(/<\/?script>/g,'');eval(script_content)}}}
function queryString(key){hu=window.location.search.substring(1);gy=hu.split("&");if(hu.toString().indexOf("&")<0)
gy=hu.split(";");for(i=0;i < gy.length;i++){ft=gy[i].split("=");if(ft[0]==key){return ft[1]}}}
function photoImage(person){var photo=person.photo;if(!photo){if(person.gender=='M'){photo='/images/man.jpg'}
else{photo='/images/woman.jpg'}}
else if(photo.match(/^direct:/)){var hash=person.photo.replace(/^direct:/,'');photo='/en_US/profiles/photo/large/'+person.client_id+'/'+hash}
return photo}
function checkAndSaveServicesFromQueryString(){if(!isInIframe()){setCookie("dna", '1',{path:'/', secure:false});setCookie("health", '1',{path:'/', secure:false});setCookie("ancestry", '1',{path:'/', secure:false});setCookie("questionnaire", '1',{path:'/', secure:false});setCookie("ethnicity", '1',{path:'/', secure:false});setCookie("diseases", '1',{path:'/', secure:false});setCookie("purchase", '1',{path:'/', secure:false});setCookie("message", '1',{path:'/', secure:false})}
else{if(queryString("dna")){setCookie("dna", queryString("dna"),{path:'/', secure:false})}
if(queryString("h")){setCookie("partner_key", queryString("h"),{path:'/', secure:false})}
if(queryString("diseases")){setCookie("diseases", queryString("diseases"),{path:'/', secure:false})}
if(queryString("partner_disease")){setCookie("partner_disease", queryString("partner_disease"),{path:'/', secure:false})}
if(queryString("health")){setCookie("health", queryString("health"),{path:'/', secure:false})}
if(queryString("ancestry")){setCookie("ancestry", queryString("ancestry"),{path:'/', secure:false})}
if(queryString("questionnaire")){setCookie("questionnaire", queryString("questionnaire"),{path:'/', secure:false})}
if(queryString("ethnicity")){setCookie("ethnicity", queryString("ethnicity"),{path:'/', secure:false})}
if(queryString("purchase")){setCookie("purchase", queryString("purchase"),{path:'/', secure:false})}
if(queryString("message")){setCookie("message", queryString("message"),{path:'/', secure:false})}}}
function doCookieTest(){if(!navigator.cookieEnabled){alert('You need to enable cookies for this site to load properly!')}}
doCookieTest();function clone(obj){function F(){};F.prototype=obj;return new F()}
var server_session_time=7200 * 1000 - 60000;var session_time_notify=7200 * 1000 - 180000;function timeoutHandler(){showWarning('Your session is about to expire in 120 seconds. If you wish to continue please click <a href="/en_US/reports/">here</a>.')}
function startLogoutTimer(){ultimate_logout_timer=setTimeout("autoLogout()", server_session_time);logout_timer_notify=setTimeout(timeoutHandler, session_time_notify)}
var ultimate_logout_timer;var logout_timer_notify;function resetServerSessionTimer(){if(typeof ultimate_logout_timer !='undefined'){clearTimeout(ultimate_logout_timer);clearTimeout(logout_timer_notify)}
if(iniframe==undefined || !iniframe){ultimate_logout_timer=setTimeout("autoLogout()", server_session_time);logout_timer_notify=setTimeout(timeoutHandler, session_time_notify)}}
function autoLogout(){if(iniframe==undefined || !iniframe){window.location="/en_US/account/auto_logout"}}
function log_chat(link){var callback={success:function(o){JSONdata=JSONparse(o.responseText);if(JSONdata.result==1){showPopup(link,"height=200","width=200")}}, failure:function(o){}}
YUI.ajax('POST', '/en_US/reports/chat_log', callback)}
function validate_date_entry(date, error_message){var valid=true;if(date !='-00-00'){valid=validate_date(date)}
if(!valid){showError(error_message);return false}
return valid}
function findIndex(arrayData, value){for(var i=0;i < arrayData.length;i++){if(arrayData[i]==value){return i}}}
function crossDomainAjaxCall(runmode, params_hash, success_callback_function_name){params_hash["callback"]=success_callback_function_name;if(typeof(widget_timeouts)=='undefined'){widget_timeouts={}}
if(typeof(timeout_id)=='undefined'){timeout_id=1}
while(widget_timeouts[timeout_id]){timeout_id++}
script=document.createElement('script');script.id='genseq_json_data_'+timeout_id;var last_widget_timeout=setTimeout(healthdrive.event.onRequestTimeout, 20000);widget_timeouts[timeout_id]=last_widget_timeout;params_hash['request_timeout_id']=timeout_id;var query_string=makeQueryString(params_hash);script.src=site_url+runmode+'?'+query_string;document.body.appendChild(script)}
function removeFromDOMById(element,parent){var parent_element=YUI.get(parent);var e=YUI.get(element);if(parent_element && e){parent_element.removeChild(e);return 1}
return 0}
function emailToTechSupport(subject,message){var q={"subject":subject, "message":message};YUI.ajax('POST', '/en_US/home/report_bug', function(){}, makeQueryString(q))}
var record;var new_window;function showFullScreenPopup(url,resizable){var screenW=640, screenH=480;if(parseInt(navigator.appVersion) > 3){screenW=screen.width;screenH=screen.height}
else if(navigator.appName=="Netscape" &&
parseInt(navigator.appVersion)==3 &&
navigator.javaEnabled()){var jToolkit=java.awt.Toolkit.getDefaultToolkit();var jScreenSize=jToolkit.getScreenSize();screenW=jScreenSize.width;screenH=jScreenSize.height}
new_window=window.open(url, 'name', 'directories=no,status=no,resizable='+resizable+',toolbar=no,menubar=no,scrollbars=yes,left=0,top=0,height='+screenH+',width='+screenW);if(window.focus){new_window.focus()}}
function showPopup(url,params){new_window=window.open(url, 'name', params);if(window.focus){new_window.focus()}}
function showComposeWindow(name,id){dialogFromTemplate('/en_US/xml/10.3.19_en_US/messaging/compose.xml',{$PERSON$:name, $ID$:id})}
function showPokeMessageWindow(name,id){dialogFromTemplate('/en_US/xml/10.3.19_en_US/messaging/poke_message.xml',{$PERSON$:name, $EMAIL$:User[id].email})}
function showFriendInvitationWindow(name, id, senders_name,btn_add_friend){var msg='Hi '+name+",\nI would like to add you to my friends list.\nBest,\n"+senders_name;var sub="Friend request from "+senders_name;dialogFromTemplate('/en_US/xml/10.3.19_en_US/messaging/friends_invitation.xml',{$PERSON$:name, $ID$:id, $SUBJECT$:sub, $BODY$:msg, $BTN_ADD_FRIEND_ID$:btn_add_friend})}
function showJoinInvitationWindow(id, email_input_id){if(!FIC_checkField("validate-email", YUI.get(email_input_id))){alert("Please enter a valid email address");return -1}
var msg='I have added you to our family tree on a website that helps relatives to connect and record their family health history. Sign-up and contribute to a medically valuable portrait of our family.';var sender_name;if(User[myID].first_name)
sender_name=User[myID].first_name+" ";if(User[myID].last_name)
sender_name+=User[myID].last_name;var subject=sender_name+" invites you to join your family tree";var reciver_full_name="";if(User[id].first_name)
reciver_full_name+=User[id].first_name+" ";if(User[id].last_name)
reciver_full_name+=User[id].last_name;dialogFromTemplate('/en_US/xml/10.3.19_en_US/messaging/join_invitation.xml',{$PERSON$:reciver_full_name, $EMAIL$:YUI.get(email_input_id).value, $SUBJECT$:subject, $BODY$:msg, $TOID$:id})}
function togglesection(header_id, report_body_id){if(YUI.Dom.hasClass(header_id,'coach_header_closed')){YUI.addClass(report_body_id,"show");YUI.removeClass(report_body_id,"hide");YUI.addClass(header_id,"coach_header_opened");YUI.removeClass(header_id,"coach_header_closed")}else{YUI.removeClass(header_id,"coach_header_opened");YUI.addClass(header_id,"coach_header_closed");YUI.addClass(report_body_id,"hide");YUI.removeClass(report_body_id,"show")}}
function toggleItem(id, visible, content){var newCondition;var element=YUI.get(id);var toggle_icon=YUI.get("toggle_icon_"+id);var show_element=YUI.hasClass(element, "hide");if(visible)
show_element=1;if(visible !=null && !visible)
show_element=0;if(show_element){YUI.removeClass(element, "hide")
if(toggle_icon)
toggle_icon.src="/images/report/arrow_opened.gif";visibility_status[id]=1;if(content !=null)
element.innerHTML=content}
else{YUI.addClass(element, "hide")
if(toggle_icon)
toggle_icon.src="/images/report/arrow_closed.gif";visibility_status[id]=0}
return show_element}
checkAndSaveServicesFromQueryString();window.onerror=function(message, url, line){logger("window.onerror --> "+message+" \nURL"+url+" \nLine:"+line)};
String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,'')}
String.prototype.ltrim=function(){return this.replace(/^\s*/g,'')}
String.prototype.rtrim=function(){return this.replace(/\s*$/g,'')}
var FIC_atLeastOneName=0;var FIC_mustBeSame=[];var submit_button;var submit_button_text;function FIC_checkForm(e, just_validate){var errs=new Array();FIC_atLeastOneName=0;FIC_mustBeSame=[];var addClassName=YUI.Dom.addClass;var removeClassName=YUI.Dom.removeClass;var eventObj;if(typeof(e)=="string"){e=document.getElementById(e);if(!e){return true}}
var elm=e;if(!e.nodeName){eventObj=e;elm=(e.srcElement) ? e.srcElement:e.target}
if(elm.nodeName.toLowerCase() !='form'){elm=YUI.Dom.getAncestorByTagName(elm,'form')}
var all_valid=true;var f_in=elm.getElementsByTagName('input');var f_sl=elm.getElementsByTagName('select');var f_ta=elm.getElementsByTagName('textarea');for(i=0;i<f_in.length;i++){if(f_in[i].type.toLowerCase() !='submit' && f_in[i].type.toLowerCase() !='button' && f_in[i].type.toLowerCase() !='hidden'){if(isVisible(f_in[i])){var inv=f_in[i].value.trim();var t=f_in[i].type.toLowerCase();var cext='';if(t=='text' || t=='password'){var valid=FIC_checkField(null,f_in[i])} else if(t=='radio' || t=='checkbox'){var valid=FIC_checkRadCbx(null,f_in[i],f_in);cext='-cr'} else if(t=='file'){var valid=FIC_checkFile(null,f_in[i])}else{var valid=true}
if(valid==true){if(!just_validate){removeClassName(f_in[i],'validation-failed'+cext);addClassName(f_in[i],'validation-passed'+cext)}} else{if(!just_validate){removeClassName(f_in[i],'validation-passed'+cext);addClassName(f_in[i],'validation-failed'+cext)}
if(valid==false){if(f_in[i].getAttribute('title')){errs[errs.length]=f_in[i].getAttribute('title')}}
else{errs[errs.length]=valid}
all_valid=false}}}}
for(i=0;i<f_ta.length;i++){if(isVisible(f_ta[i])){var valid=FIC_checkField(null,f_ta[i]);if(valid){removeClassName(f_ta[i],'validation-failed');addClassName(f_ta[i],'validation-passed')} else{removeClassName(f_ta[i],'validation-passed');addClassName(f_ta[i],'validation-failed');if(f_ta[i].getAttribute('title')){errs[errs.length]=f_ta[i].getAttribute('title')}
all_valid=false}}}
for(i=0;i<f_sl.length;i++){if(isVisible(f_sl[i])){var valid=FIC_checkSel(null,f_sl[i]);if(valid){removeClassName(f_sl[i],'validation-failed-sel');addClassName(f_sl[i],'validation-passed-sel')} else{removeClassName(f_sl[i],'validation-passed-sel');addClassName(f_sl[i],'validation-failed-sel');if(f_sl[i].getAttribute('title')){errs[errs.length]=f_sl[i].getAttribute('title')}
all_valid=false}}}
if(elm.name==='compose_mail' && elm.id==='compose_email_form'){if(!checkRecipients()){el=document.compose_mail.to;addClassName(el,'validation-failed');errs.join('enter message recipient<br>');all_valid=false}}
if(!all_valid){if(errs.length > 0){showError(errs.join('<br>'))}
else{showError(getMessageText("required_missing"))}
YAHOO.util.Event.stopEvent(e);if(submit_button){submit_button.innerHTML=submit_button_text;submit_button.disabled=false}}
else
if(FIC_atLeastOneName < 0){showError(getMessageText("empty_name"));all_valid=false;YUI.getByClass('at-least-one', 'input', elm, function(el){removeClassName(el, 'validation-passed');addClassName(el, 'validation-failed')})}
else{if(FIC_mustBeSame[0] !=FIC_mustBeSame[1]){showError(getMessageText("password_match_failed"));all_valid=false;YUI.getByClass('must-be-same', 'input', elm, function(el){removeClassName(el, 'validation-passed');addClassName(el, 'validation-failed');el.value=""})}
else{YUI.getByClass('must-be-same', 'input', elm, function(el){removeClassName(el, 'validation-failed');addClassName(el, 'validation-passed')});YUI.getByClass('at-least-one', 'input', elm, function(el){removeClassName(el, 'validation-failed');addClassName(el, 'validation-passed')})}}
if(eventObj && !all_valid){YUI.Event.preventDefault(eventObj)}
return all_valid}
function FIC_checkField(c,e){var valid=true;var t=e.value.trim();var has=YUI.Dom.hasClass;if(has(e,'at-least-one')){if(t.length > 0){FIC_atLeastOneName++}
else{FIC_atLeastOneName --}}
if(has(e,'must-be-same')){FIC_mustBeSame.push(t)}
if(t.length==0){if(has(e,'required')){return false}
else{return true}}
if(has(e,'required')){var m=e.getAttribute("minlength");if(m && Math.abs(m) > 0){if(t.length < Math.abs(m)){var label_for=get_label(e.id);if(label_for){valid=getMessageText("min_length",{label:label_for, length:m})}else{valid=false}}}}
if(has(e,'validate-number') && isNaN(t) && t.match(/[^\d]/)){valid=false} else if(has(e,'validate-digits') && t.replace(/ /,'').match(/[^\d]/)){valid=false} else if(has(e,'validate-age') &&((t > 150 || t < 0) || t.match(/[^\d]/))){valid=false} else if(has(e,'validate-alpha') && !t.match(/[^\!\@\#\$\%\^\&\*\(\)\_\+\{\}\|\:\"\<\>\?\-\=\[\]\\\;\'\,\.\/\ \d]+$/i)){valid=false} else if(has(e,'validate-alphanum-withspecialchar') && !t.match(/[^\!\@\#\$\%\^\&\*\(\)\_\+\{\}\|\:\"\<\>\?\=\[\]\\\;\/]+$/)){valid=false} else if(has(e,'validate-address') && !t.match(/^[A-Za-z0-9\ \,\'\#\.\-\/\\\:]+$/)){valid=false} else if(has(e,'validate-phone') && !t.match(/^[0-9\+\ \(\)\-\+]+$/)){valid=false} else if(has(e,'validate-name') && t.match(/^\d|[\!\@\#\$\%\^\&\*\_\+\{\}\|\"\<\>\?\=\[\]\\\;\/]/)){valid=false} else if(has(e,'validate-alphanum') && t.match(/\W/)){valid=false}
else if(has(e,'validate-alphanum-withdot') && !t.match(/^[A-Za-z0-9]+\.?\_?[A-Za-z0-9]+$/)){valid=false}
else if(has(e,'validate-date') && t.match(/^(\d{4})\/|-(\d{2})\/|-(\d{2})$/)){if(!validate_date(t)){showError(getMessageText("validation_failed",{"invalid_text":t}));valid=false}}
else if(has(e,'validate-year')){if(!t.match(/^\d{4}$/)){valid=false}
else{var current_date=new Date();var current_year=current_date.getFullYear();valid=(t <=current_year && t >=1000)}}
else if(has(e,'validate-email') && !t.match(/^[a-z0-9#=?^_-]+(?:\.[a-z0-9#=?^_-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i)){valid=false;if(!has(e,'required') && t.length==0){valid=true}} else if(has(e,'validate-url') && !t.match(/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i)){valid=false} else if(has(e,'validate-date-au') && !t.match(/^(\d{4})\/|-(\d{2})\/|-(\d{2})$/)){valid=false} else if(has(e,'validate-currency-dollar') && !t.match(/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/)){valid=false}
return valid}
function validate_date(strDate){if(strDate.length !=10)
return false;var strDay =strDate.substr(8,2);var strMonth=strDate.substr(5,2);var strYear =strDate.substr(0,4);strMonth--;var d=new Date();d.setFullYear(strYear,strMonth,strDay);var valid=true;if(strDay !=d.getDate() || strMonth !=d.getMonth() || strYear !=d.getFullYear()){valid=false}
return valid}
function FIC_checkFile(c,e){var valid=true;var t=e.value.trim();if(YUI.Dom.hasClass(e,'validate-file') && !t.match(/[a-zA-Z0-9_\-\\\/\.]/i)){valid=false;if(YUI.Dom.hasClass(e,'required') && t.length==0){valid=false}}
return valid}
function FIC_checkRadCbx(c,e,f){var valid=true;if(YUI.Dom.hasClass(e,'validate-one-required')){valid=false;for(var i=0;i<f.length;i++){if(f[i].name.toLowerCase()==e.name.toLowerCase() && f[i].checked){valid=true;break}}}
return valid}
function FIC_checkSel(c,e){var valid=true;if(YUI.Dom.hasClass(e,'validate-not-first') && e.selectedIndex==0){valid=false} else if(YUI.Dom.hasClass(e,'validate-not-empty') && e.options[e.selectedIndex].value.length==0){valid=false}
return valid}
function attachToForms(e){var frms=document.getElementsByTagName('form');for(var i=0;i<frms.length;i++){YUI.Event.addListener(frms[i], "submit", FIC_checkForm)}}
function isVisible(e){e=YUI.get(e);while(e.nodeName.toLowerCase() !='body' && e.style.display.toLowerCase() !='none' && e.style.visibility.toLowerCase() !='hidden'){e=e.parentNode}
if(e.nodeName.toLowerCase()=='body'){return true} else{return false}}
function checkRecipients(){for(var i=0;i<document.forms[0].elements.length;i++){var element=document.compose_mail.elements[i];if(element.name){if(element.name.indexOf("recipients") !=-1){return true}}}
return false}
function validate_ajax_passed(e){if(e.className.indexOf('validation-passed')==-1){return false}
return true}
function setMeasurementStatus(inputEl, hintEl, ok, error_message){if(ok){toggleClass(inputEl, 'validation-failed', 'validation-passed');if(hintEl){toggleClass(hintEl, 'hint-validation-failed', 'hint-validation-passed');hintEl.innerHTML=''}} else{toggleClass(inputEl, 'validation-passed', 'validation-failed');if(hintEl){toggleClass(hintEl, 'hint-validation-passed', 'hint-validation-failed');hintEl.innerHTML=error_message}}}
function toggleClass(e, from, to){YUI.Dom.removeClass(e,from);YUI.Dom.addClass(e,to)}
function swapClass(e, flip, flop){if(YUI.hasClass(e, flop)){YUI.removeClass(e, flop);YUI.addClass(e, flip)} else{YUI.removeClass(e, flip);YUI.addClass(e, flop)}}
function showValidatingFlag(hint_text){hint_text.innerHTML='Validating ...'}
function measurement_validation_done(JSONdata, hint_text, e, button_id, button_text){hint_text=hint_text || YUI.get(JSONdata.hint_text);e=e || YUI.get(JSONdata.element_id);if(!e){return true}
button_id=button_id || JSONdata.button_id;if(button_id){button_text=button_text || JSONdata.button_text;var button=YUI.get(button_id);button.innerHTML=button_text}
if(hint_text){hint_text.innerHTML=' '}
setMeasurementStatus(e, hint_text, JSONdata.status, JSONdata.value);YUI.removeClass(e, 'ajax_validating');if(JSONdata.type=='time_string' || JSONdata.type=='number' || JSONdata.type=='validate_week_days'){hint_text.style.display='block'}
return JSONdata.status==1}
function validate_measurement(e, attr, userText, button_id){var hint_text=YUI.get(attr+'_hint_text');if(attr=='validate_hour_minute'){var id=e.name;id=id.replace(/__/,'_unit__');var unit_el;if(id &&(unit_el=YUI.get(id))){var val='';for(var i=0;i < unit_el.length;++i){if(unit_el[i].selected){val=unit_el[i].value}}
if(val=='hours'){attr='validate_day_hours'}
else if(val=='minutes'){attr='validate_day_minutes'}}}
if(attr=='time_string' || attr=='number' || attr=='validate_week_days'){hint_text=YUI.get(e.name+'_hint_text')}
if(hint_text){showValidatingFlag(hint_text)}
var button_text;if(button_id){var button=YUI.get(button_id);button_text=button.innerHTML;button.innerHTML="Validating..."}
YUI.removeClass(e, 'ajax_validating');YUI.addClass(e, 'ajax_validating');var valueToSend=e.value;var in_facebook='0';if(in_facebook=='0' && non_metric=='1'){if(!isNaN(valueToSend)){var question_id=e.id;question_id=question_id.replace(/radio_/i,'');if(YUI.get(question_id+'_unit_text')){var unit_text=YUI.get(question_id+'_unit_text');var unit_text_value=unit_text.innerHTML;if(unit_text_value){valueToSend=valueToSend+unit_text_value}}}
if(e.id.match('height')){var height_in_inches;var height_in_feet;if(e.id.match('inches')){height_in_inches=YUI.get(e.id).value;height_feet_id=e.id;height_feet_id=height_feet_id.replace(/_inches/i,'');height_in_feet=YUI.get(height_feet_id).value}else{height_in_feet=YUI.get(e.id).value;height_inches_id=e.id+'_inches';height_in_inches=YUI.get(height_inches_id).value;height_in_inches=(height_in_inches) ? height_in_inches:0}
valueToSend=height_in_feet+"ft "+height_in_inches+"in"}}else{if(YUI.get('unit_option_'+e.name)){var selected_unit=YUI.get('unit_option_'+e.name).value;if(selected_unit){valueToSend=valueToSend+selected_unit}}}
if(attr=='bodyfat'){valueToSend=e.value.replace(/%/g,'percent')}
var return_data={value:valueToSend, type:attr};if(cross_domain_ajax){var element_id=e.id;if(! element_id){log("FIX ME:element should have id, validate_measurement");return true}
if(hint_text){return_data['hint_text']=hint_text}
if(button_id){return_data['button_id']=button_id;return_data['button_text']=button_text}
return_data["element_id"]=element_id;crossDomainAjaxCall('/en_US/json/measurement/validate_measurement', return_data, 'measurement_validation_done')}else{var callback={success:function(o){JSONdata=JSONparse(o.responseText);return measurement_validation_done(JSONdata, hint_text, e, button_id, button_text)}, failure:function(o){YUI.removeClass(e, 'ajax_validating');if(attr=='time_string' || attr=='number' || attr=='validate_week_days'){hint_text.style.display='block'}
showError(getMessageText("validation_failed",{"invalid_text":(userText?userText:attr)}));return false}}
YUI.ajax('POST', '/en_US/json/measurement/validate_measurement', callback, makeQueryString(return_data))}
return true}
function get_label(id){inputElem=YUI.get(id);if(!inputElem) return false;if(inputElem.parentNode){if(inputElem.parentNode.tagName=='label'){return inputElem.parentNode}}
var labels=document.getElementsByTagName("label"),i;for(i=0;i<labels.length;i++){if(labels[i].htmlFor==inputElem.id){var label_text=labels[i].innerHTML;new_label_text=label_text.replace(/:/,'');var stripped=new_label_text.replace(/<[^>]+>/ig,"");return stripped.toLowerCase()}}
return false}
YUI.Event.addListener(window, "load", attachToForms);
var button=YAHOO.widget.button, Event=YAHOO.util.Event, Dom=YAHOO.util.Dom, Get=YAHOO.util.Get, elContainer=Dom.get("container"), tIds={};var cur_style=queryString("theme");if(isInIframe()){if(!cur_style){cur_style=getCookie("current_style");if(!cur_style){cur_style="1"}}}
else{cur_style="1"}
switch(cur_style){case "2":applyStyle("mgeno_blue.css");break;case "3":applyStyle("mgeno_green.css");break;case "4":applyStyle("mgeno_grey.css");break}
if(!queryString("theme_preview")){setCookie("current_style", cur_style,{path:'/', secure:false})}
function applyStyle(css_file){Get.css("/stylesheets/"+css_file,{data:css_file, onSuccess:on_success});if(!queryString("theme_preview")){setCookie("current_style", cur_style,{path:'/', secure:false})}};var on_success=function(o){tIds[o.data]=o}
<!-- Values are in Speech Synthesis Markup Language(SSML) format-->
var all_messages={"unable_to_get":'Unable to get |object|.', "unable_to_update":'Sorry, Unable to save your changes. Try again!', "unable_to_delete":'Delete failed. Sorry!', "incorrect_measurement":'Please enter a correct measurement for |field|', "unable_to_create":'Unable to create |object|', "photo_upload_failed":'Photo upload failed. Please try again', "upload_failed":'Upload failed. Please try again', "option_error":'The option you chose did not work. We apologize for the inconvenience. Please try again later. If the problem persists you can contact our support staff by clicking <a href="/home/contact">here</a>', "validation_failed":'Sorry, unable to validate |invalid_text|. Please try again.', "invitation_not_sent":'The invitation could not be sent. Please try again.', "delete_logo_failed":'Could not delete. Try again!', "assign_disease_failed":'Failed to assign disease.', "assign_allergy_failed":'Failed to assign allergy.', "delete_disease_failed":'Delete failed. Sorry!', "delete_allergy_failed":'Delete failed. Sorry!', "delete_file_failed":'Delete file failed. Sorry!', "date_order_failed":'Date of death must be later than birthdate', "questionnaire_unavailable":'Questionnaire is unavailable for the moment', "google_health_sync failed":'An error occurred. Please try again.', "password_match_failed":'Passwords do not match.', "empty_name":'Please enter either a first name or last name, or both.', "required_missing":'Some required values are not correct. Please check the items in red.', "response_value_missing":'Required value for response is missing. Please enter a value for it.', "value_invalid_format":'Format of value was not recognized, Please enter value correctly.', "no_file_to_upload":'Please choose a file to upload.', "facebook_friends_loading_failed":'Facebook friends loading Failed!', "person_not_in_tree":'Cannot find the person in your tree.', "select_your_name_in_list":'Please select your name from the list.', "loading_friends_failed":'Could not fetch the friends list. Please try again!', "attach_resume_first":'Please attach your RESUME before submitting your application.', "check_cross":'Unable to process your data. You may have entered information incorrectly.<br/> Please check entries marked with(<img src="/images/icons/cross.gif" />)', "age_exceed":'Age of onset cannot exceed your current age!', "onset_age":'Please enter onset age!', "client_undefined":'Client is undefined! Please login first and/or check parameters.', "password_missing":'Password missing and action cannot be completed! Please enter password.', "access_denied":'Access Denied!', "no_permission_to_view_tree":'You do not have permission to view |name| tree', "age_group":'The questions in this category do not apply to your age group', "realistic_value":'Enter a realistic value', "stop_date_error":'Stop Date can not be earlier than start date', "connection_error":'There is a problem with your Internet connection. Please contact your Internet service provider or try again later.', "timeout_error":'Sorry. Network is taking too long to respond. Please try again. If the problem persists, please try later.', "service_unavailable":'Sorry. Our site is down for routine maintenance please try again later. We are sorry for the inconvenience', "min_length":'|label| must have at least |length| characters ', "pdf_not_ready":'Your PDF files are being generated and will be ready in less than 5 minutes. We will inform you with a pop-up when they are ready', "pdf_not_ready_short":'PDF version is not ready yet', "pdf_is_ready":'PDF version of report is ready', "check_pdf_ready":'Checking PDF ...', "emailing_pdf":'Emailing your PDF ...', "locking_pdf":'Securing your PDF with password ...', "subsection_incomplete":'Please answer all questions', "wait_updating_main_chart_short":'Updating, Please wait', "wait_adding_chart":'Adding new chart, Please wait', "retrieving_questions":'Retrieving questions ...', "updating":'Updating ...', "select_friend":'Please select your friend!', "report_updated":'|report|&nbsp;updated', "facebook_invite_cancel_confirm":'This is the easiest way of letting |name| know that you have added |him_her| to your tree and inviting |him_her| to participate.', "sitepal_loading":'Loading previous help, please wait.', "sitepal_talking":'Talking, please wait.', "sitepal_no_content":'Sorry, content is not ready yet.', "sleepiness":"not ready", "stress_2":"On the whole, you feel you are valued and being treated fairly at work. You are effective in contributing to your employer’s business objectives. Your self-reported health is likely to be very good <break/> and your mental health is characterized by high levels of commitment and engagement in work. Congratulations! You are one of the fortunate ones experiencing a very healthy workplace.", "stress_1":"On the whole, you feel you are being treated relatively fairly at work. Your self-reported health is likely to be good <break/> and your mental health is characterized by quite high commitment to your employer <break/> and your job. Your employer is doing many things right, but there is still <break size='small'/>room for improvement.", "stress_0":"The satisfaction you get from the job <break/>and the stress you experience at work tend to cancel each other out. You are neither contributing to, nor detracting from, your employer’s business objectives. Your self-reported health is likely normal <break/>or only moderately healthy. Your mental health related to work may be characterized by complacency <break/>or disengagement. Your employer could do a lot more to improve the health of your workplace and gain your commitment and engagement.", "stress_-1":"You may feel you are treated unfairly at work. You may be inadvertently working <break/>against the achievement of your employer’s business objectives, whether these objectives <break/>are product-related or service-related. Your self-reported health is likely only fair <break/>and your mental health may be characterized by disengagement and demoralization. You are at risk of a variety of health and capacity impairments. Your employer should take notice of the unhealthy workplace conditions contributing to your poor health <break/>and a lack of productivity in the business. There is much that can be done to improve both!", "stress_-2":"You are likely to feel you are treated very unfairly at work. You are likely inadvertently working against the achievement of your employer’s business objective, whether these objectives are product-related <break/>or service-related. Your self-reported health is likely to be poor and your mental health at work may be characterized by disengagement, demoralization and depression. You are at risk of a variety of health <break/>and capacity impairments. If you feel high levels of stress and low satisfaction <break/>over a long period of time, you are likely to suffer from:3 times the risk of heart problems, 3 times the risk of back, 5 times the risk of certain cancers, 2 to 3 times the risk of injuries, 2 to 3 times the risk of infections, 2 to 3 times the risk of conflicts, 2 to 3 times the risk of mental health problems such as depression and anxiety disorders, 2 to 3 times the risk of <break size='small'/>substance abuse problems. You may also be at risk of reduced adaptability, reduced ability to cope with change, impaired learning, impaired memory, increased helplessness, increased passivity <break size='small'/>or aggression and conflict.", "bmi_info":"Your BMI can tell you if you are overweight, obese, underweight or normal. You should be aware of your BMI<break/> because of the health risks of being overweight, underweight or obese. According to standard definitions from the World Health Organization and Center for Disease Control<break/> a person with a BMI of 18.5 to 24.9 is considered to be at a healthy weight. A person with a BMI of 25 to 29.9 is considered to be overweight. A BMI of over 30 is considered obese. A BMI of 40 or above indicates that a person is morbidly obese. This can increase a person's risk of death from any cause by 50 to 150 percent.", "demo_report":"This is a demo. You can interact with this demo report, but you cannot save any changes", "user_feed_permission_dialog":'Would you like to post <b> |report_name| </b> Health grade to your News Feed?', "enable_all_features":"Please enable all features of application by granting proper permission.", "chart_fail":"Could not get chart information.", "at_least_one_sugar_answer":"Please answer at least one of Blood Sugar Level questions."};function getMessageText(messageCode,params){var processed_message=all_messages[messageCode.toString().toLowerCase()];if(processed_message){for(var parameter_key in params){var key="|"+parameter_key+"|";processed_message=processed_message.replace(key, params[parameter_key])}}else{processed_message=""}
return processed_message}

var sitepal_context_help;var context_helps_text_by_value;var context_helps_text_by_id;function processPageContexHelp(){replaceKeywords(document.body)}
function replaceKeywords(el){el=YUI.get(el) || document.body;for(var id in context_helps_text_by_id){var elm=YUI.get(id);if(elm){assignContextHelp(elm,id)}}
var TEXT_NODE=3;var ELEMENT_NODE=1;var keys=[];for(var key_word in context_helps_text_by_value){keys.push(key_word)}
keys=keys.sort();var count=0;var recurseReplaceKeywords=function(domNode){if(domNode.nodeType===ELEMENT_NODE){var children=domNode.childNodes;for(var i=0;i<children.length;i++){var child=children[i];if(child.className !='context_help_link' &&
child.className !='context_help_definition' &&
child.nodeName !='SCRIPT' &&
!(child.className && child.className.match(/hide/))){recurseReplaceKeywords(child)}}}
else if(domNode.nodeType===TEXT_NODE){var text=domNode.nodeValue;if(text.match(/[a-z]/i)){for(var n=0;n<keys.length;n++){var key_word=keys[n];var i=text.indexOf(key_word);if(i !=-1){var sp=document.createElement('span');var m=domNode.splitText(i);m.splitText(key_word.length);m.parentNode.insertBefore(sp,m);m.parentNode.removeChild(m);sp.appendChild(m);assignContextHelp(sp,key_word);text=domNode.nodeValue;count++}}}}}
recurseReplaceKeywords(el)}
function assignContextHelp(el,key_word){el=YUI.get(el);el.className='context_help_link';el.onmouseover=function(){if(mute){showContextHelp(el,key_word)} else{showContextHelp(el,key_word)}};el.onclick=function(){if(mute){showContextHelp(el,key_word)} else{showContextHelp(el,key_word)}};if(pdf_view && el){var defination_div=document.createElement('div');defination_div.className='context_help_definition';var content=context_helps_text_by_value[key_word];if(!content){content=context_helps_text_by_id[key_word];defination_div.innerHTML=content;YUI.Dom.insertAfter(defination_div,el)}else{defination_div.innerHTML=content;el.parentNode.appendChild(defination_div)}}}
function showContextHelp(el,key){var help_text=context_helps_text_by_value[key];if(help_text==undefined){help_text=context_helps_text_by_id[key]}
var bubble=bubbleTipIntelligent(el , "<p>"+help_text+"</p>","tr")}
context_helps_text_by_id={username_help:" Please choose a login name. You will need to remember this login name to log into the system in future. ", password_help:" Please choose a secure password. You will need to remember this password to log into the system in future. ", optional_email:" Please enter a valid email address - it can be your work or your personal email address. This will allow you to receive notifications from HealthDrive and recover your username or password if you forget. ", voucher_help:" Please enter the 3-digit number in top right hand corner of your voucher "};
