var activeObj = new Object();

function openMenuLang()
{
	document.getElementById("menu_lang").className = "active";
	document.getElementById("submenu_lang").style.display = "inline";
	document.getElementById("menu_lang_img").style.display = "inline";
}

function closeMenuLang()
{
	document.getElementById("menu_lang").className = "inactive";
	document.getElementById("submenu_lang").style.display = "none";
	document.getElementById("menu_lang_img").style.display = "none";
}

function openMenu(obj)
{
	document.getElementById("menu_top_sub").style.display = "inline";
	document.getElementById(obj).style.visibility = "visible";
	if (document.getElementById((obj + '_link'))) {
		document.getElementById((obj + '_link')).style.color = "#000000";
	}
}
function closeMenu(obj)
{
	document.getElementById("menu_top_sub").style.display = "none";
	document.getElementById(obj).style.visibility = "hidden";
	if (document.getElementById((obj + '_link'))) {
		document.getElementById((obj + '_link')).style.color = "#FFFFFF";
	}
}

function checkKontaktForm()
{
	var noerror = true;
	var objError = document.getElementById('error');
	var objName = document.getElementById('name');
	var objMail = document.getElementById('mail');
	var objTelefon = document.getElementById('telefon');
	var objMobil = document.getElementById('mobil');
	var objRueckruf = document.getElementById('rueckruf');
	
	if (objName.value == "" || objMail.value == "") {
		if (objName.value == "") {
			markMissingKontaktForm(objName);
			noerror = false;
		} else {
			unmarkMissingKontaktForm(objName);
		}
		if (objMail.value == "") {
			markMissingKontaktForm(objMail);
			noerror = false;
		} else {
			unmarkMissingKontaktForm(objMail);
		}
	}
	if (objRueckruf.checked == true && objTelefon.value == "" && objMobil.value == "") {
		if (objTelefon.value == "") {
			markMissingKontaktForm(objTelefon);
			noerror = false;
		} else {
			unmarkMissingKontaktForm(objTelefon);
		}
		if (objMobil.value == "") {
			markMissingKontaktForm(objMobil);
			noerror = false;
		} else {
			unmarkMissingKontaktForm(objMobil);
		}
	} else {
		unmarkMissingKontaktForm(objTelefon);
		unmarkMissingKontaktForm(objMobil);
	}
	
	if (!noerror) {
		objError.style.display = "inline";	
	} else {
		objError.style.display = "none";	
	}
	
	return noerror;
}

function markMissingKontaktForm(obj)
{
	obj.style.borderColor = "blue";
}

function unmarkMissingKontaktForm(obj)
{
	obj.style.borderColor = "#98989B";
}

function openwindow(target,name,optional)
{
	if (optional) {
		popUpWin = window.open(target,name,optional);
	} else {
		popUpWin = window.open(target,name);
	}
	popUpWin.focus();
}