//Cross fading images script by Chris Blouch
//Version 1.0 2/21/08

var axs={
	ae_ct:0,
	ae:function(o,e,f){
		var m="addEventListener",a;
		if(o[m])o[m](e,f,false);
		else if((a=o.attachEvent)){
			var t="h"+axs.ae_ct++;
			o['s'+t]=f;
			o[t]=function(){o['s'+t](window.event)}
			a('on'+e,o[t]);
		}
	},
	id:function(id){return document.getElementById(id)}
}

var pics,st,a,b,current=0;

function slideinit(){
	var d="@aol.com",o;
	o=axs.id("pmail");
	o.innerHTML="DCOBPastor"+d;
	o.href="mailto:DCOBPastor"+d;
	o=axs.id("omail");
	o.innerHTML="DCOBOffice"+d;
	o.href="mailto:DCOBOffice"+d;
	pics=axs.id("slides").getElementsByTagName("p");
	setTimeout("fadenext();",1000);
}
function fadenext(){
	st=0;
	a=current;
	b=current+1;
	if(b==pics.length)b=0;
	current=b;
	step();
}
function step(){
	st+=.5;
	pics[a].style.opacity=((10-st)/10);
	pics[a].style.filter="alpha(opacity:"+(10-st)*10+")";
	pics[b].style.opacity=((st)/10);
	pics[b].style.filter="alpha(opacity:"+(st)*10+")";
	st<10?setTimeout("step()",40):setTimeout("fadenext()",3000);
}
function mapstart(){
	var map=new GMap2(document.getElementById("m"));
	var loc=new GLatLng(38.9992,-77.3426);
	map.setCenter(loc,17);
	map.setMapType(G_HYBRID_MAP);
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	map.addOverlay(new GMarker(loc));
	map.addOverlay(new GTrafficOverlay({incidents:true}));
}
