private void loadConfig() {
        if (!xml.Load()) return;
        
        //load IP
        int IPsCount;
        try {
            langValues.put("Language", xml.getValueThrows("Config", "Language"));
        } catch (XPathExpressionException ex) {
            langValues.put("Language", "en");
        }
        
        try {
            xmlLang = new Xml(xml.getValueThrows("Config", "LanguageFile"), langValues.get("Language"));
        } catch (XPathExpressionException ex) {
            File is = new File("language.xml");
            if (is.exists()) xmlLang = new Xml("language.xml", langValues.get("Language"));
        }
        
        if (xmlLang!=null) xmlLang.Load();
        
        try {
            IPsCount = Integer.parseInt(xml.getValueThrows("Config", "IpCount"));
        } catch (XPathExpressionException ex) {
            System.out.println("IPscount not loaded");
            IPsCount=0;
        }

        for (int i=1; i<=IPsCount; i++) {
            try {
                String IP = xml.getValueThrows("Config", "IP_"+i);
                app.getIpModul().addElement(IP);
            } catch (XPathExpressionException ex) {
                Logger.getLogger(BridgeAppCode.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

        app.setLastIp(xml.getValue("Config", "LastIp"));
        
        //load port          
        app.setPort(xml.getValue("Config", "Port"));
        
        String photos=xml.getValue("Config", "AutoPhotos");
        if (photos.equals("True")) {
            app.setAutoPhotos(true);
        }
        else {
            app.setAutoPhotos(false);
        }
        app.setAutoPhotosTime(xml.getValue("Config", "AutoPhotosTime"));
    }