﻿var arImages=new Array();
function OnLoad()
{
var ifo = document.getElementById("initialfocus");
if (ifo && ifo.value)
{
var e = document.getElementById(ifo.value);
if (e)
{
e.focus();
}
}
if (typeof(AfterOnLoad)=='function')
{
AfterOnLoad();
};
}
function Preload()
{
var temp = Preload.arguments;
for (x=0; x < temp.length; x++)
{
arImages[x]=new Image();
arImages[x].src=Preload.arguments[x];
}
}
function OnNavBar(dnm, inm, cls, img)
{
var d = document.getElementById(dnm);
var i = document.getElementById(inm);
if (d && i)
{
d.className = cls;
i.src = img;
}
}
function OnButton()
{
var act = arguments[0];
if (act == "PRINT")
{
print();
}
else
{
document.getElementById('ACTION').value = act;
for (i=1; i<arguments.length; i+=2)
{
var name  = arguments[i];
var value = arguments[i+1];
document.getElementById(name).value      = value;
}
ExecSubmit();
}
}
function OnHover(elem,mode,stdclass,hvrclass)
{
if (stdclass=="" && hvrclass=="")
{
if (mode == 0)
{
elem.style.backgroundColor = (elem.style.prevBackgroundColor ? elem.style.prevBackgroundColor :'#FFFFFF');
}
else
{
elem.style.prevBackgroundColor   = elem.style.backgroundColor;
elem.style.backgroundColor = "#FFCC80";
}
}
else
{
elem.className = ((mode == 0) ? stdclass : hvrclass);
}
}
function OnChangeCombobox(nm,act)
{
document.getElementById('ACTION').value      = act;
document.getElementById('ACTIONARG1').value  = nm;
ExecSubmit();
}
function ExecSubmit()
{
document.getElementById('frm').submit();
}
function ExecRoadShow(termin)
{
document.getElementById('termin').value = termin;
document.getElementById('frm').submit();
}
function OpenWindow(url, width, height)
{
if (width==0 || height==0)
{
if (width  == 0) { width = screen.availWidth-30;   }
if (height == 0) { height = screen.availHeight-90; }
window.open(url,"","scrollbars=yes,menubar=no,height="+height+",width="+width+",top=5,left=5,resizable=yes,toolbar=no,location=no,status=yes");
}
else
{
window.open(url,"","scrollbars=yes,menubar=no,height="+height+",width="+width+",resizable=no,toolbar=no,location=no,status=yes");
}
}
function PrintWindow()
{
window.print();
}
function CloseWindow()
{
window.close();
}
function SetImage(nm, img)
{
var e = document.getElementById(nm);
if (e)
{
e.src = img;
}
}
function GetCookie(name)
{
var start = document.cookie.indexOf(name+"=");
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
if (start == -1) return null;
var end = document.cookie.indexOf(";",len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}
function SetCookie(name,value,expires,path,domain,secure)
{
expires = new Date(2099,11,31);
var cookieString = name + "=" +escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "") +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
( (secure) ? ";secure" : "");
document.cookie = cookieString;
}
function DeleteCookie(name,path,domain)
{
if (Get_Cookie(name)) document.cookie = name + "=" +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
function Clear(nm)
{
var e = window.document.getElementById(nm);
if (!e)
{
return;
}
e.value = "";
}
function Check(ctr,tp,nm,txt)
{
var e = window.document.getElementById(nm);
if (e)
{
if (tp == "TB")
{
if (e.value == "")
{
if (ctr == "UK")
{
alert("The field '" + txt + "' may not be empty.");
}
else
{
alert("Das Feld '" + txt + "' darf nicht leer sein.");
}
e.focus();
return 0;
}
}
else
{
if (e.selectedIndex <= 0)
{
if (ctr == "UK")
{
alert("Please select a value in field '" + txt + "'.");
}
else
{
alert("Bitte selektieren Sie einen Wert im Feld '" + txt + "'.");
}
e.focus();
return 0;
}
}
}
return 1;
}
function Set(nm)
{
var e = window.document.getElementById(nm);
if (!e)
{
return;
}
e.checked = "checked";
}
function Reset(nm)
{
var e = window.document.getElementById(nm);
if (!e)
{
return;
}
e.checked = "";
}
