I am trying to carry out these functions on any text area in my document. My plan is to send the name value on the textarea to the function, then have the function manipulate it accordingly. The back_to_read_only function also require sending the content in the text area and the text areas name to another function.

Code:
<script type="text/javascript" language="javascript">

function back_to_read_only(textArea_id){
		//Set to read only
		var textArea_id                  = document.getElementById(textArea_id);
	      textArea_id.readOnly              = true;
		textArea_id.style.borderColor     ='#000000';
		textArea_id.style.fontSize        ='10px';
		textArea_id.style.fontFamily      ='Verdana';
		textArea_id.style.color           ='#666666';
		textArea_id.style.backgroundColor ='#FFFFFF';
		//show saving message
		document.getElementById('saving').style.display='inline';
		xajax_updateNotes(textArea_id, textArea_id.value);
}

function change_to_text_area(textArea_id){
	    //set to text area
	    var textArea_id                   = document.getElementById(textArea_id);
	    textArea_id.readOnly              = false;
		textArea_id.style.borderColor     ='#000000';
		textArea_id.style.fontSize        ='12px';
		textArea_id.style.fontFamily      ='Arial';
		textArea_id.style.color           ='#000000';
		textArea_id.style.backgroundColor ='#ECE9D8';
		textArea_id.focus();
}

</script>
And this is my code on the textarea:
Code:
<textarea name="varName" wrap="virtual" readonly id="ajotpad" ondblclick="change_to_text_area(varName);" onblur="back_to_read_only(varName);">My Text</textarea>
Any suggestions?

Thanks,
e39m5