function getStyle(oElm, strCssRule){
	var strValue = "";
	if(document.defaultView && document.defaultView.getComputedStyle){
		strValue = document.defaultView.getComputedStyle(oElm, null).getPropertyValue(strCssRule);
	}
	else if(oElm.currentStyle){
		strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
			return p1.toUpperCase();
		});
		strValue = oElm.currentStyle[strCssRule];
	}
	return strValue;
}

function fieldChange(input, label, color){
  input.style.border = '1px solid ' + color; 
  document.getElementById(label).style.color = color;
}

function toggleSub(){
  var sub = document.getElementById('sub');
  var display = getStyle(sub, 'display');

  if(display == 'none'){
    sub.style.display = 'block';
  }else{
    sub.style.display = 'none';
  }
}
