var tmpTitel = document.title.replace("Speedy´s Hamsterseiten / Alles über und rund um Hamster","");
var tmpURLLang = document.URL.substr(document.URL.lastIndexOf("/")+1,document.URL.length);
var tmpURL = tmpURLLang;
var tmpQuery = "";
if (tmpURLLang.lastIndexOf("?") > 0) {
	var tmpURL = tmpURLLang.substr(0,tmpURLLang.lastIndexOf("?"));
	var tmpQuery = tmpURLLang.substr(tmpURLLang.lastIndexOf("?")+1,tmpURLLang.length);
}
if ((self.name != "speedy_main") && (self.name != "Infofenster")) top.location.href = "http://www.hamsterseiten.de/index.asp?titel=" + escape(tmpTitel) + "&site=" + escape(tmpURL) + "&query=" + escape(tmpQuery);

if (document.all) {
	document.writeln('<style type="text/css">');
	document.writeln('<!--');
	document.writeln('.menubg {background-color:#FFFFFF; filter:Alpha(opacity=80, finishopacity=80, style=0);}');
	document.writeln(' -->');
	document.writeln('</style>');
}

var nn=document.layers?true:false;
var ie=document.all?true:false;
var iCheck = true;
var fJS = false;
var vn = navigator.appVersion.substring(0,1);
var lay_open = -1;
var anzahl = 7;
var n_anzahl = 3;
var l_anzahl = 4;
var imp = null;
var tmpLinksRahmen = 0;
var mOver1 = new Image();
mOver1.src = "gif/pfeil2.gif";
var mOver2 = new Image();
mOver2.src = "gif/point.gif";
var mOut = new Image();
mOut.src = "gif/spc.gif";

tmpLinksRahm = new Array(l_anzahl);
hoehe = new Array(l_anzahl);
breite = new Array(l_anzahl);
lay_id = new Array(l_anzahl);
lay = new Array(l_anzahl);
zustand = new Array(l_anzahl);

menuNor = new Array(anzahl);
menuFoc = new Array(anzahl);

navNor = new Array(n_anzahl);
navFoc = new Array(n_anzahl);

function init() {
	if (vn >= 4) {
		// Btns vorladen.
		for (i=0; i<=anzahl-1; i++) {		
			menuNor[i] = new Image();
			menuNor[i].src = "gif/b_0" + (i+1) + "n.gif";
			menuFoc[i] = new Image();
			menuFoc[i].src = "gif/b_0" + (i+1) + "f.gif";
		}
		for (i=1; i<=n_anzahl; i++) {		
			navNor[i] = new Image();
			navNor[i].src = "gif/n_0" + i + "n.gif";
			navFoc[i] = new Image();
			navFoc[i].src = "gif/n_0" + i + "f.gif";
		}
		if ((!ie) && (!nn)) {
			//alert("OK");
			lay_id[0] = document.getElementById("anschaffung").style;
			lay_id[1] = document.getElementById("haltung").style;
			lay_id[2] = document.getElementById("zucht").style;
			lay_id[3] = document.getElementById("allgemeines").style;
			
			hoehe[0] = 5 + document.getElementById("anschaffung").offsetHeight;
			hoehe[1] = 5 + document.getElementById("haltung").offsetHeight;
			hoehe[2] = 5 + document.getElementById("zucht").offsetHeight;
			hoehe[3] = 5 + document.getElementById("allgemeines").offsetHeight;
			
			breite[0] = 5 + document.getElementById("anschaffung").offsetWidth;
			breite[1] = 5 + document.getElementById("haltung").offsetWidth;
			breite[2] = 5 + document.getElementById("zucht").offsetWidth;
			breite[3] = 5 + document.getElementById("allgemeines").offsetWidth;
			
			maxBreite = window.innerWidth;
			
			document.onmousemove=mouseMove;
		}
		if (ie) {
			lay_id[0] = document.all['anschaffung'].style;
			lay_id[1] = document.all['haltung'].style;
			lay_id[2] = document.all['zucht'].style;
			lay_id[3] = document.all['allgemeines'].style;
			
			hoehe[0] = 5 + document.all['anschaffung'].offsetHeight;
			hoehe[1] = 5 + document.all['haltung'].offsetHeight;
			hoehe[2] = 5 + document.all['zucht'].offsetHeight;
			hoehe[3] = 5 + document.all['allgemeines'].offsetHeight;
			
			breite[0] = 5 + document.all['anschaffung'].offsetWidth;
			breite[1] = 5 + document.all['haltung'].offsetWidth;
			breite[2] = 5 + document.all['zucht'].offsetWidth;
			breite[3] = 5 + document.all['allgemeines'].offsetWidth;
			
			maxBreite = document.body.clientWidth;
			
			document.onmousemove=mouseMove;
		}
		if (nn) {
			lay_id[0] = document['anschaffung'];
			lay_id[1] = document['haltung'];
			lay_id[2] = document['zucht'];
			lay_id[3] = document['allgemeines'];
			lay[0] = "anschaffung";
			lay[1] = "haltung";
			lay[2] = "zucht";
			lay[3] = "allgemeines";
			
			for (i=0; i<l_anzahl; i++) {
				hoehe[i] = 5 + lay_id[i].document.height;
				breite[i] = 5 + lay_id[i].document.width;
			}
			
			maxBreite = window.innerWidth;
			
			window.captureEvents(Event.MOUSEMOVE);
			window.onMouseMove=mouseMove;
		}
		for (i=0; i<l_anzahl; i++) {
			if (nn) tmpLinksRahm[i] = lay_id[i].left;
			if ((ie) || ((!ie) && (!nn))) tmpLinksRahm[i] = parseInt(lay_id[i].left);
			//alert(tmpLinksRahm[i]);
		}
		fJS = true;
		positionLayer();
	}
}

var sw = null;
function swverzeichnis(datei,x,y,scbar,stat) {
	tmpScroll = "yes";
	if (scbar == 0) tmpScroll = "no";
	tmpStat = "yes";
	if (stat == 0) tmpStat = "no";
	if (!x) var tmpX = 520;
	else var tmpX = x+20;
	if (!y) var tmpY = 350;
	else var tmpY = y+30;
	if (sw != null) if (!sw.closed) sw.close();
	sw = window.open('/' + datei,'Stichwortverzeichnis','marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=' + tmpScroll + ',status=' + tmpScroll + ',width=' + tmpX + ',height=' + tmpY + ',resizable=no');
	if (sw.opener==null) sw.opener=self;
	if (vn >= "4")sw.moveTo((screen.availWidth/2)-tmpX/2,(screen.availHeight/2)-tmpY/2);
	return;
}

function mouseMove(Ereignis) {
	if (nn) {
		xwert = Ereignis.pageX;
		ywert = Ereignis.pageY;
		var outPos = 30;
	}
	if (ie) {
		xwert = window.event.clientX;
		ywert = window.event.clientY;
		var outPos = 30 - document.body.scrollTop;
	}
	if ((!ie) && (!nn)) {
		//alert("OK");
		xwert = Ereignis.pageX;
		ywert = Ereignis.pageY;
		var outPos = 30;
	}
	//window.status = document.body.scrollTop + "/" + xwert + "/" + ywert;
	if ((lay_open >= 0) && (ywert < parseInt(outPos))) Reset();
	if ((lay_open >= 0) && (xwert < parseInt(lay_id[lay_open].left)-5)) Reset();
	if ((lay_open >= 0) && (ywert > parseInt(outPos+hoehe[lay_open]+20))) Reset();
	if ((lay_open >= 0) && (xwert > parseInt(lay_id[lay_open].left)+breite[lay_open]+5)) Reset();
}

function m_go(lay) {
	if ((fJS) && (lay != lay_open)) {
		for(i=0;i<l_anzahl;i++) {
			if (zustand[i] > 0) {
				//alert(zustand[i] + "/" + i);
				if (nn) lay_id[i].visibility = "hide";
				if (((!ie) && (!nn)) || (ie)) lay_id[i].visibility = "hidden";
				var s = "b" + (i+1);
				if (((i+1) != mainsite) && (document.images[s].src != menuNor[i].src)) document.images[s].src = menuNor[i].src;
			}
		}
		lay_open = lay;
		zustand[lay] = 1;
		var s = "b" + (lay+1);
		if (document.images[s].src != menuFoc[lay].src) document.images[s].src = menuFoc[lay].src;
		if (nn) lay_id[lay].visibility = "show";
		if (((!ie) && (!nn)) || (ie)) lay_id[lay].visibility = "visible";
	}
}

function Reset() {
	if((fJS) && (lay_open >= 0)) {
		for(i=0;i<=l_anzahl-1;i++) {
			if (zustand[i] != 0) {
				if (nn) lay_id[i].visibility = "hide";
				if (((!ie) && (!nn)) || (ie)) lay_id[i].visibility = "hidden";
				zustand[i] = 0;
				var s = "b" + (i+1);
				if ((i+1) != mainsite) document.images[s].src = menuNor[i].src;
			}
		}
		lay_open = -1;
	}
}

function impressum() {
	if (imp != null) if (!imp.closed) imp.close();
	imp = window.open('impressum.htm','Impressum','left=0,top=0,marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=yes,status=no,width=250,height=450,resizable=no');
	if (imp.opener==null) imp.opener=self;
	return;
}

var tickerTime = null;
function wichtig() {
	if (fJS) {
		var tmpTxt = headline + tickTxt[tickNr] + subline;
		if (nn) {
			with (document.rahmen.document.inhalt.document) {
				open();
				write(tmpTxt);
				close();
			}
		}
		if (ie) {
			inhalt.filters.revealTrans.Apply();
			inhalt.innerHTML = tmpTxt;
			inhalt.filters.revealTrans.Play();
		}
		if ((!nn) && (!ie)) document.getElementById("inhalt").innerHTML = tmpTxt;
		if (tickerStatus) {
			tickNr += 1;
			if (tickNr == anzahl_ticker) tickNr = 0;
		}
	}
	if (tickerTime != null) window.clearTimeout(tickerTime);
	if (tickerStatus) tickerTime = setTimeout('wichtig()',4000);
}

function tickerMove(id) {
	if ((fJS) && (!tickerStatus)) {
		tickNr += id;
		if (tickNr == anzahl_ticker) tickNr = 0;
		if (tickNr < 0) tickNr = anzahl_ticker-1;
		wichtig();
	}
}

var tickerStatus = true;
function infoTicker(id) {
	if (fJS) {
		if (id == 0) {
			if (tickerTime != null) window.clearTimeout(tickerTime);
			var s = "tp";
			document.images[s].src = "gif/pause1.gif";
			var s = "ts";
			document.images[s].src = "gif/pfeil2.gif";
			var s = "tu";
			document.images[s].src = "gif/u2.gif";
			var s = "td";
			document.images[s].src = "gif/d2.gif";
			tickerStatus = false;
		}
		if (id == 1) {
			var s = "tp";
			document.images[s].src = "gif/pause2.gif";
			var s = "ts";
			document.images[s].src = "gif/pfeil1.gif";
			var s = "tu";
			document.images[s].src = "gif/u1.gif";
			var s = "td";
			document.images[s].src = "gif/d1.gif";
			tickerStatus = true;
			wichtig();
		}
	}
}

function Focus(idx) {
	// Btn fokussiert darstellen.
	if ((fJS) && (idx != (site-7))) {
		var s = "m"+idx;
		document.images[s].src = mOver1.src;
	}
}

function Focus1(idx) {
	// Btn fokussiert darstellen.
	if (fJS) {
		var s = "s"+idx;
		document.images[s].src = mOver2.src;
	}
}

function Focus2(idx) {
	// Btn fokussiert darstellen.
	if ((fJS) && (idx != site)) {
		var s = "n"+idx;
		document.images[s].src = navFoc[idx].src;
	}
}

function Focus3(idx) {
	// Btn fokussiert darstellen.
	if (fJS) {
		var s = "b"+idx;
		if (((!ie) && (!nn)) || (ie)) document.images[s].src = mOver2.src;
		if (nn) lay_id[lay_open].document.images[s].src = mOver2.src;
	}
}

function Focus4(idx) {
	// Btn fokussiert darstellen.
	if ((fJS) && (idx != mainsite)) {
		if (lay_open >= 0) Reset();
		var s = "b"+idx;
		if (((!ie) && (!nn)) || (ie)) document.images[s].src = menuFoc[idx-1].src;
		if (nn) document.images[s].src = menuFoc[idx-1].src;
	}
}

function Blur(idx) {
	// Btn normal darstellen.
	if ((fJS) && (idx != (site-7))) {
		var s = "m"+idx;
		document.images[s].src = mOut.src;
	}
}

function Blur1(idx) {
	// Btn normal darstellen.
	if (fJS) {
		var s = "s"+idx;
		document.images[s].src = mOut.src;
	}
}

function Blur2(idx) {
	// Btn normal darstellen.
	if ((fJS) && (idx != site)) {
		var s = "n"+idx;
		document.images[s].src = navNor[idx].src;
	}
}

function Blur3(idx) {
	// Btn normal darstellen.
	if (fJS) {
		var s = "b"+idx;
		if (((!ie) && (!nn)) || (ie)) document.images[s].src = mOut.src;
		if (nn) lay_id[lay_open].document.images[s].src = mOut.src;
	}
}

function Blur4(idx) {
	// Btn normal darstellen.
	if ((fJS) && (idx != mainsite)) {
		var s = "b"+idx;
		if (((!ie) && (!nn)) || (ie)) document.images[s].src = menuNor[idx-1].src;
		if (nn) document.images[s].src = menuNor[idx-1].src;
	}
}

function ieFake(fake) {
	if ((document.all) && (fake)) fake.blur();
}

var tmpTxt;

function statAnzeige(txt) {
	tmpTxt = txt;
	setTimeout("window.status = tmpTxt;",0);
	return true;
}

function inhaltCheck(field,txt,url) {
	iCheck = true;

	for(i=0;i<field.value.length;i++) {
		if (field.value.substr(i,1) != ' ') {
			iCheck = false;
			i = field.value.length;
		}
	}
	if (iCheck) {
		alert(txt);
		//return false;
	}
	else document.location.href = url;
}

function loginCheck(inout,seite) {
	iCheck = true;

	for(i=0;i<document.eingabe.nickname.value.length;i++) {
		if (document.eingabe.nickname.value.substr(i,1) != ' ') {
			iCheck = false;
			i = document.eingabe.nickname.value.length;
		}
	}
	for(i=0;i<document.eingabe.passwort.value.length;i++) {
		if (document.eingabe.passwort.value.substr(i,1) != ' ') {
			iCheck = false;
			i = document.eingabe.passwort.value.length;
		}
	}
	if ((document.eingabe.nickname.value == '') || (document.eingabe.passwort.value == '') || (iCheck)) {
		alert("Bitte geben Sie Ihren Benutzernamen und das zugehörige Passwort an!");
		return false;
	}
	else {
		if (seite) return inout+".asp?herkunft="+seite;
		else return inout+".asp";
	}
}

var wi = null;
function info(datei,x,y,scbar) {
	tmpScroll = "yes";
	if (scbar == 0) tmpScroll = "no";
	if (!x) var tmpX = 520;
	else var tmpX = x+20;
	if (!y) var tmpY = 350;
	else var tmpY = y+30;
	if (wi != null) if (!wi.closed) wi.close();
	wi = window.open('/' + datei,'Infofenster','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=' + tmpScroll + ',status=no,width=' + tmpX + ',height=' + tmpY + ',resizable=no');
	if (wi.opener==null) wi.opener=self;
	//if (vn >= "4") wi.moveTo((screen.availWidth/2)-tmpX/2,(screen.availHeight/2)-tmpY/2);
	return;
}

var ew = null;
function webkarte(datei,x,y,alt,scbar) {
	var tmpX = x+20;
	var tmpY = y+80;
	var tmpSc = "no";
	if (tmpY > 500) {
		tmpY = 500;
		tmpSc = "yes";
		tmpX += 20;
	}
	if (scbar == 1) {
		tmpSc = "yes";
		tmpX += 20;
	}
	if (ew != null) if (!ew.closed) ew.close();
	ew = window.open('/webkarte.asp?hoch=' + y + '&breit=' + x + '&bild=' + datei + '&titel=' + alt,'Bildvergroesserung','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=' + tmpSc + ',status=no,width=' + tmpX + ',height=' + tmpY + ',resizable=no');
	if (ew.opener==null) ew.opener=self;
	//if (vn >= "4") ew.moveTo((screen.availWidth/2)-tmpX/2,(screen.availHeight/2)-tmpY/2);
	return;
}

var ew = null;
function zoomFenster(datei,x,y,alt,scbar,id,wo) {
	var tmpX = x+52;
	var tmpY = y+90;
	if (id > 0) tmpY = tmpY+20;
	var tmpSc = "no";
	if (tmpY > 500) {
		tmpY = 500;
		tmpSc = "yes";
		tmpX += 16;
	}
	var scbar = 1;
	if (scbar == 1) {
		tmpSc = "yes";
		tmpX += 16;
	}
	if (ew != null) if (!ew.closed) ew.close();
	//alert("OK");
	ew = window.open('/zoom.asp?id=' + id + '&hoch=' + y + '&breit=' + x + '&bild=' + datei + '&titel=' + alt + '&woher=' + wo,'Bildvergroesserung','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=' + tmpSc + ',status=no,width=' + tmpX + ',height=' + tmpY + ',resizable=no');
	if (ew.opener==null) ew.opener=self;
	//if (vn >= "4") ew.moveTo((screen.availWidth/2)-tmpX/2,(screen.availHeight/2)-tmpY/2);
	return;
}

var vw = null;
function videoFenster(datei,x,y,alt,scbar) {
	var tmpX = x+20;
	var tmpY = y+115;
	var tmpSc = "no";
	if (tmpY > 500) {
		tmpY = 500;
		tmpSc = "yes";
		tmpX += 20;
	}
	if (scbar == 1) {
		tmpSc = "yes";
		tmpX += 20;
	}
	if (vw != null) if (!vw.closed) vw.close();
	vw = window.open('/video.asp?bild=' + datei + '&titel=' + alt,'Video','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=' + tmpSc + ',status=no,width=' + tmpX + ',height=' + tmpY + ',resizable=no');
	if (vw.opener==null) vw.opener=self;
	//if (vn >= "4") vw.moveTo((screen.availWidth/2)-tmpX/2,(screen.availHeight/2)-tmpY/2);
	return;
}

function feldGr(feld,inhalt,max) {
	who = feld;
	if (inhalt >= max) {
		alert('Achtung, maximale Feldgröße erreicht!');
		who.value = who.value.substr(0,max-1);
	}
}

function checkErweitertStichwort() {
	if ((!document.erweitertesucheingabe.infopool.checked) && (!document.erweitertesucheingabe.forum.checked) && (!document.erweitertesucheingabe.nachrichten.checked) && (!document.erweitertesucheingabe.textbeitrag.checked)) {
		alert("Einen Bereich sollten Sie schon auswählen,\nsonst macht die Suche wenig Sinn!");
		return false;
	}
	if ((document.erweitertesucheingabe.forum.checked) && (!document.erweitertesucheingabe.thema.checked) && (!document.erweitertesucheingabe.beitrag.checked)) {
		alert("Wählen Sie noch aus, ob in den Themen\nund/oder in den Beiträgen gesucht werden soll!");
		return false;
	}
	if ((document.erweitertesucheingabe.stichwort.value == "") && (!document.erweitertesucheingabe.forum.checked) && (!document.erweitertesucheingabe.textbeitrag.checked)) {
		alert("Ein Stichwort sollten Sie schon eintragen,\nsonst macht die Suche wenig Sinn!");
		return false;
	}
	if ((document.erweitertesucheingabe.stichwort.value == "") && ((document.erweitertesucheingabe.infopool.checked) || (document.erweitertesucheingabe.nachrichten.checked))) {
		alert("Ein Stichwort sollten Sie schon eintragen,\nsonst macht die Suche wenig Sinn!");
		return false;
	}
	if ((document.erweitertesucheingabe.stichwort.value == "") && (document.erweitertesucheingabe.forum.checked) && (document.erweitertesucheingabe.usernamen.options[document.erweitertesucheingabe.usernamen.selectedIndex].value == 0)) {
		alert("Wählen Sie bitte ein Mitglied aus, dessen Beiträge sie anzeigen möchten!");
		return false;
	}
	if ((document.erweitertesucheingabe.stichwort.value == "") && (document.erweitertesucheingabe.textbeitrag.checked) && (document.erweitertesucheingabe.usernamen1.options[document.erweitertesucheingabe.usernamen1.selectedIndex].value == 0)) {
		alert("Wählen Sie bitte ein Mitglied aus, dessen Beiträge sie anzeigen möchten!");
		return false;
	}
}

function checkMainStichwort() {
	if (document.sucheingabe.stichwort.value == "") {
		alert("Ein Stichwort sollten Sie schon eintragen,\nsonst macht die Suche wenig Sinn!");
		return false;
	}
}

function checkStichwort() {
	if (document.stichwort.wort.value == "") {
		alert("Ein Stichwort sollten Sie schon eintragen,\nsonst macht die Suche wenig Sinn!");
		return false;
	}
}

function checkUsername() {
	if (document.namepruefung.Nutzername.value == "") {
		alert("Einen Benutzernamen sollten Sie schon eintragen,\nsonst macht die Prüfung wenig Sinn!");
		return false;
	}
}
