for(k=0;k<arr.length;k++)
{
for (j=1; j<=4;j++)
{
if(arr[k].substr(0,1)=="\u0020")
{
arr[k]=arr[k].slice(1)
}
}
mytext += arr[k] + ((k==(arr.length-1))? "" : String.fromCharCode(13,10));
}
with(sel){
sel.text = mytext;
collapse(true)
moveEnd("character",0)
moveStart("character",(mytext.length ) * -1)
select()
}
window.event.cancelBubble = true;
event.returnValue = false;
return;
}
if (event.keyCode == 9)
{
arr=mytext.split(String.fromCharCode(13,10))
mytext=""
for(j=0;j<arr.length;j++)
{
mytext += "\u0020\u0020\u0020\u0020" + arr[j] + ((j==(arr.length-1))? "" :
String.fromCharCode(13,10));
}
with(sel){
sel.text = mytext;
collapse(true)
moveEnd("character",0)
moveStart("character",(mytext.length -4) * -1)
select()
}
window.event.cancelBubble = true;
event.returnValue = false;
return;