protected void beforeGUI1(Form f) {
    try {
      HttpCon con12 = new HttpCon(null, PropertyClass.ServerUrl + "Allfrends");
      con12.SetContype(false, true, true);
      Thread t = new Thread(con12);
      synchronized (t) {
        t.start();
        t.wait();
      }
      final String bf[] = Splitter.Split(con12.getValue().toString(), "-");
      System.out.println(bf);
      final List l = (List) findByName("studentlist", f);

      for (int i = 0; i < bf.length - 1; i++) {

        l.addItem(Splitter.Split(bf[i], "/")[0]);
      }

      l.addActionListener(
          new ActionListener() {

            public void actionPerformed(ActionEvent ae) {
              frndid = Splitter.Split(bf[l.getSelectedIndex()], "/")[1];
              showForm("Userprofile", null);
            }
          });

    } catch (Exception e) {
      System.out.println(e);
    }

    super.beforeGUI1(f);
  }
  protected boolean onHtmlpasrecoverRetrieve() {

    try {
      String Email = Splitter.Split(new String(record.getRecord(4)), "-")[4];
      if (!Email.equals("n")) {
        HttpCon con =
            new HttpCon(
                new String(record.getRecord(1)) + "-" + Email,
                PropertyClass.ServerUrl + "PasswordRecvoer");
        con.SetContype(true, true, true);
        Thread t = new Thread(con);
        showContainer("AlertBox", null, null);
        synchronized (t) {
          t.start();
          t.wait();
        }

        ((TextField) findByName("status1", HTTPemailsender)).setText(con.getValue().toString());
      } else {
        ((TextField) findByName("status1", HTTPemailsender))
            .setText("Your password need not to retrive, it's default password");
      }
      Email = null;
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    boolean val = super.onHtmlpasrecoverRetrieve();
    return val;
  }
  protected void beforeDepartments(Form f) {
    department = f;
    Label l = (Label) findByName("Label2", f);
    try {
      HttpCon con12 =
          new HttpCon(
              String.valueOf(departmentPerson) + "-p",
              PropertyClass.ServerUrl + "DepartmentOffiecer");
      con12.SetContype(true, true, true);
      Thread t = new Thread(con12);
      synchronized (t) {
        t.start();
        t.wait();
      }

      String a[] = Splitter.Split(con12.getValue().toString(), "-");
      ((Label) findByName("Label3", f)).setText(a[4]);
      ((TextArea) findByName("aboutDepartmentt", f)).setText(a[0]);
      ((Label) findByName("name", f)).setText("Head Dept: " + a[1]);
      ((Label) findByName("Label7", f)).setText(a[2]);
      ((Label) findByName("Label8", f)).setText("Tel : " + a[3]);

      switch (departmentPerson) {
        case 1:
          l.setIcon(Image.createImage("/ceo.png").scaledHeight(78));

          break;
        case 2:
          l.setIcon(Image.createImage("/div1.png").scaledHeight(78));
          break;
        case 3:
          l.setIcon(Image.createImage("/div2.png").scaledHeight(78));
          break;
        case 4:
          l.setIcon(Image.createImage("/div3.png").scaledHeight(78));
          break;
        default:
          l.setIcon(Image.createImage("no_user.png").scaledHeight(78));
          break;
      }
      departmentPerson = 0;
      super.beforeDepartments(f);
      System.gc();
    } catch (Exception e) {
    }
  }
  public String sendEmial(String email, String title, String body) {
    HttpCon con12 =
        new HttpCon(email + "-" + title + "-" + body, PropertyClass.ServerUrl + "importantEmails");
    try {

      con12.SetContype(true, true, true);
      Thread t = new Thread(con12);
      synchronized (t) {
        t.start();
        t.wait();
      }

    } catch (Exception e) {
      System.out.println(e);
    }
    return con12.getValue().toString();
  }
  protected void beforeUserprofile(Form f) {
    try {
      ((Label) findByName("Label2", f)).setIcon(Image.createImage("/no_user.png").scaledHeight(72));
      HttpCon con12 = new HttpCon(frndid + "-p", PropertyClass.ServerUrl + "Frends");
      con12.SetContype(true, true, true);
      Thread t = new Thread(con12);
      synchronized (t) {
        t.start();
        t.wait();
      }
      String frnd[] = Splitter.Split(con12.getValue().toString(), "-");
      ((Label) findByName("Label4", f)).setText(frnd[0]);
      ((Label) findByName("Label6", f)).setText(frnd[1]);
      ((Label) findByName("tel", f)).setText("Tel   " + frnd[2]);
      ((Label) findByName("Label81", f)).setText("Address   " + frnd[3]);
      ((Label) findByName("Label7", f)).setText("email   " + frnd[4]);

    } catch (Exception ex) {
      ex.printStackTrace();
    }
    super.beforeUserprofile(f);
  }
  protected boolean onMyProfileSaveAll() {
    String pass = null;
    byte arr[] = null;

    if (checkpass.equals("+")) {
      try {
        pass = new String(record.getRecord(1));
        pass = Splitter.Split(pass, "-")[1];
      } catch (Exception e) {
      }

    } else {
      pass = checkpass;
    }

    if (!imgpath.equals("+")) {
      try {
        record.setRecord(2, imgpath.getBytes(), 0, imgpath.getBytes().length);
      } catch (RecordStoreException ex) {
        ex.printStackTrace();
      }
    }

    try {

      String userpass[] = Splitter.Split(new String(record.getRecord(1)), "-");

      byte userpsss[] = (userpass[0] + "-" + pass).getBytes();
      record.setRecord(1, userpsss, 0, userpsss.length);

      String record4 =
          name.getText()
              + "-"
              + index.getText()
              + "-"
              + tel.getText()
              + "-"
              + addr.getText()
              + "-"
              + email.getText()
              + "-"
              + group.getText();
      byte reco4[] = record4.getBytes();

      record.setRecord(4, reco4, 0, reco4.length);

      String id = (Splitter.Split(new String(record.getRecord(3)), "-")[1]);

      if (id.equals("0")) {

        HttpCon con2 = new HttpCon(record4 + "-" + pass, PropertyClass.ServerUrl + "addaUser");
        con2.SetContype(true, true, true);
        Thread t = new Thread(con2);
        synchronized (t) {
          t.start();
          t.wait();
        }

        String[] newid = Splitter.Split((new String(record.getRecord(3))), "-");
        userpsss = null;
        userpsss = (newid[0] + "-" + con2.getValue().toString() + "-" + newid[2]).getBytes();
        record.setRecord(3, userpsss, 0, userpsss.length);

      } else {
        HttpCon con12 =
            new HttpCon(record4 + ("-" + pass + "-" + id), PropertyClass.ServerUrl + "UpdateUser");

        con12.SetContype(true, true, true);
        Thread t = new Thread(con12);

        synchronized (t) {
          t.start();
          t.wait();
        }
      }
    } catch (Exception e) {
      System.out.println(e);
    }
    pass = null;
    arr = null;
    boolean val = super.onMyProfileSaveAll();
    return val;
  }