Dreamweaver provides a number of JavaScript functions you can add to your pages easily. No prior knowledge of JavaScript is required to use them. Macromedia calls these JavaScript actions behaviors . Behaviors can add interactivity to your site. Many times the behavior is triggered by some action of the user; for example, the behavior will happen when the user clicks a link or hovers over a link. Other behaviors happen without any overt action from the user , such as a browser check for a needed plug-in as a page loads. You add many behaviors with the Behaviors panel. There are also some behaviors available in the Insert Bar menu. And finally, Dreamweaver imports behaviors from other Macromedia Suite 8 software, such as Fireworks. In this chapter you'll learn how to use behaviors to add rollovers, open new windows , check for plug-ins, validate forms, insert jump and pop-up menus , and add navigation bars. Table 12.1 gives a full list of the available behaviors. Table 12.1. The behaviors available through Dreamweaver. Only the most commonly used are covered in this chapter, but you can add any of these to your page. Dreamweaver Behaviors | B EHAVIOR | D ESCRIPTION | Call JavaScript | Specify that a custom JavaScript should execute for a specific event. You can write the custom JavaScript yourself, or use one from the many available JavaScript libraries. | Change Property | Change the value of an object's properties. Only certain properties can be changed, and only in certain browsers. | Check Browser | Check the user's browser brand and version. Do this if you want to send the user to a page prepared especially for a certain browser. | Check Plugin | Send visitors to specific pages based on whether they have certain plug-ins installed. This only works in certain browsers. | Control Shockwave or Flash | Control whether to play, stop, rewind, or go to a frame in a Macromedia Shockwave or Macromedia Flash SWF file. | Drag Layer | Set up movable elements that users can drag. Attach this behavior to the document to make interactive puzzles, games , or sliders. | Go To URL | Open a new page in a specified window or frame or change the contents of two or more frames with one click. | Jump Menu | Create or edit a Jump Menu. Normally, you create a Jump Menu using Insert > Form Objects > Jump Menu, and merely use the Behaviors panel to edit it. | Open Browser Window | Open a URL in a new window. You can set the properties for the new window. | Play Sound | Play a sound for an event such as a page loading, a mouse moving over a link, or a mouse click. | Popup Message | Create a JavaScript alert with the message you specify, usually a brief informative statement. | Preload Images | Preload images that won't be seen right away, for example, images for rollovers. That way, there's no wait to see the image when the action is triggered. | Set Nav Bar Image | Edit the properties of navigation bar images. Normally, you create the nav bar using Insert > Image Objects > Navigation Bar. Use the Behaviors panel to control the display and actions of images in a navigation bar. | Set Text of Frame | Change the text display in a frame to the new content and formatting you specify. The new content can include text, HTML, and JavaScript functions. | Set Text of Layer | Replace the content and formatting of an existing layer with new content. The new content can include text, HTML, and JavaScript functions. | Set Text of Status Bar | Put a message in the browser's status bar. | Set Text of Text Field | Replace the content of a form's text field with new content. The new content can include text or JavaScript functions. | Show-Hide Layers | Show, hide, or restore the default visibility of one or more layers. | Show Pop-Up Menu | Create or edit a Dreamweaver pop-up menu or open and modify a Fireworks pop-up menu you've inserted in a Dreamweaver document. | Swap Image | Swap one image for another to create rollover effects or even swap more than one image at a time. | Swap Image Restore | Restore the last set of swapped images to their previous source files. If you leave the Restore option selected when you attach a Swap Image action, this action gets automatically added. | Validate Form | Check the contents of specified text fields to be sure the user has entered the proper type of data. You can also check whether the user entered something in a required field. | |