Random Quote Alert (JavaScript Animation)
Random Quote Alert (JavaScript Animation)
<SCRIPT language="JavaScript">
<!--
function get_random(maxNum)
{
if (Math.random && Math.round)
{
var ranNum= Math.round(Math.random()*(maxNum-1));
ranNum+=1;
return ranNum;
}
else
{
today= new Date();
hours= today.getHours();
mins= today.getMinutes();
secn= today.getSeconds();
if (hours==19)
hours=18;
var ranNum= (((hours+1)*(mins+1)*secn)%maxNum)+1;
return ranNum;
}
}
function getaQuote()
{
var maxQuotes=10;
var whichQuote=get_random(maxQuotes);
whichQuote--;
alert(quote[whichQuote]);
}
//-->
</SCRIPT>
<FORM name="form1">
<INPUT TYPE="button" value="Get a Quote!" onClick="getaQuote()">
</FORM>