public static Map loadProperties(String file) throws IOException {
      Map map = new HashMap();

      BufferedReader reader = null;
      UnicodeReader r = new UnicodeReader(new FileInputStream(file), null);
		
      try {
         reader = new BufferedReader(r);
         String line;
         while( (line=reader.readLine()) != null) {
            if (line.equals("")) continue; // empty line

            int idx = line.indexOf('=');
            if (idx < 1) continue;         // no name=value pair

            String key = line.substring(0, idx).trim();
            if (key.charAt(0) == '#') continue; // comment line

            String val = line.substring(idx+1).trim();
            
            map.put(key, val);  
         }
      } catch (IOException ex) {
         throw ex;
      } finally {
         try {
            reader.close(); r.close();
         } catch (Exception ex) { }
      }

      return map;
   }