//Browsercheck
function lib_bwcheck() { 
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera5=this.agent.indexOf("Opera 5")>-1;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie50=(this.ver.indexOf("MSIE 5.0")>-1||this.ver.indexOf("MSIE 5.1")>-1)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.iemac=this.ie50&&this.mac;
	this.bw=(this.ie6 || this.ie5 || this.iemac || this.ie4 || this.ns4 || this.ns6 || this.opera5);
	return this;
}
var bw=new lib_bwcheck();

//Preloader
var PreloadNamen=getIllus();
var bildobjekte=new Array();

function preLoad() {
	for (i=0;i<PreloadNamen.length;i++){
		bildobjekte[i]=new Image();
		bildobjekte[i].src=PreloadNamen[i];
	}
}

//Weiterschalter Bilder
var anz,x;
var me="illu";

function ill(rew) {
	(me=="illu")?anz=anzIllus:anz=anzScribbles;
	if(rew)(x==1)?x=anz:x--;
	else(x==anz)?x=1:x++;
	var ill = "bilder/"+me+x+".jpg";
	(me=="illu")?document.szekessy.src=ill:document.tanja.src=ill;
}

//Layer zeigen/verstecken
var lyr;

function swapLayers(id) {
	me=id; x=1;
	hideLayer("tanja");
	showLayer("nav");
	var ill1 = "bilder/"+me+"1.jpg";
	(me=="illu")?document.szekessy.src=ill1:document.tanja.src=ill1;
	if(lyr)hideLayer(lyr);
	showLayer(id);
	lyr=id;
}

function showLayer(id) {
  var lyr=getElemRefs(id);
  if (lyr&&lyr.css)lyr.css.visibility="visible";
}

function hideLayer(id) {
  var lyr=getElemRefs(id);
  if(lyr&&lyr.css)lyr.css.visibility="hidden";
}

function getElemRefs(id) {
	var el=(document.getElementById)?document.getElementById(id):(document.all)?document.all[id]:(document.layers)?document.layers[id]:null;
	if (el)el.css=(el.style)?el.style:el;
	return el;
}

//MouseOverHold Menue
var lastmoo;
function moo(id,my) {
	if(lastmoo!=id){
		var men="shared/button"+my+".gif";
		document.images[id].src=men;
	}
	else return;	
}

function mooMe(id) {
	if(lastmoo)document.images[lastmoo].src="shared/button1.gif";
	document.images[id].src="shared/button2.gif";
	lastmoo=id;
}

//other
function neu() {
self.location.reload();
}

// Netscape resize fix
function netscapeResizeFix() {
	if (typeof (ns_origWidth) != "number" || typeof (ns_origHeight) != "number") return;
	if (innerWidth != ns_origWidth || innerHeight != ns_origHeight) location.reload();
}

//onload selfinstall
if (bw.ns4){
	ns_origWidth = innerWidth;
	ns_origHeight = innerHeight;
	window.onresize = netscapeResizeFix;
	} 
if (bw.iemac) window.onresize=neu;

