function formbuttonClassNew(obj, new_style) 
{
    obj.className = new_style;
}


function blockClassNew(obj, new_style) {
    obj.className = new_style;
}


function disableSubmit(btn,form) {
  var submitMessage = "Processing...";
  btn.value = submitMessage;
  btn.disabled = true;
  form.submit();
  return false;
}


function update_date (formObj) {
  timestamp1 = Date.UTC (formObj.cruise_year.value, formObj.cruise_month.value-1, formObj.cruise_day.value);
  timestamp2 = Date.UTC (formObj.cruise_year2.value, formObj.cruise_month2.value-1, formObj.cruise_day2.value);

  if (timestamp1 > timestamp2) {
    newdate = new Date(formObj.cruise_year.value, formObj.cruise_month.value, formObj.cruise_day.value-1);
    newYear = newdate.getYear()
    if (newYear < 1900) {
      newYear = newYear + 1900;
    }
    formObj.cruise_year2.selectedIndex  = getValueIndex(formObj.cruise_year2, newYear);
    formObj.cruise_month2.selectedIndex = getValueIndex(formObj.cruise_month2, newdate.getMonth()+1);
    formObj.cruise_day2.selectedIndex   = getValueIndex(formObj.cruise_day2, newdate.getDate());
  }
}


function getValueIndex(formObj, objVal) {
  for (lcv=0;lcv < formObj.length;lcv++) {
    if (formObj.options[lcv].value == objVal) return lcv;
  }
  return 0;
}

function checkform(thisForm) {
  port_string = new String(thisForm.portid.value);
  string_length = port_string.length;
  good_values = port_string.indexOf('X');
  if (string_length != 0 && good_values >= 0) {
    alert('Please select a port.');
    return false;
  }
  return true;
}



function initdt(mf) {
var t = new Date;
mf.cruise_month.value = t.getMonth() + 1;
mf.cruise_day.value = t.getDate() + 1;
mf.cruise_year.value = t.getFullYear();
mf.cruise_month2.value = t.getMonth() + 1;
mf.cruise_day2.value = t.getDate() + 8;
mf.cruise_year2.value = t.getFullYear();
}
