

// calcEstDel takes in a leadtime and range variable (integer) and writes the formatted date to screen
// the date is calculated using current date + leadtime, and current date + leadtime + range

function calcEstDel(inLeadtime, inRange)
{

<!-- Begin
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var curTime=new Date();
var curTime2=new Date();

// lttoship and range must be grabbed from product variables
// or i can use shipservice.  ex. range = if (shipservice = "Ground Shipping" or shipservice = "dropship - standard" or shipservice = "postal service", 5, 7)

var lttoship = inLeadtime;
var range = inRange;

curTime.setDate(curTime.getDate()+lttoship);
curTime2.setDate(curTime2.getDate()+lttoship+range);

var txtMonth=months[curTime.getMonth() + 1];
var date=curTime.getDate();
var year=curTime.getYear();

var txtMonth2=months[curTime2.getMonth() + 1];
var date2=curTime2.getDate();
var year2=curTime2.getYear();

if (year < 2000)
year = year + 1900;

if (year2 < 2000)
year2 = year2 + 1900;


document.write(txtMonth + " ");
document.write(date + ", " + year + " - ");

document.write(txtMonth2 + " ");
document.write(date2 + ", " + year2);


// End -->
}
