#!/bin/bash

HTML="player.html"

cat >$HTML <<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">

        <head>

                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

                <title>#openttdcoop PublicServer Webcam</title>

                <link rel="stylesheet" href="http://www.openttdcoop.org/templates/style.css" type="text/css" />
                <link rel="stylesheet" type="text/css" href="http://www.openttdcoop.org/templates/shadowbox/shadowbox.css" />
                <script type="text/javascript" src="http://www.openttdcoop.org/templates/shadowbox/shadowbox.js"></script>
                <script type="text/javascript">
                        Shadowbox.init({
                                handleOversize:"drag",
                                autoplayMovies:false,
                                counterType:"skip"
                        });
                </script>

        </head>

        <body>
EOF
echo "<a href="RubiAndCake.JPG" rel=\"shadowbox[webcam]\"><img src="RubiAndCake.JPG"></a>" >> $HTML
for i in `ls *.jpg *.JPG 2>/dev/null | grep -v RubiAndCake.JPG`; do
        echo "<a href=\"$i\" rel=\"shadowbox[webcam]\"></a>" >> $HTML
done

cat >>$HTML <<EOF
        </body>
</html>
EOF

