Sys.UI.
    |--IContainer
    |--mouseButton
    |     |__prototype leftButton:0,middleButton:1,rightButton:2
    |    
    |--Key
    |     |_prototype backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127
    |
    |--DomEvent
    |    |--DomEvent()
    |    |--prototype
    |    |    |--preventDefault
    |    |    |_stopPropagation
    |    |--addHandler()
    |    |--clearHandlers()
    |    |--removeHandler()
    |-DomElemrnt
    |-Behavior
    |-VisiblityMode
    |_Control

Sys.UI.IContainer
Sys.IContainer=function ()
{
    
}
;
Sys.IContainer.prototype
=
{
    
}
;
Sys.IContainer.registerInterface(
"Sys.IContainer");

Sys.UI.MouseButton  Sys.UI.Key
 1Sys.UI.MouseButton=function ()
 2{
 3    throwError.notImplemented()
 4}
;
 5Sys.UI.MouseButton.prototype=
 6{
 7    leftButton:0,middleButton:1,rightButton:2
 8}
;
 9Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");
10Sys.UI.Key=function ()
11{
12    throwError.notImplemented()
13}
;
14Sys.UI.Key.prototype=
15{
16    backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127
17}
;
18Sys.UI.Key.registerEnum("Sys.UI.Key");
Sys.UI.DomEvent
Sys.UI.DomEvent=function (c)
{
    
var a=c;
    
this.rawEvent=a;
    
this.altKey=a.altKey;
    
this.button=typeofa.which==="undefined"?a.button:a.button===4?Sys.UI.MouseButton.middleButton:a.button===2?Sys.UI.MouseButton.rightButton:Sys.UI.MouseButton.leftButton;
    
if(a.type==="keypress")this.charCode=a.charCode||a.keyCode;
    
else if(a.keyCode&&a.keyCode===46)this.keyCode=127;
    
else this.keyCode=a.keyCode;
    
this.clientX=a.clientX;
    
this.clientY=a.clientY;
    
this.ctrlKey=a.ctrlKey;
    
this.target=a.target?a.target:a.srcElement;
    
if(this.target)
    
{
        
var b=Sys.UI.DomElement.getLocation(this.target);
        
this.offsetX=a.offsetX?a.offsetX:window.pageXOffset+a.clientX-b.x;
        
this.offsetY=a.offsetY?a.offsetY:window.pageYOffset+a.clientY-b.y
    }
this.screenX=a.screenX;
    
this.screenY=a.screenY;
    
this.shiftKey=a.shiftKey;
    
this.type=a.type
}
;
Sys.UI.DomEvent.prototype
=
{
    preventDefault:
function ()
    
{
        
if(this.rawEvent.preventDefault)this.rawEvent.preventDefault();
        
else if(window.event)window.event.returnValue=false
    }
,stopPropagation:function ()
    
{
        
if(this.rawEvent.stopPropagation)this.rawEvent.stopPropagation();
        
else if(window.event)window.event.cancelBubble=true
    }

}
;
Sys.UI.DomEvent.registerClass(
"Sys.UI.DomEvent");
var $addHandler=Sys.UI.DomEvent.addHandler=function (a,d,b)
{
    
if(a.addEventListener)
    
{
        
if(!b._browserHandler)b._browserHandler=function (c)
        
{
            b.call(a,
new Sys.UI.DomEvent(c))
        }
;
        a.addEventListener(d,b._browserHandler,
false)
    }
else if(a.attachEvent)
    
{
        
if(!b._browserHandler)b._browserHandler=function ()
        
{
            b.call(a,
new Sys.UI.DomEvent(window.event))
        }
;
        a.attachEvent(
"on"+d,b._browserHandler)
    }
if(!a._events)a._events=
    
{
        
    }
;
    
var c=a._events[d];
    
if(!c)a._events[d]=c=[];
    c[c.length]
=b
}
,$addHandlers=Sys.UI.DomEvent.addHandlers=function (e,d,c)
{
    
for(var b in d)
    
{
        
var a=d[b];
        
if(c)a=Function.createDelegate(c,a);
        $addHandler(e,b,a)
    }

}
,$clearHandlers=Sys.UI.DomEvent.clearHandlers=function (a)
{
    
if(a._events)
    
{
        
var e=a._events;
        
for(var b in e)
        
{
            
var d=e[b];
            
for(var c=d.length-1;c>=0;c--)$removeHandler(a,b,d[c])
        }
a._events=null
    }

}
,$removeHandler=Sys.UI.DomEvent.removeHandler=function (a,b,d)
{
    
var c=d._browserHandler;
    
if(a.removeEventListener)a.removeEventListener(b,c,false);
    
else if(a.detachEvent)a.detachEvent("on"+b,c);
    
if(a._events&&a._events[b])Array.remove(a._events[b],d)
}
;
Sys.UI.Behavior
Sys.UI.DomElement=function ()
{
    
}
;
Sys.UI.DomElement.registerClass(
"Sys.UI.DomElement");
Sys.UI.DomElement.addCssClass
=function (a,b)
{
    
if(!Sys.UI.DomElement.containsCssClass(a,b))if(a.className==="")a.className=b;
    
else a.className+=" "+b
}
;
Sys.UI.DomElement.containsCssClass
=function (b,a)
{
    
return Array.contains(b.className.split(" "),a)
}
;
Sys.UI.DomElement.getBounds
=function (a)
{
    
var b=Sys.UI.DomElement.getLocation(a);
    
return 
    
{
        x:b.x,y:b.y,width:a.offsetWidth,height:a.offsetHeight
    }

}
;
var $get=Sys.UI.DomElement.getElementById=function (f,e)
{
    
if(!e)return document.getElementById(f);
    
if(e.getElementById)return e.getElementById(f);
    
var c=[],d=e.childNodes;
    
for(var b=0;b<d.length;b++)
    
{
        
var a=d[b];
        
if(a.nodeType==1)c[c.length]=a
    }
while(c.length)
    
{
        a
=c.shift();
        
if(a.id==f)return a;
        d
=a.childNodes;
        
for(b=0;b<d.length;b++)
        
{
            a
=d[b];
            
if(a.nodeType==1)c[c.length]=a
        }

    }
return null
}
;
Sys.UI.DomElement.getLocation
=function (d)
{
    
var b=0,c=0,a;
    
for(a=d;a;a=a.offsetParent)
    
{
        
if(a.offsetLeft)b+=a.offsetLeft;
        
if(a.offsetTop)c+=a.offsetTop
    }
return 
    
{
        x:b,y:c
    }

}
;
Sys.UI.DomElement.removeCssClass
=function (d,c)
{
    
var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");
    
if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()
}
;
Sys.UI.DomElement.setAccessibilityAttribute
=function (a,c,b)
{
    
if(a.setAttributeNS)a.setAttributeNS("http://www.w3.org/2005/07/aaa",c,b)
}
;
Sys.UI.DomElement.setLocation
=function (b,c,d)
{
    
var a=b.style;
    a.position
="absolute";
    a.left
=c+"px";
    a.top
=d+"px"
}
;
Sys.UI.DomElement.toggleCssClass
=function (b,a)
{
    
if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);
    
else Sys.UI.DomElement.addCssClass(b,a)
}
;
Sys.UI.Behavior
=function (b)
{
    Sys.UI.Behavior.initializeBase(
this);
    
this._element=b;
    
var a=b._behaviors;
    
if(!a)b._behaviors=[this];
    
else a[a.length]=this
}
;
Sys.UI.Behavior.prototype
=
{
    _name:
null,get_element:function ()
    
{
        
return this._element
    }
,get_id:function ()
    
{
        
var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");
        
if(a)return a;
        
if(!this._element||!this._element.id)return "";
        
return this._element.id+"$"+this.get_name()
    }
,get_name:function ()
    
{
        
if(this._name)return this._name;
        
var a=Object.getTypeName(this),b=a.lastIndexOf(".");
        
if(b!=-1)a=a.substr(b+1);
        
if(!this.get_isInitialized())this._name=a;
        
return a
    }
,set_name:function (a)
    
{
        
this._name=a
    }
,initialize:function ()
    
{
        Sys.UI.Behavior.callBaseMethod(
this,"initialize");
        
var a=this.get_name();
        
if(a)this._element[a]=this
    }
,dispose:function ()
    
{
        Sys.UI.Behavior.callBaseMethod(
this,"dispose");
        
if(this._element)
        
{
            
var a=this.get_name();
            
if(a)this._element[a]=null;
            Array.remove(
this._element._behaviors,this);
            
delete this._element
        }

    }

}
;
Sys.UI.Behavior.registerClass(
"Sys.UI.Behavior",Sys.Component);
Sys.UI.VisibilityMode
Sys.UI.Behavior.getBehaviorByName=function (b,c)
{
    
var a=b[c];
    
return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null
}
;
Sys.UI.Behavior.getBehaviors
=function (a)
{
    
if(!a._behaviors)return [];
    
return Array.clone(a._behaviors)
}
;
Sys.UI.Behavior.getBehaviorsByType
=function (d,e)
{
    
var a=d._behaviors,c=[];
    
if(a)for(var b=0,f=a.length;b<f;b++)if(e.isInstanceOfType(a[b]))c[c.length]=a[b];return c
}
;Sys.UI.VisibilityMode=function ()
{
    throwError.notImplemented()
}
;
Sys.UI.VisibilityMode.prototype
=
{
    hide:
0,collapse:1
}
;
Sys.UI.VisibilityMode.registerEnum(
"Sys.UI.VisibilityMode");
Sys.UI.Control
Sys.UI.Control=function (a)
{
    Sys.UI.Control.initializeBase(
this);
    
this._element=a;
    a.control
=this;
    
this._oldDisplayMode=this._element.style.display;
    
if(!this._oldDisplayMode||this._oldDisplayMode=="none")this._oldDisplayMode=""
}
;
Sys.UI.Control.prototype
=
{
    _parent:
null,_visibilityMode:Sys.UI.VisibilityMode.hide,get_element:function ()
    
{
        
return this._element
    }
,get_id:function ()
    
{
        
if(!this._element)return "";
        
return this._element.id
    }
,set_id:function ()
    
{
        throwError.invalidOperation(Sys.Res.cantSetId)
    }
,get_parent:function ()
    
{
        
if(this._parent)return this._parent;
        
else 
        
{
            
var a=this._element.parentNode;
            
while(a)
            
{
                
if(a.control)return a.control;
                a
=a.parentNode
            }
return null
        }

    }
,set_parent:function (a)
    
{
        
this._parent=a
    }
,get_role:function ()
    
{
        
return ""
    }
,get_visibilityMode:function ()
    
{
        
return this._visibilityMode
    }
,set_visibilityMode:function (a)
    
{
        
if(this._visibilityMode!==a)
        
{
            
this._visibilityMode=a;
            
if(this.get_visible()===false)if(this._visibilityMode===Sys.UI.VisibilityMode.hide)this._element.style.display=this._oldDisplayMode;
            
else this._element.style.display="none"
        }
this._visibilityMode=a
    }
,get_visible:function ()
    
{
        
return this._element.style.visibility!="hidden"
    }
,set_visible:function (a)
    
{
        
if(a!=this.get_visible())
        
{
            
this._element.style.visibility=a?"visible":"hidden";
            
if(a||this._visibilityMode===Sys.UI.VisibilityMode.hide)this._element.style.display=this._oldDisplayMode;
            
else this._element.style.display="none"
        }

    }
,addCssClass:function (a)
    
{
        Sys.UI.DomElement.addCssClass(
this._element,a)
    }
,dispose:function ()
    
{
        Sys.UI.Control.callBaseMethod(
this,"dispose");
        
if(this._element)
        
{
            
this._element.control=undefined;
            
delete this._element
        }

    }
,initialize:function ()
    
{
        Sys.UI.Control.callBaseMethod(
this,"initialize");
        
var a=this._element;
        
if(a.setAttributeNS)a.setAttributeNS("http://www.w3.org/TR/xhtml2","role",this.get_role())
    }
,onBubbleEvent:function ()
    
{
        
return false
    }
,raiseBubbleEvent:function (b,c)
    
{
        
var a=this.get_parent();
        
while(a)
        
{
            
if(a.onBubbleEvent(b,c))return ;
            a
=a.get_parent()
        }

    }
,removeCssClass:function (a)
    
{
        Sys.UI.DomElement.removeCssClass(
this._element,a)
    }
,toggleCssClass:function (a)
    
{
        Sys.UI.DomElement.toggleCssClass(
this._element,a)
    }

}
;
Sys.UI.Control.registerClass(
"Sys.UI.Control",Sys.Component)