// Decompiled by DJ v3.12.12.96 Copyright 2011 Atanas Neshkov  Date: 12.08.2011 2:53:57
// Home Page: http://members.fortunecity.com/neshkov/dj.html  http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3) 

import agent.JAgent;
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;

public final class b extends Form
    implements CommandListener, Runnable
{

    public b(String s, String s1, ad ad1)
    {
        super(s);
        a_java_lang_String_fld = s1;
        a_ad_fld = ad1;
        addCommand(y.B);
        addCommand(y.t);
        setCommandListener(this);
        x.c();
        a();
    }

    private void a()
    {
        (new Thread(this)).start();
    }

    public final void run()
    {
        HttpConnection httpconnection = null;
        DataInputStream datainputstream = null;
        try
        {
            int i = (httpconnection = (HttpConnection)Connector.open(a_java_lang_String_fld)).getResponseCode();
            deleteAll();
            if(i == 200)
            {
                datainputstream = httpconnection.openDataInputStream();
                byte abyte0[];
                int j;
                if((j = (int)httpconnection.getLength()) != -1 && j < 51200)
                {
                    abyte0 = new byte[j];
                    datainputstream.readFully(abyte0);
                } else
                {
                    ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
                    int k;
                    while((k = datainputstream.read()) != -1) 
                        bytearrayoutputstream.write(k);
                    abyte0 = bytearrayoutputstream.toByteArray();
                    bytearrayoutputstream.close();
                }
                Image image = Image.createImage(abyte0, 0, abyte0.length);
                append(image);
                append(new StringItem(v.a(68), String.valueOf(j)));
            } else
            {
                append(new StringItem(null, v.a(267)));
            }
        }
        catch(Exception exception)
        {
            insert(0, new StringItem("\u0424\u043E\u0440\u043C\u0430\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u043E\u0439", exception.getMessage()));
        }
        try
        {
            if(datainputstream != null)
                datainputstream.close();
            if(httpconnection != null)
                httpconnection.close();
        }
        catch(IOException _ex) { }
        x.f();
        JAgent.a.setCurrent(this);
    }

    public final void deleteAll()
    {
        super.deleteAll();
    }

    public final void commandAction(Command command, Displayable displayable)
    {
        if(command == y.B)
        {
            a_ad_fld.g();
            return;
        } else
        {
            a();
            return;
        }
    }

    private String a_java_lang_String_fld;
    private ad a_ad_fld;
}