Hi,
As you've prob noticied, I'm not a javascript guru
I managed to put this together, based on some code I found on this forum, and my (little) bit of JS knowledge.
However, this gives an error
It seems to be due to this part;
Can anyone see my (most likely, obvious =)) boo boo?
NB: I'm from a perl background, so appologies if my mistake is a really simple one (i.e is elsif valid in JS? I know it is in Perl, but PHP using elsif .. which gets confusing sometimes <G>)
TIA!
Andy
As you've prob noticied, I'm not a javascript guru

I managed to put this together, based on some code I found on this forum, and my (little) bit of JS knowledge.
Code:
<script type="text/javascript" language="Javascript">
var maxSize = 400;
function getImg(src){
var oImg = new Image();
oImg.src = src;
var proportion = ( oImg.width > oImg.height ? oImg.width / maxSize : oImg.height / maxSize );
if (oImg.width <400) {
document.write('<img src="'+src+'">');
} elsif (oImg.height <3) {
document.write('<img src="'+src+'" width="25">');
} else {
var newHeight = oImg.height / proportion;
var newWidth = oImg.width / proportion;
document.write('<img src="'+src+'" width="'+newWidth+'" height="'+newHeight+'">');
}
}
</script>
However, this gives an error

Error: missing ; before statement
Source File: Line: 30, Column: 26
Source Code:
} elsif (oImg.height <3) {
It seems to be due to this part;
Code:
if (oImg.width <400) {
document.write('<img src="'+src+'">');
} elsif (oImg.height < 3) {
document.write('<img src="'+src+'" width="25">');
} else {
Can anyone see my (most likely, obvious =)) boo boo?
NB: I'm from a perl background, so appologies if my mistake is a really simple one (i.e is elsif valid in JS? I know it is in Perl, but PHP using elsif .. which gets confusing sometimes <G>)
TIA!
Andy