function get_random(x)
{
var ranNum = Math.floor(Math.random()*x);
return ranNum;
}
<!--
//The line to parse the value for "number" must be inside empty_bbox, so
//that it will not be loaded until the user has actually had a chance to
//enter something and click the button.
function empty_bbox() {
//"number" still exists as a string. It must be parsed into an integer
//variable using the parseInt function. parseInt will return a NaN (Not A
//Number) value if it processes a variable that is not a number.

var ub=10;
var lb=1;
var unum = parseInt(document.forms[0].number.value)
//The only way to check if a variable is NaN is by using the isNaN function.
//isNaN returns 1 if the analyzed variable is NaN, and 0 if it is not.
if (isNaN(unum)==1) { alert("You didn't enter a number!"); }
//if (isNaN(unum)==0) { alert("You entered the number: " + unum); }
if(unum >= lb && unum <= ub) {
rnum=get_random(ub)+1;
 //document.write(rnum); 
if(rnum==unum)
{
document.write('<div style="background:#000;text-align:center;">');
document.write('<img src="http://my-bigbox.com/images/openbigbox.png" alt="What Dat?" />');
document.write('<p style="color:#fff;padding:0 20px 20px 20px;text-align:center;font-size:150%;">This is Your Lucky Day!<br />You Get to');
document.write(' <a href="#"  style="color:#695d38;" onclick="window.open(\'http://my-bigbox.com/plogger/\'');
document.write(',\'_blank\',\'width=1024,height=625,menubar=0,toolbar=0,resizable=1,');
document.write('scrollbars=1\');">Open</a> the Big Box!</p></div>');
//document.write(unum);
}
else
{
//document.write(unum);
//document.write('<br /><br />Sorry, you guessed wrong!');
alert("WRONG...Guess Again!");
window.location.reload();
} //end unum test

} // 
else
{
alert("Error -- You must enter a number from 1 to 10!");
window.location.reload;
} //end input validation
} //end function
-->
