+ message = response.statusText || 'Brak połączenia z serwerem';
+ level = "error";
+ }
+
+ return {error_message: message, error_level: level};
+}
+
+function parseXHRResponse(xhr) {
+ var response = {}
+
+ if(xhr.status >= 200 && xhr.status < 300)
+ {
+ response.success = true;
+ try {
+ response.data = $.evalJSON(xhr.responseText);
+ } catch(e) {
+ response.data = {};
+ }
+
+ return response;