var PATH_LIBRARY=location.href.indexOf("espanol.humana.com")==-1?"/library/":"/enes/library/";prepare_iehovers=function(){if(!window.XMLHttpRequest){$$("#nav_main li[class!=channel]",".teal",".purple",".blue",".green",".blueteal").each(function(e){e.onmouseover=function(){this.className+=" iehover"};e.onmouseout=function(){this.className=this.className.replace(" iehover","")}})}};prepare_gmaps=function(){$$("a.gmap").each(function(e){var get_vars=e.href.toQueryParams();var coordinates=get_vars.sll.split(",");if(!e.getAttribute("rev")){$continue}var args=e.getAttribute("rev").split("_");var ref_elem=null;var div_id="gmap_"+e.identify();var map_div=new Element("div",{id:div_id});map_div.setStyle({width:args[1]+"px",height:args[2]+"px"});map_div.addClassName("gmap");switch(args[3]){case"inner":ref_elem=e.up("div.side").next("div.inner");ref_elem.update(map_div);break;default:ref_elem=e.up();ref_elem.insert(map_div,{position:"after"});break}init_gmaps({map_id:div_id,latitude:coordinates[0],longitude:coordinates[1],zoom:get_vars.z,link:e.href});e.remove()})};init_gmaps=function(options){if(GBrowserIsCompatible()){var map=new GMap2(document.getElementById(options.map_id));var ll=new GLatLng(options.latitude,options.longitude);map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());var zoom=parseInt(options.zoom);map.setCenter(ll,zoom);map.addOverlay(new GMarker(ll));function createMarker(point,number){var marker=new GMarker(point);GEvent.addListener(marker,"click",function(){open_window(options.link,null)});return marker}map.addOverlay(createMarker(ll,1))}};prepare_language_link=function(){var obj=document.getElementById("language_link");if(!obj){return}obj.onclick=function(){oh="humana.com";tsh="espanol.humana.com/enes/";idx=location.href.indexOf(tsh);if(idx==-1){idx=location.href.indexOf(oh)+oh.length;hname=tsh}else{idx=idx+tsh.length;hname="www."+oh}path=location.href.substring(idx);hend=hname.charAt(hname.length-1);pstart=path.charAt(0);if(hend=="/"&&pstart=="/"){path=path.substring(path.indexOf("/")+1)}if(hend!="/"&&pstart!="/"){path="/"+path}this.href=location.protocol+"//"+hname+path;return true}};prepare_printer_friendly=function(){var elem=$("printer_friendly");if(!elem){return false}elem.setStyle({cursor:"pointer"});elem.observe("click",print_window)};prepare_rounded=function(){$$(".rounded",".rounded_outline").each(function(e){firstchild=e.down();if(firstchild.hasClassName("content")){e.down().setStyle({paddingTop:0,paddingBottom:0})}else{firstchild.setStyle({paddingTop:0});firstchild=e.select(".content");if(firstchild.length){firstchild[0].setStyle({paddingTop:0,paddingBottom:0})}}e.insert({top:'<div class="tl"><div class="tr"></div></div>'});e.insert('<div class="bl"><div class="br"></div></div>')})};condense_lists=function(){$$(".condense").each(function(e){var select=new Element("select",{name:e.identify(),id:e.identify()});if(e.title){select.insert('<option value="">'+e.title+"</option>")}if(e.tagName=="DIV"){e.select("ul").each(function(list){group=list.previous("h6").innerHTML;optgroup=new Element("optgroup",{label:group});list.select("li a").each(function(item){value=item.href.split("#");value=value[1]?value[1]:value[0];if(value.indexOf("jlt_")!=-1){toggle_jump_section(value)}optgroup.insert(new Element("option",{value:value}).update(item.innerHTML))});select.insert(optgroup)})}else{e.select("li a").each(function(item){value=item.href.split("#");value=value[1]?value[1]:value[0];if(value.indexOf("jlt_")!=-1){toggle_jump_section(value)}select.insert('<option value="'+value+'">'+item.innerHTML+"</option>")})}select.selectedIndex=0;e.insert({before:select});var image=new Element("img",{src:"/library/images/btn_go.gif",alt:"Go",style:"vertical-align: bottom; cursor: pointer;"});e.insert({before:image});image.observe("click",jumplist.bind(select));e.remove()})};toggle_jump_section=function(id){var elem=$(id);if(!elem){return}var parent=elem.up();var child=null;do{parent.toggle();parent=parent.next();child=parent.down()}while(parent&&child.id.indexOf("jlt_")==-1&&!child.hasClassName("jlt_last"));if(child.hasClassName("jlt_last")){child.up().toggle()}};var old_jumps={};jumplist=function(){var jump=this[this.selectedIndex].value;if(!jump){return}if(jump.indexOf("http://")==-1){if(jump.indexOf("jlt_")!=-1){toggle_jump_section(old_jumps[this.id]);toggle_jump_section(jump);old_jumps[this.id]=jump}else{window.location.hash="#"+jump}}else{if(jump.indexOf("documents.asp?file=")){open_window(jump,null)}else{window.location=jump}}};prepare_tabs=function(){$$(".tabset").each(function(e){new Tab({id:e,rounded:1})})};prepare_login_form=function(){var f=$("frmLogin");if(!f){return false}f.setAttribute("autocomplete","off");f.onsubmit=validate_login};prepare_links=function(){$$("a.revlink").each(function(e){e.href+=e.getAttribute("rev");e.setAttribute("rev","")});$$('a[rel="external"]').invoke("observe","click",function(e){elem=e.findElement("a");e.stop();open_window(elem.href,elem.getAttribute("rev"))});$$("a.close").invoke("observe","click",function(e){e.stop();close_window()});$$("a.print_page").invoke("observe","click",function(e){e.stop();print_window()})};close_window=function(){window.close()};print_window=function(){window.print()};open_window=function(href,options){if(options){args=options.split("_");options="width="+args[1]+",height="+args[2];switch(args[3]){case"glossary":options+=",toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes";break;case"info":options+=",toolbar=no,location=no,status=yes,menubar=yes,resizable=yes,scrollbars=yes";break;case"popup":options+=",toolbar=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=no";break;default:options+=",toolbar=no,location=no,status=yes,menubar=no,resizable=yes,scrollbars=yes"}var wWindow=window.open(href,null,options)}else{var wWindow=window.open(href)}wWindow.focus()};validate_login=function(){if(!/^[\w\d]+$/.test(document.forms.frmLogin.Userid.value)){alert("User ID is a required field and must not contain spaces.");document.forms.frmLogin.Userid.focus();return false}if(document.forms.frmLogin.txtPassword.value.length>15||document.forms.frmLogin.txtPassword.value.length==0){alert("Password is a required field and must not be more 15 characters.");document.forms.frmLogin.txtPassword.focus();return false}return true};var Equalizer={px_base:10,elements:[],init:function(elements,px_base){Equalizer.px_base=px_base||Equalizer.px_base;Equalizer.elements=elements.collect(function(e){if(e.length==1){return $$(e)}else{return e.collect(function(f){return $(f)})}});Equalizer.setHeights()},setHeights:function(){Equalizer.elements.each(function(elems){elems=elems.compact();if(elems.length){elems.invoke("setStyle",{height:""});tallest=elems.max(function(e){return e.getHeight()});em_base=tallest/Equalizer.px_base+1;elems.invoke("setStyle",{height:em_base.toFixed(2)+"em"})}})}};var Cookie={data:{},options:{expires:1,domain:"",path:"",secure:false},init:function(options,data){Cookie.options=Object.extend(Cookie.options,options||{});var payload=Cookie.retrieve();if(payload){Cookie.data=payload.evalJSON()}else{Cookie.data=data||{}}Cookie.store()},getData:function(key){return Cookie.data[key]},setData:function(key,value){Cookie.data[key]=value;Cookie.store()},removeData:function(key){delete Cookie.data[key];Cookie.store()},retrieve:function(){var start=document.cookie.indexOf(Cookie.options.name+"=");if(start==-1){return null}if(Cookie.options.name!=document.cookie.substring(start,Cookie.options.name.length)){return null}var len=start+Cookie.options.name.length+1;var end=document.cookie.indexOf(";",len);if(end==-1){end=document.cookie.length}return unescape(document.cookie.substring(len,end))},store:function(){var expires="";if(Cookie.options.expires){var today=new Date();expires=Cookie.options.expires*86400000;expires=new Date(today.getTime()+expires)}document.cookie=Cookie.options.name+"="+escape(Object.toJSON(Cookie.data))+Cookie.getOptions()+";expires="+expires},erase:function(){document.cookie=Cookie.options.name+"="+Cookie.getOptions()+";expires=Thu, 01-Jan-1970 00:00:01 GMT"},getOptions:function(){return(Cookie.options.path?";path="+Cookie.options.path:"")+(Cookie.options.domain?";domain="+Cookie.options.domain:"")+(Cookie.options.secure?";secure":"")}};var Highlights={interval:null,current:0,length:0,init:function(){elem=$("highlights");if(!elem){return false}elem.observe("mouseover",Highlights.stop);elem.observe("mouseout",Highlights.start);Highlights.buildNav();if(Highlights.length>1){Highlights.change()}},buildNav:function(){var elements=$("highlights").select(".item");Highlights.length=elements.length;if(Highlights.length<2){return false}else{ul=new Element("ul");elements.each(function(e,i){++i;e=new Element("img",{id:"itemlink"+i,alt:"Go To Item"+i,src:PATH_LIBRARY+"images/circle_off.gif"});e.observe("click",Highlights.change.bindAsEventListener(e,i));li=new Element("li").update(e);ul.insert(li)});e=new Element("a",{title:"display previous highlight","class":"previous"}).update("Previous");e.observe("click",Highlights.change.bindAsEventListener(e,-1));div=new Element("div",{id:"item_nav"}).insert(e).insert(ul);e=new Element("a",{title:"display next highlight","class":"next"}).update("Next");e.observe("click",Highlights.change.bindAsEventListener(e,null));div.insert(e);elements[0].insert({before:div})}},change:function(e,i){if(Highlights.current){$("itemlink"+Highlights.current).src=PATH_LIBRARY+"images/circle_off.gif";$("item"+Highlights.current).setStyle({display:"none"})}if(!i){++Highlights.current}else{if(i==-1){--Highlights.current}else{Highlights.current=i}}if(Highlights.current<1){Highlights.current=Highlights.length}else{if(Highlights.current>Highlights.length){Highlights.current=1}}$("itemlink"+Highlights.current).src=PATH_LIBRARY+"images/circle_on.gif";$("item"+Highlights.current).setStyle({display:"block"})},start:function(){try{Highlights.interval=setInterval(Highlights.change,5000)}catch(e){}},stop:function(){try{clearInterval(Highlights.interval)}catch(e){}}};var Tab=Class.create({initialize:function(options){this.tab=$(options.id);if(!this.tab){throw ("Attempted to initalize tab with undefined element: "+options.id)}var styles={display:"none",opacity:0};this.toggleClass="tabset_tabs";this.activeClass="active";this.contentClass="tabset_content";this.current=0;this.tabs=this.tab.select("."+this.toggleClass+" li");this.contents=this.tab.select("."+this.contentClass);this.isAnimating=false;options.event=options.event||"click";hash=0;this.tabs.each(function(e,i){if(e.hasClassName(this.activeClass)){this.current=i}if(window.location.hash==("#"+e.down("a").href.split("#")[1])){hash=i}e.observe(options.event,this.toggle.bindAsEventListener(this,i))}.bind(this));if(hash){this.tabs[this.current].removeClassName(this.activeClass);this.current=hash}this.tabs[this.current].addClassName(this.activeClass);this.contents[this.current].setStyle({display:"block"});if(options.height==true){styles.height=this.contents.max(function(e){return e.getHeight()})+"px";this.contents[this.current].setStyle({height:styles.height})}if(options.rounded==true){var elem=this.tab.select("."+this.contentClass+"_container")[0];if(elem){elem.setStyle({paddingTop:0,paddingBottom:0});elem.insert({top:'<div class="tr"></div>'});elem.insert('<div class="bl"><div class="br"></div></div>')}}this.contents.each(function(section,i){if(this.current!=i){section.setStyle(styles)}}.bind(this))},toggle:function(e,i){e.stop();if(this.isAnimating||this.current==i){return false}this.tabs[i].addClassName(this.activeClass);this.contents[this.current].setStyle({display:"none",opacity:0});this.tabs[this.current].removeClassName(this.activeClass);this.contents[i].setStyle({display:"block"});new Effect.Opacity(this.contents[i],{from:0,to:1,transition:Effect.Transitions.sinoidal,duration:0.3,beforeStart:function(){this.isAnimating=true}.bind(this),afterFinish:function(){this.isAnimating=false;this.current=i}.bind(this)})}});var Slideshow=Class.create({initialize:function(options){this.slideshow=$(options.id);if(!this.slideshow){throw ("Attempted to initalize slideshow with undefined element: "+options.id)}this.slideClass=options.slideClass||"slide";this.duration=options.duration||6;options.navigation=options.navigation||false;this.slides=this.slideshow.select("."+this.slideClass);this.current=1;this.isAnimating=options.isAnimating||false;this.toExpand=null;this.animation=options.animation||true;if(options.navigation){options.event=options.event||"click";var nav=new Element("p",{id:"slideshow_nav"});this.slideshow.insert({bottom:nav});var e=null;for(var i=0;i<this.slides.length;){++i;e=new Element("a",{id:"slide"+i+"_link",href:"#"+this.slideshow.id}).update(i);if(i==this.current){e.addClassName("active")}e.observe(options.event,this.control.bindAsEventListener(this,i));nav.insert({bottom:e})}e=new Element("span",{id:"control_link",href:"#"+this.slideshow.id}).update("&gt;");e.observe(options.event,this.control.bindAsEventListener(this,0));nav.insert({bottom:e})}this.pe=new PeriodicalExecuter(this.animate.bind(this),this.duration)},control:function(e,i){if(this.isAnimating||this.current==i){return false}e.stop();this.pe.stop();if(i==0){if($("control_link").hasClassName("active")){$("control_link").removeClassName("active");this.pe=new PeriodicalExecuter(this.animate.bind(this),this.duration)}else{$("control_link").addClassName("active")}}else{$("control_link").addClassName("active");this.animate(i)}},animate:function(slide){var effects=[];var next=0;if(typeof slide=="number"){next=slide}else{next=(this.current==this.slides.length)?1:this.current+1}var currentBC=$("breadcrumbs");var copyBC=this.dupBreadCrumbs("breadcrumbs");currentBC.setStyle({backgroundImage:"url("+bcImages[this.current-1]+")"});copyBC.setStyle({backgroundImage:"url("+bcImages[next-1]+")",display:"none"});effects.push(new Effect.Fade(this.slides[this.current-1],{sync:true}));effects.push(new Effect.Appear(this.slides[next-1],{sync:true}));effects.push(new Effect.Fade(currentBC,{sync:true}));effects.push(new Effect.Appear(copyBC,{sync:true}));new Effect.Parallel(effects,{duration:1,queue:{position:"end",scope:this.slideshow.id+"Animation"},beforeStart:function(){this.isAnimating=true;$("slide"+this.current+"_link").removeClassName("active");$("slide"+next+"_link").addClassName("active")}.bind(this),afterFinish:function(){this.current=next;this.isAnimating=false;copyBC.setStyle({position:"static"});currentBC.remove()}.bind(this)})},dupBreadCrumbs:function(bcId){var bc=$(bcId).cloneNode(true);var dims=$(bcId).positionedOffset();var width=$(bcId).getStyle("width");bc.setStyle({top:dims[1]+"px",left:dims[0]+"px",position:"absolute",width:width});$(bcId).insert({before:bc});return bc}});