").appendTo(t.errorLog);
else {
t.selectedFiles++, t.existingFileNames.push(r[o].name);
var l = e.extend({}, a),
u = new FormData,
p = a.fileName.replace("[]", "");
u.append(p, r[o]);
var c = a.formData;
if (c)
for (var h = i(c), f = 0; f < h.length; f++) h[f] && u.append(h[f][0], h[f][1]);
l.fileData = u;
var w = new m(t, a),
g = "";
g = a.showFileCounter ? t.fileCounter + a.fileCounterStyle + r[o].name : r[o].name, a.showFileSize && (g += " (" + s(r[o].size) + ")"), w.filename.html(g);
var C = e("");
C.appendTo("body");
var b = [];
b.push(r[o].name), v(C, l, w, b, t, r[o]), t.fileCounter++
} else a.showError && e("
").appendTo(t.errorLog)
}
function n(e, a, t) {
var r = a.allowedTypes.toLowerCase().split(/[\s,]+/g),
o = t.split(".").pop().toLowerCase();
return !("*" != a.allowedTypes && jQuery.inArray(o, r) < 0)
}
function d(e, a) {
var t = !1;
if (e.existingFileNames.length)
for (var r = 0; r < e.existingFileNames.length; r++)(e.existingFileNames[r] == a || w.duplicateStrict && e.existingFileNames[r].toLowerCase() == a.toLowerCase()) && (t = !0);
return t
}
function u(e, a) {
if (e.existingFileNames.length)
for (var t = 0; t < a.length; t++) {
var r = e.existingFileNames.indexOf(a[t]); - 1 != r && e.existingFileNames.splice(r, 1)
}
}
function p(e, a) {
if (e) {
a.show();
var t = new FileReader;
t.onload = function(e) {
a.attr("src", e.target.result)
}, t.readAsDataURL(e)
}
}
function c(a, t) {
if (a.showFileCounter) {
var r = e(t.container).find(".ajax-file-upload-filename").length;
t.fileCounter = r + 1, e(t.container).find(".ajax-file-upload-filename").each(function(t, o) {
var s = e(this).html().split(a.fileCounterStyle),
i = (parseInt(s[0]), r + a.fileCounterStyle + s[1]);
e(this).html(i), r--
})
}
}
function h(t, r, o, s) {
var i = "ajax-upload-id-" + (new Date).getTime(),
d = e(""),
u = "";
o.multiple && (o.fileName.indexOf("[]") != o.fileName.length - 2 && (o.fileName += "[]"), u = "");
var p = e(u).appendTo(d);
p.change(function() {
t.errorLog.html("");
o.allowedTypes.toLowerCase().split(",");
var i = [];
if (this.files) {
for (g = 0; g < this.files.length; g++) i.push(this.files[g].name);
if (0 == o.onSelect(this.files)) return
} else {
var u = e(this).val(),
p = [];
if (i.push(u), !n(t, o, u)) return void(o.showError && e("
" + u + " " + o.extErrorStr + o.allowedTypes + "
").appendTo(t.errorLog));
if (p.push({
name: u,
size: "NA"
}), 0 == o.onSelect(p)) return
}
if (c(o, t), s.unbind("click"), d.hide(), h(t, r, o, s), d.addClass(r), o.serialize && a.fileapi && a.formdata) {
d.removeClass(r);
var f = this.files;
d.remove(), l(o, t, f)
} else {
for (var w = "", g = 0; g < i.length; g++) o.showFileCounter ? w += t.fileCounter + o.fileCounterStyle + i[g] + " " : w += i[g] + " ", t.fileCounter++;
if (-1 != o.maxFileCount && t.selectedFiles + i.length > o.maxFileCount) return void(o.showError && e("