// (c) Klaus-Peter Gadacz QIX Systemintegration 1979-2005

function zumStart(x) {
if((self==top&&x=="QIX") || (self!=top&&x!="QIX")) {
window.open("/gadacz/index.php","_top","");
}
} 

function org_zumStart(x) {
if(self==top&&x=="QIX") window.open("/gadacz/index.php","_top","")
else if(self!=top&&x!="QIX")  window.open("/gadacz/index.php","_top","") } 

/* Globale Variable zur Feststellung des Browsers sollte komplett geaendert werden und fuer alle Funktionen anwendbar sein */
var BrowserType=navigator.userAgent;
an=navigator.appName; av=parseInt(navigator.appVersion);
IE=navigator.userAgent.indexOf("MSIE");
NN=navigator.userAgent.indexOf("Netscape");
OP=navigator.userAgent.indexOf("Opera");
// Weltzeituhr
var DT=0;
function dsptime() {
  var gmt=new Date(), target=new Date();
  var offset=document.clock.timezone.selectedIndex-12;
  target.setTime(gmt.getTime()+(offset+DT)*3600000);
  time=target.toGMTString();
  document.clock.now.value=time.substring(0,time.length-3);
  setTimeout("dsptime()",1000)
}
/* Zur Datumsberechnung
1. Variante fuer Fusszeile (mag noch nicht richtig, liegt aber wahrscheinlich an der Reihenfolge des Aufrufs)
*/
function initArray() {
	this.length=initArray.arguments.length
	for (var i=0;i<this.length;i++)
	this[i+1]=initArray.arguments[i] }
/* Gibt automatisch das letzte Aenerungsdatum und UTC-Zeit aus aufgerufen wird im <script>:
	Aenderungsdatum(new Date(document.lastModified),"Autor Name","Postname","Class");
*/
var emil="\u0040Gadacz\u002einfo",kp="Klaus-Peter", kpg=" "+kp+" Gadacz", sub="?subject=Familienangelegenheiten%20Gadacz";

function Aenderungsdatum(lm,au,po,cl) {
	var yr = lm.getYear();
	yr = (yr<=1900)?yr+1900:yr;	// einige Brauser kennen das 21. Jh. nicht
	au = au==""?kpg :" "+au, cl=cl!=""?" CLASS=\'"+cl+"\'":"";
	with(document) {
		write("<span"+cl+"><HR");
		if(cl!="") write(" CLASS='breit'");
		write("><B>\u00a9 1997 - "+yr+au+"</B><BR>");
		write("Letzte \u00c4nderung am\/Last modification: "+lm.toLocaleString());
		write("<BR>eMail: <A HREF=\'mailto:"+po+emil+sub+"\'>"+po+emil+"</a>");
		write("</span>");
}
}
function Email(po) {
document.write("<B><A HREF='ma"+"ilto"+":"+po+emil+sub+"'>&nbsp;Email: "+po+emil+"</A></B> ");
}
function Emailso(po) {
document.write("<B><A HREF='ma"+"ilto"+":"+po+emil+"?subject=Korrektur: Schlesische Orsnamen'>&nbsp;"+po+emil+"</A></B> ");
}
/* Text in Fenster "Fenster(g,h,Titel, File)" Uebergeben wird: Font-Size fuer Ueberschrift, Fensterhoehe Überschrift, html-File */
function Fensterx(g,h,Titel,Datei) {
 document.write("<ENTER><FONT SIZE="+g+">")
 // Je nach Browser anders ausgeben
if (NN>-1) document.write("<A HREF='"+Datei+"'>"+Titel+"</A></FONT><BR>");
else document.write("<B>"+Titel+"</FONT><BR><IFRAME BORDER='1' HIGHT='"+h+"' SCROLLING='YES' SRC='../gedicht/"+Datei+".html' WIDTH='100%'></ÌFRAME>");  }
// Tonwiedergabe
function Musik(Titel,ret) {
document.write("<EMBED SRC='"+Titel+"' AUTOSTART=TRUE HIDDEN=TRUE VOLUME=100 LOOP=TRUE>");
document.write('<BGSOUND SRC="'+Titel+'" LOOP="'+ret+'">');
}

// Auswahlmenue
function Zeige(x){
 if(x=="nix") {document.forms[0].reset();document.forms[0].elements[0].blur();return;}
 else if(x=="ende") top.location.href = parent.frames[1].location;
 else {parent.frames[1].location.href=x;
   // document.forms[0].reset(); // kann, muss aber nicht - loescht Cursor vom Feld
   document.forms[0].elements[0].blur();  }
}
// Verhindert, dass Fenster innerhalb von Frames erscheint
function changePage() {
  if(self.parent.frames.length!=0) self.parent.location=document.location;}
// Verhindert Rechtsclick bei Links und Bildern
function right(e) {
if((NN>-1)&&(e.which==3||e.which==2)){ window.open("/gadacz/impress.html","impressum","toolbar=no,status=no,resizable=yes,menubar=no,location=no,directories=no"); } }

document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;

// Fuer Textticker
var mxa=mxb=xa=posa=xb=posb=posha=poshb=0;
tla=new textlista ("Hallo, herzlich willkommen auf meiner Homepage","Salut - bienvenue sur ma page d'accueil","Hello - welcome on my homepage","Willkommen bei Klaus-Peter Gadacz","\u00a1Hola! - dan la bienvenida sobre mi homepage", "\u041f\u0440\u0438\u0432\u0435\u0442 - \u043f\u0440\u0438\u0435\u043c \u043d\u0430 \u043c\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435","Hier gibt es Informationen von und \u00fcber \u00abGADACZ\u00bb aus aller Welt","Auswahl zu den Themen mit dem Menu oben!","Datenbank (passwortgesch\u00fctzter Bereich)");
tlb=new textlistb ("Informationen","Family Tree","Stammbaum","Familie","Family","Abstammung","Ancestors","Geschichten","Stories","Neuigkeiten","News","Klatsch und Tratsch");
var la=tla[0].length,lb=tlb[0].length; // var cola="fffff"
function textlista() {// var fa=new Date();
 mxa=textlista.arguments.length; for(ia=0;ia<mxa;ia++) this[ia]=textlista.arguments[ia];}
function textlistb() {
 mxb=textlistb.arguments.length; for(ib=0;ib<mxb;ib++) this[ib]=textlistb.arguments[ib];}
function texttickera() {
 // var fa = new Date(); farbWahl(fa%555,fa%300,fa%255);
  document.tickforma.tickfielda.value="\u2192 "+tla[xa].substring(0,posa)+" \u2190";
  if(posa++==la) { posa=0;setTimeout("texttickera()",5000);xa++;xa=(xa==mxa)?0:xa;la=tla[xa].length;
  }
  else  setTimeout("texttickera()",30);
}

function texttickerb() {
 document.tickformb.tickfieldb.style.color="red";
 document.tickformb.tickfieldb.value="\u2190"+tlb[xb].substring(posb,lb)+ "\u2192";
 if(posb++==lb) {
  posb=0; setTimeout("texttickerb()",100);xb++;xb=(xb==mxb)?0:xb;lb=tlb[xb].length; }
 else {
  if(posb==1) {setTimeout("texttickerb()",3000);document.tickformb.tickfieldb.style.color="navy";}
  else setTimeout("texttickerb()",10); }
}

function farbWahl(r,g,b) {
   var hr=hex(r),hg=hex(g),hb=hex(b);
   document.tickforma.tickfielda.style.color="#"+hr+hg+hb; }
//  Zeit-und Dazumsanzeige
function ZeitAnz(){
 var Nd=new Date().toLocaleString()
if(document.all) document.all.TUhr.innerHTML=Nd;
 else if(document.layers) {
   document.TUhr.document.open(); zz='<SPAN CLASS="uhr")>'+zz+'</SPAN>';
   document.TUhr.document.write(zz); document.TUhr.document.close(); }
 window.setTimeout("ZeitAnz()",1000); }

// Allg Funktionen zur Farbdefinition bzw. -veraenderung
var hexchars="0123456789ABCDEF";
function fromHex (str) {
var high=str.charAt(0); /*Da Netscape 2.0 hier Mist macht */
var low=str.charAt(1);
return(16*hexchars.indexOf(high))+hexchars.indexOf(low); }
function Color(str){
  this.r=fromHex(str.substring(0,2)); this.g=fromHex(str.substring(2,4));        this.b=fromHex(str.substring(4,6)); return this; }
function makeArray(n) { this.length=n; for(var i=1;i<=n;i++) this[i]=0; return this; }
hexa=new makeArray(16);
for(var i=0;i<10;i++) hexa[i]=i;
hexa[10]="a"; hexa[11]="b"; hexa[12]="c"; hexa[13]="d"; hexa[14]="e"; hexa[15]="f";

function hex(i) {
 if(i<0) return "00";
 else if(i>255) return "ff";
 else return ""+hexa[Math.floor(i/16)]+hexa[i%16];}

var meldg = new Array("Gadacz's Homepage","Willkommen","Welcome","\u041f\u0440\u0438\u0435\u043c\u044b","Bienvenue", "Klaus-Peter Gadacz","Familienseite","My Family","Gadacz International");
var anztexte=meldg.length;
// Geschwindugkeit der Bewegung (min 1), groesser=schneller (>50 unlesbar!)
var BallSpeed=12;
var contentWidth, contentHeight, xMax, yMax, akttext=0, ic=0;
// Startposition und Startrichtung
var xPos=0,yPos=0,xDir='right',yDir='down';
function berechnePos() {
   if(xDir=="right") {if(xPos>(xMax-contentWidth-BallSpeed)) {xDir="left";
   document.ballform.ballfield.style.color="#7B79DC";}}
   else if(xDir=="left") {if(xPos<BallSpeed){xDir="right";
   document.ballform.ballfield.style.color="#5B59BC";}}
   if(yDir=="down") {if(yPos>(yMax-contentHeight-BallSpeed)) {yDir="up";
   document.ballform.ballfield.style.color="#3B399C";}}
   else if(yDir=="up") {if(yPos<BallSpeed) {yDir="down"; neuerText();}}
   if(xDir=="right") {xPos+=BallSpeed;}
   else if(xDir=="left") {xPos-=BallSpeed;}//else xPos=xPos;
   if(yDir=="down") yPos+=BallSpeed;
   else if(yDir=="up") yPos-=BallSpeed;//else yPos=yPos;
}
function neuerText(){
  document.ballform.ballfield.value=meldg[ic++]; ic==anztexte?ic=0:ic;
  document.ballform.ballfield.style.overflow="visible";
  document.ballform.ballfield.style.color="#9B99FC";
  // wegen  rechtem Rand muss Textbreite korrigiert werden
  if(document.all)contentWidth=ballform.ballfield.offsetWidth;
  else if(document.layers) contentWidth=document.balltext.document.width;
}
function initBall() {
  document.ballform.ballfield.value=meldg[ic++];
  document.ballform.ballfield.style.overflow="visible";//Angleich Feldbreite
  if(document.all) {
    xMax=document.body.clientWidth;yMax=document.body.clientHeight*90/100;
    document.ballform.ballfield.style.visibility="visible";
    contentWidth=ballform.ballfield.offsetWidth;
    contentHeight=ballform.ballfield.offsetHeight;  }
  else if(document.layers) {
    xMax=window.innerWidth; yMax=window.innerHeight;
    contentWidth=document.balltext.document.width;
    contentHeight=document.balltext.document.height;
    document.ballform.ballfield.visibility="show";  }
  setTimeout('moveBall()',400);
}
function moveBall() {
  berechnePos();
  if(document.all) {
    document.ballform.ballfield.style.left=xPos+document.body.scrollLeft;
    document.ballform.ballfield.style.top =yPos+document.body.scrollTop;  }
  else if(document.layers) {
    document.ballform.ballfield.left=xPos+pageXOffset;
    document.ballform.ballfield.top =yPos+pageYOffset;  }
  setTimeout('moveBall()',20);
}

function zurueck() {
 document.write("<CENTER><A HREF='javascript:history.back()'>zur&uuml;ck</A><IMG SRC='../pic/ho.gif' BORDER='0' ALT='ZUR&Uuml;CK' HIGHT='25' WIDHT=25></A><BR></CENTER>")
}
