// JavaScript Document
var EffectManager = Class.create({
	
	initialize:function(){
		this.leftColSize=false;
		this.rightColSize=false;
		this.oldContent="";
		this.leftCol=null;
		this.rightCol=null;
		this.state = "collapsed";
		document.observe("dom:loaded",this.initCol.bindAsEventListener(this));
	}
	
	
	,toogleMenu:function(target){
		Effect.toggle(target,'slide');
	}
	
	
	,toggleColumn:function(){		
		if(this.state=='collapsed'){
			this.log("expand");
			this.leftCol.makeClipping();
			new s2.fx.Parallel([
						this.leftCol.morph('width:50px;',{sync:true})
						,this.rightCol.grow({sync:true})
					]);
			this.state = "expanded"
		}else{
			
		}

	}
	
	,initCol:function(){
		
		var leftCols = Element.select(document, '.leftCol');
		if(leftCols.length==0)return false;
		var rightCols = Element.select(document, '.rightCol');
		if(rightCols.length==0)return false;
		
		this.leftCol = leftCols[0];
		this.rightCol = rightCols[0];
		
		var togglers = Element.select(document,'.toggleCol');
		this.log(togglers);
		for(i=0;i<togglers.length;i++){
			togglers[i].observe('click',this.toggleColumn.bindAsEventListener(this));
		}
		
		this.leftColSize = this.leftCol.getWidth();
		this.rightColSize = this.rightCol.getWidth();
		
	}
	
	,log:function(message){
		if(console)console.log(message);	
	}

});
