var  PopupW;

function Impressum() {
   if (PopupW) {
      Checker = !(PopupW.closed == undefined);  // für Opera 8.5
      if (Checker && !PopupW.closed) {
         PopupW.close();
         window.setTimeout("Impressum()",10);
         return;
      }
   }
   if (Lang == 'pl') { FH = 700; } else { FH = 580; };
   PopupW = window.open("impressum.php?lang="+Lang,"Anlagenbau_Popup","left=25,top=25,width=600,height="+FH+",scrollbars=no,resizable=yes");
}

function Datenschutz() {
   if (PopupW) {
      Checker = !(PopupW.closed == undefined);  // für Opera 8.5
      if (Checker && !PopupW.closed) {
         PopupW.close();
         window.setTimeout("Datenschutz()",10);
         return;
      }
   }
   FH = 580;
   PopupW = window.open("datenschutz.php?lang="+Lang,"Anlagenbau_Popup","left=25,top=25,width=600,height="+FH+",scrollbars=yes,resizable=yes");
}

function Sitemap() {
   if (PopupW) {
      Checker = !(PopupW.closed == undefined);  // für Opera 8.5
      if (Checker && !PopupW.closed) {
         PopupW.close();
         window.setTimeout("Sitemap()",10);
         return;
      }
   }
   PopupW = window.open("sitemap.php?lang="+Lang,"Anlagenbau_Popup","left=25,top=25,width=600,height=570,scrollbars=no,resizable=yes");
}

function Link(Id) {
   if (window.location.host == "anlagenbau") {
      istURL = "http://istnet?lang=" + Lang;
   } else {
      istURL = "http://www.istnet.de?lang=" + Lang;
   }
   if (Id == "home") window.location.href = "index.php?lang=" + Lang;
   //if (Id == "home") window.location.href = window.location.protocol+"//"+window.location.host+"?lang=" + Lang;
   if (Id == "map") Sitemap();
   if (Id == "imp") Impressum();
   if (Id == "pri") Datenschutz();
   //if (Id == "ist") window.open(istURL,"_blank","menubar=yes,toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes");
   if (Id == "ist") window.location.href = istURL;
}

var T,L;

function RefBild(Name) {
   if (navigator.appVersion.substring(0,1) > 3) {
      L = (screen.width-800)/2;
      T = (screen.height-500)/2;
   } else {
      L = 0; T = 0;
   }
   if (PopupW) {
      Checker = !(PopupW.closed == undefined);  // für Opera 8.5
      if (Checker && !PopupW.closed) {
         PopupW.close();
         window.setTimeout("RefBild('" + Name + "')",10);
         return
      }
   }
   PopupW = window.open("bild.php?lang=" + Lang + "&name=" + Name,"Anlagenbau_Popup","top="+T+",left="+L+",width=770,height=460,resizable=no,scrollbars=no");
}

function Detail(Name) {
   if (navigator.appVersion.substring(0,1) > 3) {
      L = (screen.width-770)/2;
      T = (screen.height-600)/2;
   } else {
      L = 0; T = 0;
   }
   if (PopupW) {
      Checker = !(PopupW.closed == undefined);  // für Opera 8.5
      if (Checker && !PopupW.closed) {
         PopupW.close();
         window.setTimeout("Detail('" + Name + "')",10);
         return
      }
   }
   PopupW = window.open("bild.php?lang=" + Lang + "&name=" + Name,"Anlagenbau_Popup","top="+T+",left="+L+",width=740,height=560,resizable=no,scrollbars=no");
}

function Video(Nr,Pid) {
   if (PopupW) {
      Checker = !(PopupW.closed == undefined);  // für Opera 8.5
      if (Checker && !PopupW.closed) {
         PopupW.close();
         window.setTimeout("Video(" + Nr + "," + Pid + ")",10);
         return;
      }
   }
   if (Pid == 1) {
      FH = 650;  // Quicktime
   } else {
      FH = 703;
   }
   PopupW = window.open("video.php?lang="+Lang+"&nr="+Nr+"&pid="+Pid,"Anlagenbau_Popup","left=25,top=25,width=570,height="+FH+",scrollbars=no,resizable=no");
}

function Bildauswahl(RefId,Anz) {
   W = 710; H = 620;
   if (navigator.appVersion.substring(0,1) > 3) {
      L = (screen.width-W-30)/2;
      T = (screen.height-H-40)/2;
   } else {
      L = 0; T = 0;
   }
   if (PopupW) {
      Checker = !(PopupW.closed == undefined);  // für Opera 8.5
      if (Checker && !PopupW.closed) {
         PopupW.close();
         window.setTimeout("RefId(" + RefId + "," + An + ")",10);
         return
      }
   }
   PopupW = window.open("bildauswahl.php?lang=" + Lang + "&RefId=" + RefId,"Anlagenbau_Popup","top="+T+",left="+L+",width="+W+",height="+H+",resizable=yes,scrollbars=yes");
}

function AnlagenInfo(Id) {
   if (navigator.appVersion.substring(0,1) > 3) {
      L = (screen.width-620)/2;
      T = (screen.height-220)/2;
   } else {
      L = 0; T = 0;
   }
   if (PopupW) {
      Checker = !(PopupW.closed == undefined);  // für Opera 8.5
      if (Checker && !PopupW.closed) {
         PopupW.close();
         window.setTimeout("AnlagenInfo('" + Id + "')",10);
         return
      }
   }
   PopupW = window.open("klsrefdaten.php?Mode=1&Id=" + Id + "&lang=" + Lang,"Anlagenbau_Popup","top="+T+",left="+L+",width=590,height=207,resizable=yes,scrollbars=no");
}

function GotoTop() {
   window.setTimeout("window.location = '#top'",20);   
}

function EMCaller(Name,Server,Domain) {
   window.location = "mailto:"+Name+"@"+Server+"."+Domain;
}

function Closer() {
   if (PopupW) {
      Checker = !(PopupW.closed == undefined);  // für Opera 8.5
      if (Checker && !PopupW.closed) PopupW.close();
   }
}
