var chars = "NDRVEBGHLSYTKPZOIUCWMAQXFJ";
var string_length = 8;
var randomstring = '';
for (var i=0; i<string_length; i++) {
	var rnum = Math.floor(Math.random() * chars.length);
	randomstring += chars.substring(rnum,rnum+1);
}
function DrawBotBoot()
{
       BotSetCookie();
       PrintLine(randomstring);
       document.write("<BR \/><BR \/>");
       document.write("Please enter the security code above: ");
       document.write("<input id='BotBootInput' name='BotBootInput' type='text' maxlength='8' size='8'/>&nbsp;<img src='/images/requiredstar.jpg' height='9' width='10' />");
}
function ValidBotBoot()
{
       var d = document.getElementById('BotBootInput').value;
       if (d.toUpperCase() != randomstring.toUpperCase())
       {
           alert("ERROR: Enter security code as it is shown.");
	   document.getElementById('BotBootInput').focus();
	   return false;
       }
       else {
           return true;
       }
}
function PrintLine(imgString)
{
       var printline = imgString;
       lct = printline.toLowerCase();
       st = lct.replace(/\ /g,'_')
       dt = st.replace(/\./g,'-')
       splitline = dt.split('');
       imgline = splitline.join('_uppercase.gif"><img src="scripts/botboot/print\/');
       document.write('<img src="scripts/botboot/print\/'+imgline+'_uppercase.gif">');
}
function BotSetCookie()
{
       var exdate = new Date();
       var CookieValue = "WEB_2010_JOBAPP_FORM";
       exdate.setDate(exdate.getDate()+1);
       document.cookie = "BOTBOOT=" + escape(CookieValue) + ";expires=" + exdate.toGMTString();
}
