function openIcdPanel(){
icdPanel.style.display="block";
}

function icdLookup(){
var lookupText=new Array();
var roll;
var sroll;
var icdResult=new Array();
lookupText=document.getElementById("icd_lookup_text").value.split(",");
for (sroll=0;sroll<lookupText.length;sroll++) {
if (lookupText[sroll].charAt(0)==" ") lookupText[sroll]=lookupText[sroll].substr(1,lookupText[sroll].length-1)
if (lookupText[sroll].charAt(lookupText[sroll].length-1)==" ") lookupText[sroll]=lookupText[sroll].substr(0,lookupText[sroll].length-1)
}
for (roll=0;roll<codeTable[78].length;roll++) {
var dummy2=0;
for (sroll=0;sroll<lookupText.length;sroll++) {
if ((" "+codeTable[78][roll][0]+" "+codeTable[78][roll][1]+" "+codeTable[78][roll][2]+" "+codeTable[78][roll][3]+" "+codeTable[78][roll][4]+" ").toLowerCase().indexOf(lookupText[sroll].toLowerCase())!=-1) {
dummy2+=1;
sroll=lookupText.length;
}
if (dummy2>0) {
icdResult.push([roll,codeTable[78][roll][0],codeTable[78][roll][1],codeTable[78][roll][2],codeTable[78][roll][3],codeTable[78][roll][4]]);
}
}
}
icd_list.options.length=0;
for (roll=0;roll<icdResult.length;roll++) {
icd_list.options[roll]= new Option(icdResult[roll][parseInt(word)+2], icdResult[roll][0], false, false);
}
return false;
}

function icdTransfer(){
var roll;
var croll;
var icdTab;
var icdCrit;
for (croll=0;croll<criteriafield.length;croll++){
if (codesetVar[criteriafield[croll]]==78) {
icdCrit=croll;
for (roll=0;roll<icd_list.options.length;roll++){
icdTab=document.forms["criteria"].elements[croll].options[icd_list.options[roll].value].value
if (icd_list.options[roll].selected==true) document.forms["criteria"].elements[croll].options[icd_list.options[roll].value]= new Option(icd_list.options[roll].text, icdTab, false, true)
}
}
}
if (icd_list.options.selectedIndex==-1) {
var blankIcd=confirm(noneSelectMsg[word]);
if (blankIcd==true) icdPanel.style.display="none"
} else icdPanel.style.display="none"
cbochange(icdCrit);
}

function resetIcd(){
icd_list.options.selectedIndex=-1;
}

function clearIcd(){
icd_list.options.length=0;
}

function closeIcd(){
icdPanel.style.display="none";
}
