Event.observe(document, 'dom:loaded', function(){ 
	$$('img').each(function(s) {
		if( parseInt(s.getWidth())>300 ){
			s.setStyle({ width: parseInt(s.getWidth())/2 + 'px',
						height: parseInt(s.getHeight())/2 + 'px'
			});
		}
	});

});
