window.addEvent('domready', function(){
	
	$$('a[href^="http:"], a[href$=".pdf"]').set('target', '_blank');
	
	
	function nextImg(){
		this.counter++;
		if (this.counter >= this.images.length) this.counter = 0;
		this.images.setStyle('z-index', 1);
		this.images[this.counter].setStyle('z-index', 2);
	}
	
	var article = $$('.article')
	
	article.each(function(images, i){
		(function(){
			nextImg.periodical(5000, {
				images: images.getElements('.images img'),
				counter: 0
			});
		}).delay((5000 * (i / article.length)));
	});
	
	
});


