//Beyer for HOCO Enterprises, LLC - 12/27/03
//Get Date-Time
var DateMonths=new initArray("January","February","March","April","May","June","July","August","September","October","November","December");
today=new Date();
month=DateMonths[today.getMonth()];
mo = today.getMonth();
day = today.getDate();
year = getFullYear(today);
var Digital = new Date();
var hours = Digital.getHours();
var minutes = Digital.getMinutes();
var seconds = Digital.getSeconds();
var number = year + ''; // previous value
var removechar = "200"; // character to remove from string

var yr2 = year + ''; //Change number to string for string function to work
yr2 = yr2.substring(+4,3);

 function initArray() {
  for(i=0;i<initArray.arguments.length; i++)
   this[i] = initArray.arguments[i];
}

//Correct Netscape 2 and 3 date problem
function getFullYear(y) { // y is a date object
 yr = y.getYear();
 if (yr < 1000)
  yr+=1900;
 return yr;
 }

//Display Order Number function
 function ordernum(){
  mo = mo + 1; 
  if (mo < 10) {mo= '0'+ mo;} 
  if (day < 10) {day= '0'+ day;} 
  if (hours == 0) {hours= '00';} 
  if (hours < 10) {hours= '0'+ hours;} 
  if (minutes < 10) {minutes= '0'+ minutes;} 
  order_number = (yr2 + '' + mo + '' + day + '' + hours + '' + minutes);
//  document.write(order_number);
}
function get_ordernum(){
   document.forms[0].ordernum.value = order_number;
}

//Display Approximate Shipping Date
 function shipdate_approx(sw){
mo1 = today.getMonth();
mo1 = mo1 + 1;
mo2 = mo1;
mo3 = mo1;
day1 = today.getDate();
  day2 = day1 + 21;
  day3 = day1 + 10;
  day1 = day1 + 14;
  year2 = year;
  year3 = year;
  year4 = year;
  if (mo1 == 12 || mo1 == 2 || mo1 == 4 || mo1 == 6 || mo1 == 7 || mo1 == 9 || mo1 == 11){   
     if (day1 > 31) {mo1 = mo1 + 1; day1 = day1 - 31;}
  }
  if (mo2 == 12 || mo2 == 2 || mo2 == 4 || mo2 == 6 || mo2 == 7 || mo2 == 9 || mo2 == 11){   
     if (day2 > 31) {mo2 = mo2 + 1; day2 = day2 - 31;}
  }
  if (mo3 == 12 || mo3 == 2 || mo3 == 4 || mo3 == 6 || mo3 == 7 || mo3 == 9 || mo3 == 11){   
     if (day3 > 31) {mo3 = mo3 + 1; day3 = day3 - 31;}
  }
  if (mo1 == 3 || mo1 == 5 || mo1 == 8 || mo1 == 10){   
     if (day1 > 30) {mo1 = mo1 + 1; day1 = day1 - 30;}
  }
  if (mo2 == 3 || mo2 == 5 || mo2 == 8 || mo2 == 10){   
     if (day2 > 30) {mo2 = mo2 + 1; day2 = day2 - 30;}
  }
  if (mo3 == 3 || mo3 == 5 || mo3 == 8 || mo3 == 10){   
     if (day3 > 30) {mo3 = mo3 + 1; day3 = day3 - 30;}
  }
  if (mo1 == 1){ 
     if (day1 > 28) {mo1 = mo1 + 1; day1 = day1 - 28;}
  }
  if (mo2 == 1){ 
     if (day2 > 28) {mo2 = mo2 + 1; day2 = day2 - 28;}
  }
  if (mo3 == 1){ 
     if (day3 > 28) {mo3 = mo3 + 1; day3 = day3 - 28;}
  }
  if (mo1 > '12') {mo1 = '1'; year2 = year + 1} 
  if (mo2 > '12') {mo2 = '1'; year3 = year + 1}
  if (mo3 > '12') {mo3 = '1'; year4 = year + 1}  
  ship_approx_date = (mo1 + '/' + day1 + '/' + year2);
  ship_approx_date2 = (mo2 + '/' + day2 + '/' + year3);
  ship_approx_date3 = (mo3 + '/' + day3 + '/' + year4);
  if (sw == 1){document.writeln(ship_approx_date);}
  if (sw == 2){return ship_approx_date;}
  if (sw == 3){document.writeln(ship_approx_date2);}
  if (sw == 4){document.writeln(ship_approx_date3);}
 }
 //Display date function
 function displaydate(){document.write(month + " " + day + ", " + year); idate = month + " " + day + ", " + year;}

//Display State in Unites States
 function states(){
  document.write('<option selected value="none">Select');
  document.write('<option>AK <option>AL <option>AR <option>AZ <option>CA <option>CO');
  document.write('<option>CT <option>DC <option>DE <option>FL <option>GA <option>HI <option>IA');  
  document.write('<option>ID <option>IL <option>IN <option>KS <option>KY <option>LA <option>MA');
  document.write('<option>MD <option>ME <option>MI <option>MN <option>MO <option>MS');
  document.write('<option>MT <option>NC <option>ND <option>NE <option>NH <option>NJ');
  document.write('<option>NM <option>NV <option>NY <option>OH <option>OK <option>OR');
  document.write('<option>PA <option>RI <option>SC <option>SD <option>TN <option>TX');
  document.write('<option>UT <option>VA <option>VT <option>WA <option>WI <option>WV <option>WY');
}

//  End -->

