 	// Cell updater for the quote box flake
      function updateQuoteBoxFlake(updateEvent,flakeId) {
        var updateCol = updateEvent.columnid;
        if (updateEvent.newValue.replace(/^\s+|\s+$/g, '').replace(/\u00A0/g, "")  == "") return; // movie problem, updates shoud not be empty
  
        var cell = dojo.byId("QuoteBoxFlake_"+updateCol+"_"+flakeId);
        if (cell) {   
           if (updateCol == 'LastPrice' || updateCol == 'BidPrice' || updateCol == 'AskPrice'){
                //var quotePlayer = dojo.eval("quoteBoxFlakePlayer"+flakeId);
                //var img = dojo.byId("QuoteBoxFlake_"+updateCol+"_"+flakeId+"_image");
                
                
                if (cell.lastChild.nodeName == "#text") {  // there was already text in it
                   cell.lastChild.data = updateEvent.newValue;
                } else {  // there was no text (like daily volume and market was closed before)
                   cell.innerHTML += updateEvent.newValue;
                }
                
                 changeCellColor(cell,updateEvent.delta);
           }
           else if(updateCol == 'ClosingDelta'){
                cell.innerHTML = updateEvent.newValue;
                var delta = updateEvent.newValue.substr(0,updateEvent.newValue.length-1);
                if(delta > 0 ) cell.style.color = "green";
                else if(delta < 0 ) cell.style.color = "red";
                else cell.style.color = "black";
                
           }
           else{
              cell.innerHTML = updateEvent.newValue;
           }
        }       
      }
      
      function stopUpdateAndRestart(quoteMovie){
              quoteMovie.stop();
              quoteMovie.start();
      }
      

      function changeCellColor(cell, deltaChange) {
        if (cell != null) {
           var imgInTd = cell.getElementsByTagName('img')[0];     // the first image in the cell
           var color = "#FFFFFF";
           if (deltaChange > 0) {
             color = "#00FF00";
             imgInTd.src = '/resources/images/dojo/arrow_up_black.gif'; 
           } else if (deltaChange < 0) {
             color = "#FF0000";
             imgInTd.src = '/resources/images/dojo/arrow_down_black.gif'; 
           }
          //dojo.style(cell, "color", color);
          highlight(cell,color,1500);
          opacityFading(imgInTd,1500);

        }
      }    
      
  /*
   * Highlights the specified nodeName.
   */
  function highlight(nodeName,color,duration) {
        var anim = swx.fx.highlight({node:nodeName, color:color, duration:duration});
        anim.play();
  };
  
    function opacityFading(nodeName,duration) {
        var anim = swx.fx.opacityFading({node:nodeName, duration:duration});
        anim.play();
  };
