Tnx Adam.
I called this function on the " Body Onload"
But the problem is when the "chat_layout_message" is writing new sentence the focus of the page is change to this sentence.
This pic demonstrate the situation after clicking the red gif insert button (The page is jump to the new sentence)