<!--
function textPlayer_DoFSCommand(command, args){
  //get the last node in the captions_text_stream element
  var lNode = document.getElementById("captions_text_stream").lastChild;

  if(command == "onNextText" || command == "FSCommand:onNextText"){
    args = decodeURI(args);
    args = unescape(args);

    //split the received text at any line breaks
    var textArr = args.split("\r\n");

    //loop through all of the items in the array and add them to text nodes
    for(i = 0; i < textArr.length; i++){
      //if the last node is a text node, then just add the 
      if(lNode.nodeType == 1){
        lNode = document.createTextNode("");
        document.getElementById("captions_text_stream").appendChild(lNode);
      }
	  
      lNode.data += textArr[i];

      //if there are nodes left in the array, then we need to add a break element
      if(i + 1 < textArr.length){
        lNode = document.createElement("br");
        document.getElementById("captions_text_stream").appendChild(lNode);
      }
    }
  }
  else if(command == "onDeletes" || command == "FSCommand:onDeletes"){
    //loop while there are still characters to remove
    while(args > 0){
      //if the last node is a text node, then remove the text from that node
      if(lNode.nodeType == 3){
        //if there is enough text in the text node to take care of all the
        //delete characters, then just remove those number of characters from
        //the end
        if(lNode.length > args){
          //lNode.deleteData(lNode.length - args, args);
          lNode.data = lNode.data.substring(0, lNode.data.length - args);

          //reset the delete count to 0
          args = 0;
        }
        else{
          //remove the node from the document and decrement the delete count
          //by the length of the node
          args -= lNode.length;

          document.getElementById("captions_text_stream").removeChild(lNode);         

          //now get the last node in the document
          lNode = document.getElementById("captions_text_stream").lastChild;
        }
      }
      else{
        //remove the node from the document and decrement the delete by one
        document.getElementById("captions_text_stream").removeChild(lNode);

        //decrement the number of delete characters
        args--;

        //now get the last node in the document
        lNode = document.getElementById("captions_text_stream").lastChild;
      }
    }
  }
  //place any code here that needs to run after text is processed
  //for example any formatting or scrolling code 
  scroll();
}

function changeFont(){
  if(document.getElementById("font").value.length > 0){
    document.getElementById("captions_text_stream").style.fontFamily = document.getElementById("font").value;
    scroll();
  }
}

function changeSize(){
  if(document.getElementById("fontSize").value.length > 0){
    document.getElementById("captions_text_stream").style.fontSize = document.getElementById("fontSize").value;
    scroll();
  }
}

function changeColor(){
  if(document.getElementById("fontColor").value.length > 0){
    document.getElementById("captions_text_stream").style.color = document.getElementById("fontColor").value;
  }
}

function changeBackground(){
  if(document.getElementById("bgColor").value.length > 0){
    document.getElementById("captions_text_stream").style.backgroundColor = document.getElementById("bgColor").value;
  }
}

function scroll(){
	//var d = document.getElementById("scrollText");
	var s = document.getElementById("captions_text_stream");
	
	//if(d.checked == true) {
		s.scrollTop = s.scrollHeight - s.clientHeight;
	//}
}
-->