function MM_isValidEmail(email){ var pattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; return pattern.test(trim(email)); } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&idefau){ rem.style.display = ""; }else{ rem.style.display = "none"; } } function MM_addRecipient(){ var table = document.getElementById("MM_recipient_table"); var num = eval(table.getAttribute("numRecipientRow")); var tr = table.rows[num-1]; var oCloneTr = document.getElementById("MM_recipient_clone_tr").cloneNode(true); oCloneTr.style.display = ""; oCloneTr.setAttribute("id",""); tr.parentNode.insertBefore(oCloneTr,table.rows[num]); table.setAttribute("numRecipientRow",num+1); MM_refreshRecipient(table); } function MM_remRecipient(){ var table = document.getElementById("MM_recipient_table"); var num = eval(table.getAttribute("numRecipientRow")); table.deleteRow(num-1); table.setAttribute("numRecipientRow",num-1); MM_refreshRecipient(table); } function MM_refreshRecipient(table){ var num = eval(table.getAttribute("numRecipientRow")); var max = eval(table.getAttribute("maxRecipient")); var defau = eval(table.getAttribute("defaultRecipient")); var add = document.getElementById("MM_AddRecipient"); var rem = document.getElementById("MM_RemRecipient"); if(max > num){ add.style.display = ""; }else{ add.style.display = "none"; } if(num>defau){ rem.style.display = ""; }else{ rem.style.display = "none"; } } function MM_SENDFILE_checkRecipients(element){ var result = 0; if(element.length){ for(var i=0;i 1000){ alert("Message too long"); return false; } return true; } function MM_SENDFILE_checkRecipient(obj){ obj.value = trim(obj.value); if(obj.value=="") return 0; if(MM_isValidEmail(obj.value)) return 1; return -1; } function MM_SENDFILE_submit(formName) { var f=document.forms[formName]; var recipients = f.recipient; if(!MM_SENDFILE_checkRecipients(recipients)) return; if(!MM_SENDFILE_checkMessageLength(f.message)) return; var formTable = document.getElementById("MM_sendfileTable"); var progress = document.getElementById("MM_progressTable"); var error = document.getElementById("MM_sendfile_error"); if(error!=null){ error.style.display = "none"; } formTable.style.display = "none"; progress.style.display = ""; MM_SENDFILE_checkProgress(); f.submit(); var loadingImage = document.getElementById("MM_loadingImage"); var src = loadingImage.src; var preloadedImg = new Image(); preloadedImg.src = src; loadingImage.src = preloadedImg.src; } function MM_ADDRECIPIENT_submit(formName) { var f=document.forms[formName]; var recipients = f.recipient; if(!MM_SENDFILE_checkRecipients(recipients)) return; if(!MM_SENDFILE_checkMessageLength(f.message)) return; f.submit(); } function testAjax(){ alert("test"); dojo.xhrGet( { // The following URL must match that used to test the server. url: "/_testajax.action?rand="+Math.random(), handleAs: "text", timeout: 5000, // Time in milliseconds // The LOAD function will be called on a successful response. load: function(response, ioArgs) { alert(response); return response; }, // The ERROR function will be called in an error case. error: function(response, ioArgs) { alert("error"); console.error("HTTP status code: ", ioArgs.xhr.status); return response; } }); } function MM_SENDFILE_displayProgress(tmpPiece){ var text = document.getElementById("MM_progressText"); var bar = document.getElementById("MM_progressBar"); var width = eval(tmpPiece[0]); bar.width = width * 3; text.style.display = ""; document.getElementById("MM_percent").innerHTML = tmpPiece[1]; document.getElementById("MM_currentByte").innerHTML = tmpPiece[3]; document.getElementById("MM_totalByte").innerHTML = tmpPiece[5]; document.getElementById("MM_remaining").innerHTML = tmpPiece[11]; } function MM_SENDFILE_checkProgress() { dojo.xhrGet( { url: "/member/_uploadProgress.action?rand="+Math.random(), handleAs: "text", timeout: 5000, // Time in milliseconds // The LOAD function will be called on a successful response. load: function(response, ioArgs) { //dojo.byId("MM_response").innerHTML = "['/member/_uploadProgress.action']"+response; if(response!=null && response!=""){ var tmpPiece = response.split(":"); var foundError=false; if(tmpPiece.length > 12){ foundError = true; //window.location.reload(); var f = document.sendfileForm; var qs = "?"; for(var i=0; i maxLength){ reminder.className = tooLongClass; }else { reminder.className = ''; } reminder.firstChild.nodeValue = currentLength; }