
function compareFields(compareField1, compareField2, highLight1, highLight2) 
{
  var field1 = document.getElementById(compareField1);
  var field2 = document.getElementById(compareField2);
  var label1 = document.getElementById(highLight1);
  var label2 = document.getElementById(highLight2);

  if (field1 != null && field2 != null && label1 != null && label2 != null ) {
      if (field1.value != field2.value) {
          label1.style.color = 'red';
          label2.style.color = 'red';
      }
      else {
          label1.style.color = 'black';
          label2.style.color = 'black';
      }
  }
}