import java.awt.Container;

public class Class274 {

   static Class274 aClass274_3182 = new Class274();
   public static Class274 aClass274_3183 = new Class274();
   static Class274 aClass274_3184 = new Class274();
   public static Class274 aClass274_3185 = new Class274();
   static int anInt3186;


   public static Container method4851(int var0) {
      return (Container)(null != Class254.aFrame3020?Class254.aFrame3020:(null != Class268.aFrame3105?Class268.aFrame3105:Class393.anApplet4870));
   }

   static void method4852(int var0) {
      Class290.anIntArray3412 = Class225_Sub30.method13991(2048, 35, 8, 8, 4, 0.4F, true, -1496898428);
   }

   public static int method4853(int var0, int var1) {
      double var2 = (double)(var0 >> 16 & 255) / 256.0D;
      double var4 = (double)(var0 >> 8 & 255) / 256.0D;
      double var6 = (double)(var0 & 255) / 256.0D;
      double var8 = var2;
      if(var4 < var2) {
         var8 = var4;
      }

      if(var6 < var8) {
         var8 = var6;
      }

      double var10 = var2;
      if(var4 > var2) {
         var10 = var4;
      }

      if(var6 > var10) {
         var10 = var6;
      }

      double var12 = 0.0D;
      double var14 = 0.0D;
      double var16 = (var10 + var8) / 2.0D;
      if(var10 != var8) {
         if(var16 < 0.5D) {
            var14 = (var10 - var8) / (var10 + var8);
         }

         if(var16 >= 0.5D) {
            var14 = (var10 - var8) / (2.0D - var10 - var8);
         }

         if(var10 == var2) {
            var12 = (var4 - var6) / (var10 - var8);
         } else if(var4 == var10) {
            var12 = (var6 - var2) / (var10 - var8) + 2.0D;
         } else if(var6 == var10) {
            var12 = (var2 - var4) / (var10 - var8) + 4.0D;
         }
      }

      var12 /= 6.0D;
      int var18 = (int)(256.0D * var12);
      int var19 = (int)(256.0D * var14);
      int var20 = (int)(var16 * 256.0D);
      if(var19 < 0) {
         var19 = 0;
      } else if(var19 > 255) {
         var19 = 255;
      }

      if(var20 < 0) {
         var20 = 0;
      } else if(var20 > 255) {
         var20 = 255;
      }

      if(var20 > 243) {
         var19 >>= 4;
      } else if(var20 > 217) {
         var19 >>= 3;
      } else if(var20 > 192) {
         var19 >>= 2;
      } else if(var20 > 179) {
         var19 >>= 1;
      }

      return ((var18 & 255) >> 2 << 10) + (var19 >> 5 << 7) + (var20 >> 1);
   }

   static final void method4854(Class508 var0, byte var1) {
      var0.anInt6003 -= 196624946;
      int var2 = var0.anIntArray6027[var0.anInt6003 * -937710807];
      int var3 = var0.anIntArray6027[1 + var0.anInt6003 * -937710807];
      Class505 var4;
      if(var0.aBool6014) {
         var4 = var0.aClass505_6011;
      } else {
         var4 = var0.aClass505_6010;
      }

      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = var4.method8432(var0.aClass515_Sub1_Sub4_Sub4_6021.aClass121_10789, var2, var3, -639264019)?1:0;
   }

   static final void method4855(Class515_Sub1 var0, Class508 var1, byte var2) {
      boolean var3 = false;
      int var4 = 0;
      int var5 = 0;
      int var6 = 0;
      int var7 = 0;
      if(var0.aClass89Array8446 != null) {
         for(int var8 = 0; var8 < var0.aClass89Array8446.length; ++var8) {
            Class89 var9 = var0.aClass89Array8446[var8];
            if(var9.aBool886) {
               int var10;
               int var11;
               if(var9.anInt887 < var9.anInt884) {
                  var10 = var9.anInt887 - var9.anInt883;
                  var11 = var9.anInt884 + var9.anInt883;
               } else {
                  var10 = var9.anInt884 - var9.anInt883;
                  var11 = var9.anInt883 + var9.anInt887;
               }

               int var12;
               int var13;
               if(var9.anInt885 < var9.anInt888) {
                  var12 = var9.anInt885 - var9.anInt883;
                  var13 = var9.anInt888 + var9.anInt883;
               } else {
                  var12 = var9.anInt888 - var9.anInt883;
                  var13 = var9.anInt885 + var9.anInt883;
               }

               if(!var3 || var10 < var4) {
                  var4 = var10;
               }

               if(!var3 || var12 < var5) {
                  var5 = var12;
               }

               if(!var3 || var11 > var6) {
                  var6 = var11;
               }

               if(!var3 || var13 > var7) {
                  var7 = var13;
               }

               var3 = true;
            }
         }
      }

      var1.anIntArray6027[(var1.anInt6003 += 98312473) * -937710807 - 1] = var3?1:0;
      var1.anIntArray6027[(var1.anInt6003 += 98312473) * -937710807 - 1] = var4;
      var1.anIntArray6027[(var1.anInt6003 += 98312473) * -937710807 - 1] = var5;
      var1.anIntArray6027[(var1.anInt6003 += 98312473) * -937710807 - 1] = var6;
      var1.anIntArray6027[(var1.anInt6003 += 98312473) * -937710807 - 1] = var7;
   }

   public static void method4856(Class515_Sub1_Sub4_Sub4_Sub2 var0, int var1) {
      for(Class225_Sub46 var2 = (Class225_Sub46)Class225_Sub46.aClass456_8781.method7682((byte)85); var2 != null; var2 = (Class225_Sub46)Class225_Sub46.aClass456_8781.method7666(-1468075988)) {
         if(var2.aClass515_Sub1_Sub4_Sub4_Sub2_8809 == var0) {
            if(var2.aClass225_Sub12_Sub3_8792 != null) {
               Class118_Sub3.aClass225_Sub12_Sub5_8217.method16282(var2.aClass225_Sub12_Sub3_8792);
               var2.aClass225_Sub12_Sub3_8792 = null;
            }

            var2.method3857(-844847894);
            return;
         }
      }

   }
}
