//The script below generates a tracking request ID (myTrack, which becomes TrackingID in the form) for the email subject, and also a hexidecimal number
//(myHex, which becomes HexID in the form). It starts from January 1, 2005 at Midnight, written as 20050101000000 in the format of yyyymmddhhmms.
//The hex number is almost assuredly a unique identifer. DVF 2/2005
//Have recoded so only the HexID needs to be passed. 
window.onload=function ()
{
var now=new Date();
var nowFullYear=now.getFullYear().toString();
var nowMonth=now.getMonth() + 1; if (nowMonth < 10) {nowMonth="0" + nowMonth };
var nowDate=now.getDate(); if (nowDate < 10) {nowDate="0" + nowDate };
var nowHours=now.getHours(); if (nowHours < 10) {nowHours="0" + nowHours };
var nowMinutes=now.getMinutes(); if (nowMinutes < 10) {nowMinutes="0" + nowMinutes };
var nowSeconds=now.getSeconds(); if (nowSeconds < 10) {nowSeconds="0" + nowSeconds };
var myTrack = "AV Request " + nowFullYear +  "-" + nowMonth + "-" + nowDate + " " + nowHours + ":" + nowMinutes + ":" + nowSeconds;

var myKey= nowFullYear + nowMonth + nowDate + nowHours + nowMinutes + nowSeconds;
var myInteger=(myKey-0) - 20050101000000; //Start with January 1, 2005 so the hex key starts out much smaller. 
var myHex=myInteger.toString(16);
myHex=myHex.toUpperCase();
document.forms[document.forms.length-1].HexID.value = myHex;
document.forms[document.forms.length-1].TrackingID.value = myTrack;
alert(myHex); //just for displaying the value--delete in the main form. 
}
