home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1998 Macromedia, Inc. All rights reserved.
-
- //*************** GLOBALS VARS *****************
-
- //******************* BEHAVIOR FUNCTION **********************
-
- //Displays a message in the status bar at the bottom of the
- //browser window. Passed the following arg:
- // msgStr - a string
- //
- //This simple function, passed a string, sets the status property.
- //This is especially useful for having links display a help message when
- //the mouse is over them. Normally, links display the HREF value, unless
- //we return "true". Because we could have many actions to a single event,
- //here we set a global return value, which gets returned after all
- //Action function calls, with an inserted "return(document.MM_returnValue)".
-
- function MM_displayStatusMsg(msgStr) { //v2.0
- status=msgStr;
- document.MM_returnValue = true;
- }
-
-
- //******************* 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_displayStatusMsg";
- }
-
-
-
- //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_displayStatusMsg('" + 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){
-