function dynamicText(obj, type, box){
    var str = obj.value; //Get the string inside the textarea

    // Perform loop to remove and save english words within @@ tags
    var engarr = new Array();
    var i = 0;
    while (str.match(/@@([^@]+)@@/)){
        engarr[i] = RegExp.$1;
	str = str.replace(/@@([^@]+)@@/, '!'+i+'!');
	i++;
    }

    var trans = "";
    if(type == '1'){
        str = str.toLowerCase(); //Change uppercase to lowercase
        trans = cript2uni(str);      //Convert trans to unicode
    }
    if(type == '2'){
	trans = uni2cript(str);      //Convert unicode to trans
	trans = capit(trans);
    }
    if(type == '3'){
	trans = bam2uni(str);      //Convert bamini to unicode
	var bami = trans;
	bami = bami.replace(/\n/, '<br>');
	// Replace the english words in array back into string.
	   for(j=0;j<engarr.length;j++){
	       bami = bami.replace(/!(\d)!/, engarr[j]);
	    }

	document.getElementById('boxFour').innerHTML = bami;    
	trans = uni2cript(trans);      //Convert bamini to trans
	trans = capit(trans);
    }	

    /* Replace the english words in array back into string.*/
    for(j=0;j<engarr.length;j++){
        trans = trans.replace(/!(\d)!/, engarr[j]);
    }
	
	document.forms[0].searchText.value=trans
}
function scrollT()
{
document.body.scrollTop=0
}
