	var SideBar = Class.create();
	SideBar.prototype = {
	    
        initialize: function(container, ho, hc, as) {
            this.container = container;
            this.container.style.overflow = 'hidden';
            this.busy = false;
            this.opened = true;
            this.height_o = ho || container.offsetHeight;
            this.autosize = (typeof(as)!=="undefined")? as : true;//as===null || as==true;
            this.height_c = (typeof(hc)!=="undefined")? hc : 0;
			this.onOpenComplete = function () {};
			this.onCloseComplete = function () {};
        },
        
	    doOpen: function(onComplete) {
    		if (this.busy) return;
    		if (this.opened) return;
    		this.busy=1;
//			if (this.autosize)
//				this.container.style.overflow = 'hidden'; 
    		new Effect.Size(this.container, null, this.height_o, 50, 2, {
    				sideBar: this,
    				doOnDone: onComplete,
					doOnDone2: this.onOpenComplete,
    				complete: function() { 
    					this.sideBar.busy=0;
//    					dO(this); 
    					if (this.sideBar.autosize) {
	    					this.sideBar.container.style.overflow = 'visible'; 
    						this.sideBar.container.style.height = ''; 
    					}
    					if (this.doOnDone) this.doOnDone();    					
    					if (this.doOnDone2) this.doOnDone2();    					
    				} 
    			} 
    		);
			this.opened = true;
	    },
	    
	    doClose: function(onComplete) {
    		if (this.busy) return;
    		if (!this.opened) return;
    		this.busy=1;
			this.container.style.overflow = 'hidden'; 
    		new Effect.Size(this.container, null, this.height_c, 50, 2, {
    				sideBar: this,
    				doOnDone: onComplete,
					doOnDone2: this.onCloseComplete,
    				complete: function() { 
    					this.sideBar.busy=0; 
				        this.sideBar.opened = false;
    					if (this.doOnDone) this.doOnDone();    					
    					if (this.doOnDone2) this.doOnDone2();    					
    				}
    			} 
    		);
	    },
		
		enable: function() {
//			d('enable');
        	var list = new Array();
        	list.pushA(this.container.getElementsByTagName("INPUT"));
        	list.pushA(this.container.getElementsByTagName("TEXTAREA"));
        	list.pushA(this.container.getElementsByTagName("SELECT"));
//        	list.pushA(this.container.getElementsByTagName("FORM"));
        	for (var i = 0; i<list.length; i++) {
   	    		var c = list[i];
				c.disabled = false;
			}
//			this.container.disabled = 'false';
		},

		disable: function() {
//			d('disable');
        	var list = new Array();
        	list.pushA(this.container.getElementsByTagName("INPUT"));
        	list.pushA(this.container.getElementsByTagName("TEXTAREA"));
        	list.pushA(this.container.getElementsByTagName("SELECT"));
//        	list.pushA(this.container.getElementsByTagName("FORM"));
        	for (var i = 0; i<list.length; i++) {
   	    		var c = list[i];
				c.disabled = 'true';
			}
//			this.container.disabled = 'true';
		}
	}
	

