var dbArray = new Array() function getSection(section) { var children, i; section = section.toLowerCase(); for (sec in dbArray) { if (sec.toLowerCase() == section) return dbArray[sec]; } return null; } //used to filter keystrokes on input fields function clientKeyFilter(evt, x, encludeFunctionChars) { var k = evt.keyCode if( typeof(x) == "object" ){ if( String.fromCharCode(k).replace( x, "" ) == "" ) evt.returnValue = false } else { var f= new String(x) if ((encludeFunctionChars)&&(k<32)) retVal=true if (f.indexOf(String.fromCharCode(k) , 0) <= -1) evt.returnValue = false } } //used to filter paste action on input fields function clientPasteFilter(evt, x) { evt.returnValue = false var str = clipboardData.getData('text') var resStr var re if( typeof(x) == "object" ) { re = x; } else { re = new RegExp("[^"+x+"]","g"); } resStr = str.replace( re, "" ) evt.srcElement.value = resStr if( resStr.length != str.length ) { iwayMessageBox("Paste", "Note: Not all symbols were copied.") /*iwayLCLZ*/ } } function clientSendMail( mailto, subject, message ) { var mailStr = "mailto:"+mailto+"?subject="+clientEncodeUrlAsUTF8(subject)+"&body="+clientEncodeUrlAsUTF8(message) document.getElementById("mailhook").href = mailStr document.getElementById("mailhook").onclick() } var g_jobid, g_guiobj, g_callingWindow // [in] string callingWindow (optional) : name of a window that will handle the saving of the notes function clientUserNoteEdit( guiobj, jobid, canedit, selectivenotes, callingWindow, privilege) { if (typeof(privilege)=="undefined") { privilege = "" } if( typeof(selectivenotes)=="undefined" || selectivenotes=="") selectivenotes = "user-notes;common-notes" if ( (typeof(callingWindow)!="undefined") && (callingWindow!="") ) callingWindow = clientFindFrameAnyLevel(callingWindow) else callingWindow = null var common_notes = (callingWindow)?callingWindow.document.getElementById("common-notes").value:"" var params = { "custommode" : "usernotes", "jobid" : jobid, "common-notes" : common_notes, "canedit" : canedit, "selectivenotes" : selectivenotes, "privilege" : privilege } var dialogURL = "/newsway/versions/250/site/iway/app/noteedit/editDialog.asp"; var retnote = clientOpenDialog(dialogURL, params, 800, 600, "clientUserNoteEditCallback") g_jobid = jobid g_guiobj = guiobj g_callingWindow = callingWindow if (retnote==null) { return null; } return clientUserNoteEditCallback(retnote) } function clientUserNoteEditCallback(retnote) { document.getElementById("note_jobid").value = g_jobid clientUserNoteUpdate( retnote ,g_guiobj, g_callingWindow) return retnote; } // updates the note fields and changes the note icon // if calling window is null : submit the note changes // else let the calling window handle it function clientUserNoteUpdate( retnote, guiobj, callingWindow ) { var unEmptyNotes = 0, noteCount = 0 if (!callingWindow ) { document.getElementById("note_method").value = "save" document.getElementById("user_notes").value = "nochange" document.getElementById("common_notes").value = "nochange" document.getElementById("printer_notes").value = "nochange" } for(notetype in retnote) { if (retnote[notetype] != "nochange") { if (callingWindow) callingWindow.document.getElementById(notetype.replace("_","-")).value = retnote[notetype] else document.getElementById(notetype).value = retnote[notetype] noteCount++ if (retnote[notetype] != "") unEmptyNotes++; } } if( unEmptyNotes > 0 ) { if (!callingWindow) document.getElementById("note_form").submit() if( guiobj!=null ) { // make sure the icon is on guiobj.src = "/newsway/versions/250/site/iway/resources/general/note.gif" } } else { if( noteCount > 0 ) { if (!callingWindow) document.getElementById("note_form").submit() if( guiobj!=null ) { // make sure the icon is on guiobj.src = "/newsway/versions/250/site/iway/resources/general/noteempty.gif" } } } return retnote; }