﻿// uiElements.js


if (typeof role == "undefined" || role == "" || role == null) {
if (typeof ui_role == "undefined" || ui_role == "" || ui_role == null) role = "site"
else role=ui_role
}

if (typeof lang == "undefined" || lang==null) lang="de"



var values = new Array();



var imagename_size=45
var line_size=60
var word_size=15
var password_size=15
var file_size=30
var filename_size=30
var lines_col_size=52
var lines_row_size=10
var page_col_size=60
var page_row_size=15
var integer_size=15
var url_size=60
var pane_width="$ui.pane.width"
var who_label="Wer?"
var textspacing_size=5
var space = "<img src=/ibt/adm/core/ibt/lib/image/util/nix.gif width=1 height=1 border=0 >"
var space5 = "<img src=/ibt/adm/core/ibt/lib/image/util/nix.gif width=5 height=1 border=0 >"
var space300 = "<img src=/ibt/adm/core/ibt/lib/image/util/nix.gif width=300 height=1 border=0 >"
var space8x8 = "<img src=/ibt/adm/core/ibt/lib/image/util/nix.gif width=8 height=8 border=0 >"
var spacer="<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>"





function uiElementBsp()
{
globalStandardConstructor(this, "ui", "ElementBsp", uiElementBsp.arguments);
function write()
{
w("<b><i>_name:</i> " + this._name + "</b>");
w(", <i>_prefix:</i> " + this._prefix);
w(", <i>_tag:</i> " + this._tag);
w(", <i>ownName:</i> " + this.ownName);
w(", <i>num_children:</i> " + this._children.length + " -> ");
this.writeChildren();
w("<BR>");
}
this.write = write
}



function w(text) { document.write(text) }
function wln(text) { document.writeln(text) }
function wbr(text) { document.writeln(text+"<BR>") }

function hexcolor(r,g,b)
{
var hex= new Array( '0','1','2','3', '4','5','6','7', '8','9','A','B', 'C','D','E','F' )
return "#" + hex[r] + hex[r] + hex[g] + hex[g] + hex[b] + hex[b]
}
function setColor(name, value) { document.forms[0].elements[name].value=value }
function setColorHref(name, value) { return "javascript:setColor('"+name+"','" + value+ "')" }
function gotoHref(href) {document.location.href=href}

function _ASSERT(condition, text)
{
if (!condition) {
w("<br><b>ASSERTION in uiElement.js:</b> " + text + "!</br>");
alert(text);
}
}


function globalAdd(name, value)
{
if (typeof value != "undefined") {
if ( value == null ) {
delete this[name];
} else {
this[name] = value;
}
} else if (typeof name != "undefined" && name != null) {
var count = this._children.length;
this._children[count] = name;
}
}


function globalWriteChildren()
{
for (var i = 0; i < this._children.length; i++) {
var child = this._children[i];
if (child._name) {
child.write();
} else {
w(child + " ");
}
}
}


function globalStandardConstructor(e, prefix, tag, args)
{
_ASSERT(e, "globalStandardConstructor: no e");
_ASSERT(prefix, "globalStandardConstructor: no prefix");
_ASSERT(tag, "globalStandardConstructor: no tag");
e.add = globalAdd;
e.writeChildren = globalWriteChildren;
e._children = new Array();
e._prefix = prefix;
e._tag = tag;
e._name = prefix + ":" + tag;
if (args) {
for (var i = 0; i < args.length-1 && typeof args[i] == "string"; i+=2) {
e.add(args[i], args[i+1]);
}
for (var j = i; j < args.length; j++) {
e.add(args[j]);
}
}
function write() {
_ASSERT(false, "globalStandardConstructor: no write() for " + e._name);
}
e.write = write
}





var uiFormbutton_Submit = new uiFormbutton("type", "submit", "value", "Submit", "label", "OK");
var uiFormbutton_Cancel = new uiFormbutton("type", "cancel", "value", "Cancel", "label", "Abbrechen");
var uiFormbutton_Reset  = new uiFormbutton("type", "reset", "value", "Reset", "label", "Zurücksetzen");

var uiButtonbar_Submit = new uiButtonbar(uiFormbutton_Submit);
var uiButtonbar_SubmitCancel = new uiButtonbar(uiFormbutton_Submit, uiFormbutton_Cancel);
var uiButtonbar_SubmitCancelReset = new uiButtonbar(uiFormbutton_Submit, uiFormbutton_Cancel, uiFormbutton_Reset);


function uiForm()
{
globalStandardConstructor(this, "ui", "Form", uiForm.arguments);
function write()
{
var method = this.type;
var enctype = "";
if (this.type=="upload") {
method="post";
enctype=" enctype=\"multipart/form-data\"";
}
var formName = "form";
if (this.name)
formName = this.name;
if (this.onsubmit) {
enctype+=" onsubmit=\"" + this.onsubmit + "\"";
}
w("<form name=\"" + formName + "\" method=\""+method+"\" action=\""+this.action+"\"" + enctype +">")
this.writeChildren();
w("</form>")
}
this.write = write
}


function uiFormbutton()
{
globalStandardConstructor(this, "ui", "Formbutton", uiFormbutton.arguments);
function write()
{
if (this.type == "submit") {
var formName = "form";
if (this.form)
formName = this.form;
var action = "document." + formName + ".submit()";
if (this.onsubmit) {
action = this.onsubmit + ";" + action;
}
w("<input type=\"submit\" name=\""+this.label+"\" value=\""+this.label+"\">");
} else if (this.type == "cancel")
w("<input type=\"button\" value=\""+this.label+"\" onclick=\"history.go(-1)\">");
else if (this.type == "reset")
w("<input type=\"button\" value=\""+this.label+"\" onclick=\"document.form.reset()\">");
else
_ASSERT(false, "uiFormbutton: " + this.type);
}
this.write = write
}


function uiScript()
{
globalStandardConstructor(this, "ui", "Script", uiScript.arguments);
}


function uiGroup()
{
globalStandardConstructor(this, "ui", "Group", uiGroup.arguments);
function write()
{
if (this.arrange && this.arrange == "r")
w("<div align=right>")
w("<nobr>")
for (var i=0; i<this._children.length; i++) {
this._children[i].write()
if (this.arrange && this.arrange == "v")
w("<br>")
else
w("&#160;")
}
w("</nobr>")
if (this.arrange && this.arrange == "r")
w("</div>")
}
this.write = write
}


function uiGroupDatebook()
{
globalStandardConstructor(this, "ui", "GroupDatebook", uiGroupDatebook.arguments);
function write()
{
if (this.arrange && this.arrange == "r")
w("<span align=left>")
w("<nobr>")
for (var i=0; i<this._children.length; i++) {
this._children[i].write()
if (this.arrange && this.arrange == "v")
w("<br>")
else
w("&#160;")
}
w("</nobr>")
if (this.arrange && this.arrange == "r")
w("</span>")
}
this.write = write
}


function uiMenuPane()
{
globalStandardConstructor(this, "ui", "MenuPane", uiMenuPane.arguments);
function write()
{
w("<table bgcolor=\"#000000\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">")
w("<tr><td>")
w("<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"#000000\">")
w("<td bgcolor=\"#000000\" colspan=\"4\">&nbsp;</td>")
this.writeChildren();
w("<td bgcolor=\"#000000\" colspan=\"4\">&nbsp;</td>")
w("</table></td></tr></table>")
}
this.write = write
}


function uiButtonbar()
{
globalStandardConstructor(this, "ui", "Buttonbar", uiButtonbar.arguments);
function write()
{
w("<nobr>")
for (var i=0; i<this._children.length; i++) {
this._children[i].write()
w("&#160;")
}
w("</nobr>")
}
this.write = write
}


function uiButtongroup()
{
globalStandardConstructor(this, "ui", "Buttongroup", uiButtongroup.arguments);
function write()
{
w("<table align=center width=90% border=0 cellpadding=5 bgcolor=#000000><tr><td align=center>")
this.writeChildren();
w("</td></tr></table>")
}
this.write = write
}





function uiPane()
{
globalStandardConstructor(this, "ui", "Pane", uiPane.arguments);
function write()
{
w("<table border=\"0\" cellspacing=0 cellpadding=0 width="+pane_width+">")
if (this.title)
w("<tr><td>" + this.title +"<br></td></tr>")
w("<tr><td>")
this.writeChildren();
w("</td></tr>")
w("</table>")
}
this.write = write
}


function uiTabbingPane()
{
globalStandardConstructor(this, "ui", "TabbingPane", uiTabbingPane.arguments);
function write()
{
w("<table border=\"0\" cellspacing=\"1\" width=\"90%\">")
if (this.title)
w("<tr><td><div class='padfontsizem1'><b>" + this.title +"</b></div></td></tr>")
w("<tr><td>")
this.writeChildren();
w("</td></tr>")
w("</table>")
}
this.write = write
}




function uiList()
{
globalStandardConstructor(this, "ui", "List", uiList.arguments);
function write()
{
var visibleChildren = new Array();
var j=0;
for (var i=0; i < this._children.length; i++) {
if (this._children[i].type != "hidden") {
visibleChildren[j] = this._children[i];
j+=1;
} else {
this._children[i].write();
}
}
var rows = (visibleChildren.length*2)-1;
w("<table border=0 cellspacing=0 cellpadding=0 bgcolor=#000000>");
for (var i=0; i < visibleChildren.length; i++) {
if (visibleChildren[i].classCSS) {
if (visibleChildren[i].topline==null || visibleChildren[i].topline!="none") {
uiListRidgeH(visibleChildren[i].classCSS);   //  Separator
}
w("<tr class='"+visibleChildren[i].classCSS+"' valign=top>");  //  Tabellenzeile
} else {
if (visibleChildren[i].topline==null || visibleChildren[i].topline!="none") {
uiListRidgeH()
}
w("<tr valign=top>");
}
uiListRidgeV()
w("<td bgcolor=#e5e5e5>" + space5 );
uiWriteListLabel(visibleChildren[i]);
w("</td>");
w("<td bgcolor=#e5e5e5>" + space5 +"</td>");
var color = (i==0 || i==visibleChildren.length-1) ? "#e5e5e5" : "#ffffff";
w("<td valign=top bgcolor="+color+">");
uiWriteListValue(visibleChildren[i]);
w("</td>");
uiListRidgeV()
w("</tr>");
}
uiListRidgeH()
w("</table>");
}
this.write = write
function uiWriteListLabel(e)
{
label = (e.label && e.label != "")?e.label:"&nbsp;";
w(label);
}
function uiWriteListValue(e)
{
e.write();
}
}

function uiListRidgeV()
{ w("<td bgcolor=#000000>" + space + "</td>"); }


function uiListRidgeH(classCSS)
{
if (classCSS != null)
w("<tr class='"+classCSS+"'>");
else
w("<tr>");
w("<td bgcolor=#000000 colspan=5>" + space + "</td></tr>");
}




function uiTable()
{
globalStandardConstructor(this, "ui", "Table", uiTable.arguments);
function write()
{
var color_odd   = "#ffffff"
var color_even  = "#f3f3f3"
w("<table border=0 cellspacing=0 cellpadding=0 width="+pane_width+">"
+ "<tr><td height=1 bgcolor=#000000>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"1\">"
+ "</td></tr>"
+ "<tr><td height=10>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"10\">"
+ "</td></tr><tr><td>");
w("<table cellspacing=0 cellpadding=5 border=0 width=100%>");
for (var row=0; row<this._children.length; row++) {
w("<tr valign=middle>");
for (var col=0; col<this._children[row]._children.length; col++) {
if (row % 2 == 0)
w("<td bgcolor="+color_even+">");   // <div class='padfontsizem2'>
else
w("<td bgcolor="+color_odd+">");  // <div class='padfontsizem2'>
this._children[row]._children[col].write();
w("</td>")  // </div>
}
w("</tr>");
}
w("</table>")
w("</td></tr>"
+ "<tr><td height=10"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"10\">"
+ "</td></tr>"
+ "<tr><td height=1 bgcolor=#000000>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"1\">"
+ "</td></tr></table>");
}
this.write = write

function writePartial(from, to)
{
var color_odd   = "#ffffff"
var color_even  = "#f3f3f3"
if (from<0 || from>to) from = 0;
if (to<0 || from>to) to = this._children.length;
if (from==0) {
w("<table border=0 cellspacing=0 cellpadding=0 width="+pane_width+">"
+ "<tr><td height=1 bgcolor=#000000>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"1\">"
+ "</td></tr>"
+ "<tr><td height=10>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"10\">"
+ "</td></tr><tr><td>");
w("<table cellspacing=0 cellpadding=5 border=0 width=100%>");
}
for (var row=from; row<to; row++) {
w("<tr valign=middle>");
for (var col=0; col<this._children[row]._children.length; col++) {
if (row % 2 == 0)
w("<td bgcolor="+color_even+">");  // <div class='padfontsizem2'>
else
w("<td bgcolor="+color_odd+">");  // <div class='padfontsizem2'>
this._children[row]._children[col].write();
w("</td>")  // </div>
}
w("</tr>");
}
if (to==this._children.length) {
w("</table>")
w("</td></tr>"
+ "<tr><td height=10"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"10\">"
+ "</td></tr>"
+ "<tr><td height=1 bgcolor=#000000>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"1\">"
+ "</td></tr></table>");
}
}
this.writePartial = writePartial

function getChildrenCount()
{
return this._children.length;
}
this.getChildrenCount = getChildrenCount
}


function uiTableDatebook()
{
globalStandardConstructor(this, "ui", "TableDatebook", uiTableDatebook.arguments);
function write()
{
var color_odd = "#FFFFFF";
var color_even = "#FAF1EC";
w("<table border=0 cellspacing=0 cellpadding=0 width="+pane_width+">"
+ "<tr><td height=1 bgcolor=#000000>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"1\">"
+ "</td></tr>"
+ "<tr><td height=10>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"10\">"
+ "</td></tr><tr><td>");
w("<table class=datebook cellspacing=0 cellpadding=0 width=100%>");
w("<tr valign=left>");
for (var col=0; col<this._children[0]._children.length; col++) {
var colspan = (col == 1) ? 2: 1;
w("<td class=datebookHeader colspan="+colspan+" bgcolor="+color_odd+">");
this._children[0]._children[col].write();
w("</td>");
}
w("</tr>");
for (var row=1; row<this._children.length; row++) {
w("<tr class=datebookBody valign=top align=left>");
for (var col=0; col<this._children[row]._children.length; col++) {
var style = ( this._children[row]._children[col].alignbottom )
? "style=position:absolute;bottom:5px"
: "";
var css = (col == 2 || col == 4) ? "datebookNoLeftborder" : "datebookLeftborder";
css = (col == (this._children[row]._children.length-1)) ? "datebookLast" : css;
if (row % 2 == 0)
w("<td class="+css+" style="+style+" bgcolor="+color_even+">");  // <div class='padfontsizem2'>
else
w("<td class="+css+" style="+style+" bgcolor="+color_odd+">");  // <div class='padfontsizem2'>
this._children[row]._children[col].write();
w("</td>")   // </div>
}
w("</tr>");
}
w("</table>")
w("</td></tr>"
+ "<tr><td height=10"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"10\">"
+ "</td></tr>"
+ "<tr><td height=1 bgcolor=#000000>"
+ "<img src=\"/ibt/adm/core/ibt/lib/image/util/nix.gif\" height=\"1\">"
+ "</td></tr></table>");
}
this.write = write;
}


function uiRow()
{
globalStandardConstructor(this, "ui", "Row", uiRow.arguments);
function write()
{
w("<tr bgcolor=#000000>");
for (var i=0; i<this._children.length;i++) {
w("<td>");   // <div class='padfontsizem2'>
this._children[i].write();
w("</td>")   // </div>
}
w("</tr>");
}
this.write = write
}




function uiText()
{
globalStandardConstructor(this, "ui", "Text", uiText.arguments);
function write()
{
if (this.label) {
var t=(this.target)?" target="+this.target:""
if (this.labelhref) {
w("<a href='"+this.labelhref+"'"+t+">")
}
if (this.type == "name") {
w("<div class='padfontsizenormal' style='color: #000000'>"+this.label+"</div>")
} else if (this.type == "label") {
w("<div class='padfontsizenormal'><b>"+this.label+"</b></div>")
} else if (this.type == "title") {
w("<div class='padfontsizenormal'><b>"+this.label+"</b></div>")
} else if (this.type == "small") {
w("<div class='padfontsizem2'>"+this.label+"</div>")
} else if (this.type == "description") {
w("<table border=0 cellpadding=10 bgcolor=#e5e5e5><tr><td>")
w("<div class='padfontsizem1'>"+this.label+"</div>")
w("</td></tr></table>")
} else
w("<div class='padfontsizenormal'>"+this.label+"</div>")
if (this.labelhref)
w("</a>")
}
}
this.write = write
}


function uiTextDatebook()
{
globalStandardConstructor(this, "ui", "TextDatebook", uiTextDatebook.arguments);
function write()
{
if (this.label) {
var t=(this.target)?" target="+this.target:""
if (this.labelhref) {
w("<a href='"+this.labelhref+"'"+t+">")
}
if (this.type == "name") {
w("<div class='padfontsizenormal' style='color: #000000'>"+this.label+"</div>")
} else if (this.type == "label") {
w("<div class='padfontsizenormal'><b>"+this.label+"</b></div>")
} else if (this.type == "title") {
w("<div class='padfontsizenormal'><b>"+this.label+"</b></div>")
} else if (this.type == "small") {
w("<div class='padfontsizem2'>"+this.label+"</div>")
} else if (this.type == "datebook") {
if (this.bold) {
w("<div class='padfontsizenormal' style='color: "+this.color+"'><b>"+this.label+"</b></div>")
} else
w("<div class='padfontsizenormal' style='color: "+this.color+"'>"+this.label+"</div>")
} else if (this.type == "description") {
w("<table border=0 cellpadding=10 bgcolor=#e5e5e5><tr><td>")
w("<div class='padfontsizem1'>"+this.label+"</div>")
w("</td></tr></table>")
} else
w("<div class='padfontsizenormal'>"+this.label+"</div>")
if (this.labelhref)
w("</a>")
if (this.who) {
w("<br/><br/>");
w("<div class='padfontsizenormal'><b>"+who_label+"</b> " + this.who + "</div>");
}
}
}
this.write = write
}


function uiMessage()
{
globalStandardConstructor(this, "ui", "Message", uiMessage.arguments);
function write()
{
var timeout = (this.timeout)?this.timeout:1000;
var frame = (this.frame)?this.frame:"document"
if (this.valuation=="ok")
w("<table><tr><td><div class='padfontsizenormal' style='color: #669966'><b>"+this.label+"</b></div></td></table>")
else if (this.valuation=="error" || this.valuation=="fault")
w("<table><tr><td><div class='padfontsizenormal' style='color: #996666'>"+this.label+"</div></td></table>")
else if (this.valuation=="info")
w("<table><tr><td><div class='padfontsizenormal'><i>"+this.label+"</i></div></td></table>")
else
_ASSERT(false, "uiMessage: " + this.valuation);
if(this.nextHref && timeout != 0 ) {
if (this.nextHref=="back") {setTimeout("history.back()",timeout)}
else setTimeout(frame+".location.href='"+this.nextHref+"'", timeout)
}
}
this.write = write
}


function uiValue()
{
globalStandardConstructor(this, "ui", "Value", uiValue.arguments);
function write()
{
var t=(this.target)?" target="+this.target:""
var title=(this.imageTitle)?" title="+this.imageTitle:""
if (this.imageHref) w("<a href=\""+this.imageHref+"\""+t+">")
if (this.image) w("<img border=\"0\" src=\""+this.image+"\""+title+">")
if (this.imageHref) w("</a>")
if (this.value) {
if (this.valuehref) w("<a href=\""+this.valuehref+"\""+t+">")
w("<div class='padfontsizenormal'>"+this.value+"</div>")
if (this.valuehref) w("</a>")
}
if (this.helpHref) w("<a href=\""+this.helpHref+"\""+t+">")
if (this.help) w("<br><div class='padfontsizep1'>"+this.help+"</div>")
if (this.helpHref) w("</a>")
}
this.write = write
}


function uiInput()
{
this.textstyle = "plain";
globalStandardConstructor(this, "ui", "Input", uiInput.arguments);
function write()
{
value="";
if (typeof this.value != "undefined" && this.value!=null) value = this.value
if (this.type=="word") {
if (this.textstyle=="password")
w("<input type=\"password\" name=\""+this.name+"\" value=\"" + value + "\" size=\""+password_size+"\">")
else
w("<input type=\"text\" name=\""+this.name+"\" value=\"" + value + "\" size=\""+word_size+"\">")
} else if (this.type=="line") {
w("<input type=\"text\" name=\""+this.name+"\" value=\"" + value + "\" size=\""+line_size+"\">")
} else if (this.type=="subjectline") {
w("<textarea wrap=\"virtual\" name=\""+this.name+"\" cols=\""+lines_col_size+"\" rows=\"1\">" + value + "</textarea>")
} else if (this.type=="integer") {
w("<input type=\"text\" name=\""+this.name+"\" value=\"" + value + "\" size=\""+integer_size+"\">")
} else if (this.type=="checkbox") {
w("<input type=\"checkbox\" name=\""+this.name+"\" value=\"" + value + "\""
+ ( (this.checked=="true" || this.checked==true) ? " checked" : "" )
+ ">");
} else if (this.type=="lines") {
w("<textarea wrap=\"virtual\" name=\""+this.name+"\" cols=\""+lines_col_size+"\" rows=\""+lines_row_size+"\">" + value + "</textarea>")
} else if (this.type=="linesGc21Chat") {
lines_row_size = 2;
w("<textarea wrap=\"virtual\" name=\""+this.name+"\" cols=\""+lines_col_size+"\" rows=\""+lines_row_size+"\">" + value + "</textarea>")
} else if (this.type=="page") {
w("<textarea name=\""+this.name+"\" cols=\""+page_col_size+"\" rows=\""+page_row_size+"\">" + value + "</textarea>")
} else if (this.type=="file") {  // sw070728: Parameter id u. onchange ergänzt
var idString = (this.id != null) ? " id=\""+this.id+"\"" : "";
var onchangeString = (this.onchange != null) ? " onchange=\""+this.onchange+"\"" : "";
w("<input type=\"file\" name=\""+this.name+"\" value=\"" + value + "\" size=\""+file_size+"\"" + idString + onchangeString + " >")
} else if (this.type=="filename") { // sw070728: Parameter id ergänzt, sw070823: Parameter onchange ergänzt
var idString = (this.id != null) ? " id=\""+this.id+"\"" : "";
var onchangeString = (this.onchange != null) ? " onchange=\""+this.onchange+"\"" : "";
w("<input type=\"text\" name=\""+this.name+"\" value=\"" + value + "\" size=\""+filename_size+"\"" + idString + onchangeString + " >")
} else if (this.type=="image") {
w("<input type=\"text\" name=\""+this.name+"\" value=\"" + this.value + "\" size="+imagename_size+">")
w(" <img align=top src=\""+this.image+"\" border=1\">")
} else if (this.type=="hidden") {
w("<input type=\"hidden\" name=\""+this.name+"\" value=\"" + value + "\">")
} else if (this.type=="url") {
w("URL:&nbsp;<input type=\"text\" name=\""+this.name+"\" value=\"" + value + "\" size=\""+url_size+"\">")
} else if (this.type=="select") {
if (this.selectstyle=="radio")
for (var i=0; i<this._children.length;i++) {
c=""
if (this.value == this._children[i].name) c="CHECKED"
w("<input type='radio' name=\""+this.name+"\" value=\""+this._children[i].name+"\" "+c+">" + this._children[i].label + "<br>")
}
else if (this.selectstyle=="radioHorizontal")
for (var i=0; i<this._children.length;i++) {
c=""
if (this.value == this._children[i].name) c="CHECKED"
w("<nobr><input type='radio' name=\""+this.name+"\" value=\""+this._children[i].name+"\" "+c+">" + this._children[i].label + "&nbsp;</nobr>")
}
else if (this.selectstyle=="button")
w("<input type=\"button\" name=\""+this.name+"\" value=\"" + value + "\">")
else if (this.selectstyle=="menu") {
w("<select name=\""+this.name+"\">")
for (var i=0; i<this._children.length;i++) {
c=""
if (this.value == this._children[i].name) c="SELECTED"
w("<option value=\""+this._children[i].name+"\" " +c+">" + this._children[i].label + "</option>")
}
w("</select>")
}
else if (this.selectstyle=="list")
w("<input type=\"radio\" name=\""+this.name+"\" value=\"" + value + "\">"+this.label)
else if (this.selectstyle=="link")
w("<a href=\""+this.labelhref+"\">"+this.label+"</a>")
else if (this.selectstyle=="checkbox") {
for (var i=0; i<this._children.length;i++) {
c=""
if (this.value == this._children[i].name) c="CHECKED"
w("<input type='checkbox' value=\""+this._children[i].name+"\" name=\""+this.name+"\" " +c+">" + this._children[i].label + "<br>")
}
} else if (this.selectstyle=="mlist") {
w("<select multiple size=5 name=\""+this.name+"\">")
for (var i=0; i<this._children.length;i++) {
c=""
if (this.value == this._children[i].name) c="SELECTED"
w("<option value=\""+this._children[i].name+"\" " +c+">" + this._children[i].label + "</option>")
}
w("</select>")
} else if (this.selectstyle=="rapidLangList") {
w("<select multiple size=5 name=\""+this.name+"\">")
for (var i=0; i<this._children.length;i++) {
c=""
var valuesArr = this.value.split(",");
for (var j=0; j<valuesArr.length; j++)
if (valuesArr[j] == this._children[i].name) c="SELECTED"
w("<option value=\""+this._children[i].name+"\" " +c+">" + this._children[i].label + "</option>")
}
w("</select>")
} else if (this.selectstyle=="rapidLangCheckbox") {
for (var i=0; i<this._children.length;i++) {
c=""
var valuesArr = this.value.split(",");
for (var j=0; j<valuesArr.length; j++)
if (valuesArr[j] == this._children[i].name) c="CHECKED"
w("<input type='checkbox' value=\""+this._children[i].name+"\" name=\""+this.name+"\" " +c+">" + this._children[i].label + "<br>")
}
} else _ASSERT(false, "uiInput: " + this.selectstyle);
} else if (this.type=="boolean") {
w("<input type=\"radio\" name=\""+this.name+"\" value=\"true\"")
if (value == "true") w (" CHECKED")
w("> ja")
w("&nbsp;&nbsp;<input type=\"radio\" name=\""+this.name+"\" value=\"false\"")
if (value != "true") w (" CHECKED")
w("> nein")
} else if (this.type=="color") {
w("<input type=\"text\" name=\""+this.name+"\" value=\"" + value +"\" size=\"8\">")
var name = this.name
w("<table border=0 cellpadding=0 cellspacing=1>")
for (r=0; r<=15; r+=3) {
w("<tr>");
for (g=0; g<=15; g+=3) {
for (b=0; b<=15; b+=3) {
var color = hexcolor(g, r, b);
w("<td bgcolor=\""+color+"\"><a href=\""+setColorHref(name,color)+"\">"+space8x8+"</a></td>");
}
}
w("</tr>");
}
w("</table>");
} else if (this.type=="colorLess") {
w("<table border=0 cellpadding=0 cellspacing=0><tr><td>");
w("<input type=\"text\" name=\""+this.name+"\" value=\"" + value +"\" size=\"8\">");
w("</td>");
var name = this.name
var colors = new Array("#000000", "#808080", "#800000", "#008000",
"#808000", "#000080", "#800080", "#008080",
"#C0C0C0", "#FF0000", "#FF9900", "#00FF00",
"#FFFF00", "#0000FF", "#FF00FF", "#00FFFF");
w("<td><table border=0 cellpadding=0 cellspacing=1><tr>")
w("<td width=\"4\"/>");
for (var i=0; i<colors.length; i++) {
var color = colors[i];
w("<td bgcolor=\""+color+"\"><a href=\""+setColorHref(name,color)+"\">"+space8x8+"</a></td>");
}
w("</tr></table></td>");
w("</tr></table>");
} else if (this.type=="datetime") {
yearSelection = new uiInput("type", "select", "selectstyle", "menu", "name", this.name + "Year", "value", this.value.getFullYear())
for (j = 2000; j <= 2025; j++)
yearSelection.add(new uiValue("label", j, "name", j))
monthSelection = new uiInput("type", "select", "selectstyle", "menu", "name", this.name + "Month", "value", this.value.getMonth(),
new uiValue("label", "Januar", "name", "0"),
new uiValue("label", "Februar", "name", "1"),
new uiValue("label", "März", "name", "2"),
new uiValue("label", "April", "name", "3"),
new uiValue("label", "Mai", "name", "4"),
new uiValue("label", "Juni", "name", "5"),
new uiValue("label", "Juli", "name", "6"),
new uiValue("label", "August", "name", "7"),
new uiValue("label", "September", "name", "8"),
new uiValue("label", "Oktober", "name", "9"),
new uiValue("label", "November", "name", "10"),
new uiValue("label", "Dezember", "name", "11")
)
daySelection = new uiInput("type", "select", "selectstyle", "menu", "name", this.name + "Day", "value", this.value.getDate())
for (j = 1; j <= 31; j++) {
value = ""
if (j < 10) value += "0"
value += j
daySelection.add(new uiValue("label", j, "name", value))
}
hourSelection = new uiInput("type", "select", "selectstyle", "menu", "name", this.name + "Hours", "value", this.value.getHours())
for (j = 0; j <= 23; j++) {
value = ""
if (j < 10) value += "0"
value += j
hourSelection.add(new uiValue("label", j, "name", value))
}
aktMinutes = this.value.getMinutes();
aktMinutes = aktMinutes - (aktMinutes % 15);
aktMinutes = aktMinutes.toString();
minuteSelection = new uiInput("type", "select", "selectstyle", "menu", "name", this.name + "Minutes", "value", aktMinutes,
new uiValue("label", "00", "name", "00"),
new uiValue("label", "15", "name", "15"),
new uiValue("label", "30", "name", "30"),
new uiValue("label", "45", "name", "45")
)
new uiPane("arrange", "h", "label", this.label,
yearSelection,
monthSelection,
daySelection,
hourSelection,
minuteSelection
).write()
} else {
w("<input type=\"text\" name=\""+this.name+"\" value=\"" + value +"\">")
}
if (this.help) w("<br>")
if (this.helpHref) w("<a href=\""+this.helpHref+"\">")
if (this.help) w("<div class='padfontsizep1'>"+this.help+"</div>")
if (this.helpHref) w("</a>")
}
this.write = write
}




function uiButton()
{
globalStandardConstructor(this, "ui", "Button", uiButton.arguments);
function write()
{
if (this.type=="create") {
} else if (this.type=="action") {
_ASSERT(this.value, "uiButton: action - no value");
w("<input type=image value=\""+this.value+"\">")
} else if (this.type=="element") {
_ASSERT(this.value, "uiButton: element - no value");
w("<input type=image value=\""+this.value+"\">")
} else if (this.type=="script") {
_ASSERT(this.value, "uiButton: script - no value");
_ASSERT(this.valuehref, "uiButton: script - no valueRef");
var name = (typeof(this.name)=="undefined") ? "" : this.name;
w("<input type=button onclick=\""+this.valuehref+"\" value=\""+this.value+"\" name=\""+name+"\">")
} else if (this.type=="href") {
_ASSERT(this.value, "uiButton: href - no value");
_ASSERT(this.valuehref, "uiButton: href - no valueRef");
var target = (this.target)?this.target:"document"
if (target=="_blank") {
var href="window.open('"+this.valuehref+"','win','height=300,width=750')";
w("<input type=button onclick=\""+href+"\" value="+this.value+">")
} else {
w("<input type=button onclick=\""+target+".location.href=&quot;"+this.valuehref+"&quot;\" value=\""+this.value+"\">")
}
} else _ASSERT(false, "uiButton: " + this.type);
}
this.write = write
}





function _uiRidge(direction,cs)
{
if (direction=="h")
w("<tr><td colspan="+cs+" bgcolor=#000000 height=1>"+space+"</td></tr>");
if (direction=="v")
w("<td bgcolor="+color_bg+">"+space+"</td><td bgcolor=#000000>"+space+"</td>")
}


function _uiSepline(direction,cs)
{
if (direction=="h")
w("<tr><td colspan="+cs+" bgcolor=#000000>"+space300+"</td></tr>");
if (direction=="v")
w("<td colspan="+cs+" bgcolor=#000000>"+space+"</td>")
}


function uiChangeCSS(theClass, element, value)
{
var cssRules;
if (document.all) {
cssRules = 'rules';
} else if (document.getElementById) {
cssRules = 'cssRules';
}
try {
for (var ss = 0; ss < document.styleSheets.length; ss++){
for (var cr = 0; cr < document.styleSheets[ss][cssRules].length; cr++) {
if (document.styleSheets[ss][cssRules][cr].selectorText == theClass) {
document.styleSheets[ss][cssRules][cr].style[element] = value;
}
}
}
} catch (e) {}
}

if(typeof loadCheck=="function") loadCheck()


