var theArray=[];
       theArray[0] = 100;
       theArray[1] = 200;
       theArray[2] = 100;
       theArray[3] = 400;
       theArray[4] = 500;
       theArray[5] = 600;
       theArray[6] = 900;
       theArray[7] = 800;
       theArray[8] = 100;
 
       var max1 = 0;
       var max2 = 0;
       var max3 = 0;
 
       for (var i = 0; i < theArray.length; i++) {
           if (theArray[i] > max1) {
               max3 = max2;
               max2 = max1;
               max1 = theArray[i];
           } else if (theArray[i] > max2) {
               max3 = max2;
               max2 = theArray[i];
           } else if (theArray[i] > max3) {
               max3 = theArray[i];
           }
       }
 
        console.log("max1  :" + max1);
        console.log("max2  :" + max2);
        console.log("max3  :" + max3);