/* (c) Kalamun.org - GNU/GPL 3 */

k_Resizer=new function() {
	var win=null,
		startWidth=0,
		finalWidth=0,
		timer=null;

	this.setTarget=function() {
		win=document.getElementById('container');
		startWidth=win.offsetWidth;
		}

	this.setWidth=function(w) {
		finalWidth=w;
		timer=setInterval(this.resize,50);
		}

	this.resize=function() {
		var ww=win.offsetWidth;
		win.style.width=ww+((finalWidth-ww)/10)+'px';
		startWidth=win.offsetWidth;
		if(startWidth>=finalWidth-5&&startWidth<=finalWidth+5) {
			clearInterval(timer);
			win.style.width=finalWidth+'px';
			startWidth=win.offsetWidth;
			}
		}

	}

