// JavaScript Document

function changeFeature(next){

	var bottom_img = document.getElementById('bottom_image');
	bottom_img.src = "/common/images/logos/"+feature_images[next];

	
	var attributes = { opacity: {to : 0} };
	var anim = new YAHOO.util.Anim('top_image', attributes, 1);
	
	anim.onComplete.subscribe(function(){
			 var top_img = document.getElementById('top_image');
				top_img.src = bottom_img.src;
				
				window.setTimeout(function(){
					YAHOO.util.Dom.setStyle(top_img, 'opacity', '1');
				}, 100);
				
				if(next >= feature_images.length-1){
					next = 0;
				}
				else{
					next ++;
				}				
				
				
				window.setTimeout(function(){
														 changeFeature(next);
														 }, 3000);	
	});
	anim.animate();


	

}



YAHOO.util.Event.onDOMReady(function(){
																		 
															window.setTimeout(function(){
														 	changeFeature(feature_start);
														 	}, 1000);
																		 
																		 
																		 
																		 });


