var img = 0;

function equal_height(){
	max = 0;
	$each(arguments,function(el){
		h = $(el).getHeight();
		if(h > max) max = h;
	});
	$each(arguments,function(el){
		$(el).setStyle('height',max);
	});
}


function changeImg(){
	new Element('a',{
		href: imgs[img],
	html: '<img src="' + imgs[img] + '" width="150" />'
	}).inject($('randomImg').empty());
	img++;
	if(img >= imgs.length) img = 0;
}
changeImg.periodical(4000);

window.addEvent('domready',function(){
	
	equal_height('sidebar','text');
	changeImg();
	
});
