<a href="http://www.livewetter.org/"><img id="wetterbild1" width="200" height="150" /></a> <br>
<a href="http://www.livewetter.org/"><img id="wetterbild2" width="200" height="150" /></a>
<script>
function adjVal(v) {
if (v < 10) v = "0" + v;
return v;
}
function getUrls(now) {
var now = new Date();
var fullYear = now.getUTCFullYear(),
year = fullYear - 2000;
var month = adjVal(now.getUTCMonth() + 1);
var date = adjVal(now.getUTCDate());
var hour = now.getUTCHours();
var hour6 = adjVal(Math.floor(hour / 6) * 6);
hour = adjVal(hour);
var url1 = "http://www.zamg.ac.at/fix/wetter/bodenkarte/"
+ fullYear + "/" + month + "/" + date + "/BK_BodAna_Sat_"
+ year + month + date + hour6 + "00.png";
//+ year + month + date + "0000.png";
var url2 = "http://www.zamg.ac.at/dyn/pictures/Hsatimg/H"
+ year + month + date + hour + "00.gif";
//+ year + month + date + "0000.gif";
return [url1, url2];
}
document.getElementById("wetterbild1").addEventListener("error", function () {
if (zaehler1 < 10) {
now1.setUTCHours(now1.getUTCHours() - 6);
this.src = getUrls(now1)[0];
zaehler1++;
}
});
document.getElementById("wetterbild2").addEventListener("error", function () {
if (zaehler2 < 10) {
now2.setHours(now2.getHours() - 1);
this.src = getUrls(now2)[1];
zaehler2++;
}
});
var now1 = new Date(), now2 = new Date(),
zaehler1 = 0, zaehler2 = 0;
var urls = getUrls(now1);
document.getElementById("wetterbild1").src = urls[0];
document.getElementById("wetterbild2").src = urls[1];
</script>