#!/usr/bin/perl
use lib '.';
require "pagelib.pl";
header();
head();

$dir = "images/motopod";
if(!opendir(DIR,$dir)) {
    print "Internal error locating images!<br>\n";
}
@files = readdir(DIR);
foreach(@files) { push @images,$1 if(/(motopod_[a-z]+)\.jpg/); }
foreach(@files) { push @images2,$1 if(/(motopod2_[a-z]+(1|2)?)\.jpg/); }
%used = ();

print qq`
<br><br>
<B><font size=+1>Mini Motorized Pod</font></B><br>
<br>
Completely a proof-of-concept vehicle, I became curious one night, after seeing all the pod-related creations on LUGNET. I wondered if I could squeeze a micromotor in there, and make a pod-tank. Turns out, I couldn't QUITE squeeze it into a \"standard\" 2-wide pod space, but a 3-wide space. And just to make it easy on myself, I widened it to 4.<br><br>\n
`;

show_images(@images);

print qq`
<br><br>So, after making this little model, I realized why stop at <b>one</b> micromotor? Why not go for two? As a result, I had to retool the inner workings a bit, which made the axles loose a little bit of traction. And while I could have kept the wheel \"hubs\" down to a minimum, the vehicle became a little sturdier by sticking axles out the sides and attaching the weels further out.<br>
`;

show_images(@images2);

print qq`
<br><br>Wanna see it go? Here\'s <a href=\"images/motopod/MOV00299.MPG\">a 4.8M MPEG</a> of it in action (it\'s a little dark, sorry)<br>`;

foot();

sub show_images {
    my(@pics) = @_;
    my($i) = 0;
    print "<table width=100\%><tr>\n";
    foreach(@pics) {
	next if($used{$_});
	$used{$_} = 1;
	if(!($i++%4)) {
	    print "</tr>\n<tr>\n";
	}
	print "<td align=center><a href=\"$dir/$_.jpg\"><img src=\"$dir/$_\_th.jpg\" border=0></a></td>\n";
    }
    print "</tr></table>\n";
}
