// clears and replaces text in form input fields and textareas
// -----------------------------------------------------------------
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}

function newDetailsWindow(htmlfile,width,height) {
	htmlWindow = window.open(htmlfile, 'newWin', 'width='+width+',height='+height+',toolbar=no,scrollbars=yes');
	htmlWindow.focus();
}



function toggleMore(span, style) {
  target = span.nextSibling;
  while (target.tagName != 'SPAN' && target.tagName != 'span') {
    target = target.nextSibling;
  }

  if (target.style.display == 'none' || target.style.display == '') {
    showMore(span, target, style);
  } else {
    showLess(span, target);
  }
}

function showMore(span, target, style) {
  span.innerHTML = '(close)';
  target.style.display = style;
}

function showLess(span, target) {
  span.innerHTML = '(read more)';
  target.style.display = 'none';
}
