/* -- Adobe GoLive JavaScript Library */


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImagesArray(array) {
	if (preloadFlag == true) {
		var d = document; var img;
		for (var i=0; i<array.length; i+=2) {
			img = null; var n = array[i];
			if (d.images) {img = d.images[n];}
			if (!img && d.getElementById) {img = d.getElementById(n);}
			if (img) {img.src = array[i+1];}
		}
	}
}

function changeImages() {
	changeImagesArray(changeImages.arguments);
}

var preloadFlag = false;
function mouse_overImages() {
	if (document.images) {
		mouse_Home_over = newImage('../images/Home_over.jpg');
		mouse_Astronomie_over = newImage('../images/astronomie_over.jpg');
		mouse_Oldtimer_over = newImage('../images/oldtimer_over.jpg');
		mouse_Persoenlich_over = newImage('../images/persoenlich_over.jpg');
		mouse_ab1996_over = newImage('../images/button_1996_over.jpg');
		mouse_zust2006_over = newImage('../images/button_2006_over.jpg');
		mouse_rest2007_over = newImage('../images/button_2007_over.jpg');
		preloadFlag = true;
	}
}

function menuToggle(cmd)
{
var cmdId = this.parent.links.document.getElementById("menu_" + cmd);
if (null == cmdId) return;
if (cmdId.style.display == '') {
var image = this.parent.links.document.getElementById(cmd + "_img");
image.src = "../images/big_plus.jpg";
cmdId.style.display = 'none';
} else {
var image = this.parent.links.document.getElementById(cmd + "_img");
image.src = "../images/big_minus.jpg";
cmdId.style.display = '';
}
}

function menuSwitch(page1,page2,frameFile)
{
var cmdId1 = this.document.getElementById("menu_" + page1);
if (null == cmdId1)
{
//alert("Kein menu zu " + page1 +" und " +parent.links.document.URL);
	return;
}
//else
//alert("menu zu " + page1 +" und " + cmdId1.name);

var image1 = this.document.getElementById(page1 + "_img");
image1.src = "../images/big_minus.jpg";
cmdId1.style.display = '';

if (frameFile == null)
{
//alert("menuSwitch to " + page1);
	parent.rechts.location.href = "./"+page1+"_D.html#END";
}
else {
//alert("menuSwitch to " + frameFile);
	parent.rechts.location.href = "./"+frameFile+"#END";
}

var cmdId2 = this.document.getElementById("menu_" + page2);
var image2 = this.document.getElementById(page2 + "_img");
//alert("menu 2 = menu_" + page2);
image2.src = "../images/big_plus.jpg";
cmdId2.style.display = 'none';
//alert("menu image2 fertig");
}

function menuClose(cmd)
{
if(this.parent.location.href != this.location.href) {
var cmdId = this.parent.links.document.getElementById("menu_" + cmd);
if (null != cmdId)
	{
	cmdId.style.display = 'none';
	}
var image = this.parent.links.document.getElementById(cmd + "_img");
if (null != image)
	{
	image.src = "../images/big_plus.jpg";
	}
}
}

function persSwitch()
{
var cmdId1 = document.getElementById("menu_astro_astronomie");
if (null == cmdId1) return;
var image1 = document.getElementById("astro_astronomie_img");
image1.src = "../images/big_plus.jpg";
cmdId1.style.display = 'none';

var cmdId2 = document.getElementById("menu_cel_oldtimer");
if (null == cmdId2) return;
var image2 = document.getElementById("cel_oldtimer_img");
image2.src = "../images/big_plus.jpg";
cmdId2.style.display = 'none';
parent.rechts.location.href = "./person_D.html";
}

function homeSwitch(pFramePage)
{
var framePage = pFramePage;
	if (framePage == "MenuAstro")
	{
		framePage = "#astro_astronomie_D.html";
		this.location.hash = "";
	} else if (framePage == "MenuCel")
	{
		framePage = "#cel_oldtimer_D.html";
		this.location.hash = "";
	} else if (this.location.hash == "#END") {
		this.location.hash = "";
		return;
	}
	if (framePage == "HOME")
	{
		if(this.parent.location.href == this.location.href) {
			this.location.href = "../index.html";
		}
		return;
	} else if (framePage == "HOME_ZERO") {
		parent.rechts.location.href = "./frmain_D.html#END";
		return;
	} else if(this.parent.location.href == this.location.href) {
		if (null == framePage)
		{
			this.location.replace("../index.html");
			return;
		} else {
			this.location.replace("../index.html"+framePage);
		}
    } else if (this.parent.location.hash > "#") {
			if (this.name == "rechts")
			{
				var frameFile = this.parent.location.hash;
				frameFile = framePage.replace(/#/,"");
				this.location.href = frameFile + "#END";
			} else if (this.name == "links") {
				var frameFile = this.parent.location.hash;
				frameFile = frameFile.replace(/#/,"");
				if (frameFile.match(/cel_/))
				{
//alert("now call menuSwitch mit " +frameFile);
					menuSwitch('cel_oldtimer','astro_astronomie',frameFile);				
				} else if (frameFile.match(/astro_/))
				{
//alert("now call menuSwitch mit " +frameFile);
					menuSwitch('astro_astronomie','cel_oldtimer',frameFile);
				} else {
					parent.rechts.location.href = "./"+frameFile+"#END";
				}
			}
	}
	return;
}

