home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1998 Macromedia, Inc. All rights reserved.
-
- //*************** GLOBALS VARS *****************
-
- //******************* BEHAVIOR FUNCTION **********************
-
- //Passed a string, function calls alert() to popup a message.
-
- function MM_popupMsg(theMsg) { //v2.0
- alert(theMsg);
- }
-
-
- //******************* API **********************
-
-
- //Can be used with any tag and any event
-
- function canAcceptBehavior(){
- return true;
- }
-
-
-
- //Returns a Javascript function to be inserted in HTML head with script tags.
-
- function behaviorFunction(){
- return "MM_popupMsg";
- }
-
-
-
- //Returns fn call to insert in HTML tag <TAG... onEvent='thisFn(arg)'>
- //Calls escQuotes to find embedded quotes and precede them with \
-
- function applyBehavior() {
- var msgStr = escQuotes(document.theForm.message.value);
- if (msgStr == '') {
- return MSG_NoMsg;
- } else {
- return "MM_popupMsg('" + msgStr + "')";
- }
- }
-
-
-
- //Passed the function call above, takes prior arguments and reloads the UI.
- //Removes any escape characters "\"
-
- function inspectBehavior(msgStr){
- var startStr = msgStr.indexOf("'") + 1;
- var endStr = msgStr.lastIndexOf("'");
- if (startStr > 0 && endStr > startStr) {
- document.theForm.message.value = unescQuotes(msgStr.substring(startStr,endStr));
- }
- }
-
-
-
- //***************** LOCAL FUNCTIONS ******************
-
-
- //Set the insertion point
-
- function initializeUI(){
- document.theForm.message.focus(); //set focus on textbox
- document.theForm.message.select(); //set insertion point into textbox
- }
-
-
-
- //**************** GENERIC FUNCTIONS ****************
-
- //function escQuotes(theStr){
- //function unescQuotes(theStr){
-