");
prodID=parent.frames[1].prodID;for (var i = 1; i <= prodID.length; i++){
//alert(theProd + " " + prodID[i].name.toUpperCase());
if(prodName.toUpperCase() == prodID[i].name.toUpperCase()){
indexNum = i;
prodID[i].show(sWin,i);
match = true;
}
}
if(!match){
pTotal = new makeArray(prodID.length);
for (var i = 1; i <= prodID.length; i++){
var pSearch = prodName.toUpperCase();
var pInventory = prodID[i].name.toUpperCase();
for(var x = 1; x <= pSearch.length; x++){
if(pSearch.substring(0,x) == pInventory.substring(0,x)){
pTotal[i] = pSearch.substring(0,x);
}
}
};oldlen=0;
for (var i = 1; i <= prodID.length; i++){
// alert(pTotal[i] + " " + i);
if(pTotal[i] != "0"){ prodID[i].show(sWin,i);
if(pTotal[i].length >= oldlen){
oldlen = 1;// pTotal[i].length;
olditer = iter;
var iter = i;
}
}
}
if (oldlen!=1){sWin.write("No Match !");}// if(oldlen > 1){
//sWin.write("Nearest match was:
")
// indexNum = iter;
// prodID[iter].show(sWin,iter);
// if(olditer != 0){
// sWin.write("
Next closest match was:
")
// indexNum = olditer;
// prodID[olditer].show(sWin,olditer);
// }
// }else{
// sWin.write("No match!");
// }
}
sWin.write(