On a single page, I have 2 functions: 1) one is similar to a FB wall, where users click to post a comment and the textarea appears on click and posts on submission 2) it's a modal window that opens on click and users enter text and submits, and on submit, the modal window closes and a particular section where the comment is displayed updates automatically The below code is what's at the very top of the page, which are lines 1-7. When line 5 is in its current position, option 1 above works as expected, but option 2 does not work properly. On submit, the modal window does not close and the page doesn't refresh automatically. However, if I move line 5 and place it on line 1, option 2 works as expected, but on option 1, the textarea does not appear on click and users can't post. If you can figure out a solution, let me know. Thanks. <scripttype="text/javascript"src="ajax/modal_window/js/ajax.js"></script> <scripttype="text/javascript"src="ajax/modal_window/js/modal-message.js"></script> <scripttype="text/javascript"src="ajax/modal_window/js/ajax-dynamic-content.js"></script> <scripttype="text/javascript"src="ajax/prototype.js"></script> <scripttype="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <scripttype="text/javascript"src="js/jquery.oembed.js"></script> <scripttype="text/javascript"src="js/wall.js"></script> Code (markup):