/*
ENLARGE BMP CHARACTERS

author: Jens Brueckmann
        http://www.j-a-b.net/

      created: 2003-01-20
last modified: 2004-04-30
________________________________________________________________________________
This script is published under a Creative Commons License. For more information 
about this license visit http://creativecommons.org/licenses/by-sa/2.0/
________________________________________________________________________________
Comments are welcome :-) Use contact form or mail me at jens[at]j-a-b.net
________________________________________________________________________________
*/


var codePointDec;
var codePointHex;
var codePointHexEsc;
var codePointDef;
var glyph = "";

function showBig(codePointDec,codePointHex,codePointHexEsc,codePointDef) {

  if (document.getElementById('bigChar').hasChildNodes()) {

    var oldGlyph = document.getElementById('glyphsection');
    var oldData  = document.getElementById('datasection');

    document.getElementById('bigChar').removeChild (oldData);
    document.getElementById('bigChar').removeChild (oldGlyph);
  }

  if (
       (codePointDec<=31) ||
         (
           (codePointDec>=127) &&
           (codePointDec<=159)
         )
     ) {

    glyph = "\u20E0";
    document.getElementById('bigChar').style.color = "#999";
  }

  else {
    glyph = codePointHexEsc;
    document.getElementById('bigChar').style.color = "#000";
  }


  codePointDec = "\n\u0026\u0023"  + codePointDec + ";\n";
  codePointHex = "\u0026\u0023x"   + codePointHex + ";\n";
 
  document.getElementById('bigChar').style.display = "block";

  var glyphSection     = document.createElement ('strong');
  var bigGlyph         = document.createTextNode (glyph);
  var dataSection      = document.createElement ('div');
  var breakPoint1      = document.createElement ('br');
  var breakPoint2      = document.createElement ('br');
  var glyphDataDec     = document.createTextNode (codePointDec);
  var glyphDataHex     = document.createTextNode (codePointHex);
  var codePointSection = document.createElement ('span');
  var codePointData    = document.createTextNode (codePointDef);

  dataSection.setAttribute ('id','datasection');
  glyphSection.setAttribute ('id','glyphsection');

  codePointSection.appendChild (codePointData);
  dataSection.appendChild (glyphDataDec);
  dataSection.appendChild (breakPoint1);
  dataSection.appendChild (glyphDataHex);
  dataSection.appendChild (breakPoint2);
  dataSection.appendChild (codePointSection);
  glyphSection.appendChild (bigGlyph);
  document.getElementById('bigChar').appendChild (glyphSection);
  document.getElementById('bigChar').appendChild (dataSection);

}


function hideBig() {

  document.getElementById('bigChar').style.display = "none";

}

