
var _RootPath = window.location.protocol+"//"+window.location.host;
if (window.location.href.indexOf("localhost") > -1){
_RootPath += "/bgtproject.medienkultur.de";
}
var Runtime =
{
_dictionary: this._dictionary ? this._dictionary : new Object(),
Put: function(key, value)
{
this._dictionary[key] = value
},
Get: function(key)
{
return this._dictionary[key] ? this._dictionary[key] : null;
},
Remove: function(key)
{
if (this.Get(key) != null){delete this._dictionary[key];}
},
Clear: function(){
for (key in this._dictionary){
this.Remove(key);
}
}
}
var Client =
{
_isDetected: false,
_detect: function() {
if (!this._isDetected) {
Util.BrowserDetect.Init();
this._isDetected = true;
}
},
GetVersion: function() { this._detect(); return Util.BrowserDetect.Version; },
GetBrowser: function() { this._detect(); return Util.BrowserDetect.Browser; },
IsDOM: function() { return document.getElementById ? true : false; }, 
IsOpera: function() { return this.GetBrowser() == "Opera" ? true : false; },
IsIE: function() { return this.GetBrowser() == "Explorer" ? true : false; },
IsIE6: function() { return this.IsIE && this.GetVersion() == 6 ? true : false; },
IsIE7: function() { return this.IsIE && this.GetVersion() == 7 ? true : false; },
IsIE8: function() { return this.IsIE && this.GetVersion() == 8 ? true : false; },
IsWindows: function() {
return navigator.appVersion.toLowerCase().indexOf("win") != -1 ? true : false;
},
GetWidth: function() { return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0; },
GetHeight: function() { return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0; }
};
var Body =
{
Get: function(){return document.body ? document.body : document.documentElement;},
GetOffsetWidth: function() { return this.Get().offsetWidth },
GetOffsetHeight: function() { return this.Get().offsetHeight },
GetScrollLeft: function() {
return window.pageXOffset ? window.pageXOffset
: document.documentElement.scrollLeft ? document.documentElement.scrollLeft
: document.body.scrollLeft;
},
GetScrollTop: function() {
return window.pageYOffset ? window.pageYOffset
: document.documentElement.scrollTop ? document.documentElement.scrollTop
: document.body.scrollTop;
},
GetClipTop: function() { return this.GetScrollTop(); },
GetClipRight: function() { return (this.GetScrollLeft() + Client.GetWidth()); },
GetClipBottom: function() { return (this.GetScrollTop() + Client.GetHeight()); },
GetClipLeft: function() { return this.GetScrollLeft(); }
};
 
var DomLoaded =
{
onload: [],
Loaded: function()
{
if (arguments.callee.done) return;
arguments.callee.done = true;
for (i = 0;i < DomLoaded.onload.length;i++) DomLoaded.onload[i]();
},
Load: function(fireThis)
{
this.onload.push(fireThis);
if (document.addEventListener) 
document.addEventListener("DOMContentLoaded", DomLoaded.Loaded, null);
if (/KHTML|WebKit/i.test(navigator.userAgent))
{ 
var _timer = setInterval(function()
{
if (/loaded|complete/.test(document.readyState))
{
clearInterval(_timer);
delete _timer;
DomLoaded.Loaded();
}
}, 10);
}
window.onload = DomLoaded.Loaded;
}
};
if (window.onload != null){
DomLoaded.Load(window.onload);
}
function BindInlineEvent(handlerString,element,event){
Util.EventBinding.ExecutiveBind(handlerString,element,event);
}
function Listener(eventType,eventHandler){
this.id = Util.UniqueID.Get();
this.type = eventType;
this.handler = eventHandler;
this.object = "Listener" + this.id;
eval(this.object + "=this");
return this;
}
function EventTrigger(event,targetNode){
this.event = event.type ? event : window.event;
targetNode = targetNode ? targetNode : null;
this.type = event.type ? event.type : window.event.type;
this.currentTarget = targetNode != null ? targetNode : event.currentTarget ? event.currentTarget : event.srcElement ? event.srcElement : null;
if (this.currentTarget != null){
if (this.currentTarget.nodeType == 3){ 
this.currentTarget = this.currentTarget.parentNode;
} 
this.currentTarget.id = this.currentTarget.id ? this.currentTarget.id : Util.UniqueID.Get();
this.nodeObject = GetNodeObject(this.currentTarget);
}
this.target = event.target ? event.target : event.srcElement ? event.srcElement : null;
if (this.target != null){
if (this.target.nodeType == 3){ 
this.target = this.target.parentNode;
}
this.target.id = this.target.id ? this.target.id : Util.UniqueID.Get();
}
this.pageX = event.pageX ? event.pageX : event.clientX ? event.clientX + Body.GetScrollLeft() : this.nodeObject ? this.nodeObject.GetX() : 0;
this.pageY = event.pageY ? event.pageY : event.clientY ? event.clientY + Body.GetScrollTop() : this.nodeObject ? this.nodeObject.GetY() : 0;
this.GetX = function(){return this.pageX;}
this.GetY = function(){return this.pageY;}
if (this.currentTarget != null){
this.currentTargetDeltaX = this.pageX - parseInt(this.currentTarget.style.left);
this.currentTargetDeltaY = this.pageY - parseInt(this.currentTarget.style.top);;
} 
if (this.target != null){ 
this.targetDeltaX = this.target ? this.pageX - parseInt(this.target.style.left) : this.currentTargetDeltaX;
this.targetDeltaY = this.target ? this.pageY - parseInt(this.target.style.top) : this.currentTargetDeltaY;
} 
this.object = "EventTrigger" + this.id;
eval(this.object + "=this");
return this;
}
var _storageFormObjects = new Object();
function GetFormObject(element){
element.id = element.id ? element.id : Util.UniqueID.Get();
return _storageFormObjects[element.id] && _storageFormObjects[element.id].element == element ?
_storageFormObjects[element.id] : new FormObject(element);
}
function FormObject(element) { 
element.id = element.id ? element.id : Util.UniqueID.Get();
this.element = element;
this.object = "FormObject" + element.id;
eval(this.object + "=this");
_storageFormObjects[element.id] = this;
return this;
}
FormObject.prototype.InsertOption = function(value, text){ 
if (this.element.nodeName.toLowerCase() == "select"){
var ci = this.element.selectedIndex;
var no = document.createElement('option');
no.value = value != null ? value : "!InsertOption:Value";
no.text = text != null ? text : no.value;
try {
var oo = this.element.options[this.element.selectedIndex];
this.element.add(no, oo); 
} catch(ex) {
try{
this.element.add(no, this.element.selectedIndex); 
} catch(e){alert(e.message);}
}
oo.selected = false;
no.selected = true;
return true
}
return false;
}
FormObject.prototype.SetValue = function(value){ 
this.element.value = value;
return true;
}
FormObject.prototype.Clear = function(){ 
if (this.element.value){
delete this.element.value;
return true;
}
return false;
}
FormObject.prototype.Click = function(){
if (this.element.click && !document.createEvent){
this.element.click();
} else if(document.createEvent){
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
this.element.dispatchEvent(evt);
}
}
FormObject.prototype.DoubleClick = function(){
if (this.element.click && !document.createEvent){
alert("FormObject.DoubleClick: ie. Hier nochmal nachchecken");
var storeClick = this.element.onclick;
Runtime.Put("ForcedEvent", "click");
Runtime.Put("ForcedRealEvent", "dblclick");
this.element.click();
Runtime.Remove("ForcedEvent");
Runtime.Remove("ForcedRealEvent");
this.element.onclick = storeClick;
} else if(document.createEvent){
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("dblclick", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
this.element.dispatchEvent(evt);
}
}
var _storageNodeObjects = new Object();
function GetNodeObject(element){
element.id = element.id ? element.id : Util.UniqueID.Get();
return _storageNodeObjects[element.id] && _storageNodeObjects[element.id].element == element ?
_storageNodeObjects[element.id] : new NodeObject(element);
}
function NodeObject(element) {
if( typeof element == "string"){
element = document.getElementById(element);
} if (!element){return null;}
element.id = element.id ? element.id : Util.UniqueID.Get();
this.element = element;
this.object = "NodeObject" + element.id;
this.GetStyle = function(){return this.element.currentStyle ? this.element.currentStyle : this.element.style;}
this.GetX = function(){return parseInt(this.GetStyle().left) || this.GetStyle().pixelLeft || this.GetOffsetLeft() || 0;}
this.GetY = function(){return parseInt(this.GetStyle().top) || this.GetStyle().pixelTop || this.GetOffsetTop() || 0;}
this.GetWidth = function(){return parseInt(this.element.width) || parseInt(this.GetStyle().width.indexOf("px") > -1 ? this.GetStyle().width : "") || this.GetOffsetWidth() - this.GetPadding()["left"] - this.GetPadding()["right"] - this.GetBorderWidth()["left"] - this.GetBorderWidth()["right"] || 0;}
this.GetHeight = function(){return parseInt(this.element.height) || parseInt(this.GetStyle().height.indexOf("px") ? this.GetStyle().height : "") || this.GetOffsetHeight() - this.GetPadding()["top"] - this.GetPadding()["bottom"] - this.GetBorderWidth()["top"] - this.GetBorderWidth()["bottom"] || 0;}
this.GetOffsetWidth = function(){return this.element.offsetWidth || 0;}
this.GetOffsetHeight = function(){return this.element.offsetHeight || 0;}
eval(this.object + "=this");
_storageNodeObjects[element.id] = this;
return this;
}
NodeObject.prototype.GetPositionReference = function(){
var element = arguments.length > 0 ? arguments[0] : this.element;
if (element.parentNode && element.parentNode.style){
if (element.parentNode.style.position == "absolute" || element.parentNode.style.position == "relative"){
return element.parentNode;
} else {
return this.GetPositionReference(element.parentNode);
}
}
return null;
}
NodeObject.prototype.GetBorderWidth = function(){
var b = new Object();
b["top"] = parseInt(this.GetStyle().borderTopWidth) || 0;
b["right"] = parseInt(this.GetStyle().borderRightWidth) || 0;
b["bottom"] = parseInt(this.GetStyle().borderBottomWidth) || 0;
b["left"] = parseInt(this.GetStyle().borderLeftWidth) || 0;
return b;
}
NodeObject.prototype.GetPadding = function(){
var p = new Object();
p["top"] = parseInt(this.GetStyle().paddingTop) || 0;
p["right"] = parseInt(this.GetStyle().paddingRight) || 0;
p["bottom"] = parseInt(this.GetStyle().paddingBottom) || 0;
p["left"] = parseInt(this.GetStyle().paddingLeft) || 0;
return p;
}
NodeObject.prototype.GetOffsetTop = function(){
var curtop = 0;
var obj = this.element; 
if (obj.offsetParent){
while (obj.offsetParent){
curtop += obj.offsetTop
obj = obj.offsetParent;
}
} else if (obj.y) {
curtop += obj.y;
}
return curtop;
}
NodeObject.prototype.GetOffsetLeft = function(){
var curleft = 0;
var obj = this.element; 
if (obj.offsetParent){
while (obj.offsetParent){
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
} else if (obj.x) {
curleft += obj.x;
}
return curleft;
}
NodeObject.prototype._ProtectInlineEvent = function(listenerType){
if(this.element['on'+listenerType]){
var f = this.element['on'+listenerType];
if (f.toString().indexOf("BindInlineEvent(") >= 0){
var body = f.toString().substr(f.toString().indexOf("{") + 1);
body = body.replace("javascript:", "").replace("}","").replace(/\n/g,"").replace(/\t/g,"").replace(/\s/g,"");
var isolation = body.substr(body.indexOf(",BindInlineEvent(") > -1 ? body.indexOf(",BindInlineEvent(") : body.indexOf(";BindInlineEvent(") > -1 ? body.indexOf(";BindInlineEvent(") : body.indexOf("BindInlineEvent("));
isolation = isolation.substr(0, isolation.indexOf("),") > -1 ? isolation.indexOf("),") + 2 : isolation.indexOf("):") > -1 ? isolation.indexOf(");") + 2 : isolation.indexOf(")") + 1);
var splits = body.split(isolation);
body = "";
for (var i=0; i < splits.length; i++){
if (splits[i].length > 0){
body += splits[i].charAt(splits[i].length - 1) == ";" ? splits[i] : splits[i] + ";";
} 
}
this.element['on'+listenerType] = "";
var isplits = isolation.substr(isolation.indexOf("(") + 1, isolation.indexOf(")") - 1).split(",");
alert("NodeObject.prototype._ProtectInlineEvent: do Transformation (TODO: check if that still works!)");
this.AddListener(new Listener(listenerType, Util.EventBinding.Transform(isplits[0].replace(/\"/g, "").replace(/\'/g, ""))));
if (body.length > 0){
this.AddListener(new Listener(listenerType,new Function("trigger",""+body+"")));
}
} else {
this.element['on'+listenerType] = "";
this.AddListener(new Listener(listenerType,f));
}
}
}
NodeObject.prototype.AddListener = function(Listener) {
var isAlreadyTriggering = false;
this.listener = this.listener ? this.listener : new Object();
if (this.listener[Listener.type]) {
isAlreadyTriggering = true;
if (this.listener[Listener.type][Listener.id]) {
return;
}
} else {
this.listener[Listener.type] = new Object();
}
this.listener[Listener.type][Listener.id] = Listener;
if (document.implementation && document.implementation.hasFeature('Events', '2.0')) { 
if (isAlreadyTriggering == false) {
this._ProtectInlineEvent(Listener.type);
}
Listener._Dispatch = function(evt) { Listener.handler(new EventTrigger(evt)) };
this.element.addEventListener(Listener.type, Listener._Dispatch, true);
}
else {
if (isAlreadyTriggering == false) { 
this._ProtectInlineEvent(Listener.type);
}
eval(_TriggerDOM0(Listener.type));
this.element['on' + Listener.type] = _PrivateEventTrigger;
if (this.element.captureEvents) {
this.element.captureEvents('Event.' + Listener.type.toUpperCase());
}
}
}
NodeObject.prototype.RemoveListener = function(Listener) {
var removeThisListener = false;
var keepTrigger = false;
this.listener = this.listener ? this.listener : new Object();
for (listenerId in this.listener[Listener.type]){
if (listenerId == Listener.id){
delete this.listener[Listener.type][listenerId];
removeThisListener = true;
if (document.implementation && document.implementation.hasFeature('Events', '2.0')) {
this.element.removeEventListener(Listener.type, Listener._Dispatch, true);
}
 
}
else {
keepTrigger = true;
} 
}
if (removeThisListener && !keepTrigger && (!document.implementation || !document.implementation.hasFeature('Events', '2.0'))) {
delete this.listener[Listener.type];
this.element['on'+Listener.type]= window.clientInformation ? null : window.undefined;
}
}
function _TriggerDOM0(t){
return 'function _PrivateEventTrigger(e){return _EventDispatch(e,this, \''+t+'\');}';
}
function _EventDispatch(e,eventSource,eventType){
e = e ? e : window.event;
var objEventTrigger = new EventTrigger(e,eventSource);
var elisteners = new Array();
var result = window.undefined;
if(objEventTrigger.nodeObject){
for (listenerId in objEventTrigger.nodeObject.listener[eventType]){
elisteners[elisteners.length] = objEventTrigger.nodeObject.listener[eventType][listenerId].handler; 
}
} else {
return alert("Adding a listener to dhtml object for eventlvl 0 failed in _EventDispatch!"+
"(trigger has not the node object current target)");
}
for (var i=0;i<elisteners.length;i++){
var r = elisteners[i](objEventTrigger);
if (r+''!='undefined'){
result = r;
}
}
return result;
}
NodeObject.prototype.GetParentLayer = function(){
var f = function(node){
if (node.parentNode){
if (node.parentNode.id && ExistsLayer(node.parentNode.id)){
return GetLayer(node.parentNode.id);
} else {
return f(node.parentNode);
}
}
return null;
}
var n = this.element;
return f(n);
}
NodeObject.prototype.Click = function(){
if (this.element.click && !document.createEvent){
this.element.click();
} else if(document.createEvent){
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
this.element.dispatchEvent(evt);
}
}
NodeObject.prototype.DoubleClick = function(){
if (this.element.click && !document.createEvent){
alert("FormObject.DoubleClick: ie. Hier nochmal nachchecken");
var storeClick = this.element.onclick;
Runtime.Put("ForcedEvent", "click");
Runtime.Put("ForcedRealEvent", "dblclick");
this.element.click();
Runtime.Remove("ForcedEvent");
Runtime.Remove("ForcedRealEvent");
this.element.onclick = storeClick;
} else if(document.createEvent){
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("dblclick", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
this.element.dispatchEvent(evt);
}
}
function AjaxRequest(){
this._IsAsync = arguments.length > 0 && arguments[0] == false ? false : true;
this.URL = null;
this._RequestMethod = null;
this._ParamString = null;
try {
this.request = new XMLHttpRequest();
} catch(w3c) {
try {
this.request = new ActiveXObject("Msxml2.XMLHTTP");
} catch(msie) {
try {
this.request = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
Util.Debug.Append("new AjaxRequest: (catch of try) XMLRequest failed: \n\t"+w3c.message+"\n\t"+msie.message+"\n\t"+e.message);
}
} 
}
this.object = "AjaxRequest" + Util.UniqueID.Get();
eval(this.object + "=this");
return this;
}
AjaxRequest.prototype.Load = function(reqmethod, URL){
this.URL = URL;
this._RequestMethod = reqmethod;
this._ParamString = arguments.length > 2 ? arguments[2] : null;
try {
this.request.onreadystatechange = new Function(""+this.object+"._Callback()");
this.request.open(reqmethod, URL , this._IsAsync);
this.request.setRequestHeader('If-Modified-Since','Sat, 1 Jan 2000 00:00:00 GMT');
if (this._ParamString != null && this._RequestMethod.toLowerCase() == "post"){
this.request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
this.request.setRequestHeader("Content-length", this._ParamString.length);
this.request.setRequestHeader("Connection", "close");
this.request.send(this._ParamString);
} else {
this.request.send(null);
}
} catch(e){
Util.Debug.Append("AjaxRequest.Load (catch of try): " + e.message);
}
}
AjaxRequest.prototype._Callback = function(){
try {
if (this.request.readyState == 4){
if (this.request.status != 200 && this.request.status != 0){
Util.Debug.Append("AjaxRequest aborted (status not 200): "+this.request.statusText);
if(this.onabort){
this.onabort(this);
}
}
else if (this.request.responseXML || this.request.response || this.request.responseText){
if(this.onresponse){
this.onresponse(this);
}
} 
} else if (this.request.readyState < 4 && this.request.readyState > 0){
if(this.onload){
this.onload(this);
}
} else {
if(this.onabort){
this.onabort(this);
}
else{
Util.Debug.Append("AjaxRequest aborted (Did not load?): "+this.request.statusText);
}
}
} catch(e){
Util.Debug.Append("AjaxRequest._Callback (catch of try): " + e.message );
}
}
AjaxRequest.prototype.GetText = function(){
return this.request.responseText ? this.request.responseText : null;
}
AjaxRequest.prototype.GetXML = function(rootNodeName){
rootNodeName = arguments.length > 0 ? arguments[0] : "body";
var root = this.request.responseXML.getElementsByTagName(rootNodeName).item(0);
if (!this.request.responseXML || root == null) {return null;}
this._XMLResponseRoot = root;
var cDataIndex = -1;
var hasCDataOnly = true;
for (var i=0; i<root.childNodes.length; i++){
if (root.childNodes[i].nodeType == 4){
cDataIndex = i;
}
if (root.childNodes[i].nodeType != 4){
hasCDataOnly = true;
if (root.childNodes[i].nodeType == 3 && root.childNodes[i].data.match(/\S/)){
hasCDataOnly = false;
}
}
}
if (hasCDataOnly && cDataIndex >= 0){
return root.childNodes[cDataIndex].data;
} else {
return root;
}
}
String.prototype.Trim = function(){ 
return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""));
}
String.prototype.StartsWith = function(str){ 
return (this.match("^"+str)==str);
}
String.prototype.EndsWith = function(str){ 
return (this.match(str+"$")==str);
}
var Util = {
Debug: {
_string: "",
Append: function(string){this._string += string + "\n"; return this._string;},
Get: function(){return this._string;},
Throw : function(){alert(this._string);},
Clear: function(){this._string = "";}
},
UniqueID: {
_current: 0,
Get: function(){this._current++; return "UtilGenerated" + this._current;}
},
BrowserDetect: {
Init: function () {
this.Browser = this._searchString(this._dataBrowser) || "An unknown browser";
this.Version = this._searchVersion(navigator.userAgent)
|| this._searchVersion(navigator.appVersion)
|| "An unknown version";
this.OS = this._searchString(this._dataOS) || "An unknown OS";
Util.Debug.Append("Util.BrowserDetect: " + this.Browser + " " + this.Version + " on " + this.OS);
},
_searchString: function(data) {
for (var i=0;i<data.length;i++) {
var dataString = data[i].string;
var dataProp = data[i].prop;
this.versionSearchString = data[i].versionSearch || data[i].identity;
if (dataString) {
if (dataString.indexOf(data[i].subString) != -1)
return data[i].identity;
}
else if (dataProp)
return data[i].identity;
}
},
_searchVersion: function(dataString) {
var index = dataString.indexOf(this.versionSearchString);
if (index == -1) return;
return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
},
_dataBrowser: [
{ string: navigator.userAgent,
subString: "OmniWeb",
versionSearch: "OmniWeb/",
identity: "OmniWeb"
},
{
string: navigator.vendor,
subString: "Apple",
identity: "Safari"
},
{
prop: window.opera,
identity: "Opera"
},
{
string: navigator.vendor,
subString: "iCab",
identity: "iCab"
},
{
string: navigator.vendor,
subString: "KDE",
identity: "Konqueror"
},
{
string: navigator.userAgent,
subString: "Firefox",
identity: "Firefox"
},
{
string: navigator.vendor,
subString: "Camino",
identity: "Camino"
},
{ 
string: navigator.userAgent,
subString: "Netscape",
identity: "Netscape"
},
{
string: navigator.userAgent,
subString: "MSIE",
identity: "Explorer",
versionSearch: "MSIE"
},
{
string: navigator.userAgent,
subString: "Gecko",
identity: "Mozilla",
versionSearch: "rv"
},
{ 
string: navigator.userAgent,
subString: "Mozilla",
identity: "Netscape",
versionSearch: "Mozilla"
}
],
_dataOS : [
{
string: navigator.platform,
subString: "Win",
identity: "Windows"
},
{
string: navigator.platform,
subString: "Mac",
identity: "Mac"
},
{
string: navigator.platform,
subString: "Linux",
identity: "Linux"
}
]
},
ImageLoader: {
_storage: new Object(),
_queue: new Array(),
Queue: function(src){
this._queue[this._queue.length] = src;
},
Load: function(){
this._loadcount = 0;
for (var i=0; i< this._queue.length; i++){
var oi = new Image();
oi._src = this._queue[i];
oi.il = this;
oi.onload = function(){
this.timeoutabort = true;
this.il._storage[this._src] = this;
this.il._loadcount++;
this.il._TryReadyState();
}
oi.onabort = function(){
alert("Util.ImageLoader: " + this._src + " Image loading aborted");
}
oi.onerror = function(){
alert("Util.ImageLoader: " + this._src + "Image loading error");
}
oi.src = oi._src;
}
},
_TryReadyState: function(){
if (this._queue.length == this._loadcount){
this._queue = new Array();
if (this.onreadystate){
this.onreadystate();
}
}
},
GetImage: function(src){
return this._storage[src] ? this._storage[src] : null;
}
},
EventBinding: {
ArrayOfListenerType: new Array("click","dblclick","mouseover","mouseout","change","focus","blur","mouseup","mousedown","submit","contextmenu"),
Transform: function(handlerString){ 
var newF = "";
var functions = handlerString.split(";");
for (var a=0;a<functions.length;a++){
if (functions[a].length > 0){
var con = false;
if (functions[a].indexOf("onvalue[") > -1){
functions[a] = functions[a].replace("onvalue[", "if(trigger.nodeObject && trigger.nodeObject.element && trigger.nodeObject.element.value && trigger.nodeObject.element.value=='");
functions[a] = functions[a].replace("]=", "'){");
con = true;
}
functions[a] = functions[a].replace(/,/g,"','");
functions[a] = functions[a].replace("[", "(trigger,'");
functions[a] = functions[a].replace("trigger,']", "trigger]");
functions[a] = functions[a].replace("]","');");
functions[a] = functions[a].replace("trigger')", "trigger)");
if(con){
functions[a]+= "}"; 
con = false;
}
}
newF+= functions[a];
}
var f = new Function("trigger",""+newF+"");
return f;
},
Bind: function(handlerString, element){ 
element.id = element.id ? element.id : Util.UniqueID.Get();
for (var i=0; i < thisAarrayOfListenerType.length; i++){
if(element["on" + thisAarrayOfListenerType[i]]){
var f = this.Transform(handlerString);
element["on" + this.ArrayOfListenerType[i]] = "";
GetNodeObject(element).AddListener(new Listener(this.ArrayOfListenerType[i],f));
}
}
},
ExecutiveBind: function(handlerString, element, event){ 
if (!event){ 
event = window.event;
}
element.id = element.id ? element.id : Util.UniqueID.Get();
for (var i=0; i < this.ArrayOfListenerType.length; i++){
var evtType = this.ArrayOfListenerType[i];
if (Runtime.Get("ForcedEvent") != null && Runtime.Get("ForcedEvent") == evtType
&& Runtime.Get("ForcedRealEvent") != null){
alert("Util.EventBinding.ExecutiveBind: setze " + Runtime.Get("ForcedEvent") + " auf " + Runtime.Get("ForcedRealEvent") + "muss lales nochmal gecjeckt werden");
evtType = Runtime.ForcedRealEvent;
}
if(element["on" + evtType] && element["on" + evtType] != null){
var f = this.Transform(handlerString);
f(new EventTrigger(event,element));
element["on" + evtType] = null;
GetNodeObject(element).AddListener(new Listener(evtType ,f));
}
}
}
}, 
Nodes: {
AjaxLinkExtension: {".pdf":false, ".aspx":true, ".html":false, ".htm":false,
Put: function(extension){
extension = extension.StartsWith(".") ? extension : "." + extension;
this[extension] = this[extension] ? this[extension] : true; 
},
Remove: function(extension){
extension = extension.StartsWith(".") ? extension : "." + extension;
this[extension] = false; 
},
Get: function(extension){
extension = extension.StartsWith(".") ? extension : "." + extension;
return this[extension] ? this[extension] : false;
}
},
CloneHyperLink: function(nodeTo, nodeFrom){
if (nodeFrom.getAttribute('href') != null){
var url = nodeFrom.getAttribute('href');
var ext = url.indexOf(".") > -1 ? url.substring(url.lastIndexOf("."), url.length) : "NoExtensionFound";
ext = ext.indexOf("?") > -1 ? ext.substring(0, ext.indexOf("?")) : ext;
var isALE = this.AjaxLinkExtension.Get(ext);
if (url != "#" && url.indexOf(":void") < 0 && url.toLowerCase().indexOf(":stay(") < 0 && isALE){
nodeTo.href = "javascript:Stay();AjaxLink('" + url + "');";
} else {
nodeTo.href = url;
} 
}
},
Clear: function(node){
while (node.childNodes.length >= 1){
node.removeChild(node.firstChild); 
}
},
GetFirstChildNode: function(node){
for (var i = 0; i <= node.childNodes.length; i++){
if (node.childNodes[i].nodeType == 1){
return node.childNodes[i];
}
}
return null;
},
CloneText: function(nodeTo,nodeFrom){
var content = nodeFrom.value ? nodeFrom.value
: nodeFrom.firstChild ? nodeFrom.firstChild.data
: null;
if (nodeTo.value){
nodeTo.value = content;
} else if (nodeTo.firstChild){
nodeTo.firstChild.data = content;
} else {
nodeTo.appendChild(document.createTextNode(content));
}
},
CloneEvents: function(nodeTo, nodeFrom){
for(var i = 0; i < Util.EventBinding.ArrayOfListenerType.length; i++){
var f = "";
if (nodeTo.type && nodeTo.type == "submit" && Util.EventBinding.ArrayOfListenerType[i] == "click"){
nodeTo.id = nodeTo.id ? nodeTo.id : Util.UniqueID.Get();
f = "Runtime.Put('AjaxSubmittingElementID', '" + nodeTo.id + "');";
}
if (nodeFrom.getAttribute("on" + Util.EventBinding.ArrayOfListenerType[i]) != null){
f = f + nodeFrom.getAttribute("on" + Util.EventBinding.ArrayOfListenerType[i]);
Util.Debug.Append("Util.CloneEvents: " + nodeTo + " bekommt " + Util.EventBinding.ArrayOfListenerType[i] + ": " + f);
}
if (f != ""){
nodeTo["on" + Util.EventBinding.ArrayOfListenerType[i]] = new Function("event",""+f+"");
}
}
},
CloneAttributes: function(nodeTo, nodeFrom){
this._CloneAttributes(nodeTo, nodeFrom, false);
this._CloneAttributes(nodeTo, nodeFrom, true);
this.CloneHyperLink(nodeTo, nodeFrom);
this.CloneEvents(nodeTo, nodeFrom);
},
_CloneAttributes: function(nodeTo, nodeFrom, nodeToIsInTree){
if (!nodeToIsInTree){
if (nodeFrom.getAttribute('type') != null){
nodeTo.type = nodeFrom.getAttribute('type');
}
if (nodeFrom.nodeName.toLowerCase() == "form"){ 
if (!nodeFrom.getAttribute('name') != null){
nodeTo.name = Util.UniqueID.Get();
} else {
nodeTo.name = nodeFrom.getAttribute('name');
} 
if (nodeFrom.getAttribute('method') != null){
nodeTo.method = nodeFrom.getAttribute('method');
}
if (nodeFrom.getAttribute('action') != null){
nodeTo.action = nodeFrom.getAttribute('action');
}
if (nodeFrom.getAttribute('enctype') != null){
nodeTo.enctype = nodeFrom.getAttribute('enctype');
}
}
if (nodeFrom.getAttribute('id') != null){
nodeTo.id = nodeFrom.getAttribute('id');
}
if (nodeFrom.getAttribute('name') != null){
nodeTo.name = nodeFrom.getAttribute('name');
}
}
else {
if (nodeFrom.getAttribute('maxlength') != null){
nodeTo.maxLength = nodeFrom.getAttribute('maxlength');
}
if (nodeFrom.getAttribute('checked') != null){
nodeTo.checked = nodeFrom.getAttribute('checked');
}
if (nodeFrom.getAttribute('disabled') != null){
nodeTo.disabled = nodeFrom.getAttribute('disabled');
}
if (nodeFrom.checked){
nodeTo.checked = nodeFrom.checked;
}
if (nodeFrom.disabled){
nodeTo.disabled = nodeFrom.disabled;
}
if (nodeFrom.getAttribute('selected') != null){
nodeTo.selected = nodeFrom.getAttribute('selected');
}
if (nodeFrom.getAttribute('class') != null){
nodeTo.className = nodeFrom.getAttribute('class');
}
if (nodeFrom.getAttribute('style') != null){
var propertyList = Util.Convert.ToJSPropertyList(nodeFrom.getAttribute('style'));
for (property in propertyList){
nodeTo.style[property] = propertyList[property];
}
}
if (nodeFrom.getAttribute('value') != null){
nodeTo.value = nodeFrom.getAttribute('value');
} else {
nodeTo.value = "";
}
if (nodeFrom.getAttribute('colspan') != null){
nodeTo.colSpan = nodeFrom.getAttribute('colspan');
}
if (nodeFrom.getAttribute('src') != null){
nodeTo.src = nodeFrom.getAttribute('src');
}
if (nodeFrom.getAttribute('width') != null){
nodeTo.width = nodeFrom.getAttribute('width');
}
if (nodeFrom.getAttribute('height') != null){
nodeTo.height = nodeFrom.getAttribute('height');
}
if (nodeFrom.getAttribute('alt') != null){
nodeTo.alt = nodeFrom.getAttribute('alt');
}
if (nodeFrom.getAttribute('title') != null){
nodeTo.title = nodeFrom.getAttribute('title');
}
}
},
CloneReplace: function(nodeToReplace, nodeFrom){
var r = document.createElement(nodeFrom.tagName);
var p = nodeToReplace.parentNode;
this._CloneAttributes(r, nodeFrom, false);
p.replaceChild(r, nodeToReplace);
Runtime.Put("CurrentDestinationNode", r);
this._CloneAttributes(r, nodeFrom, true);
this.CloneDescendant(r, nodeFrom);
},
CloneDescendantReplace: function(nodeToReplace, nodeFrom){
var p = nodeToReplace.parentNode;
this.CloneDescendant(p, nodeFrom, nodeToReplace);
p.removeChild(nodeToReplace);
},
CloneDescendant: function(nodeTo, nodeFrom){
var nodeInsertBefore = arguments.length > 2 ? arguments[2] : null;
var _setAjaxDestinationNode = arguments.length > 3 ? arguments[3] : true;
if (_setAjaxDestinationNode){
Runtime.Put("CurrentDestinationNode", nodeTo);
}
for (var i=0;i<nodeFrom.childNodes.length;i++){
try{
switch (nodeFrom.childNodes[i].nodeType){
case 1:
var meClone = nodeFrom.childNodes[i].cloneNode(false);
var meNode = document.createElement(meClone.nodeName);
if (meClone.getAttribute("type") != null
&& (meClone.getAttribute("type") == "radio"
|| meClone.getAttribute("type") == "checkbox")){
var name = meClone.getAttribute("name");
var type = meClone.getAttribute("type");
try{
meNode = document.createElement('<input type="'+type+'" name="' + name + '" />');
} catch(e){
Util.Debug.Append("Util.Nodes.CloneDescendant: Luckily, you don't surf with IE, so radios and checkboxes could be created using regular DOM.")
}
}
this._CloneAttributes(meNode, meClone, false);
if (nodeInsertBefore != null && nodeInsertBefore.parentNode == nodeTo){ 
nodeTo.insertBefore(meNode, nodeInsertBefore);
}
else {
nodeTo.appendChild(meNode);
}
this._CloneAttributes(meNode, meClone, true);
if (meNode.nodeName.toLowerCase() == "textarea"){
var value = nodeFrom.childNodes[i].childNodes[0] != null ? nodeFrom.childNodes[i].childNodes[0].nodeValue : "";
meNode.value = value;
}
if (meNode.nodeName.toLowerCase() == "script"){
this.LoadInlineScript(nodeFrom.childNodes[i]);
}
this.CloneHyperLink(meNode, meClone);
this.CloneEvents(meNode, meClone);
if (Client.IsIE() &&
nodeFrom.childNodes[i].nodeName.toLowerCase() == "table" &&
nodeFrom.childNodes[i].childNodes[0].nodeName.toLowerCase() != "tbody"){
var mnt = document.createElement("tbody");
meNode.appendChild(mnt)
meNode = mnt;
}
this.CloneDescendant(meNode, nodeFrom.childNodes[i], null, false);
break;
case 3:
if (nodeFrom.childNodes[i].nodeValue != null){
if (nodeFrom.nodeName.toLowerCase() != "textarea"){
var meTextNode = document.createTextNode(nodeFrom.childNodes[i].nodeValue);
nodeTo.appendChild(meTextNode);
this.CloneDescendant(meTextNode,nodeFrom.childNodes[i], null, false);
}
} 
break;
case 4: 
nodeTo.innerHTML = nodeTo.innerHTML + nodeFrom.childNodes[i].nodeValue;
this.CloneDescendant(nodeTo,nodeFrom.childNodes[i], null, false);
break;
case 8:
break;
}
}
catch(e){
Util.Debug.Append("Util.Nodes.CloneDescendant catch: " + meNode + " to " + nodeTo + " " + e.message);
Util.Debug.Throw();
}
} 
},
Move: function(nodeTo, node){
this._Move(nodeTo, node, 0, null);
},
_Move: function(oldElement, newElement, newAsClone, optionalWhere){
if(typeof oldElement=="string"){oldElement=document.getElementById(oldElement);};
if(typeof newElement=="string"){newElement=document.getElementById(newElement);};
if(!oldElement || !newElement){return null;};
var optionalWhereWasPassedAsNode=(typeof optionalWhere=="object" && optionalWhere)?true:false;
var removed=(!newAsClone) ? newElement.parentNode.removeChild(newElement):newElement.cloneNode(true);
optionalWhere=(optionalWhere==="")?null:optionalWhere;
if(!isNaN(parseFloat(optionalWhere))){
optionalWhere=parseFloat(optionalWhere);
if(optionalWhere<0 || optionalWhere>=oldElement.childNodes.length){optionalWhere=null;}
else{optionalWhere=oldElement.childNodes[optionalWhere];};
};
if(typeof optionalWhere!="undefined" && typeof optionalWhere!="object"){optionalWhere=null;};
if(optionalWhereWasPassedAsNode){
var optionalWhereBelongsTo_oldElement=false;
var optionalWhere2=optionalWhere;
while(optionalWhere2.parentNode){
optionalWhere2=optionalWhere2.parentNode;
if(optionalWhere2==oldElement){optionalWhereBelongsTo_oldElement=true; break;};
}
if(!optionalWhereBelongsTo_oldElement){optionalWhere=null;};
};
return (typeof optionalWhere=="undefined")?
oldElement.parentNode.replaceChild(removed, oldElement):
(optionalWhere===null)?oldElement.appendChild(removed):
oldElement.insertBefore(removed, optionalWhere);
},
CreateSlidingDoors: function(nodeTo){
var s = document.createElement("div");
s.className = nodeTo.className == "Top" ? "Right" : nodeTo.className == "Right" ? "Bottom" : nodeTo.className == "Bottom" ? "Left" : "Top";
nodeTo.appendChild(s);
if (s.className == "Left"){
var c = document.createElement("div");
c.className = "Content";
s.appendChild(c);
return c;
} else {
return this.CreateSlidingDoors(s);
}
},
LoadInlineScript: function(nodeFrom){
try {
var scriptID = nodeFrom.getAttribute("id");
var addScript = function(){
var newJs= document.createElement( "script" );
newJs.type = 'text/javascript';
newJs.id = scriptID;
var head = document.getElementsByTagName( "head" )[0];
head.appendChild(newJs);
newJs.text = nodeFrom.firstChild.data;
var addedScripts = Runtime.Get("addedScripts") != null ? Runtime.Get("addedScripts") : new Object;
addedScripts[scriptID] = true;
Runtime.Put("addedScripts", addedScripts);
}
if (scriptID != null && (Runtime.Get("addedScripts") == null || !Runtime.Get("addedScripts")[scriptID])){
addScript();
Util.Debug.Append("Util.Nodes.LoadInlineScript: Script (" + scriptID + ") added to head");
}
else if (scriptID != null){
var r = document.getElementById(scriptID);
document.getElementsByTagName( "head" )[0].removeChild(r);
addScript();
Util.Debug.Append("Util.Nodes.LoadInlineScript: Script (" + scriptID + ") was replaced by new script"); 
}
else {
Util.Debug.Append("Util.Nodes.LoadInlineScript: Only scripts with id will be handled!");
}
} catch(e){
Util.Debug.Append("Util.Nodes.LoadInlineScript catch error: " + e.message);
}
Util.Debug.Throw();
Util.Debug.Clear();
}
},
Convert: {
Color: {
ToHexArray: function(strColor){
var color = new Array("ff","ff","ff");
if (strColor.StartsWith("rgb")){
strColor = strColor.replace(/^rgb/g,'');
strColor = strColor.replace(/\(/g,'');
strColor = strColor.replace(/\)/g,'');
strColor = strColor.replace(/ /g,'');
color = strColor.split(',');
color[0] = parseFloat(color[0]).toString(16).toLowerCase();
color[1] = parseFloat(color[1]).toString(16).toLowerCase();
color[2] = parseFloat(color[2]).toString(16).toLowerCase();
if (color[0].length<2) { color[0]='0'+color[0]; }
if (color[1].length<2) { color[1]='0'+color[1]; }
if (color[2].length<2) { color[2]='0'+color[2]; }
} else if (strColor.StartsWith("#")) {
if (strColor.length == 7){
color[0] = strColor.substring(1,3);
color[1] = strColor.substring(3,5);
color[2] = strColor.substring(5);
} else if (strColor.length == 4){
color[0] = strColor.substring(1,2) +""+ strColor.substring(1,2);
color[1] = strColor.substring(2,3) +""+ strColor.substring(2,3);
color[2] = strColor.substring(3) +""+ strColor.substring(3);
}
}
return color;
},
ToRGBArray: function(strColor){
var color = new Array("255", "255", "255");
if (strColor.StartsWith("#")){
if (strColor.length == 7){
color[0] = parseInt(strColor.substring(1,3), 16);
color[1] = parseInt(strColor.substring(3,5), 16);
color[2] = parseInt(strColor.substring(5), 16);
} else if (strColor.length == 4){
color[0] = parseInt(strColor.substring(1,2) +""+ strColor.substring(1,2), 16);
color[1] = parseInt(strColor.substring(2,3) +""+ strColor.substring(2,3), 16);
color[2] = parseInt(strColor.substring(3) +""+ strColor.substring(3), 16);
}
}
else if (strColor.toLowerCase().StartsWith("rgb")){
strColor = strColor.replace(/^rgb/g,'');
strColor = strColor.replace(/\(/g,'');
strColor = strColor.replace(/\)/g,'');
strColor = strColor.replace(/ /g,'');
color = strColor.split(',');
}
return color;
}
},
ToJSPropertyList: function(strCssStyleValue){
var properties = strCssStyleValue.split(";");
var propertyList = new Object();
for (var s = 0; s < properties.length; s++){
if (properties[s].match(/[A-Z]/i) != null){
var dlmt = properties[s].indexOf(":");
var property = properties[s].substring(0,dlmt).replace(/ /g, "");
var value = properties[s].substring(dlmt + 1, properties[s].length);
while (value.indexOf(" ") == 0){
value = value.substring(1, value.length);
}
propertyList[this.ToJSProperty(property)] = value;
}
}
return propertyList;
},
ToJSProperty: function(strCssProperty){
var property = strCssProperty.replace(/ /g, "");
var prts = property.split("-");
property = prts[0].toLowerCase();
for (var p = 1; p < prts.length; p++){
property += prts[p].substring(0,1).toUpperCase() + prts[p].substring(1).toLowerCase();
}
property = (property == "float") ? Client.IsIE() ? "styleFloat" : "cssFloat" : property;
return property;
}
},
Document: {
_storage: new Object(),
ScriptLoader: {
_storage: new Object(),
Queue: function(){ 
this.id = "Util.Document.ScriptLoader.Queue" + Util.UniqueID.Get();
this._queue = [];
this._loadScripts = function(allLoaded){
if (!Util.Document.ScriptLoader.Load(this._queue[0])){
allLoaded = false;
}
var taos = [];
for (var i = 1; i< this._queue.length; i++ ){
taos[taos.length] = this._queue[i];
}
this._queue = taos;
if (this._queue.length > 0){
this._loadScripts(allLoaded);
} else if(allLoaded){
if (this.onreadystate && allLoaded){
this.onreadystate();
}
} else {
Util.Debug.Append("Util.Document.ScriptLoader.Queue: Could not load all scripts of queue");
}
}
this.Load = function(){
this._loadScripts(true);
}
this.Add = function(url){
this._queue[this._queue.length] = url;
}
this.object = this.id;
eval(this.object + "=this");
return this;
},
Load: function(url){
if (Util.Document.ScriptLoader._storage[url]){
Util.Debug.Append("Util.Document.ScriptLoader.Load: Already loaded(" + url + ")");
return true;
} else {
var scope = arguments.length > 1 ? arguments[1] : window;
var r = new AjaxRequest(false);
var success = false;
r.onresponse = function(){
var script = this.GetText();
try {
window.execScript(script);
Util.Document.ScriptLoader._storage[url] = Util.UniqueID.Get();
success = true;
} catch(ie){
try {
window.eval(script);
Util.Document.ScriptLoader._storage[url] = Util.UniqueID.Get();
success = true;
} catch(gecko){
Util.Debug.Append("Util.Document.Scriptloader.Load: Neither IE: (" + ie + ") nore Gecko (" + gecko + ") is able to eval the loaded script. We should use old style.\n\nIt's possible, that eval did not work!" );
}
}
}
r.onabort = function(){
Util.Debug.Append("Util.Document.ScriptLoader.Load: Could not load (" + url + ")");
}
r.Load("GET", url);
return success
}
},
Import: function(url){ 
if ( (!this._storage[url]) ){ 
var oHead = document.getElementsByTagName('HEAD').item(0); 
var oScript = document.createElement( "script" ); 
oScript.language = "javascript"; 
oScript.type = "text/javascript"; 
oScript.src = url;
oHead.appendChild( oScript ); 
this._storage[url] = Util.UniqueID.Get();
}
},
Include: function(id, source){ 
if ( (source != null) && (!document.getElementById(id)) ){ 
var oHead = document.getElementsByTagName('HEAD').item(0); 
var oScript = document.createElement( "script" ); 
oScript.language = "javascript"; 
oScript.type = "text/javascript"; 
oScript.id = id;
oScript.defer = true; 
oScript.text = source; 
oHead.appendChild( oScript ); 
}
}
},
StyleSheetLoader: {
_storage: new Object(), 
Queue: function(path){
}
},
IncludeCSS: function(path) {
if (this._storage[path]){
return true;
}
var link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = path;
link.id = Util.UniqueID.Get();
var heads = document.getElementsByTagName("head");
for(var i=0;i<heads.length;i++) {
heads[i].appendChild(link);
this._storage[path] = link.id;
}
}
}
}
var _storageEffects = new Object();
function GetEffect(element){
element.id = element.id ? element.id : Util.UniqueID.Get();
return _storageEffects[element.id] && _storageEffects[element.id].element == element ?
_storageEffects[element.id] : new Effect(element);
}
function ExistsEffect(element){
element.id = element.id ? element.id : Util.UniqueID.Get();
return (_storageEffects[element.id] != null);
}
function Effect(element){
if( typeof element == "string"){
element = document.getElementById(element);
}
if (!element || !element.parentNode || element.parentNode.nodeType != 1){
return alert("new Effect: element is no valid Node in document tree!"); 
}
this.element = element;
this.nodeObject = GetNodeObject(element);
this._activeXLayer = Client.IsIE() && this.element.style.position && this.element.style.position == "absolute" ?
this._activeXLayer && this._activeXLayer != null ?
this._activeXLayer :
document.createElement("<iframe frameborder=\"0\"></iframe>")
: null;
this.object = "Effect" + element.id;
eval(this.object + "=this");
_storageEffects[element.id] = this;
this._Reset();
return this;
}
Effect.prototype._Reset = function() {
this.isBusy = false;
this._delay = 0;
this.Delay = function(timeInMs) {
this._delay = timeInMs;
}
this._isAnimate = false;
this.Animate = function(stepSize) {
if (stepSize != null) {
this.oStp = stepSize;
this.pxStp = stepSize;
}
this._isAnimate = true;
}
this._isCentered = false;
this.Center = function(stepSize) { 
if (stepSize != null) {
this.oStp = stepSize;
this.pxStp = stepSize;
}
this._isCentered = true;
}
this._isScreenSave = false;
this.ScreenSave = function(edgeDistance) {
this._edgeDistance = edgeDistance == null ? 0 : edgeDistance;
this._isScreenSave = true;
}
this._ReadyState = function() {
var d = function() { return true; }
var f = this.onreadystate ? this.onreadystate : d;
this.onreadystate = d;
setTimeout(f, this._delay);
}
this.pxStp = 20;
this.oStp = 0.1;
this.fps = 25;
this._frameno = 0;
this.dstW = this.nodeObject.GetWidth();
this.dstOW = this.nodeObject.GetOffsetWidth();
this.dstH = this.nodeObject.GetHeight();
this.dstOH = this.nodeObject.GetOffsetHeight();
this.dstX = this.nodeObject.GetX();
this.dstY = this.nodeObject.GetY();
this.dstO = this._GetOpacity();
this.srcW = this.dstW;
this.srcOW = this.dstOW;
this.srcH = this.dstH;
this.srcOH = this.dstOH;
this.srcX = this.dstX;
this.srcY = this.dstY;
this.srcO = this.dstO;
this.itlY = this.itlY ? this.itlY : null;
this.itlX = this.itlX ? this.itlX : null;
}
Effect.prototype._SyncActiveXLayer = function() {
if (this._activeXLayer && this._activeXLayer != null) {
if (!this._IsValidNode() && this._activeXLayer != null) {
this._activeXLayer.parentNode.removeChild(this._activeXLayer);
}
if (!this._activeXLayerIsInTree) {
this._activeXLayer.src = "/blank.gif"; 
document.body.appendChild(this._activeXLayer);
this._activeXLayerIsInTree = true;
this.element.style.zIndex = this.element.style.zIndex + 1;
this._activeXLayer.style.zIndex = this.element.style.zIndex - 1;
this._activeXLayer.style.position = this.element.style.position;
this._activeXLayer.frameborder = 0;
this._activeXLayer.style.background = "transparent";
}
this._activeXLayer.style.left = this.element.style.left;
this._activeXLayer.style.top = this.element.style.top;
this._activeXLayer.style.width = this.nodeObject.GetOffsetWidth() + "px";
this._activeXLayer.style.height = this.nodeObject.GetOffsetHeight()+ "px";
}
}
Effect.prototype._Render = function() {
this.isBusy = true;
var waitInMs = Math.round(1000 / this.fps);
var stpW = !this._isAnimate ? this.dstW : this.dstW < this.srcW ? this.nodeObject.GetWidth() - this.pxStp : this.dstW > this.srcW ? this.nodeObject.GetWidth() + this.pxStp : this.nodeObject.GetWidth();
var stpOW = !this._isAnimate ? this.dstOW : this.dstOW < this.srcOW ? this.nodeObject.GetOffsetWidth() - this.pxStp : this.dstOW > this.srcOW ? this.nodeObject.GetOffsetWidth() + this.pxStp : this.nodeObject.GetOffsetWidth();
var stpH = !this._isAnimate ? this.dstH : this.dstH < this.srcH ? this.nodeObject.GetHeight() - this.pxStp : this.dstH > this.srcH ? this.nodeObject.GetHeight() + this.pxStp : this.nodeObject.GetHeight();
var stpOH = !this._isAnimate ? this.dstOH : this.dstOH < this.srcOH ? this.nodeObject.GetOffsetHeight() - this.pxStp : this.dstOH > this.srcOH ? this.nodeObject.GetOffsetHeight() + this.pxStp : this.nodeObject.GetOffsetHeight();
var stpX = !this._isAnimate ? this.dstX : this.dstX < this.srcX ? this.nodeObject.GetX() - this.pxStp : this.dstX > this.srcX ? this.nodeObject.GetX() + this.pxStp : this.nodeObject.GetX();
var stpY = !this._isAnimate ? this.dstY : this.dstY < this.srcY ? this.nodeObject.GetY() - this.pxStp : this.dstY > this.srcY ? this.nodeObject.GetY() + this.pxStp : this.nodeObject.GetY();
var stpO = !this._isAnimate ? this.dstO : this.dstO < this.srcO ? this._GetOpacity() - this.oStp : this.dstO > this.srcO ? this._GetOpacity() + this.oStp : this._GetOpacity();
var curW = (this.dstW < this.srcW && stpW < this.dstW) || (this.dstW > this.srcW && stpW > this.dstW) ? this.dstW : stpW;
var curOW = (this.dstOW < this.srcOW && stpOW < this.dstOW) || (this.dstOW > this.srcOW && stpOW > this.dstOW) ? this.dstOW : stpOW;
var curH = (this.dstH < this.srcH && stpH < this.dstH) || (this.dstH > this.srcH && stpH > this.dstH) ? this.dstH : stpH;
var curOH = (this.dstOH < this.srcOH && stpOH < this.dstOH) || (this.dstOH > this.srcOH && stpOH > this.dstOH) ? this.dstOH : stpOH;
var curX = (this.dstX < this.srcX && stpX < this.dstX) || (this.dstX > this.srcX && stpX > this.dstX) ? this.dstX : stpX;
var curY = (this.dstY < this.srcY && stpY < this.dstY) || (this.dstY > this.srcY && stpY > this.dstY) ? this.dstY : stpY;
var curO = (this.dstO < this.srcO && stpO < this.dstO) || (this.dstO > this.srcO && stpO > this.dstO) ? this.dstO : stpO;
if (this._isCentered) {
if (this.dstW < this.srcW) {
curX = curX + (this.pxStp / 2);
this.dstX = curX;
}
if (this.dstH < this.srcH) {
curY = curY + (this.pxStp / 2);
this.dstY = curY;
}
if (this.dstW > this.srcW) {
curX = curX - (this.pxStp / 2);
this.dstX = curX;
}
if (this.dstH > this.srcH) {
curY = curY - (this.pxStp / 2);
this.dstY = curY;
}
this._SyncActiveXLayer();
}
this.element.style.width = curW + "px";
this.element.style.height = curH + "px";
this.element.style.left = curX + "px";
this.element.style.top = curY + "px";
if (this.srcO != this.dstO) { this._SetOpacity(curO); } 
if (!(this.dstW == curW && this.dstH == curH && this.dstX == curX && this.dstY == curY && this.dstO == curO)) {
this._frameno++;
setTimeout(this.object + "._Render()", waitInMs);
} else {
this._SyncActiveXLayer();
this._Reset();
this._ReadyState();
}
}
Effect.prototype._SetOpacity = function(value) {
if (value == 1) {
this.element.style.opacity = /Gecko/.test(navigator.userAgent)
&& !/Konqueror|Safari|KHTML/.test(navigator.userAgent) ?
0.999999 : null;
if (this.dstO == 1) {
this.dstO = this.element.style.opacity;
}
if (Client.IsIE() && this.element.style.filter) {
this.element.style.filter = this.element.currentStyle.filter.replace(/alpha\([^\)]*\)/gi, "");
}
} else {
if (value < 0.00001) {
value = 0;
if (this.dstO == 0) {
this.dstO = value;
}
}
this.element.style.opacity = value;
if (Client.IsIE8()) {
this.element.style["-ms-filter"] = '"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"'; 
}
if (Client.IsIE()) {
this.element.style.filter = this.nodeObject.GetStyle().filter.replace(/alpha\([^\)]*\)/gi, "") + "alpha(opacity=" + value * 100 + ")";
}
}
}
Effect.prototype._GetOpacity = function(){
if (this.nodeObject.GetStyle().opacity){
return parseFloat(this.nodeObject.GetStyle().opacity);
} 
if (this.nodeObject.GetStyle().filter){
var value;
if ( value = this.nodeObject.GetStyle().filter.match(/alpha\(opacity=(.*)\)/) ){
return parseFloat(value[1]) / 100;
}
} 
return 0.999999;
}
Effect.prototype._IsBlock = function(){ 
return (GetNodeObject(this.element).GetStyle().display.indexOf("block") > -1);
}
Effect.prototype._IsValidNode = function(){
return (this.element.parentNode && this.element.parentNode.nodeType == 1);
}
Effect.prototype.Sync = function(){ 
this.dstW = this.nodeObject.GetWidth();
this.dstOW = this.nodeObject.GetOffsetWidth();
this.dstH = this.nodeObject.GetHeight();
this.dstOH = this.nodeObject.GetOffsetHeight();
this.dstX = this.nodeObject.GetX();
this.dstY = this.nodeObject.GetY();
this.dstO = this._GetOpacity();
this.srcW = this.dstW;
this.srcOW = this.dstOW;
this.srcH = this.dstH;
this.srcOH = this.dstOH;
this.srcX = this.dstX;
this.srcY = this.dstY;
this.srcO = this.dstO;
this._SyncActiveXLayer();
if (!this._IsValidNode && _storageEffects[this.element.id]){ 
delete _storageEffects[this.element.id];
}
}
Effect.prototype._DragDrop = function(dragArea, boolMoveX, boolMoveY){
var dragObject = this.element;
var isChild = function(n){
if (n.parentNode){
n = n.parentNode;
if (n == dragObject){
return true;
} else {
return isChild(n);
}
} else {
return false;
}
}
if (isChild(dragArea)){
dragArea.className = dragArea.className && dragArea.className != "" ? dragArea.className + " DragArea" : "DragArea";
}
var initListener = new Listener("mousedown", function(trigger){
var e = GetEffect(dragObject); 
var deltaX = trigger.GetX() - e.nodeObject.GetX();
var deltaY = trigger.GetY() - e.nodeObject.GetY(); 
var ap = e.nodeObject.GetPositionReference();
if (ap != null && !e.nodeObject.apDone){
deltaX = deltaX + GetNodeObject(ap).GetX();
deltaY = deltaY + GetNodeObject(ap).GetY();
e.nodeObject.apDone = true;
}
var moveListener = new Listener("mousemove", function(trigger){
var x = trigger.GetX() - deltaX
var y = trigger.GetY() - deltaY;
e.MoveTo(x, y);
});
GetNodeObject(Body.Get()).AddListener(moveListener);
GetNodeObject(Body.Get()).AddListener(new Listener("mouseup", function(trigger){
GetNodeObject(Body.Get()).RemoveListener(moveListener);
}));
});
GetNodeObject(dragArea).AddListener(initListener);
}
Effect.prototype.DragDrop = function(){
var dragArea = arguments.length > 0 ? arguments[0] : this.element; 
this._DragDrop(dragArea, true, true);
}
Effect.prototype.HorizontalSlide = function(){
var dragArea = arguments.length > 0 ? arguments[0] : this.element; 
alert("HS: mach et!");
this._DragDrop(dragArea, true, false);
alert("done!");
}
Effect.prototype.VerticalSlide = function(){
var dragArea = arguments.length > 0 ? arguments[0] : this.element; 
this._DragDrop(dragArea, false, true);
}
Effect.prototype.ScaleTo = function(w, h){
if (w == null || h == null){return alert("w,h are not given");}
this.dstW = w;
this.dstH = h;
this._Render();
}
Effect.prototype.ScaleOffsetTo = function(ow, oh){
if (ow == null || oh == null){return alert("w,h are not given");}
this.dstOW = ow;
this.dstOH = oh;
this._Render();
}
Effect.prototype.MoveTo = function(x,y){
if (x == null || y == null){return alert("x,y are not given");}
this.dstX = x;
this.dstY = y;
this.itlX = x;
this.itlY = y;
this._Render();
}
Effect.prototype.FadeTo = function(o){
if(o == null){return alert("o is not given");}
this.dstO = o;
this._Render();
}
Effect.prototype.Display = function(){
this.element.style.display = this.element.nodeName.toLowerCase() == 'tr' ? Client.IsIE() ? "inline" : "table-row" : "block";
var n = this.element;
if (n.offsetParent){
var h = GetNodeObject(n).GetOffsetHeight();
while (n.offsetParent){
n = n.offsetParent;
if (n.style.position == "absolute"){
n.style.height = GetNodeObject(n).GetHeight() + h + "px";
break;
}
}
}
this._ReadyState();
}
Effect.prototype.Fold = function(){
var n = this.element;
if (n.offsetParent){
var h = GetNodeObject(n).GetOffsetHeight();
while (n.offsetParent){
n = n.offsetParent;
if (n.style.position == "absolute"){
n.style.height = GetNodeObject(n).GetHeight() - h + "px";
break;
}
}
}
this.element.style.display = "none";
this._ReadyState();
}
Effect.prototype.Show = function(){
this.element.style.visibility = "visible";
if (this._activeXLayer && this._activeXLayer != null){
this._activeXLayer.style.display = "block";
}
this._ReadyState();
}
Effect.prototype.Hide = function(){
this.element.style.visibility = "hidden";
if (this._activeXLayer && this._activeXLayer != null){
this._activeXLayer.style.display = "none";
}
this._ReadyState();
}
Effect.prototype.Vanish = function(){ 
this.nodeObject.unVanishX = this.nodeObject.GetX();
this.element.style.left = "-10000px";
if (this._activeXLayer && this._activeXLayer != null){
this._activeXLayer.style.left = "-10000px";
}
}
Effect.prototype.UnVanish = function(){ 
if (this.nodeObject.unVanishX){
this.element.style.left = this.nodeObject.unVanishX + "px";
if (this._activeXLayer && this._activeXLayer != null){
this._activeXLayer.style.left = this.nodeObject.unVanishX + "px";
}
delete this.nodeObject.unVanishX;
} 
}
var _storageLayers= new Object();
function GetLayer(){
id = arguments.length > 0 && arguments[0] != null ? arguments[0] : Util.UniqueID.Get();
return _storageLayers[id] && _storageLayers[id].element != null ? _storageLayers[id] : new Layer(id);
}
function ExistsLayer(id){
return (_storageLayers[id] != null);
}
function Layer(id){
var d = document.createElement("div");
d.id = id;
d.style.position = "absolute";
d.style.top = "0px";
d.style.left = "0px";
document.body.appendChild(d);
this.element = d;
this.contentNode = Util.Nodes.CreateSlidingDoors(d);
var h = document.createElement("div");
h.className = "Head";
this.contentNode.parentNode.insertBefore(h, this.contentNode);
this.headNode = h;
var f = document.createElement("div");
f.className = "Foot";
this.contentNode.parentNode.appendChild(f);
this.footNode = f;
this.object = "Layer" + id;
eval(this.object + "=this");
_storageLayers[id] = this;
return this;
}
Layer.prototype.Remove = function(){
this.element.parentNode.removeChild(this.element);
this.element = null;
}
Layer.prototype.EnableDragDrop = function(){
if (!this.dragDropEnabled){
GetEffect(this.element).DragDrop(this.headNode);
this.dragDropEnabled = true;
} 
}
Layer.prototype._CreateCloseButton = function(persistent){
if (!this.closeNode){
var c = document.createElement("input");
c.type = "button";
c.className = "Close";
c.value = " x ";
this.headNode.appendChild(c);
var lObj = GetLayer(this.element.id);
if (persistent){
GetNodeObject(c).AddListener(new Listener('click', function(trigger){
if (lObj.onclose){
lObj.onclose(this);
}
GetEffect(lObj.element).Hide();
}));
} else {
GetNodeObject(c).AddListener(new Listener('click', function(trigger){
if (lObj.onclose){
lObj.onclose(this);
}
lObj.Remove();
}));
}
this.closeNode = c;
}
}
Layer.prototype.EnablePersistentClose = function(){
this._CreateCloseButton(true);
}
Layer.prototype.EnableClose = function(){
this._CreateCloseButton(false);
}
Layer.prototype.DisableClose = function(){
if (this.closeNode){
this.closeNode.parentNode.removeChild(this.closeNode);
delete this.closeNode;
}
}
function ImageRotation(element) {
if (typeof element == "string") {
element = document.getElementById(element);
}
if (!element || !element.parentNode || element.parentNode.nodeType != 1) {
return; 
}
this.element = element;
this._isAnchor = element.nodeName.toLowerCase() == "a";
this._isImage = element.nodeName.toLowerCase() == "img";
this._imageNode = null;
this._timeInMS = 3000; 
this._frames = new Array();
this._frameCount = 0;
this._currentIndex = -1;
this._isAnimated = false;
this.object = "ImageRotation" + element.id;
eval(this.object + "=this");
return this;
}
ImageRotation.prototype.Animate = function() {
if (this.element == null) { return };
this._isAnimated = true;
}
ImageRotation.prototype.AddFrame = function(src, url, title) {
if (this.element == null) { return };
if (src != null && url != null && title != null) {
timeInMS = arguments.length > 3 ? arguments[3] : this._timeInMS;
var fi = new Image();
fi.src = src;
this._frameCount = this._frameCount + 1;
var proto = this;
fi.onload = function() {
fi.iW = fi.width;
fi.iH = fi.height;
proto._frames[proto._frames.length] = {
image: fi,
url: url,
title: title,
timeout: timeInMS
};
}
} else {
return; 
}
}
ImageRotation.prototype.Run = function() {
if (this.element == null) { return };
if (this._frames.length == this._frameCount) {
this._currentIndex = this._currentIndex < this._frames.length - 1 ? this._currentIndex + 1 : 0;
var img = this._frames[this._currentIndex].image;
if (this._isAnimated) {
if (this._imageNode == null) {
this.element.appendChild(img);
this._imageNode = img;
this.element.style.backgroundImage = "none";
this._initialImageX = GetNodeObject(this._imageNode).GetX();
this._initialImageY = GetNodeObject(this._imageNode).GetY();
}
img.style.position = "absolute";
this._imageNode.parentNode.replaceChild(img, this._imageNode);
this._imageNode = img;
var proto = this;
var eff = GetEffect(img);
eff.ScaleTo(img.iW, img.iH);
eff.MoveTo(this._initialImageX, this._initialImageY);
eff.Show();
var f = function() {
eff.onreadystate = function() {
eff.Hide();
proto.Run();
}
eff.Center();
eff.Animate(10);
eff.ScaleTo(20, 20);
}
setTimeout(f, this._frames[this._currentIndex].timeout);
}
else if (this._imageNode != null) {
this._imageNode.parentNode.replaceChild(img, this._imageNode);
this._imageNode = img;
setTimeout(this.object + ".Run()", this._frames[this._currentIndex].timeout);
}
else {
this.element.style.backgroundImage = "url(" + this._frames[this._currentIndex].image.src + ")";
setTimeout(this.object + ".Run()", this._frames[this._currentIndex].timeout);
}
if (this._isAnchor) {
this.element.title = this._frames[this._currentIndex].title;
this.element.href = this._frames[this._currentIndex].url;
}
} else {
setTimeout(this.object + ".Run()", 100); 
}
}
function Select(node){
var n = document.getElementById("cbHyperLinkContainer");
if (n != null){
var aoh = n.getElementsByTagName("a");
for (var i = 0; i < aoh.length; i++){
aoh[i].className = aoh[i].deselectedClassName;
}
}
node.className = node.className + " selected1";
}
function InitLegalInfoContainer(){
var n = document.getElementById("cleverLegalLinks");
if (n != null){
var aoh = n.getElementsByTagName("a");
for (var i = 0; i < aoh.length; i++){
aoh[i].href = "javascript:void(0)";
}
}
}
function InitHyperLinkContainer(){
var n = document.getElementById("cbHyperLinkContainer");
if (n != null){
var aoh = n.getElementsByTagName("a");
for (var i = 0; i < aoh.length; i++){
aoh[i].deselectedClassName = aoh[i].className;
aoh[i].onclick = function(){
Select(this);
}
if (i == 0){
Select(aoh[i]);
}
}
}
}
function InitForm(){
for (var i = 0; i < document.forms.length; i ++){
var form = document.forms["cleverForm"];
if(form != null){
var combos = form.getElementsByTagName("select");
for (var c = 0; c < combos.length; c++){
combos[c].onchange = function(){form.submit()};
}
}
}
}
function Init(){
InitHyperLinkContainer();
InitLegalInfoContainer();
InitForm();
}
DomLoaded.Load(Init);