/*
 * @(#)width.js
 *
 *    Version: 0.99.20100301
 * Written by: Yves Kreis <mailto:yves.kreis@education.lu>
 *
 * Copyright (C) 2003-2010 by Yves Kreis
 *
 * This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Luxembourg License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/lu/ or send a letter to 
 * Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
 *
 */

/*
 *
 * Function available in this file:
 *   setWidth(width)
 *
 * Usage examples:
 *   href = "javascript: setWidth('auto');"
 *   href = "javascript: setWidth('640');"
 *   href = "javascript: setWidth('864');"
 *
 */

function setWidth(text) {
  var arrSpan = document.getElementsByTagName("span");
  for (var intSpan = 0; intSpan < arrSpan.length; intSpan++) {
    if (arrSpan[intSpan].id.indexOf("width:") == 0) {
      document.getElementById(arrSpan[intSpan].id).className = "";
    }
  }
  
  if (!isNaN(text)) {
    top.document.body.cols = "*,160," + text + ",*";
    if (document.getElementById("width:" + text) != null) {
      document.getElementById("width:" + text).className = "bold";
    }
  } else if ("auto" == text) {
    top.document.body.cols = "*,160,100%,*";
    document.getElementById("width:auto").className = "bold";
  }
}