function switchTab(to,from)	{
	document.forms['orderForm'].switchToSection.value = to;
	document.forms['orderForm'].switchFromSection.value = from;
	document.forms['orderForm'].submit();
}

function confirmDelete(id, idname, page, action)
{
	if(confirm("Wollen sie diesen Eintrag wirklich loeschen?"))
	{
		location.href = "?site=" + page + "&action=" + action + "&" + idname + "=" + id;
	}
}

function popup(url,width,height){
	var popupX = (screen.width/2)-(width/2);
	var popupY = (screen.height/2)-(height/2);
	var pos = "left="+popupX+",top="+popupY;

	winpops=window.open(url,"popup","width=" + width + ",height=" + height + "," + pos + ",scrollbars=yes,toolbar=yes");
}

function reloadCPFrameAndClose(url)	{
	opener.location.href = url;
	self.close();
}

function reloadParentAndClose()	{
	opener.location.reload();
	self.close();
}

function copyValueToInputfield(value,field)	{
	input_h = eval("document.forms[0]." + field);
	input_h.value = value;
}

function moveEntryFromTo(formname,source,target)	{
	var form_h = eval("document." + formname);
	var source_h = eval("document." + formname + ".elements['" + source + "']");
	var target_h = eval("document." + formname + ".elements['" + target + "']");
	var selected_ele_index = eval("document." + formname + ".elements['" + source + "'].selectedIndex");
	
	// Value und Text zwischenspeichern
	var value_to_move = source_h.value;
	var text_to_move = eval("document." + formname + ".elements['" + source + "'].options[" + selected_ele_index + "].text");
	
	// ListEntry von Source löschen
	eval("document." + formname + ".elements['" + source + "'].options[" + selected_ele_index + "] = null;");
	
	// Neuen Eintrag in target erstellen
	NewEntry = new Option(text_to_move,value_to_move,false,true);
	target_h.options[target_h.options.length] = NewEntry;
}

function selectAllMultiple(form,list)	{
	var form_h = eval("document." + form);
	var list_h = eval("document." + form + ".elements['" + list + "']");
	for (var i=0; i < list_h.options.length; i++)	{
		eval("list_h.options[" + i + "].selected = true;");
	}
}

function acceptPathAndClose(path,formname,field)	{
	form_h = eval("opener.document.forms['" + formname + "'].elements['" + field + "']");
	form_h.value = path;
	self.close();
}

function acceptPathAndCloseWithExtCheck(path,formname,field)	{
	var result_php = path.match(/(.php(3|4|5))|(.php)/);
	var result_pl = path.match(/.pl/);
	var result_cgi = path.match(/.cgi/);
	if (result_php || result_pl || result_php )	{
		form_h = eval("opener.document.forms['" + formname + "'].elements['" + field + "']");
		form_h.value = path;
		self.close();
	} else {
		alert("Keine Datei ausgewählt!");
	}
}

function switchVisibility( span ) {
		document.getElementById( 'faq_email' ).style.display = 'none';
		document.getElementById( 'faq_ftp' ).style.display = 'none';
		document.getElementById( 'faq_cgi' ).style.display = 'none';
		document.getElementById( 'faq_server-path' ).style.display = 'none';
		
    displayType = ( document.getElementById( span ).style.display == 'none' ) ? 'block' : 'none';
    document.getElementById( span ).style.display = displayType;
}

function switchVisibilityAdmin( span ) {		
    displayType = ( document.getElementById( span ).style.display == 'none' ) ? 'block' : 'none';
    document.getElementById( span ).style.display = displayType;
}