<!--
check0 = new Image(10, 10);
check0.src = "/html/img/icons/checkbox0.gif";
check1 = new Image(10, 10);
check1.src = "/html/img/icons/checkbox1.gif";

radio0 = new Image(10,10);
radio0.src = '/html/img/icons/checkbox0.gif';
radio1 = new Image(10,10);
radio1.src = '/html/img/icons/checkbox1.gif';


function swapCheckbox(a) {
 ref = eval('document.imgbox' + a);
 if(ref.src == check0.src) {
  ref.src = check1.src;
  eval('document.form1.dropreg' + a + '.value=1');
 } else {
  ref.src = check0.src;
  eval('document.form1.dropreg' + a + '.value=0');
 }
}

function swapRadiobutton(imagename, nr, formname, variablename, variablevalue) {
 if(eval('document.'+imagename+nr).src == radio0.src) {
  var i = 1;
  ref = eval('document.'+imagename+i);
  while(typeof ref != 'undefined') {
//  while(eval('document.'+imagename+i).src != "") {
//  while(i < 3) {
   eval('document.'+imagename+i).src = radio0.src;
   i = i + 1;
   ref = eval('document.'+imagename+i);
  }

  eval('document.'+imagename+nr).src = radio1.src;
  eval('document.'+formname+'.'+variablename).value = variablevalue;
 }
}

function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function importFile(sid,elm) {
  w=window.open('./?sid='+sid+'&pid=importFile&toField='+elm,'geturl','toolbars=no,scrollbars=yes,resizable=yes,status=yes,width=790,height=550');
  w.focus();
}

function selectFile(elm,url) {
 eval('window.opener.document.all.'+elm).value=url.substring(0,url.length);
 eval('window.opener.document.all.'+elm).focus();
 window.close();
}

// function insertText(txt,form,field) {
 // eval('document.'+form+'.'+field).value += " "+txt+" ";
 // eval('document.'+form+'.'+field).focus();    
 //field.value += " "+txt+" ";
// }

function insertText(text,formName,fieldName) {
  var txtarea = eval('document.'+formName+'.'+fieldName);
  text = ' ' + text + ' ';
  if (txtarea.createTextRange && txtarea.caretPos) {
    var caretPos = txtarea.caretPos;
    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
    txtarea.focus();
  } else {
    txtarea.value  += text;
    txtarea.focus();
  }
}

//-->
