function aendern(URL)
{
	if(window.opener)
	{
		window.opener.document.location.href = URL;
		window.opener.focus();
	}
	else
	{
		var steinel = window.open(URL, "Steinel");
		steinel.focus();
	}
}

function popwin(path, options, title, urlparams)
{
	var popwin = window.open(path+"?popwin=1&popwintitle="+title+"&"+urlparams, "popwin", options);
	popwin.focus();
}

function video_win(nr, bereich, options)
{
	var popwin = window.open("/video_"+bereich+".php?nr="+nr, "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://") || lang.match("/index") || lang.match("/"))
		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 add_ausfuehrung(anz, which, img_path)
{
	obj        = document.getElementById(which);
	var namen  = new Array();
	var art_nr = new Array();
	
	// Formularwerte zwischenspeichern
	for(i = 1; i <= anz; i++)
	{
		namen[i]  = document.forms.produkt_edit.elements["ausfuehrung_name["+i+"]"].value;
		art_nr[i] = document.forms.produkt_edit.elements["ausfuehrung_nr["+i+"]"].value;
	}
	// ENDE Formularwerte zwischenspeichern
	
	anz     = anz + 1;
	anz_str = anz.toString();
	
	zusatz  = "<!-- Ausfuehrung "+anz_str+" -->"
							+"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"300\">"
							+"<tr>"
							+"<td><span class=\"text\">Name</span></td>"
								+"<td><img src=\""+img_path+"/platz.gif\" width=\"5\" height=\"1\" alt=\"\" border=\"0\"></td>"
								+"<td><input type=\"text\" name=\"ausfuehrung_name["+anz_str+"]\" value=\"\"></td>"
							+"</tr>"
							+"<tr>"
								+"<td><span class=\"text\">Art-Nr</span></td>"
								+"<td><img src=\""+img_path+"/platz.gif\" width=\"5\" height=\"1\" alt=\"\" border=\"0\"></td>"
								+"<td><input type=\"text\" name=\"ausfuehrung_nr["+anz_str+"]\" value=\"\"></td>"
							+"</tr>"
							+"<tr>"
								+"<td colspan=\"3\" bgcolor=\"#000000\"><img src=\""+img_path+"/platz.gif\" width=\"1\" height=\"2\" alt=\"\" border=\"0\"></td>"
							+"</tr>"
							+"<tr>"
								+"<td colspan=\"3\"><img src=\""+img_path+"/platz.gif\" width=\"1\" height=\"8\" alt=\"\" border=\"0\"></td>"
							+"</tr>"
						+"</table>"
						+"<!-- /Ausfuehrung "+anz_str+" -->";
								
	obj.innerHTML = obj.innerHTML+zusatz;
	
	// Formularwerte zuruckspielen
	for(i = 1; i < anz; i++)
	{
		document.forms.produkt_edit.elements["ausfuehrung_name["+i+"]"].value = namen[i];
		document.forms.produkt_edit.elements["ausfuehrung_nr["+i+"]"].value   = art_nr[i];
	}
	// ENDE Formularwerte zuruckspielen
	
	return anz;
}

function del_ausfuehrung(anz, which, img_path)
{


}

function bildwechsel(id, neu)
{
	var bild = document.getElementById(id);
	bild.src = neu;
}

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      = "";
	}
}
