
var d=document;Function.prototype.bind=function()
{var __method=this;var object=arguments[0];return function()
{return __method.apply(object);}};gui_menu_over_selected=true;gui_menu_over_selected_id="";function gui_menu_over(id,action)
{if(action==1)
{var ele=document.getElementById("menu.link."+id);if(typeof(ele.attributes["class"])!="undefined")
{ele.attributes["class"].nodeValue="menu_over";}
var ele=document.getElementById("menu.layer."+id);ele.style.background="white";gui_menu_over_selected=true;gui_menu_over_selected_id=id;}
else if(action==0)
{gui_menu_over_selected=false;setTimeout(function()
{if(!gui_menu_over_selected||gui_menu_over_selected_id!=id)
{var ele=document.getElementById("menu.link."+id);if(typeof(ele.attributes["class"])!="undefined")
{ele.attributes["class"].nodeValue="menu";}
var ele=document.getElementById("menu.layer."+id);ele.style.background="";}},10);}}
app={Strings:new Array(),lang:function(i,v)
{if(isset(i)&&isset(v))
{this.Strings.push(new Array(i,v));}
else if(isset(i))
{for(var j=0;j<this.Strings.length;j++)
{if(this.Strings[j][0]==i)
{return this.Strings[j][1];}}
return false;}
else
{return false;}}}
function sprintf()
{if(sprintf.arguments.length<2)
{return;}
var r=sprintf.arguments[0];for(var k=1;k<sprintf.arguments.length;++k)
{switch(typeof(sprintf.arguments[k]))
{case"string":r=r.replace(/%s/,sprintf.arguments[k]);break;case"number":r=r.replace(/%d/,sprintf.arguments[k]);break;case"boolean":r=r.replace(/%b/,sprintf.arguments[k]?'true':'false');break;default:break;}}
return(r);}
function basename(v)
{if(isset(v))
{var pos=v.lastIndexOf("\/");var r=v.substring(pos+1);return r;}
else
{return false;}}
function browser()
{var r;switch(true)
{case(window.attachEvent&&!window.opera):r="ie";break;case(window.opera):r="opera";break;case(navigator.userAgent.indexOf('AppleWebKit/')>-1):r="safari";break;case(navigator.userAgent.indexOf('Gecko')>-1&&navigator.userAgent.indexOf('KHTML')==-1):r="gecko";break;default:r=false;break;}
return r;}
function dec_hex(v)
{return v.toString(16);}
function hex_dec(v)
{return parseInt(v,16);}
function isset(v)
{return(typeof v!="undefined"&&v!==null)?true:false;}
function is_null(v)
{return(v===null);}
function popup(name,url,width,height,left,top,options)
{if(isset(name)&&isset(url))
{var option_string="width="+width+",height="+height;if(isset(left)&&left!==0){option_string+=",left="+left;}
if(isset(top)&&top!==0){option_string+=",top="+top;}
if(!isset(options)){options="resizable,status,scrollbars";}
if(options.indexOf("location")!=-1){option_string+=",location=yes";}
if(options.indexOf("menubar")!=-1){option_string+=",menubar=yes";}
if(options.indexOf("resizable")!=-1){option_string+=",resizable=yes";}
if(options.indexOf("scrollbars")!=-1){option_string+=",scrollbars=yes";}
if(options.indexOf("status")!=-1){option_string+=",status=yes";}
if(options.indexOf("toolbar")!=-1){option_string+=",toolbar=yes";}
option_string+=",dependent=yes";return window.open(url,name,option_string);}
else
{return false;}}
function rand(min,max)
{var r=Math.round(Math.random()*(max-min))+min;return r;}
function redirect(v)
{if(isset(v))
{window.location.href=v;}}
function strip_scripts(v)
{return v.replace(/<script[^>]*>([\u0001-\uFFFF]*?)<\/script>/g,"");}
function strip_tags(v)
{return v.replace(/<[^>]*>/g,"");}
var ajax=function(url,options)
{this.Url="";this.Method="post";this.Parameter="";this.ContentType="application/x-www-form-urlencoded";this.Encoding="utf-8";this.Header=new Array();this.onSuccess=function(){};this.onFailure=function(){};if(isset(url))
{this._init(url,options);}};ajax.prototype._init=function(url,options)
{this.Url=url;if(isset(options.method)){this.Method=options.method.toLowerCase();}
if(isset(options.parameter)){this.Parameter=options.parameter;}
if(isset(options.encoding)){this.Encoding=options.encoding;}
if(isset(options.contenttype)){this.ContentType=options.contenttype;}
if(isset(options.onSuccess)){this.onSuccess=options.onSuccess;}
if(isset(options.onFailure)){this.onFailure=options.onFailure;}};ajax.request=function(url,options)
{this._init(url,options);this.send();};ajax.request.prototype=new ajax();ajax.request.prototype.change=function()
{if(this.response.readyState==4&&(this.response.status<=200&&this.response.status<300))
{this.onSuccess(this.response);}
else if(this.response.readyState==4&&(this.response.status>200&&this.response.status>=300))
{this.onFailure(this.response);}};ajax.request.prototype.send=function()
{if(browser()=="ie")
{try
{this.response=new ActiveXObject("Msxml2.XMLHTTP");}
catch(ex)
{try
{this.response=new ActiveXObject("Microsoft.XMLHTTP");}
catch(ex)
{}}}
else
{this.response=new XMLHttpRequest();if(this.response.overrideMimeType)
{this.response.overrideMimeType('text/xml');}}
this.response.onreadystatechange=this.change.bind(this);this.response.open(this.Method.toUpperCase(),this.Url,true);this.response.setRequestHeader("Content-type",this.ContentType);this.response.setRequestHeader("Content-length",this.Parameter.length);this.response.setRequestHeader("Connection","close");this.response.send(this.Parameter);};var c=function(v)
{if(isset(v)){this._init(v);}};c.prototype._init=function(v)
{this.Id=v;this.Item=document.getElementById(v);};c.image=function(v)
{if(isset(v)){this._init(v);}};c.image.prototype=new c();c.image.prototype.clear=function()
{try
{r=new e.input(this.Id).value("");r=new e(this.Id+".image").Element.src="";return true;}
catch(ex)
{return false;}};function dialog(title,body,options)
{this.Id=new guid();this.Body=body;this.Options=options;this.Layer=null;var ele=null;this.Layer=d.createElement("DIV");this.Layer.id=this.Id;this.Layer.className="dialog_layer";if(isset(title)&&title!=="")
{ele=d.createElement("DIV");ele.setAttribute("class","header");ele.appendChild(document.createTextNode(title));this.Layer.appendChild(ele);}
ele=d.createElement("P");if(isset(body)&&body!=="")
{ele.appendChild(d.createElement("BR"));ele.appendChild(document.createTextNode(body));ele.appendChild(d.createElement("BR"));ele.appendChild(d.createElement("BR"));}
else
{ele.appendChild(d.createElement("BR"));}
this.Layer.appendChild(ele);var default_onclick="d.body.removeChild(d.getElementById('"+this.Id+"')); d.body.removeChild(d.getElementById('ov"+this.Id+"'))";var seperator=false;if(isset(this.Options.yes))
{ele=d.createElement("INPUT");ele.type="button";ele.value="Löschen";if(isset(this.Options.target)&&this.Options.target!=="")
{ele.onclick=new Function("new ajax.request('"+this.Options.yes+"',{onSuccess: function(r) {document.getElementById('"+this.Options.target+"').innerHTML = r.responseText;}});"+default_onclick);}
else
{ele.onclick=new Function("document.location.href = '"+this.Options.yes+"'");}
this.Layer.appendChild(ele);seperator=true;}
if(isset(this.Options.no))
{if(seperator)
{ele=d.createElement("SPAN");ele.appendChild(document.createTextNode(" | "));this.Layer.appendChild(ele);}
ele=d.createElement("INPUT");ele.setAttribute("type","button");ele.setAttribute("value","No");if(isset(this.Options.target)&&this.Options.target!=="")
{ele.setAttribute("onclick","void new ajax.request('"+this.Options.no+"',{onSuccess: function(r) {document.getElementById('"+this.Options.target+"').innerHTML = r.responseText;}});"+default_onclick);}
else
{ele.setAttribute("onclick","document.location.href = '"+this.Options.no+"'");}
this.Layer.appendChild(ele);seperator=true;}
if(isset(this.Options.cancel))
{if(seperator)
{ele=d.createElement("SPAN");ele.appendChild(document.createTextNode(" | "));this.Layer.appendChild(ele);}
ele=d.createElement("INPUT");ele.type="button";ele.value="Abbrechen";ele.onclick=new Function(default_onclick);this.Layer.appendChild(ele);seperator=true;}
ele=d.createElement("P");ele.appendChild(d.createElement("BR"));this.Layer.appendChild(ele);d.body.appendChild(this.Layer);if(isset(this.Options.position))
{switch(this.Options.position)
{case"center":r=new e(this.Id).center();break;case"mouse":r=new e(this.Id).position(mouse.PosX,mouse.PosY);break;}}
if(isset(this.Options.overlay)&&this.Options.overlay)
{ele=d.createElement("DIV");ele.id="ov"+this.Id;ele.className="dialog_overlay";d.body.appendChild(ele);var height=(all.Height>mouse.WindowY)?all.Height:mouse.WindowY;height+=mouse.ScrolledY;var width=(all.Width>mouse.WindowX)?all.Width:mouse.WindowX;width+=mouse.ScrolledX;var ov=new e("ov"+this.Id);ov.resize(width,height);}}
function e(v)
{this.Height=0;this.Width=0;this.PosX=0;this.PosY=0;this._init(v);}
e.prototype._init=function(v)
{this.Element=document.getElementById(v);if(isset(this.Element))
{this.Id=this.Element.id;this.Name=this.Element.name;this.Type=this.Element.tagName.toLowerCase();this.dimension();this.position();}};e.prototype.center=function(element)
{var pos_left=0;var pos_top=0;if(isset(element))
{var container=new e(element);pos_left=container.PosX+((container.Width-this.Width)/2);pos_top=container.PosY+((container.Height-this.Height)/2);}
else
{pos_left=((mouse.WindowX-this.Width)/2)+mouse.ScrolledX;pos_top=((mouse.WindowY-this.Height)/2)+mouse.ScrolledY;}
if(this.Element)
{return this.position(pos_left,pos_top);}
else
{return false;}};e.prototype.dimension=function(width,height)
{if(isset(this.Element))
{if(isset(width)&&isset(height))
{this.Element.style.width=width+"px";this.Element.style.height=height+"px";this.Width=width;this.Height=height;return true;}
else
{if(browser()!=="ie"&&(this.style("display")==="none"||this.style("display")===""))
{var visibility=this.Element.style.visibility;var position=this.Element.style.position;var display=this.Element.style.display;this.Element.style.visibility="hidden";this.Element.style.position="absolute";this.Element.style.display="block";this.Width=this.Element.clientWidth;this.Height=this.Element.clientHeight;this.Element.style.display=visibility;this.Element.style.position=position;this.Element.style.visibility=display;}
else
{this.Width=this.Element.clientWidth;this.Height=this.Element.clientHeight;}
return[this.Width,this.Height];}}
else
{this.Width=0;this.Height=0;return false;}};e.prototype.disable=function()
{if(this.Element&&isset(this.Element.disabled))
{this.Element.disabled=true;return true;}
else
{return false;}};e.prototype.enable=function()
{if(isset(this.Element)&&isset(this.Element.disabled))
{this.Element.disabled=false;return true;}
else
{return false;}};e.prototype.hide=function()
{if(isset(this.Element))
{this.Element.style.visibility="hidden";this.Element.style.display="none";return true;}
else
{return false;}};e.prototype.opacity=function(v)
{if(isset(this.Element))
{this.Element.style.opacity=(v==1||v==="")?"":(v<0.00001)?0:v;return true;}
else
{return false;}};e.prototype.position=function(left,top)
{if(this.Element)
{if(isset(left)&&isset(top))
{this.Element.style.left=left+"px";this.Element.style.top=top+"px";this.PosX=left;this.PosY=top;return true;}
else
{var left=0;var top=0;var obj=this.Element;if(obj.offsetParent)
{left=obj.offsetLeft;top=obj.offsetTop;while(obj=obj.offsetParent)
{left+=obj.offsetLeft;top+=obj.offsetTop;}}
this.PosX=left;this.PosY=top;return[this.PosX,this.PosY];}}
else
{return false;}};e.prototype.replace=function(v)
{if(this.Element&&isset(v))
{this.Element.innerHTML=v;return true;}
else
{return false;}};e.prototype.resize=function(width,height)
{return this.dimension(width,height);};e.prototype.show=function()
{if(isset(this.Element))
{this.Element.style.visibility="visible";this.Element.style.display="block";return true;}
else
{return false;}};e.prototype.style=function(i,v)
{if(isset(this.Element)&&isset(i))
{if(!isset(v))
{return this.Element.style[i];}
else
{this.Element.style[i]=v;return true;}}};e.prototype.toggle=function()
{if(this.Element)
{switch(this.Element.style.visibility)
{case"":case"visible":return this.hide();break;case"hidden":return this.show();break;}
return true;}
return false;};e.prototype.update=function(v)
{if(isset(this.Element)&&isset(this.Element.innerHTML))
{this.Element.innerHTML=v;return true;}
return false;};e.checkbox=function(v)
{this._init(v);this.Value=this.Element.value;this.Checked=this.Element.checked;};e.checkbox.prototype=new e();e.checkbox.prototype.check=function()
{this.Element.checked=true;this.Checked=true;};e.checkbox.prototype.uncheck=function()
{this.Element.checked=false;this.Checked=false;};e.form=function(v)
{this._init(v);this.Count=this.Element.length;this.Fields=new Array();this.Post="";for(i=0;i<=this.Element.length-1;i++)
{var skip=false;var ele=this.Element.elements[i];switch(ele.tagName)
{case"INPUT":switch(ele.type)
{case"checkbox":this.Fields[i]=new e.checkbox(ele.id);case"radio":break;case"button":skip=true;break;default:this.Fields[i]=new e.input(ele.id);break;}
break;case"SELECT":this.Fields[i]=new e.select(ele.id);break;default:break;}
if(!skip)
{if(this.Post!==""){this.Post+="&";}
if(isset(this.Fields[i].Checked)&&!this.Fields[i].Checked)
{this.Post+=this.Fields[i].Name+"=";}
else
{this.Post+=this.Fields[i].Name+"="+encodeURI(this.Fields[i].Value);}}}}
e.form.prototype=new e();e.input=function(v)
{this._init(v);this.Value=this.Element.value;};e.input.prototype=new e();e.input.prototype.value=function(v)
{if(isset(this.Element)&&isset(v))
{this.Element.value=v;this.Value=v;return true;}
else if(isset(this.Element.value)&&!isset(v))
{return this.Element.value;}
else
{return false;}};e.select=function(v)
{this._init(v);this.Options=this.Element.options;this.Count=this.Element.options.length;this.Index=this.Element.selectedIndex;this.Value=this.Options[this.Index].value;this.Text=this.Options[this.Index].text;};e.select.prototype=new e();e.select.prototype.add=function(text,value,selected,is_default)
{if(isset(this.Element)&&isset(text)&&isset(value))
{var i=(this.Count==0)?0:this.Count;if(!isset(is_default))is_default=false;if(!isset(selected))selected=false;this.Options[i]=new Option(text,value,is_default,selected);this.Count++;return i;}
else
{return false;}};e.select.prototype.clear=function()
{if(isset(this.Element))
{this.Element.options.length=0;this.Count=0;return true;}
else
{return false;}};e.select.prototype.remove=function(i)
{if(isset(this.Element)&&isset(this.Options[i]))
{this.Options[i]=null;this.Count--;return true;}
else
{return false;}};e.select.prototype.select=function(i)
{if(isset(this.Element)&&isset(this.Options[i]))
{this.Options[i].selected=true;return true;}
else
{return false;}};guid=function()
{this.Seed="";this.id=this.create();};guid.prototype.valueOf=function()
{return this.id;};guid.prototype.toString=function()
{return this.id;};guid.prototype.create=function()
{if(isset(mouse.Seed))
{this.Seed=mouse.Seed;}
else
{this.Seed=rand(0,Math.pow(8,8)*16);}
return this.token(4)+this.token(4)+"-"+this.token(4)+"-"+this.token(4)+"-"+this.token(4)+"-"+this.token(4)+this.token(4)+this.token(4);};guid.prototype.token=function(amount)
{seed=this.Seed^rand(0,Math.pow(10,this.Seed.length));seed=dec_hex(seed);r=seed.substring(seed.length-(amount+1),seed.length-1);return r;};validate=function(e,validations)
{this.Element=e;this.Validations=validations;this.Valid=true;};validate.prototype.validate=function()
{if(isset(this.Element.Value))
{for(var i in this.Validations)
{if(!this.Validations[i].validate(this.Element.Value))
{this.Valid=false;}}}
else
{this.Valid=false;}
return this.Valid;};validate.date=function(format)
{this.Format=format;this.RegExp=new Array();this.RegExp[1]=/^\d{2}\.\d{2}.\d{4}$/;this.RegExp[2]=/^\d{2}\.\d{2}.\d{4} \d{2}:\d{2}$/;this.RegExp[3]=/^\d{2}\.\d{2}.\d{4} \d{2}:\d{2}:\d{2}$/;};validate.date.prototype.validate=function(v)
{var regexp=this.RegExp[this.Format];if(isset(v)&&regexp.test(v))
{return true;}
else
{return false;}};validate.email=function(v){}
validate.email.prototype.validate=function(v)
{var regexp=/^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/;if(isset(v)&&regexp.test(v))
{return true;}
else
{return false;}};validate.max=function(v)
{this.Max=v;};validate.max.prototype.validate=function(v)
{if(isset(v)&&v.length<=this.Max)
{return true;}
else
{return false;}};validate.min=function(v)
{this.Min=v;};validate.min.prototype.validate=function(v)
{if(isset(v)&&v.length>=this.Min)
{return true;}
else
{return false;}};function mouse(x)
{this.PosX=0;this.PosY=0;this.ScrolledX=0;this.ScrolledY=0;this.WindowX=0;this.WindowY=0;this.Seed=Math.round(new Date().getTime()/1000);}
mouse.prototype.update=function(e)
{if(document.all?true:false)
{this.PosX=event.clientX;this.PosY=event.clientY;}
else
{this.PosX=e.pageX;this.PosY=e.pageY;}
if(self.pageYOffset)
{this.ScrolledX=self.pageXOffset;this.ScrolledY=self.pageYOffset;}
else if(document.documentElement&&document.documentElement.scrollTop)
{this.ScrolledX=document.documentElement.scrollLeft;this.ScrolledY=document.documentElement.scrollTop;}
else if(document.body)
{this.ScrolledX=document.body.scrollLeft;this.ScrolledY=document.body.scrollTop;}
if(typeof(window.innerWidth)=='number')
{this.WindowX=window.innerWidth;this.WindowY=window.innerHeight;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
{this.WindowX=document.documentElement.clientWidth;this.WindowY=document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
{this.WindowX=document.body.clientWidth;this.WindowY=document.body.clientHeight;}
var seed=this.Seed^this.PosX*this.PosY*rand(256*4,256*8);seed=seed.toString();if(seed.length>8)
{seed=seed.substring(seed.length-9,seed.length-1);}
else if(seed.length<8)
{for(i=0;i<=8-seed.lenght;i++)
{seed="0"+seed;}}
this.Seed=seed;};function update_mouse(e){mouse.update(e);}
mouse=new mouse();document.onmousemove=update_mouse;
