function BubbleSort(arry, col)  {
  tmp = new Array();
  for (pass = 0; pass < arry.length; pass++)  {
    madeAchange = 0;
//if a numerical array column
    for (a = 0; a < arry.length-1; a++)  {
      if (col != 0 && !isNaN(arry[a][col]) )  {
        if (parseFloat(arry[a][col]) < parseFloat(arry[(a+1)][col]))  {
          for (i = 0 ; i < arry[a].length; i++)  {
            tmp = arry[a][i];
            arry[a][i] = arry[(a+1)][i];
            arry[(a+1)][i] = tmp;
          }
          madeAchange = 1;
        }
      }
//if an alphanumeric array column
      else  {

// extract name from <a><font><u> here </u></font></a> in tag (if there is background info on this product)
// if there is no background info on this product the copied value is compared
        var s1, s2;
        s1 = arry[a][col];
        s2 = arry[a+1][col];
// institution name
        if (col == 0)  {
/*       
        s1 = s1.replace(/<[^>]*a.*><font.*><u.*>(.*)<\/u *><\/font *><\/a *>/i, "$1");
        s2 = s2.replace(/<[^>]*a.*><font.*><u.*>(.*)<\/u *><\/font *><\/a *>/i, "$1");
*/       
          s1 = s1.replace(/<u.*>(.*)<\/u *>/i, "$1");
          s2 = s2.replace(/<u.*>(.*)<\/u *>/i, "$1");
          
          if (s1 > s2)  {
            for (i = 0 ; i < arry[a].length; i++)  {
              tmp = arry[a][i];
              arry[a][i] = arry[(a+1)][i];
              arry[(a+1)][i] = tmp;
            }
            madeAchange = 1;
          }
        }
// date
        else if (col == 1)  {
          if (s1 < s2)  {
            for (i = 0 ; i < arry[a].length; i++)  {
              tmp = arry[a][i];
              arry[a][i] = arry[(a+1)][i];
              arry[(a+1)][i] = tmp;
            }
            madeAchange = 1;
          }
        }
      }
    }
// if no changes made after first pass - arry is in order, leave loop
    if (! madeAchange)
      break;
  }
};