var checkboxHeight="25",radioHeight="25",selectWidth="200";document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: '+selectWidth+"px; opacity: 0; filter: alpha(opacity=0); z-index: 5; } .disabled { opacity: 0.5; filter: alpha(opacity=50); }</style>");var Custom={init:function(){var c=document.getElementsByTagName("input"),d=Array(),e,f,g;for(a=0;a<c.length;a++)if((c[a].type=="checkbox"||c[a].type=="radio")&&c[a].className=="styled"){d[a]=document.createElement("span");d[a].className=c[a].type;if(c[a].checked==1)if(c[a].type=="checkbox"){position="0 -"+checkboxHeight*2+"px";d[a].style.backgroundPosition=position}else{position="0 -"+radioHeight*2+"px";d[a].style.backgroundPosition=position}c[a].parentNode.insertBefore(d[a],c[a]);c[a].onchange=Custom.clear;if(!c[a].getAttribute("disabled")){d[a].onmousedown=Custom.pushed;d[a].onmouseup=Custom.check}else d[a].className=d[a].className+=" disabled"}c=document.getElementsByTagName("select");for(a=0;a<c.length;a++)if(c[a].className=="styled"){f=c[a].getElementsByTagName("option");g=f[0].childNodes[0].nodeValue;e=document.createTextNode(g);for(b=0;b<f.length;b++)f[b].selected==1&&(e=document.createTextNode(f[b].childNodes[0].nodeValue));d[a]=document.createElement("span");d[a].className="select";d[a].id="select"+c[a].name;d[a].appendChild(e);c[a].parentNode.insertBefore(d[a],c[a]);c[a].getAttribute("disabled")?c[a].previousSibling.className=c[a].previousSibling.className+=" disabled":c[a].onchange=Custom.choose}document.onmouseup=Custom.clear},pushed:function(){element=this.nextSibling;element.checked==1&&element.type=="checkbox"?this.style.backgroundPosition="0 -"+checkboxHeight*3+"px":element.checked==1&&element.type=="radio"?this.style.backgroundPosition="0 -"+radioHeight*3+"px":element.checked!=1&&element.type=="checkbox"?this.style.backgroundPosition="0 -"+checkboxHeight+"px":this.style.backgroundPosition="0 -"+radioHeight+"px"},check:function(){element=this.nextSibling;if(element.checked==1&&element.type=="checkbox"){this.style.backgroundPosition="0 0";element.checked=!1}else{if(element.type=="checkbox")this.style.backgroundPosition="0 -"+checkboxHeight*2+"px";else{this.style.backgroundPosition="0 -"+radioHeight*2+"px";group=this.nextSibling.name;inputs=document.getElementsByTagName("input");for(a=0;a<inputs.length;a++)inputs[a].name==group&&inputs[a]!=this.nextSibling&&(inputs[a].previousSibling.style.backgroundPosition="0 0")}element.checked=!0}},clear:function(){inputs=document.getElementsByTagName("input");for(var a=0;a<inputs.length;a++)inputs[a].type=="checkbox"&&inputs[a].checked==1&&inputs[a].className=="styled"?inputs[a].previousSibling.style.backgroundPosition="0 -"+checkboxHeight*2+"px":inputs[a].type=="checkbox"&&inputs[a].className=="styled"?inputs[a].previousSibling.style.backgroundPosition="0 0":inputs[a].type=="radio"&&inputs[a].checked==1&&inputs[a].className=="styled"?inputs[a].previousSibling.style.backgroundPosition="0 -"+radioHeight*2+"px":inputs[a].type=="radio"&&inputs[a].className=="styled"&&(inputs[a].previousSibling.style.backgroundPosition="0 0")},choose:function(){option=this.getElementsByTagName("option");for(d=0;d<option.length;d++)option[d].selected==1&&(document.getElementById("select"+this.name).childNodes[0].nodeValue=option[d].childNodes[0].nodeValue)}};window.onload=Custom.init;Util.namespace("AvonWalk.View.Home",function(){function h(){a++;a>3&&(a=1);switch(a){case 1:d.fadeOut(e);b.fadeIn(e);break;case 2:b.fadeOut(e);c.fadeIn(e);break;case 3:c.fadeOut(e);d.fadeIn(e)}setTimeout(h,f)}var a=1,b,c,d,e=500,f=4e3,g=function(){b=$("#page .slide1-content");c=$("#page .slide2-content");d=$("#page .slide3-content");setTimeout(h,f)};return{init:g}});Util.namespace("AvonWalk.View.AboutCity",function(){var a=function(){$("#slideshow .slides").cycle({fx:"fade",pager:"#pager"});$("#select-city").change(function(){var a=$(this).attr("value");a!="0"&&(window.location="/"+a+"/")})};return{init:a}});Util.namespace("AvonWalk.View.SimpleSlides",function(){var a=function(){$("#slideshow .slides").cycle({fx:"fade",pager:"#pager"})};return{init:a}});Util.namespace("AvonWalk.View.AboutFAQ",function(){var a,b=function(){a=$("#categories");$(".accordion").accordion({collapsible:!0,autoHeight:!1,active:!1});$("#categories-nav li a").filter(":first").addClass("active");$("#categories-nav li a").click(function(){var b=$(this).attr("href");$("#categories-nav li a").removeClass("active");$(this).addClass("active");$(".category",a).removeClass("active");$(b,a).addClass("active");return!1})};return{init:b}});Util.namespace("AvonWalk.View.WhereTheMoneyGoes",function(){var a,b=function(){a=$(".why-we-walk  .white_container").accordion({autoHeight:!1,active:!1,collapsible:!0,header:".city_container > a"});window.location.hash&&a.accordion("activate",window.location.hash);$(".footer a, .overlay .content a").click(function(){var b=$(this).attr("name");a.accordion("activate",b)});$(".map a").mouseenter(function(){var a=$(this).attr("class"),b=$("#overlay-"+a);b.show();b.mouseleave(function(){$(this).hide()})})};return{init:b}});Util.namespace("AvonWalk.View.NavHilight",function(){var a=function(a){a&&$("section.body nav").addClass(a)};return{hilight:a}});Util.namespace("AvonWalk.Placeholder",function(){var a=function(){$(".placeholder").each(function(){var a=$(this),b=a.val();a.focus(function(){a.val()==b&&a.val("")});a.blur(function(){a.val()==""&&a.val(b)})})};return{init:a}});$(document).ready(function(){$(".kern").lettering();$(".fancybox").fancybox();var a=$("#page"),b=a.data("view");AvonWalk.View[b]!=null&&AvonWalk.View[b].init();AvonWalk["Placeholder"]!=null&&AvonWalk.Placeholder.init();$("a").each(function(){var a=new RegExp("/"+window.location.host+"/"),b=new RegExp("/walk.avonfoundation.org/"),c=new RegExp("/info.avonfoundation.org/"),d=new RegExp("/www.avonwalk.org/"),e=new RegExp("/javascript:/");if(!a.test(this.href)&&!b.test(this.href)&&!c.test(this.href)&&!d.test(this.href)&&!e.test(this.href)){var f=$(this).attr("class");(typeof f=="undefined"||f.indexOf("fancybox")<0)&&$(this).click(function(a){a.preventDefault();a.stopPropagation();window.open(this.href,"_blank")})}})});
