function SetReadOnly(FormName, InputName, Readonly) {
	
	document.forms[FormName].elements[InputName].readOnly = Readonly;
	
}

function SetRadioButton(FormName, RadioButtonName, RadioButtonValue) {
	
	document.forms[FormName].elements[RadioButtonName][RadioButtonValue].checked = true;
	
}

function ReloadDetailPage(FormName, FormAction, FormNextSite) {

	if (document.forms[FormName].elements["schemamenue"]) {
		document.forms[FormName].elements["variante1"].value = document.forms[FormName].elements["schemamenue"].value;
	}
	
	if (document.forms[FormName].elements["schemamenue1"]) {
		document.forms[FormName].elements["variante2"].value = document.forms[FormName].elements["schemamenue1"].value;
	}

	if (document.forms[FormName].elements["schemamenue2"]) {
		document.forms[FormName].elements["variante3"].value = document.forms[FormName].elements["schemamenue2"].value;
	}

	if (document.forms[FormName].elements["schemamenue3"]) {
		document.forms[FormName].elements["variante4"].value = document.forms[FormName].elements["schemamenue3"].value;
	}
	
	document.forms[FormName].elements["formaction"].value = FormAction;
	document.forms[FormName].action = FormNextSite;
	document.forms[FormName].submit();
	
}

function GoToDetailPage(FormName, FormAction, FormNextSite) {

	if (document.forms[FormName].elements["schemamenue"]) {
		document.forms[FormName].elements["variante1"].value = document.forms[FormName].elements["schemamenue"].value;
	}
	
	if (document.forms[FormName].elements["schemamenue1"]) {
		document.forms[FormName].elements["variante2"].value = document.forms[FormName].elements["schemamenue1"].value;
	}

	if (document.forms[FormName].elements["schemamenue2"]) {
		document.forms[FormName].elements["variante3"].value = document.forms[FormName].elements["schemamenue2"].value;
	}

	if (document.forms[FormName].elements["schemamenue3"]) {
		document.forms[FormName].elements["variante4"].value = document.forms[FormName].elements["schemamenue3"].value;
	}
	
	document.forms[FormName].elements["formaction"].value = FormAction;
	document.forms[FormName].action = FormNextSite;
	document.forms[FormName].submit();

}


function SaveFormAndOpenPopup(FormName, FormAction, PopupFile, PopupWidth, PopupHeight) {
	
	document.forms[FormName].action = FormAction;
	document.forms[FormName].elements["popupfile"].value = PopupFile;
	document.forms[FormName].elements["popupwidth"].value = PopupWidth;
	document.forms[FormName].elements["popupheight"].value = PopupHeight;
	document.forms[FormName].submit()
	
}

function openFenster(datei,breite,hoehe)
{
	fenster = open(datei,"send","width="+breite+",height="+hoehe+",locationbar=no,menubar=no");
	fenster.focus();
}

function openFenster2(datei,breite,hoehe)
{
	fenster = open(datei,"big","width="+breite+",height="+hoehe+",locationbar=no,menubar=no,scrollbars=yes");
	fenster.focus();
}

function fenster_auf(file)
{ 
	fs=window.open(file,"Fenstername","location=no,height=300px,width=250px");
	fs.moveTo(230,100); <!--  Positionierung des Fensters -->
	fs.focus();
}

/* Fuer den Backgroundchange in der Navi */
function chgBg(obj,color)
{
	if (document.all || document.getElementById)
		obj.style.backgroundColor=color;
	else if (document.layers)
 		obj.bgColor=color;
}


/****************************
* Editor fuer Formulardaten *
*****************************/
function Fett()
{
  Markierung = document.selection.createRange().text
          
  if(Markierung=="")
  {
  document.getElementById('formular').beschreibung.value = document.getElementById('formular').beschreibung.value + '<b>text</b>'
  }
  else
  {
	 Markierung = '<b>'+Markierung+'</b>'
	document.selection.createRange().text = Markierung
  }      
}

function Kursiv()
{
  Markierung = document.selection.createRange().text
          
  if(Markierung=="")
  {
  document.getElementById('formular').beschreibung.value = document.getElementById('formular').beschreibung.value + '<i>text</i>'
  }
  else
  {
	 Markierung = '<i>'+Markierung+'</i>'
	document.selection.createRange().text = Markierung
  }       
}

function Unterstreichen()
{
  Markierung = document.selection.createRange().text
          
  if(Markierung=="")
  {
  document.getElementById('formular').beschreibung.value = document.getElementById('formular').beschreibung.value + '<u>text</u>'
  }
  else
  {
	 Markierung = '<u>'+Markierung+'</u>'
	document.selection.createRange().text = Markierung
  }      
}

function Pfad()
{
  Markierung = document.selection.createRange().text
          
  if(Markierung=="")
  {
  document.getElementById('formular').beschreibung.value = document.getElementById('formular').beschreibung.value + "<a href='HTTP://URL\' target='blank'>text</a>"
  }
  else
  {
	Markierung = "<a href='HTTP://URL' target='blank'>"+Markierung+"</a>"
	document.selection.createRange().text = Markierung
  }  
}

