// Zentrales Includefile für Javascript Funktionen
//
// Filename: holmpassage.js
//
// 25.02.2004 by Stefan Ostermann ostermann@dimast.de
//

function Browser() {
	var b=navigator.appName;
	if (b.indexOf('Netscape')!=-1) this.b="ns";
	else if ((b=="Opera") || (navigator.userAgent.indexOf("Opera")>0)) this.b = "opera";
	else if (b=="Microsoft Internet Explorer") this.b="ie";
	if (!b) alert('Unidentified browser.\nThis browser is not supported,');
	this.version=navigator.appVersion;
	this.v=parseInt(this.version);
	this.ns=(this.b=="ns" && this.v>=4);
	this.ns4=(this.b=="ns" && this.v==4);
	this.ns6=(this.b=="ns" && this.v==5);
	this.ie=(this.b=="ie" && this.v>=4);
	this.ie4=(this.version.indexOf('MSIE 4')>0);
	this.ie5=(this.version.indexOf('MSIE 5')>0);
	this.ie55=(this.version.indexOf('MSIE 5.5')>0);
	this.ie6=(this.version.indexOf('MSIE 6.0')>0);
	this.opera=(this.b=="opera");
	this.dom=(document.createElement && document.appendChild && document.getElementsByTagName)?true:false;
	this.def=(this.ie||this.dom); // most used browsers, for faster if loops
	var ua=navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")>-1) this.platform="win32";
	else if (ua.indexOf("mac")>-1) this.platform="mac";
	else this.platform="other";
}

nMaxItem = 4;
NameIndex = 0;
MouseOverState = 1;
MouseClickState = 2;
MouseDownState = 3;
MouseOutState = 4;
sndCounter = 0;
SoundList = new Array();
is=new Browser();

function RestoreImage(){ //v2.0
	nCount = document.OriginImage.length;
	ImgArray = document.OriginImage;

	if (document.OriginImage != null)
		for (i = 0; i < (nCount - 1); i += 2)
			ImgArray[i].src = ImgArray[i+1];
	document.OriginImage = null;
}

function ReplaceImage(){ //v2.0
	j = 0;
	ImgArray = new Array;
	oldImgArray = document.OriginImage;

	for (i = 0; i < ReplaceImage.arguments.length; i += 2) {
		obj=ReplaceImage.arguments[i]
		ImgArray[j++] = obj;
		if (oldImgArray == null || oldImgArray[j-1] != obj)
			ImgArray[j++] = obj.src;
		else
			ImgArray[j++] = oldImgArray[j];
		obj.src = ReplaceImage.arguments[i + 1];
	}
	if (document.OriginImage == null)
		document.OriginImage = ImgArray;
}

function popup(url,windowname,winwidth,winheight) {
  xoffset = (screen.width - winwidth)/2;
  yoffset = (screen.height - winheight)/2;
  newwindow = window.open(url, windowname, 'location=no,menubar=no,toolbar=no,height='+winheight+',width='+winwidth+',dependent');
  newwindow.moveTo(xoffset,yoffset);
}


