// "javascript-basis.js" beinhaltet oft verwendete, ausgelagerte Funktionen in JavaScript.

//Um Javascript in einer seite Auszuführen: <script language="javascript">...</script.

function Anzeigen(ort, oldL) {
	Verbergen();
	document.getElementById(oldL).className ='SubNavAuswahl';
	document.getElementById(ort).style.display = "inline";
	if (ort == 'Allgemeine') {
		document.getElementById('Ultraschall').style.display = "inline";
		}
	if (ort == 'Spezielle') {
		document.getElementById('Ultraschall').style.display = "none";
		}
	}

function SideBox(titel, inbox) {
		// Erstellt eine Geformte Box mit DIV-ID = "titel" als Inhalt (+U für Box).
		var inhalt = inbox;
		document.writeln("<div id=\""+titel+"U\" style=\"margin-top:6px; margin-bottom:6px; border-collapse:collapse\">");
        document.writeln("<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" >");
        document.writeln("  <tr>");
        document.writeln("      <td width=\"1px\"></td><td width=\"10px\"></td><td width=\"170px\"></td><td width=\"10px\"></td><td width=\"1px\"></td>");
        document.writeln("  </tr>");
        document.writeln("  <tr height=\"15px\" onClick=\"javascript: minimieren('"+titel+"');\">");
        document.writeln("      <td colspan=\"2\" style=\"background:url(design/SideBox/SideBoxOL.png); background-position:right\"></td>");
        document.writeln("      <td style=\"background:url(design/SideBox/SideBoxOM.png); background-repeat:repeat-x; font-size:12px\"><b> &raquo; "+titel+"</b></td>");
        document.writeln("      <td colspan=\"2\" style=\"background:url(design/SideBox/SideBoxOR.png); background-position:left\"></td>");
        document.writeln("  </tr>");
        document.writeln("  <tr>");
        document.writeln("      <td width=\"1px\" style=\"background-color:#CCCCCC\"></td>");
        document.writeln("      <td colspan=\"3\" bgcolor=\"#CCCCCC\"><div id=\""+titel+"\" style=\"margin:3px\">"+inhalt+"</div></td>");
        document.writeln("      <td width=\"1px\" style=\"background-color:#CCCCCC\"></td>");
        document.writeln("  </tr>");
        document.writeln("  <tr height=\"9px\">");
        document.writeln("      <td colspan=\"2\" style=\"background:url(design/SideBox/SideBoxUL.png); background-position:right\"></td>");
        document.writeln("      <td colspan=\"1\" style=\"background:url(design/SideBox/SideBoxUM.png); background-repeat:repeat-x\"></td>");
        document.writeln("      <td colspan=\"2\" style=\"background:url(design/SideBox/SideBoxUR.png); background-position:left\"></td>");
        document.writeln("</tr></table></div>");
	}

function LoginBox(titel) {
		// Erstellt eine Geformte Box mit DIV-ID = "titel".
		var inhaltID = "<?= session_id(); ?>";
	
		document.writeln("<div id=\""+titel+"U\" style=\"margin-top:6px; margin-bottom:6px; border-collapse:collapse\">");
    	document.writeln("<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" >");
   		document.writeln("  <tr>");
    	document.writeln("      <td width=\"1px\"></td><td width=\"10px\"></td><td width=\"170px\"></td><td width=\"10px\"></td><td width=\"1px\"></td>");
    	document.writeln("  </tr>");
    	document.writeln("  <tr height=\"15px\">");
    	document.writeln("      <td colspan=\"2\" style=\"background:url(design/SideBox/SideBoxOL.png); background-position:right\"></td>");
    	document.writeln("      <td style=\"background:url(design/SideBox/SideBoxOM.png); background-repeat:repeat-x; font-size:12px\"><b>Login</b></td>");
    	document.writeln("      <td colspan=\"2\" style=\"background:url(design/SideBox/SideBoxOR.png); background-position:left\"></td>");
    	document.writeln("  </tr>");
    	document.writeln("  <tr>");
    	document.writeln("      <td width=\"1px\" style=\"background-color:#CCCCCC\"></td>");
        // Hier steht der Inhalt.
		document.writeln("      <td colspan=\"3\" bgcolor=\"#CCCCCC\"><div id=\""+titel+"\" style=\"font-size:10px; margin:0px\">");
		document.writeln("			<table border='0px'><tr><td align='right'><form method='post' action='index.php?seite=Login'>");
		document.writeln("			<input type='hidden' name='PHPSESSID' value='"+inhaltID+"'>");
		document.writeln("			<input type='hidden' name='ulogbox' value='aktiv'>");
		document.writeln("			<label>Benutzer: </label><input class='LoginInput' type='text' name='username' id='username' size='8' style='width:71px; background-color:#E7E7E7;'><br>"); 
		document.writeln("			<label>Passwort: </label><input class='LoginInput' type='password' name='userpass' id='userpass' size='8' style='width:71px; background-color:#E7E7E7;'>"); 
		document.writeln("			</td><td align='center' valign='middle'><input type='submit' name='loginButton' id='loginButton' value='Login' style='height:47px'>"); 
		document.writeln("			</td></tr></form></table>");
		document.writeln("		</div></td>");
        document.writeln("      <td width=\"1px\" style=\"background-color:#CCCCCC\"></td>");
        document.writeln("  </tr>");
        document.writeln("  <tr height=\"9px\">");
 		document.writeln("      <td colspan=\"2\" style=\"background:url(design/SideBox/SideBoxUL.png); background-position:right\"></td>");
    	document.writeln("      <td colspan=\"1\" style=\"background:url(design/SideBox/SideBoxUM.png); background-repeat:repeat-x\"></td>");
    	document.writeln("      <td colspan=\"2\" style=\"background:url(design/SideBox/SideBoxUR.png); background-position:left\"></td>");
		document.writeln("</tr></table></div>");
	}

