//Document Scripts//

function Printout(document)
{
var Druckfenster = open(document,"kurzinfo.htm","width=600,height=1000,left=100,top=100")
Druckfenster.focus();
Druckfenster.setTimeout("self.print()",1);
}

function Zu()
{
        window.close();
}

function MM_preloadImages()
{
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function HiddenMail()
{
var c="121-660-1188-1155-352-1089-1188-1067-1265-1265-671-374-1276-1221-1232-1210-1067-1298-1155-1199-1067-1155-1188-374-682-660-1067-352-1144-1254-1111-1122-671-374-1199-1067-1155-1188-1276-1221-638-1232-1254-1067-1320-1155-1265-704-1276-1155-1111-1254-1067-1254-1342-1276-495-1188-1155-1232-1232-1265-1232-1254-1155-1210-1133-1111-506-1100-1111-374-682-759-495-847-1067-1155-1188-660-517-1067-682-660-517-1188-1155-682";
var ac=c.split("-");
var s="";for(i=1;i<ac.length;++i){s+=String.fromCharCode(Number(ac[i])/Math.sqrt(Number(ac[0])));}document.write(s);
}

//Fader Scripts//

function InitializeFaderKT()
{
        setTimeout('FaderFramework.init({id: "fader1", images:["images/galleries/head_katze.jpg", "images/galleries/head_kanin.jpg", "images/galleries/head_welli.jpg", "images/galleries/head_meerschw.jpg"]})', 6000);
        setTimeout('FaderFramework.init({id: "fader2", images:["images/galleries/head_hund.jpg", "images/galleries/head_hund2.jpg", "images/galleries/head_katze2.jpg"]})', 14000);
        setTimeout('FaderFramework.init({id: "fader3", images:["images/galleries/praxis_pic1.jpg", "images/galleries/praxis_lampe.jpg", "images/galleries/praxis_roentgen.jpg"]})', 22000)
}

function InitializeFaderKT2()
{
        setTimeout('FaderFramework.init({id: "fader1", images:["../images/galleries/head_katze.jpg", "../images/galleries/head_kanin.jpg", "../images/galleries/head_welli.jpg", "../images/galleries/head_meerschw.jpg"]})', 6000);
        setTimeout('FaderFramework.init({id: "fader2", images:["../images/galleries/head_hund.jpg", "../images/galleries/head_hund2.jpg", "../images/galleries/head_katze2.jpg"]})', 14000);
        setTimeout('FaderFramework.init({id: "fader3", images:["../images/galleries/praxis_pic1.jpg", "../images/galleries/praxis_lampe.jpg", "../images/galleries/praxis_roentgen.jpg"]})', 22000)
        setTimeout('FaderFramework.init({id: "fader4", images:["../images/galleries/head_schwein.jpg", "../images/galleries/head_kuh2.jpg", "../images/galleries/head_schaf.jpg"]})', 6000);
        setTimeout('FaderFramework.init({id: "fader5", images:["../images/galleries/head_kuh.jpg", "../images/galleries/head_ziege.jpg"]})', 14000);
        setTimeout('FaderFramework.init({id: "fader6", images:["../images/galleries/nt_labor.jpg", "../images/galleries/nt_labor2.jpg", "../images/galleries/nt_stiefel.jpg"]})', 22000)
}

var FaderFramework = {

    oldWinOnLoad: false,
    inits: new Array(),
    faders: new Object(),

    init: function (einstellungen) {
        var fader;

        if (this.inits) {
            this.inits[this.inits.length] = einstellungen;

        } else {
            fader = new this.Fader(einstellungen);

            if (fader != false && !this.faders[fader.id]) {
                this.faders[fader.id] = fader;
                window.setTimeout(function () {    fader.next(); }, fader.viewTime);
            }
        }
    },

    start: function () {
        this.oldWinOnLoad = window.onload;

        window.onload = function () {
            if (typeof(FaderFramework.oldWinOnLoad) == "function") {
                FaderFramework.oldWinOnLoad();
            }
            FaderFramework.onload();
        };
    },

    onload: function () {
        var i, fader, e = document.createElement("link");
        e.type = "text/css";
        e.rel = "stylesheet";
        e.href = "fader-framework/fader-framework.css";
        document.getElementsByTagName("head")[0].appendChild(e);

        fader = this.inits;
        delete this.inits;

        for (i = 0; i < fader.length; i++) {
            this.init(fader[i]);
        }
    },

    Fader: function (einstellungen) {
        if (!einstellungen.id || !document.getElementById(einstellungen.id)
            || FaderFramework.faders[einstellungen.id]
            || einstellungen.images.length < 2) {

            return new Boolean(false);
        }

        var i, original = document.getElementById(einstellungen.id);

        this.id = einstellungen.id;
        this.images = new Array();
        this.counter = false;

        this.element = document.createElement("span");
        this.element.className = "fader";
        original.parentNode.replaceChild(this.element, original);

        for (i = 0; i < einstellungen.images.length; i++) {
            this.images[i] = document.createElement("img");
            this.images[i].src = einstellungen.images[i];
            this.images[i].alt = "Bild";

            if (i == 0) {
                this.element.appendChild(this.images[i]);
            }
        }

        this.fade = function (step) {
            var fader = this, imgs = this.element.getElementsByTagName("img");

            step = (!step) ? 0 : step;

            imgs[1].style.opacity = step/800;
            imgs[1].style.filter = "alpha(opacity=" + step + ")"; // IE?

            step = step + 2;

            if (step <= 800) {
                window.setTimeout(function () { fader.fade(step); }, 1);
            } else {
                imgs[1].className = "";
                this.element.removeChild(imgs[0]);
                window.setTimeout(function () { fader.next(); }, 20000);
            }
        };

        this.next = function () {
            this.counter = (this.counter < this.images.length -1) ? this.counter +1 : 0;

            this.element.appendChild(this.images[this.counter]);
            this.images[this.counter].className = "next";
            this.fade();
        };
    }
};

FaderFramework.start();

//Tooltip Scripts//

wmtt = null;
document.onmousemove = updateWMTT;
function updateWMTT(e) {
  if (wmtt != null && wmtt.style.display == 'block') {
    x = (e.pageX ? e.pageX : window.event.x) + wmtt.offsetParent.scrollLeft - wmtt.offsetParent.offsetLeft;
    y = (e.pageY ? e.pageY : window.event.y) + wmtt.offsetParent.scrollTop - wmtt.offsetParent.offsetTop;
    wmtt.style.left = (x + 20) + "px";
    wmtt.style.top   = (y + 20) + "px";
  }
}
function showWMTT(id) {
  wmtt = document.getElementById(id);
  wmtt.style.display = "block";
}
function hideWMTT() {
  wmtt.style.display = "none";
}
