/* DATEI: *.js */


/* Javascript Datei BLUEPAGE CMS 07 -2004 */
/* Copyright by ISS-Oberlausitz */
/* Author: T.Hojenski */

function img_view(ds,lg,pf,inhId) {
   url = pf + './img_view.php?ds=' + ds + '&lg=' + lg + '&inhId=' + inhId;
   opt = 'location=no,scrollbars=auto,toolbar=no,resizable=yes,left=' + ((screen.availWidth-720)/2) + ',top=' + (((screen.availHeight-650)/2)-20) + ',width=665,height=650';
   galwindow = window.open(url,'_blank',opt);
   galwindow.moveTo(((screen.availWidth-720)/2),((screen.availHeight-650)/2)-20)
}

var si;
var tid;

function nav(id,view) {
   clearTimeout(si);
   if (tid) { if (tid != id) nav(tid,'hidden'); }
   tid = id;
   var n1 = id.substr(0,2);
   var n2 = id.substr(2,2);
   var n3 = id.substr(4,2);

   var i;
   var dstyle = view;

   if ((view == 'visible' && id > 99)) {
      if (document.all) document.all['n'+id].childNodes[0].style.backgroundColor = '#c0ca00';
      else if (document.getElementById) document.getElementById('n'+id).childNodes[0].style.backgroundColor = '#c0ca00';
      document.images['p'+id].src = document.images['p'+id].src.replace(/\/b./,"\/a.");
   } else {
      if (document.all) document.all['n'+id].childNodes[0].style.backgroundColor = '#ffffff';
      else if (document.getElementById) document.getElementById('n'+id).childNodes[0].style.backgroundColor = '#ffffff';
      document.images['p'+id].src = document.images['p'+id].src.replace(/\/a./,"\/b.");
   }


   if (view == 'visible') {
      if (document.all) document.all['n'+n1].childNodes[0].style.backgroundColor = '#ffffff';
      else if (document.getElementById) document.getElementById('n'+n1).childNodes[0].style.backgroundColor = '#ffffff';
      document.images['p'+n1].src = document.images['p'+n1].src.replace(/\/a./,"\/b.");
   } else if (view == 'hidden') {
      if (document.all) document.all['n'+n1].childNodes[0].style.backgroundColor = '#c0ca00';
      else if (document.getElementById) document.getElementById('n'+n1).childNodes[0].style.backgroundColor = '#c0ca00';
      document.images['p'+n1].src = document.images['p'+n1].src.replace(/\/b./,"\/a.");
   }


   if (id > 99) {
      if (document.all) { document.all['n'+id].style.visibility = dstyle; document.all['n'+id].style.zindex = 5000; }
      else if (document.getElementById) document.getElementById('n'+id).style.visibility = dstyle;
   }
   for (i = 1; i < 99; i++) {
      if (i < 10) j = '0'+i; else j = i;
      //if (i < 9) j = '0'+i; else j = i;
      if (document.all) {
         if (document.all('n'+n1+j)) { document.all['n'+n1+j].style.visibility = dstyle; document.all['n'+n1+j].zindex = 5000; }
         else break;
      } else if (document.getElementById) {
         if (document.getElementById('n'+n1+j)) { document.getElementById('n'+n1+j).style.visibility = dstyle; }
         else break;
      }
      if (n2 != '') {
         for (k = 1; k < 99; k++) {
            if (k < 10) l = '0'+k; else l = k;
            //if (k < 9) l = '0'+k; else l = k;
            if (document.all) {
               if (document.all['n'+n1+n2+l]) { document.all['n'+n1+n2+l].style.visibility = dstyle; document.all['n'+n1+n2+l].zindex = 5000; }
               else break;
            } else if (document.getElementById) {
               if (document.getElementById('n'+n1+n2+l)) { document.getElementById('n'+n1+n2+l).style.visibility = dstyle; }
               else break;
            }
         }
      }
   }
   func = "nav('"+id+"','hidden')";
   if (view == 'visible') si = setTimeout(func,2000);
}

function btnchange(obj,whl,zst){
   if(!obj.src) {
      if(document.all) obj = document.all(obj);
      else if(document.getElementById) obj = document.getElementById(obj);
   }
   if(zst == true)  obj.src = 'images/sys/' + whl + '2.gif';
   if(zst == false) obj.src = 'images/sys/' + whl + '.gif';
}

function setline(theRow,linecolor) {
   if (linecolor == '' || typeof(theRow.style) == 'undefined') {
      return false;
   }
   if (typeof(document.getElementsByTagName) != 'undefined') {
      var theCells = theRow.getElementsByTagName('td');
   } else if (typeof(theRow.cells) != 'undefined') {
      var theCells = theRow.cells;
   } else {
      return false;
   }
   var rowCellsCnt  = theCells.length;
//      theCells[0].style.backgroundColor = stopcolor;
   for (var c = 0; c < rowCellsCnt; c++) {
      theCells[c].style.backgroundColor = linecolor;
   }
   return true;
}

function addbookmark() {   // IE
   if (document.all && navigator.userAgent.indexOf('Opera') <= -1) {
      var bookmarkurl   = document.URL
      var bookmarktitle = document.title;
      window.external.AddFavorite(bookmarkurl,bookmarktitle)
   } else {
      alert("Dieser Link funktioniert nur bei Benutzern des Internet-Explorers.\n\nBenutzen Sie bitte die Tastenkombination für\nNetscape/Mozilla:\t\tSTRG+D,\nOpera:\t\t\tSTRG+T.")
   }
}


function nav_hover(theRow,theClass,txt) {
   window.status = txt;

   if (typeof(document.getElementsByTagName) != 'undefined') {
      var theCells = theRow.getElementsByTagName('td');
      var theLinks = theRow.getElementsByTagName('a');
   } else if (typeof(theRow.cells) != 'undefined') {
      var theCells = theRow.cells;
      var theLinks = theRow.theLinks;
   } else {
      return false;
   }
   var rowCellsCnt  = theCells.length;

   for (var c = 0; c < rowCellsCnt; c++) {
      theCells[c].className = theClass;
      theLinks[c].className = theClass;
   }
   return true;
}



var obj_src,link_class;

function nav_change(obj_id,zst){
   if(document.getElementById || document.all) {
      if(document.all) {
         obj = document.all("nb_"+obj_id);
         link = document.all("nl_"+obj_id);
      } else if(document.getElementById) {
         obj = document.getElementById("nb_"+obj_id);
         link = document.getElementById("nl_"+obj_id);
      }
      if (zst == 1 || zst == 2) {
         obj_src = obj.src;
         link_class = link.className;
         if (zst == 1) {
            obj.src = "images/index/t_over.gif";
            link.className = "tnav_over";
         } else {
            link.className = "tnav_over";
         }
      } else {
         obj.src = obj_src;
         link.className = link_class;
      }
   }
}

function open_extern(url,att,w,h) {
   posh = parseFloat(((screen.availHeight-h)/2)-20);
   posw = parseFloat((screen.availWidth-w)/2);
   opt = att + ',left=' + posw + ',top=' + posh + ',width='+w+',height='+h;
   extWindow = window.open(url,'_blank',opt);
   extWindow.focus();
}
function view_rpic(tid,zst) {
   if (zst == true) zst = 'visible';
   else             zst = 'hidden';
   
   if (document.all) {
      document.all('rpic2_'+tid).style.visibility =zst;
      document.all('rtxt_box_'+tid).style.visibility =zst;
   } else if (document.getElementById) {
      document.getElementById('rpic2_'+tid).style.visibility =zst;
      document.getElementById('rtxt_box_'+tid).style.visibility =zst;
   }
   zst = '';
}
