// *** checkform ***
// Funktion zum Abfragen der Formulareinträge
function checkform(form) {
	if (window.document.all.name.value=='' || window.document.all.email.value=='') {
   		alert('Please insert your name and email adresse.');
		if (window.document.all.name.value=='') {
			window.document.all.name.focus();
		}
		else window.document.all.email.focus();
		return false;
	}
	else return true;
}

// *** layer_anzeigen ***
function layer_anzeigen(obj) {
	del_layer(obj.parentNode.parentNode);
	for (var i = 0; i < obj.parentNode.childNodes.length; i++) {
		if (obj.parentNode.childNodes[i].className == "bb_layer") {
			obj.parentNode.childNodes[i].style.visibility = "visible";
		}
	}
}
//####################################################################

// *** del_layer ***
// damit wird der Layer geschlossen
function del_layer(obj) {
	if (!obj) obj=document.body;
	for (var i = 0; i < obj.childNodes.length; i++) {
		if (obj.childNodes[i].hasChildNodes()) {
			del_layer(obj.childNodes[i]);
		}
		if (obj.childNodes[i].className == "bb_layer") {
			obj.childNodes[i].style.visibility = "hidden";
		}
	} // for
}

//####################################################################

// *** teilmenu ***
function teilmenu(obj) {
	for (var i = 0; i < obj.childNodes.length; i++) {
		if (obj.childNodes[i].className == "bbmenu") {
			for (var j = 0; j < obj.childNodes[i].childNodes.length; j++) {
				if (obj.childNodes[i].childNodes[j].nodeName.toUpperCase() == "DIV") {
					return obj.childNodes[i].childNodes[j];
				}
			} // for
		} // if
		if(obj.childNodes[i].hasChildNodes()) {
			return teilmenu(obj.childNodes[i]);
		}
	} // for
	return false;
}

//####################################################################

/// *** untermenu ***
function untermenu(obj) {
	if (obj.parentNode.parentNode.parentNode.className == "untermenupunkt") {
		var myObj = teilmenu(obj.parentNode.parentNode.parentNode);
		myObj.backupbgcolor = myObj.style.backgroundColor;
		myObj.style.backgroundColor="#95A4BF";
	}
	obj.backupbgcolor = obj.style.backgroundColor;
	obj.style.backgroundColor="#95A4BF";
}

//####################################################################

// *** open_url ***
// öffnet die Ziel-url (z.B. bei onClick)
function open_url(url) {
	location.href = url;
}

//####################################################################

// *** open_url ***
// öffnet die Ziel-url (z.B. bei onClick) in einem Popup-Fenster
function popup (url) {
	fenster = window.open(url, "Popupfenster", "width=590,height=740,resizable=yes");
	fenster.focus();
 return false;
}


//####################################################################

// *** show_untermenu ***
function show_untermenu(obj) {
	if(obj.parentNode.parentNode.parentNode.className == "untermenupunkt") {
		myObj = teilmenu(obj.parentNode.parentNode.parentNode);
		myObj.style.backgroundColor=myObj.backupbgcolor;
	}
	obj.style.backgroundColor=obj.backupbgcolor;
}

//####################################################################