/* DATEI: hv.js */


/* Javascript CMS hillerschevilla.de 04-2004 */
/* Copyright by ISS-Oberlausitz */
/* Author: T.Hojenski */

var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var zfzahl = Math.random(); // Zufallszahl für Btn-Hover-Effekt

if (document.all)                 { document.onmousedown = pageMousedown; }
else if (document.getElementById) { document.addEventListener("mousedown", pageMousedown, true); }

function pageMousedown(event) {
   if (document.all){
      el = window.event.srcElement;
   } else if (document.getElementById){
      el = (event.target.tagName ? event.target : event.target.parentNode);
   }
   if (el.nodeName == "A") { return; }
   while (el != null) {
      if (el.nodeName == "A" && el.href) {
          if (el.className == 'nav_1' || el.className == 'nav_2' || el.className == 'nav_3') {
             this.location.href = el.href;
             break;
         }
      }
      el = el.firstChild;
   }
}

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)
}

function piczoom(datei,w,h,lg) {
      w = parseInt(w) + 20; h = parseInt(h) + 20;
      url = 'img_zoom.php?lg=' + lg + '&file=' + datei;
      prefs = 'location=no,scrollbars=yes,toolbar=no,resizable=yes,left='+((screen.availWidth-w)/2)+',top='+((screen.availHeight-h)/2)+',width='+ w + ',height=' + h;
      zoomwindow =  window.open(url,'_blank',prefs);
      zoomwindow.moveTo(((screen.availWidth-w)/2),((screen.availHeight-h)/2))
}

function hst_img_view(datei,lg) {
   url = 'img_zoom.php?lg=' + lg + '&file=' + datei;
   //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)
}

function NavViewOn(tdf,obj,txt) {
   tdf.src = obj + '_2.gif';
   window.status = txt;
   setTimeout("window.status=''",25000);
}

function NavViewOff(tdf,obj,awhl) {
   tdf.src = obj + '_' + awhl + '.gif';
   window.status = '';
}
function btnchange(obj,bwhl,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/' + bwhl + '2.gif';
   if(zst == false) obj.src = 'images/sys/' + bwhl + '.gif';
   obj.title = bwhl;
}

function loadincl() {
   document.write('<sc'+'ript src="js/zv_ticker.js" type=text/java'+'script></script>');
   document.write('<sc'+'ript src="js/zv_tooltip.js" type=text/java'+'script></script>');
}

function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function frml_checked(box) {
   if (box[0].checked == true) {
      for(i=1;i<box.length; i++) box[i].checked = true;
   }
}

// Alt

function auswahl_fahrplanseite(ablauf_datum,bereich_auswahl)
{
seite = "auswahl_fahrplanseite.php?ablauf_datum="+ablauf_datum+"&bereich_auswahl="+bereich_auswahl;
wnd = open(seite,"wnd","width=540,height=620,left=500,top=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable,dependent,screenX=0,screenY=0")
wnd.focus()
}
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;
   for (var c = 0; c < rowCellsCnt; c++) {
      theCells[c].style.backgroundColor = linecolor;
   }
   return true;
}

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 checkradio(obj,formular,chk) {
   var sel_templ = 0;
   if (parent.document.forms[formular].elements[obj]) {
      var elts = parent.document.forms[formular].elements[obj];
      var elts_cnt  = elts.length;
      for (var i = 0; i < elts_cnt; i++) {
         elts[i].checked = chk;
      }
   }
}

function checkradio_trip(obj,formular) {
   var sel_templ = 0;
   if (parent.document.forms[formular].elements[obj]) {
      var elts = parent.document.forms[formular].elements[obj];
      var elts_cnt  = elts.length;
      if (elts[0].checked == true) { var chk = false; } else { var chk = true; }
      for (var i = 0; i < elts_cnt; i++) {
         elts[i].checked = chk;
      }
   }
}

function boxview(aktion) {
   if (document.all) document.all['gruppenbox'].style.display = aktion;
   else if(document.getElementById) document.getElementById('gruppenbox').style.display = aktion;
}

function closeloading() {
   if (document.all) { if (document.all['loading']) document.all['loading'].style.display = 'none'; }
   else if(document.getElementById) { if (document.getElementById('loading')) document.getElementById('loading').style.display = 'none'; }
}

 var iduMap;

function onAfterSelHstOnMap(o) {
   document.fp_auskunft['name_' + o.usage].value = '1490' +o.hstNr;
   //document.fp_auskunft['type_' + o.usage][0].checked = true;
   if (iduMap.closed != true) iduMap.close();
   document.fp_auskunft.submit();
}
