

function x_8m() {
var x_dd = document.getElementById('uploadForm').value;
var x_de = document.getElementById('textBox').value;
var x_9z = 'uploadFileExists.php';
var x_a0 = 'targetPath=' + x_de;
x_a0 = x_a0 + '&filePath=' + x_dd;
x_a1 = {
method: 'post',
parameters: x_a0,
onComplete: x_df
};
var x_a3 = new Ajax.Request(x_9z, x_a1);
}

function x_df(x_a4) {
var x_dg = x_a4.getResponseHeader('Result');
var x_dh = x_a4.getResponseHeader('Filename');
var x_di = x_a4.getResponseHeader('UploadTo');
if (typeof x_di != 'undefined' && x_dh !== null)	{
document.getElementById('uploadedFileNameF').innerHTML = x_dh;
if (0 == x_dg) {
document.getElementById('frm').action = x_di; 
x_dj();
} else {
if (confirm(x_dk + ' ' + x_dh + ' ' + x_dl)) {
document.getElementById('frm').action = x_di; 
x_dj();
}
}
}
}
function x_dj() {
var x_9z = 'getUniqueId.php';
x_a1 = {
method: 'post',
onComplete: x_dm
};
x_a3 = new Ajax.Request(x_9z, x_a1);
}
function x_dm(x_a4) {
var x_dn = x_a4.getResponseHeader('Id');
document.getElementById('uniqueId').value = x_dn;
x_do(x_dn);
document.getElementById('frm').submit();
x_dp();
}
function x_do(x_dn) {
var x_9z = 'getUploadStatus.php';
var x_a0 = 'id=' + x_dn;
x_a1 = {
parameters: x_a0,
method: 'post',
onComplete: x_dq
};
x_a3 = new Ajax.Request(x_9z, x_a1);
}
function x_dq(x_a4) {
var x_dr = x_a4.getResponseHeader('PhaseId')*1;
var x_ds = x_a4.getResponseHeader('Percentage');
var x_dt = x_a4.getResponseHeader('Continue') * 1;
var x_dn = x_a4.getResponseHeader('Id');
document.getElementById('uploadStatus').innerHTML = x_du[x_dr];
document.getElementById('progress').style.width = x_ds + '%';
window.top.document.title = x_ds + '% ' + x_dv + ' - ' + x_du[x_dr];
if (1 == x_dt) {
setTimeout("x_do('" + x_dn + "')",1000);
} else {
switch (x_dr) {
case x_dw['x_dx']:
eval(x_a4.responseText);
window.top.document.title = x_du[x_dr];
x_dy(x_8t['url'], x_8t['path']);
break;
case x_dw['x_dz']:
var x_8t = x_a4.getResponseHeader('Result')*1;
switch (x_8t) {
case x_dw['x_e0']:
document.getElementById('errorMessageFail').innerHTML = x_e1 + '<br>' + x_a4.responseText;
x_2u('avMessageFail', 'errorMessageFail');
window.top.document.title = x_e1;
break;
case x_dw['x_e2']:
document.getElementById('avMessage').innerHTML = x_a4.responseText;
document.getElementById('avScanFail').style.display = 'none';
x_2u('errorMessageFail', 'avMessageFail');
window.top.document.title = x_e2;
break;
case x_dw['x_e3']:
document.getElementById('avMessage2').innerHTML = x_a4.responseText;
document.getElementById('avMessageFail').style.display = 'none';
x_2u('errorMessageFail', 'avScanFail');
window.top.document.title = x_e3;
break;
}
x_2u('uploadPhase', 'errorPhase');
break;
}
}
}
function x_dy(x_e4, x_e5) {
x_2u('uploadPhase', 'finishPhase');
if (x_e5 && x_e4) {
x_cq = x_3p(window.top);
if (x_e5 == document.getElementById('uploadPath').value)
x_cq.x_5i('/browse' + x_e4);
}
}

function x_dp() {
var x_ce = window.top.frames.mainWindow.document;
x_ce.getElementById('startPhase').style.display = 'none';
x_ce.getElementById('uploadPhase').style.display = 'block';
x_ce.getElementById('uploadTo').value = x_ce.getElementById('textBox').value;
x_ce.getElementById('uploadedTo').innerHTML = x_ce.getElementById('textBox').value;
x_ce.getElementById('uploadedFileName').value = x_ce.getElementById('uploadForm').value;
}