//document.old_onkeypress = document.onkeypress;
document.onkeypress = function(e)
{ 
//   document.old_onkeypress(e); 
   Key = window.event; 
   if (Key.keyCode == 10 || (Key.keyCode == 13 && Key.ctrlKey)) 
       insert_teg("[br]"); 
} 

function insert_teg(a) 
{
var form_id = event.srcElement.id;
 if(form_id != "")
 {
	if (document.getElementById(form_id).createTextRange) 
		{
		document.getElementById(form_id).focus();
		document.selection.createRange().duplicate().text = a;
		}
	else 
		{
		document.getElementById(form_id).value += a;
		}
 }
}

function alert_text(a)
{
alert(a);
}

function my_submit(a)
{ 
 document.all.value_submit.value = a;
 return true; 
}

function TextAreaLineNum(id, is_rows)
{
//alert(id);
var obj = document.getElementById(id);
//alert (obj.rows);
//var is_rows = obj.rows;
var rowHeight = obj.clientHeight/obj.rows;
var curHeight = obj.createTextRange().boundingHeight;
var count = parseInt(curHeight/rowHeight)+(obj.value!=''?1:0);
var count_is = obj.rows; 
obj.rows = count+1;
//alert (obj.rows);
if(count > 40)obj.rows = 40;
if(count < is_rows)obj.rows = is_rows;
}

function img_id(id, is_rows)
{
alert(id);
}
