function printIt(){ 
 if (window.print) {
  window.print() ; 
 }else{
  var browsername = '<OBJECT ID="browsername1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
  document.body.insertAdjacentHTML('beforeEnd', browsername);
  browsername1.ExecWB(6, 2);
 }
}

// popup window - require url, width, height and scrollbar yes/no
function goPopup(url, wdth, hgt, scroll) {
	window.open(url,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scroll + ',resizable=no,width=' + wdth + ',height=' + hgt + ',framemargin=0,leftmargin=0,topmargin=0,marginwidth=0,marginheight=0');
}

function TrackCount(fieldObj,countFieldName,maxChars)
{
  var countField = eval("fieldObj.form."+countFieldName);
  var diff = maxChars - fieldObj.value.length;

  // Need to check & enforce limit here also in case user pastes data
  if (diff < 0)
  {
    fieldObj.value = fieldObj.value.substring(0,maxChars);
    diff = maxChars - fieldObj.value.length;
  }
  countField.value = diff;
}

function LimitText(fieldObj,maxChars)
{
  var result = true;
  if (fieldObj.value.length >= maxChars)
    result = false;
  
  if (window.event)
    window.event.returnValue = result;
  return result;
}

function goPopupDetect(url, width, height, scrollWin) {
  var myTest = window.open("about:blank","","directories=no,height=100,width=100,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no");
  if (!myTest) {
    alert("In order to view the media player you will need to disable any popup blockers");
  } else {
    myTest.close();
	var winLeft = (screen.width - width) / 2;
	var winUp = (screen.height - height) / 2;
	win = window.open(url,'popup', 'toolbar=no, resizable=yes, scrollbars='+scrollWin+', width='+width+', height='+height+',left='+winLeft+',top='+winUp);
	win.focus();
  }
}