
var neuesfenster = null;

var ButtonWidth          = 90;
var ButtonBackColor      = '#DDF0EA';
var ButtonBackActivColor = '#FFFFFF';
var ButtonTextColor      = '#00A050';
var ActiveButton         = '';

// var RequiredHTML = "<font color=#FF0000> &#9830 </font>";
var RequiredHTML = "<font color=#FF0000 size=+1><b>*</b></font>";

var LabelColor           = '#DDF0FF';
var FieldColor           = '#DDF0EA';
// var BorderColor          = '#00A050';

//var FieldColorRequired   = '#FFFFC0';
var FieldColorRequired   = '#DDF0EA';
var ErrText              = "";

// ----------------------------------------------------------------------

function GetCookie (name) {
    var cname = name + "=";
    var dc = document.cookie;
    if (dc.length > 0) {
        posbeg = dc.indexOf(cname);
        if (posbeg != -1) {
            posbeg += cname.length;
            posend  = dc.indexOf(";", posbeg);
            if (posend == -1) posend = dc.length;
            dc = dc.replace (/\+/g, " ");
            dc = unescape (dc.substring(posbeg, posend));
            return dc;
        }
    }
    return null;
}

// ----------------------------------------------------------------------

function GetCookieArray (name) {
    var ck = GetCookie(name);
    if (ck == null) return null;
    return ck.split("@@@");
}

// ----------------------------------------------------------------------

function IsNetscape () {
    if (self.UserBrowser)
        return (self.UserBrowser == "Netscape" || self.UserBrowser == "Opera");

    return (navigator.appName == "Netscape");
}

// ----------------------------------------------------------------------

function IsMSIE () {
    if (self.UserBrowser)
        return (self.UserBrowser == "MSIE" || self.UserBrowser == "IE");

    return 
        (
            navigator.appName == "Microsoft Internet Explorer"
        &&  document.all
        );
}

// ----------------------------------------------------------------------

function IsHTTP () {
    return (document.URL.substr(0,4).toLowerCase() == "http");
}

// ----------------------------------------------------------------------

function OpenFenster (url)
{
    var w = (screen.availWidth*72)/100;
    var h = (2*screen.availHeight-screen.height);

    if (w < 480) w = 480;
    if (screen.availWidth > 590 && w < 590) w = 590;
    if (neuesfenster != null) neuesfenster.close();

    h = h - 20;
    if (self.UserBrowser) {
        if (self.UserBrowser == "Opera") h = screen.availHeight - 300;
    }
    else if (FormLocation && FormLocation.UserBrowser) {
        if (FormLocation.UserBrowser == "Opera") h = screen.availHeight - 300;
    }

    neuesfenster =
        window.open(
            '',
            "NeuesFenster",
              "screenX=0, "
            + "screenY=0, "
            + "dependent=yes, "
            + "locationbar=no, "
            + "menubar=no, "
            + "resizable=yes, "
            + "status=yes, "
            + "width=" + w + ","
            + "height=" + h
        );
    neuesfenster.moveTo(0,0);
    neuesfenster.focus();
    if (neuesfenster.statusbar) neuesfenster.statusbar.visible = true;

    //mr if (FormLocation == null)
    //mr     neuesfenster.opener = self;
    //mr else
    neuesfenster.opener = FormLocation;

    neuesfenster.location.href = url;
}

// ----------------------------------------------------------------------

function ButtonClick (name, action)
{
    eval (action);

    if (ActiveButton && ActiveButton == name) return;

    if (document.titleform) {
        // if (document.titleform.hdDoTitle) {
        //     document.titleform.hdDoTitle.value = 0;
        // }
        if (document.titleform.hdActiveButton) {
            document.titleform.hdActiveButton.value = name;
        }
        document.titleform.submit();
    }
}

// ----------------------------------------------------------------------
function OpenButtonBar ()
{
    if (!self.UserBrowser || self.UserBrowser == "MSIE" || self.UserBrowser == "IE")
    {
        document.write ("<center><TABLE><TR height=25>\n");
    }
    else
    {
        document.write ("<center><TABLE border=2><TR height=25>\n");
    }
}

// ----------------------------------------------------------------------
function MakeButton (name, action)
{
    var backcolor = ButtonBackColor;
    if (ActiveButton && ActiveButton == name) {
        backcolor = ButtonBackActivColor;
    }

    if (!IsMSIE()) {
        document.write ("<TD bgcolor="+backcolor+" width="+ButtonWidth+" align=center ");
        document.write ("><a href=\"javascript:ButtonClick('"+name+"','"+ action+"')\">");
        document.write ("<b><font color="+ButtonTextColor+">", name, "</font></b>");
        document.write ("</a>");
    }
    else {
        document.write (
            "<TD bgcolor="+backcolor+" style='cursor:hand; color:blue; ",
            "border-style:outset; border-width:thin; border-color:"+ButtonBackColor+"' ",
            "width="+ButtonWidth+" align=center "
        );
        document.write ("onClick=\"ButtonClick('"+name+"','"+ action+"')\">");
        document.write ("<b><font color="+ButtonTextColor+">", name, "</font></b>");
    }

    document.write ("</TD>");
}

// ----------------------------------------------------------------------

function CloseButtonBar () {
    document.write("</TR></TABLE></center>\n");
}

// ----------------------------------------------------------------------
// ----------------------------------------------------------------------

function OpenVButtonBar () {
    document.write ("<center><TABLE>\n");
}

// ----------------------------------------------------------------------

function MakeVButton (name, action) {

    var backcolor = ButtonBackColor;
    if (ActiveButton && ActiveButton == name) {
        backcolor = ButtonBackActivColor;
    }

   if (!IsMSIE()) {
        document.write ("<TR height=25><TD bgcolor="+backcolor+" width="+ButtonWidth+" align=center ");
        document.write ("><a href=\"javascript:ButtonClick('"+name+"','"+ action+"')\">");
        document.write ("<b><font color="+ButtonTextColor+">", name, "</font></b>");
        document.write ("</a>");
    }
    else {
        document.write (
            "<TR height=25><TD bgcolor="+backcolor+" style='cursor:hand; color:blue; ",
            "border-style:outset; border-width:thin; border-color:"+ButtonBackColor+"' ",
            "width="+ButtonWidth+" align=center "
        );
        document.write ("onClick=\"ButtonClick('"+name+"','"+ action+"')\">");
        document.write ("<b><font color="+ButtonTextColor+">", name, "</font></b>");
    }
    document.write ("</TD></TR>");
}

// ----------------------------------------------------------------------

function CloseVButtonBar () {
    document.write("</TABLE></center>\n");
}

// ----------------------------------------------------------------------
// ----------------------------------------------------------------------

function OneFrame(FR,URL)
{
   if (FR == 'mmain') {
        //mr?? top.frames['mdisp'].location.href='/mdisp.html';
   }
   top.frames[FR].location.href=URL;
}

/* --------------------------------- */

function TwoFrame(FR1,URL1,FR2,URL2)
{
   if (FR1 == 'mmain' || FR2 == 'mmain') {
        //mr?? top.frames['mdisp'].location.href='/mdisp.html';
   }
   top.frames[FR1].location.href=URL1;
   top.frames[FR2].location.href=URL2;
}

/* --------------------------------- */


