<!--
//N6 2006. 
// Zoom sur les polices / Modules pour mal-voyants


// Pass in the object to restore it to css defined sizes.
// Notably the definitions below must agree with the css values.
//
function stepcss_fontSize(obj) {
//  alert ("tagName: [" + obj.tagName + "], className: [" + obj.className + "], fontSize: [" + obj.style.fontSize +"]");
  if (obj.className!="txtsituation") {
    if (obj.className!="rubinterne") {
      if (obj.className!="rubbas") {
        if (obj.tagName=="SPAN") obj.style.fontSize="xx-small";
        else obj.style.fontSize="14px";
      }
    }
  }
}

// Pass in the object to increment its size
//
function stepup_fontSize(obj) {
  if (obj.className=="txtsituation" || obj.className=="rubbas" || obj.className=="rubinterne") return;
  var objSize=obj.style.fontSize;
 
  switch (objSize) {
    case "xx-small": obj.style.fontSize="x-small";	break;
    case "x-small" : obj.style.fontSize="small";	break;
    case "small"   : obj.style.fontSize="medium";	break;
    case "medium"  : obj.style.fontSize="large";	break;
    case "large"   : obj.style.fontSize="large"; 	break;	// sets magnification upper limit
	    case "8px"    : obj.style.fontSize="10px";		break;
	    case "10px"    : obj.style.fontSize="12px";		break;
    case "12px"    : obj.style.fontSize="14px";		break;
    case "14px"    : obj.style.fontSize="16px";		break;
    case "16px"    : obj.style.fontSize="18px";		break;
    case "18px"    : obj.style.fontSize="20px";		break;
    case "20px"    : obj.style.fontSize="20px";		break;  // sets magnification upper limit
    default        : obj.style.fontSize="14px";		break;
  }
}

// Pass in the object to decrement its size
//
function stepdn_fontSize(obj) {
  if (obj.className=="txtsituation" || obj.className=="rubbas" || obj.className=="rubinterne") return;
  var objSize=obj.style.fontSize;

  switch (objSize) {
    case "large"   : obj.style.fontSize="medium";	break;
    case "medium"  : obj.style.fontSize="small";	break;
    case "small"   : obj.style.fontSize="x-small";	break;
    case "x-small" : obj.style.fontSize="xx-small";	break;
    case "20px"    : obj.style.fontSize="18px";		break;
    case "18px"    : obj.style.fontSize="16px";		break;
    case "16px"    : obj.style.fontSize="14px";		break;
    case "14px"    : obj.style.fontSize="12px";		break;
	case "12px"    : obj.style.fontSize="10px";		break;
	case "10px"    : obj.style.fontSize="8px";		break;
	case "8px"    : obj.style.fontSize="6px";		break;
  }
}

function step_fontSize(obj, step) {
  if (step=="up") {
    stepup_fontSize(obj);
  }
  else if (step=="dn") {
    stepdn_fontSize(obj);
  }
  else {
    stepcss_fontSize(obj);
  }
}

function txtsize(step) {
//  var x;
//  x = document.getElementById("vmainframe");
//  x.style.left="20px";
//  x.style.top="120px";
//  alert (x.className);

  var main = document.getElementById("global");
  var para = main.getElementsByTagName("p");
//  var link = main.getElementsByTagName("a");
  var bold = main.getElementsByTagName("strong");
  var span = main.getElementsByTagName("span");

//  var z = document.getElementsByTagName("div");
//  x.style.background= 'white url(/assets/webct95/img/background.gif)';
//  alert(y[0].childNodes[0]);

  var i;

  for (i=0; i < para.length; i++) {
    step_fontSize(para[i], step);
  }
/*
  for (i=0; i < link.length; i++) {
    step_fontSize(link[i], step);
  }
 */
  for (i=0; i < bold.length; i++) {
    step_fontSize(bold[i], step);
  }
  for (i=0; i < span.length; i++) {
    step_fontSize(span[i], step);
  }
}


// Tab management function set
//
var _tabBaseName, _tabCount, _tabTarget;
var _tabUp=1, _tabDn=0;

function tabInit(tabBaseName, tabCount, tabTarget) {
  _tabBaseName=tabBaseName;
  _tabCount=tabCount;
  _tabTarget=tabTarget;
}

function tabState (tabState, tabIdx) {
  var itarg=document.getElementById(_tabBaseName + tabIdx);
  if (itarg != null) {
    if (tabState == _tabUp) {
      itarg.className="tabUp";
    }
    else {
      itarg.className="tabDn";
    }
  }
}

function swapHTML(tabIdx) {
  for (var i=0; i<_tabCount; i++){
    if (i==tabIdx)
      tabState(_tabUp, i);
    else
      tabState(_tabDn, i);
  }
  var tabData=document.getElementById(_tabBaseName+tabIdx+"data").innerHTML;
  document.getElementById(_tabTarget).innerHTML=tabData;
}
//-->
