/*scs-SimpleContentSystem  (c)2010 ing.-buero bechler d-halle  www.ebechler.de*/

//debug//
function debug (_m) {
  if (_m) {
    var _e=null;
    if (_e=document.getElementById('debug'))
      _e.innerHTML=_m;
      _e.style.border='solid 1px yellow';
      _e.style.display='block'; }}
//debug end//

//------------------------------------------------------------------------------

//virt. mouseover/out global background n color from css//
var winVirtBKG=null, winVirtBKGimg=null, winVirtCOL=null, winVirtBKGhov=null, winVirtBKGimghov=null, winVirtCOLhov=null;

function winVirtIni () { //f. class win//
  //win-virt-vorgaben aus css lesen//
  var _n=0, _i=0, _rules=null;
  while (_n<document.styleSheets.length) {
    _rules=document.styleSheets[_n].rules; //ie
    if (!_rules||(_rules=='undefined')) _rules=document.styleSheets[_n].cssRules;
    if (_rules) {
      _i=0;
      while (_i<_rules.length) {
        if (_rules[_i].selectorText&&(_rules[_i].selectorText.toLowerCase()=='.mvirtover')) { //class win mvirtover
          winVirtBKGimghov=_rules[_i].style.backgroundImage;
          if (!winVirtBKGimghov) winVirtBKGhov=_rules[_i].style.backgroundColor;
          winVirtCOLhov=_rules[_i].style.color;
          _i=_rules.length; }
        else
          _i++; }
      _i=0;
      while (_i<_rules.length) {
        if (_rules[_i].selectorText&&(_rules[_i].selectorText.toLowerCase()=='.mvirtout')) { //class win mvirtout
          winVirtBKGimg=_rules[_i].style.backgroundImage;
          if (!winVirtBKGimg) winVirtBKG=_rules[_i].style.backgroundColor;
          winVirtCOL=_rules[_i].style.color;
          _i=_rules.length; }
        else
          _i++; }}
    _n++; }}

function winVirtHover (_e, _h) { //win:win, hover:bool//
  //win-mouseover/out//
  if (_e) {
    if (!winVirtCOL)
      winVirtIni();
    var _n=null, _m=null;
    var _i=_h?winVirtBKGimghov:winVirtBKGimg;
    var _b=_h?winVirtBKGhov:winVirtBKG;
    if ((_e.childNodes.length>0)&&(_n=_e.childNodes[0])) //o
      if ((_n.childNodes.length>5)&&(_m=_n.childNodes[5])) { //mo2
        if (_i) _m.style.backgroundImage=_i; else _m.style.background=_b;
        if ((_n.childNodes.length>9)&&(_m=_n.childNodes[9])) { //mo3
          if (_i) _m.style.backgroundImage=_i; else _m.style.background=_b;
          if ((_e.childNodes.length>1)&&(_n=_e.childNodes[1])) { //m
            if ((_n.childNodes.length>0)&&(_m=_n.childNodes[0])) { //mm
              if (_i) {
                _m.style.border='none';
                _m.style.backgroundImage=_i; }
              else {
                _m.style.borderColor=_b;
                _m.style.background=_b; }
              if ((_m.childNodes.length>0)&&(_m=_m.childNodes[0])) { //a
                _m.style.textDecoration=_h?'underline':'none';
                _m.style.color=_h?winVirtCOLhov:winVirtCOL; }}
            if ((_e.childNodes.length>2)&&(_n=_e.childNodes[2])) { //u
              if ((_n.childNodes.length>1)&&(_m=_n.childNodes[1])) { //mu3
                if (_i) _m.style.backgroundImage=_i; else _m.style.background=_b;
                if ((_n.childNodes.length>5)&&(_m=_n.childNodes[5])) { //mu2
                  if (_i) _m.style.backgroundImage=_i; else _m.style.background=_b; }}}}}}}}

