
var currentTextSize = -1;

var textSize = new Array(4);
textSize[0] = "txtV10";
textSize[1] = "txtV11";
textSize[2] = "txtV12";
textSize[3] = "txtV14";

var fontSize = new Array(4);
fontSize[0] = "10";
fontSize[1] = "11";
fontSize[2] = "12";
fontSize[3] = "14";

var currentCol = null;
var cookiedate = new Date(2032,01,01);
  
  function initTextSize(defaultTextSizeClass) {
    for (i=0;i<textSize.length;i++)
    {
      if (textSize[i] == defaultTextSizeClass)
      {
        currentTextSize = i;
      }
    }
    setTextSize();
  }

  function setTextSize() {
    if (document.getElementById) {
      var obj = document.getElementById("story");

      if (obj)
      {
        obj.setAttribute("class", textSize[currentTextSize]);
        obj.setAttribute("className", textSize[currentTextSize]);

        if (navigator.userAgent.indexOf("Netscape6") != -1)
        {
          obj.innerHTML = obj.innerHTML;
        }
      }

    }
  }

  function biggerText() {
  
    if (currentTextSize < textSize.length-1)
    {
      currentTextSize ++;
      setTextSize();

      // Save textSize setting
      if (SetCookie)
      {
        SetCookie("TEXTSIZE", textSize[currentTextSize], cookiedate, "/");
      }
    }
   
  }
  
  function smallerText() {
    if (currentTextSize > 0)
    {
      currentTextSize --;
      
      setTextSize();

      // Save textSize setting
      if (SetCookie)
      {
        SetCookie("TEXTSIZE", textSize[currentTextSize], cookiedate, "/");
      }
    }
  }
  
  function initColumn(defaultColumn) {
    if (defaultColumn == "two")
    {
      twoCol();
    }
  }

  function oneCol() {
    if (currentCol != "one")
    {
      
      if (document.getElementById) {
        obj = document.getElementById("twocol");
        if (obj)
        {
          obj.style.display = "none";
        }

        obj = document.getElementById("onecol");
        if (obj)
        {
          obj.style.display = "block";
        }
        
        // Save column setting
        if (SetCookie)
        {
          SetCookie("COLUMN", "one", cookiedate, "/");
        }
      }
      currentCol = "one";
    }
  }

  function twoCol() {
    if (currentCol != "two")
    {
      if (document.getElementById) {
        obj = document.getElementById("onecol");
        
        fromcol = document.getElementById("col1");
        tocol = document.getElementById("column1");
        if (fromcol && tocol)
        {
          tocol.innerHTML = fromcol.innerHTML;
        }
        
        fromcol = document.getElementById("col2");
        tocol = document.getElementById("column2");
        if (fromcol && tocol)
        {
          tocol.innerHTML = fromcol.innerHTML;
        }
        if (obj)
        {
          obj.style.display = "none";
        }
        
        obj = document.getElementById("twocol");
        if (obj)
        {
          obj.style.display = "block";
        }
        
        // save column setting
        if (SetCookie)
        {
          SetCookie("COLUMN", "two", cookiedate, "/");
        }
      }
      currentCol = "two";
    }
  }

