function popwin(path, options, title, urlparams)
{
	var popwin = window.open(path+"?popwin=1&popwintitle="+title+"&"+urlparams, "popwin", options);
	popwin.focus();
}

function lang_select(path, web_root)
{
	var lang = document.forms.land_select.elements.lang.options[document.forms.land_select.elements.lang.selectedIndex].value;
	
	if(lang.match("http://"))
		var ziel = lang;
	else
	{
		if(path.length == 0)
			var ziel = web_root+"/"+lang;
		else
			var ziel = web_root+"/"+lang+"/"+path;
	}
	document.location.href = ziel;
}

function clearlogin()
{
	if(document.forms.haendler.elements.is_cleared.value == 0)
	{
		document.forms.haendler.elements.is_cleared.value = 1;
		document.forms.haendler.elements.kdnr.value       = "";
	}
}

function clearsearch()
{
	if(document.forms.suche.elements.is_cleared.value == 0)
	{
		document.forms.suche.elements.is_cleared.value = 1;
		document.forms.suche.elements.suche.value      = "";
	}
}

function replace_wildcard(wildcard, replacement, str)
{
	return str.replace(wildcard, replacement);
}

function value_einblenden()
{
	if(document.getElementById("type_select").options[document.getElementById("type_select").options.selectedIndex].value != "text" && document.getElementById("type_select").options[document.getElementById("type_select").options.selectedIndex].value != "bool")
		document.getElementById("poss_values").style.display = ''
	else
		document.getElementById("poss_values").style.display = 'none';
		
}

function anmelden(id)
{
   gross2 =  window.open("/anmelden.php?id=" + id, "fenster2", "width=400,height=550,scrollbars");
	 //alert(id);
   gross2.focus();
   gross2.moveTo(250,100);
}
