
function ImageMouseOver(imageName,imageSrcLow,imageSrcHigh) {
    this.ok = false;
    this.aktive = false;
    this.imgObj = null;
    this.imageName = imageName;
    this.imageObjLow = imageName+'low';
    this.imageObjHigh = imageName+'high';
    this.imageSrcLow = imageSrcLow;
    this.imageSrcHigh = imageSrcHigh;
    this.preloadImg = onpreloadImg;
    this.preloadImg();
    // Methoden
    this.change = changeImg;
    this.setAktive = setAktiveImg;
    this.clearAktive = clearAktiveImg;
    this.height = getHeight;
    this.width = getWidth;
    return this;
}

function onpreloadImg() {
    preload(this.imageObjLow,this.imageSrcLow);
    preload(this.imageObjHigh,this.imageSrcHigh);
    this.ok = true;
}

function changeImg(check) {
	if (!this.ok) return false;
    if (!this.aktive) {
        (check==1) ? this.imgObj=this.imageObjHigh : this.imgObj=this.imageObjLow;
        changeImage(this.imageName,this.imgObj);
    }
}

function setAktiveImg() {
    if (!this.ok) return false;
    this.change(1);
    this.aktive = true;
}

function clearAktiveImg() {
    if (!this.ok) return false;
    this.aktive = false;
    this.change(0);
}

function getHeight() {
    if (!this.ok) return false;
	return document.images[this.imageName].height;
}

function getWidth() {
    if (!this.ok) return false;
	return document.images[this.imageName].width; 
}

// Image Allgemein
function preload (imageObj,imageSrc) {
	if (document.images) {
		eval(imageObj+' = new Image();');
		eval(imageObj+'.src = "'+imageSrc+'";');
	}
}

function changeImage(imageName,imageObj) {
	if (document.images) {
		document.images[imageName].src = eval(imageObj+".src");
	}
}


/* Mouseover für toolBar */
/*
preload("imgTotop","media/totop.gif");
preload("imgTotopH","media/totop_h.gif");
preload("imgPrint","media/print.gif");
preload("imgPrintH","media/print_h.gif");
*/
/* Navigation */
aktiv = 0;

function mySubNav(arg) {
	var count = subnavItems[arg].length;
	subnav = new Array();
	subnav[arg] = "";
	if (subNavPos && navPos)
	for (i=0; i<count; i++) {
		if (i == subNavPos && arg == navPos) {
			subnav[arg] += '<div class="subNavItem"><div id="subNav_'+i+'" class="subNavAct"><a href="'+subnavLinks[arg][i]+'">'+ subnavItems[arg][i] + '</a></div></div>';
		} else {
			subnav[arg] += '<div class="subNavItem"><div id="subNav_'+i+'" class="subNavNo"><a href="'+subnavLinks[arg][i]+'" onmouseover="over(\'subNav_'+i+'\');" onmouseout="out(\'subNav_'+i+'\');">'+ subnavItems[arg][i] + '</a></div></div>';
		}
	}
	return subnav[arg];
}

function over(arg) {
	if (document.getElementById(arg)) {
		navType = arg.split("_");
		document.getElementById(arg).className = navType[0] + "Act";
		if (aktiv) {
			window.clearTimeout(aktiv);
		}
	}
}

function out(arg) {
	if (document.getElementById(arg)) {
		navType = arg.split("_");
		document.getElementById(arg).className = navType[0] + "No";
		if (navPos)
		aktiv = window.setTimeout("showSubNav("+navPos+")", 1000);
	}
}

function showSubNav(arg) {
	if (arg != "") {
		document.getElementById("sub").innerHTML = mySubNav(arg);
	} else {
		document.getElementById("sub").innerHTML = "";
	}
}


