function autoComplete (field, select, property, forcematch) {
 var found = false;
 for (var i = 0; i < select.options.length; i++) {
  if (select.options[i][property].toUpperCase().indexOf(field.value.toUpperCase()) == 0) {
   found=true; break;
  }
 }
 if (found) { select.selectedIndex = i; }
 else { select.selectedIndex = -1; }
 if (field.createTextRange) {
  if (forcematch && !found) {
          field.text=field.text.substring(0,field.text.length-1);
          return;
  }
  var cursorKeys ="8;46;37;38;39;40;33;34;35;36;45;";
  if (cursorKeys.indexOf(event.keyCode+";") == -1) {
          var r1 = field.createTextRange();
          var oldValue = r1.text;
          var newValue = found ? select.options[i][property] : oldValue;
          if (newValue != field.value) {
                  field.value = newValue;
                  var rNew = field.createTextRange();
                  rNew.moveStart('character', oldValue.length) ;
                  rNew.select();
          }
  }
 }
}

function popup(mylink, windowname) {
 if (! window.focus)return true;
 var href;
 if (typeof(mylink) == 'string')
   href=mylink;
 else
   href=mylink.href;
 window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
 return false;
}

function confirm_del(){ 
	if(confirm("ARE YOU SURE YOU WANT TO DELETE \\n\\n          OK=Yes - Cancel=No")){
		return true;
	}
	else {
		return false;
	}
}

function checkKey(oEvent){
  var oEvent = (oEvent)? oEvent : event;
  var oTarget =(oEvent.target)? oEvent.target : oEvent.srcElement;
  if(oTarget.type=="text" && oEvent.keyCode==13)
    //return false;
    oEvent.keyCode = 9;
}


