<html>
<head>
<style type="text/css">
.Point {
position: absolute;
top: 150px;
left: 20px;
}
</style>
<script type="text/javascript">
var modus = 0;
var topmode = 0;
var leftpos = 20;
var toppos = 150;
var vspeed = 10;
var hspeed = 1;
var a = 50;
function pendeln() {
if (modus == 0) {
window.document.getElementById("Dot").style["left"] = leftpos;
window.document.getElementById("Dot").style["top"] = toppos;
if (topmode == 0) {
toppos += vspeed;
if (toppos > (150+a)) topmode = 1;
} else {
toppos -= vspeed;
if (toppos < (150-a)) topmode = 0;
}
leftpos += hspeed;
if (leftpos > 800) modus = 1;
} else {
window.document.getElementById("Dot").style["left"] = leftpos;
window.document.getElementById("Dot").style["top"] = toppos;
if (topmode == 0) {
toppos += vspeed;
if (toppos > (150+a)) topmode = 1;
} else {
toppos -= vspeed;
if (toppos < (150-a)) topmode = 0;
}
leftpos -= hspeed;
if (leftpos < 20) modus = 0;
}
setTimeout("pendeln()", 1);
}
</script>
</head>
<body onLoad="pendeln();">
<span class="Point" id="Dot">o</span>
</body>
</html>