i am in need of help with writing a fairly simple piece of cod. basically i need to it take a number of yards and give me an output based on the number of yards.

this is what i have so far...

var yardsValue = document.write('<h2>' + 'The number of yards is '
+ Math.floor((Math.random()*100)+1) + '</h2>')
{
if (yardsValue > 0 && yardsValue < 10)
{
var yardsValue = 'The yards left to cover are'
+ yardsValue + 'and the play is to run the ball into the endzone'

}
else if (yardsValue >= 10 && yardsValue < 20)
{
var yardsValue = 'The yards left to cover are'
+ yardsValue + 'and the play is to throw the ball to a tight end'

}
else if (yardsValue >= 20 && yardsValue < 40)
{
var yardsValue = 'The yards left to cover are'
+ yardsValue + 'and the play is to throw the ball to a wide reciever'

}
else if (yardsValue >= 40 && yardsValue < 100)
{
var yardsValue = 'The yards left to cover are'
+ yardsValue + 'and the play is to punt the ball into opposition territory'

}
else if (yardsValue == 0 || yardsValue == 100)
{
alert('Invalid yards value entered')
}

alert(' ' + yardsValue)

}