// Javascript für "Link in Lupe"
function openparentlink(mydiv) {
	var browser = navigator.userAgent.toLowerCase();

	// Get the onclick data and extract the img's w/h!
	var vJS = String(document.getElementById(mydiv).parentNode.getElementsByTagName('a')[0].onclick);
	var vSplit = vJS.split(',');

	// ?? Ein "/' ist trotz split noch drinne ...
	if ((browser.indexOf('msie') != -1) && (browser.indexOf('opera') == -1)) {
		var vWidth = vSplit[2].replace(/'width/, 'width');
	} else {
		var vWidth = vSplit[2].replace(/"width/, 'width');
	}
	parentlink = document.getElementById(mydiv).parentNode.getElementsByTagName('a')[0];
	openPic(parentlink,'thePicture',''+vWidth+','+vSplit[3]+',status=0,menubar=0');
}

// Funktion, um das Suchfeld bei Eingabe zu löschen und zu setzen
function setSearchWord(sWord, sMode) {
	fInput = document.getElementById('suchwort');
	switch(sMode) {
		case 0:
			if (fInput.value == sWord) fInput.value = '';
		break;
		case 1:
			if (fInput.value == '') fInput.value = sWord;
		break;
	}
}

// HauptNavi Ausklapp-Steuerung
var dir		= 0;	// Zustand des Elements nach jsEffekt : 0 = zugeklappt, 1 = aufgeklappt
var divID	= ''; // ID aktuelles DIV

function manageMenu(el) {
	if (divID=='') {
		new Effect.BlindDown(el);
		dir = 1;
	} else if (el==divID && dir==1) {
		new Effect.BlindUp(el);
		dir = 0;
	} else if (el==divID && dir==0) {
		new Effect.BlindDown(el);
		dir = 1;
	} else if (divID!=el) {
		new Effect.BlindUp(divID, {afterFinish: function() {Effect.BlindDown(el);}});
		dir = 1;
	}
	divID = el;
}