window.onload = initUploadFormError; function initUploadForm() { var _s=getQueryVariable('s'); if(_s!=null){ if(type=="Redirect") parent.location=(_s=="1") ? document.getElementById('redirectonsuccess').value : document.getElementById('redirectonerror').value; else{ var msg=(_s=="1") ? 'SuccessMsg' : 'ErrorMsg'; document.getElementById(msg).style.display='block'; } } //Set the form action URL document.getElementById('sfUploadForm').action = ''; //Show and hide the appropriate elements document.getElementById('formLoadingContainer').style.display = 'none'; document.getElementById('uploadFormContainer').style.display = 'block'; } function initUploadFormError() { //Show and hide the appropriate elements document.getElementById('formLoadingContainer').style.display = 'none'; document.getElementById('uploadFormContainer').style.display = 'none'; document.getElementById('formErrorContainer').style.display = 'block'; } function startUploadProgress() { try { //Set the progress ID value var uniqueID = ''; var baseURL = 'http://vanprint.sharefile.com/'; //Show upload progress showUploadProgress(baseURL + '/ajax/uploadprogress.aspx', '?id=' + uniqueID); } catch(er) { } } function showUploadProgress(externalPage, args) { openWindow(externalPage + args, 400, 150, 'no'); } // Open a url in a new window function openWindow(url,width,height,scrollbars) { var leftoffset = (screen.width - width - 10)/2; var topoffset = (screen.height - width - 40)/2; window.open(url,'_blank','titlebar=no,resizable=no,scrollbars=' + scrollbars + ',width=' + width + ',height=' + height + ',left=' + leftoffset + ',top=' + topoffset); } function formatUpload(){ var isValid=true;var detailsText="";if(fields.length>0){for(i=0;ii && document.getElementById(validate[i]).value.length==0){alert('You must fill in the required fields.');isValid=false;return isValid;}if(isValid)detailsText+=labels[i]+": "+document.getElementById(fields[i]).value+", \n\r";}if(isValid)startUploadProgress();detailsText=detailsText.toString().substring(0,detailsText.lastIndexOf(','));document.getElementById('details').value=detailsText;}else if(isValid) startUploadProgress();return isValid; } function getQueryVariable(variable){ var query=window.location.search.substring(1);var vars=query.split("&"); for (var i=0;i