var timer = ""
var timerb = ""
var timerc = ""
var timerm = ""
var winwidth = ""
var mowe = 0
var mow = 1024
var fly = 0
var bird = 0
var rise = 5
var clowd = 0
var musi = 0
var mus = 0
var first = 1

function init()
{
if (document.body && document.body.clientWidth)
winwidth = document.body.clientWidth;
else if (window.outerWidth)
winwidth = window.outerWidth;
mow = winwidth
}

function resetmow()
{
if (document.body && document.body.clientWidth)
winwidth = document.body.clientWidth;
else if (window.outerWidth)
winwidth = window.outerWidth;
}

function mower()
{
mowe = 1
var mower = document.getElementById('mower');
mower.style.left = mow
mow = Math.round(mow*0.98)
timer = setTimeout("mower()",25)
if (mow<50)
{
clearTimeout(timer)
mowe = 0
if (first==1)
{
kloud()
}
first = 0
}
}

function mower2()
{
if (mowe==0 && clowd==0)
{
mowe = 1
mower3();
}
}

function mower3()
{
var mower = document.getElementById('mower');
mow = mow-2
mower.style.left = mow
timer = setTimeout("mower3()",25)
if (mow < -300)
{
clearTimeout(timer)
mow = winwidth
timer = setTimeout("mower()",1)
}
}

function kloud()
{
if (clowd==0 && mowe==0)
{
clowd = 1
var cloud = document.getElementById('cloud');
cloud.style.top = rise
timerc=setTimeout("kloud2()",1000)
}
}

function kloud2()
{
var cloud = document.getElementById('cloud');
cloud.style.top = rise--
timerc=setTimeout("kloud2()",10)
if (rise<-67)
{
clearTimeout(timerc)
rise = 5
clowd = 0
}
}

function humm()
{
if (bird==0)
humm2();
}

function humm2()
{
bird = 1
var hummer = document.getElementById('hummer');
fly = fly+1
hummer.style.left = fly-50
hummer.style.top = Math.round(((1000-fly)/7)-50)
timerb = setTimeout("humm2()",5)
if (fly>1000)
{
clearTimeout(timerb)
fly = 0
hummer.style.left = fly-50
bird = 0
}
}

function music1()
{
if (mus==0)
music2();
}

function music2()
{
mus = 1
var music = document.getElementById('music');
music.style.top = 150 + musi--
timerm=setTimeout("music2()",10)
if (musi<-800)
{
clearTimeout(timerm)
musi = 0
mus = 0
}
}
