// teknoDiv 3.0 - JS Object Development by Emi in Teknoland RTT, 2000
function teknoDiv(tip,obj,child) {
	this.nav = (document.layers)? true : false;
	if (this.nav) {
		this.strName = 'document.layers["'+obj+'"]';
		if (child) {
			this.name = document.layers[obj].document.layers[child];
			this.strName += '.document.layers["'+child+'"]';
		} else {
			this.name = document.layers[obj];
		}
	} else {
		if (child) {
			this.name = document.all[child].style;
			this.nostyle = document.all[child];
			this.strName = 'document.all["'+child+'"]';
		} else {
			this.name = document.all[obj].style;
			this.nostyle = document.all[obj];
			this.strName = 'document.all["'+obj+'"]';
		}
	}
	this.nameTip = tip;
	this.x = (this.nav) ? this.name.left : this.name.pixelLeft;
	this.y = (this.nav) ? this.name.top : this.name.pixelTop;
	this.w = (this.nav)? this.name.clip.width : this.nostyle.offsetWidth;
	this.h = (this.nav)? this.name.clip.height : this.nostyle.offsetHeight;
	this.w2 = (this.nav)? this.name.width : this.nostyle.scrollWidth;
	this.h2 = (this.nav)? this.name.height : this.nostyle.scrollHeight;
	this.color = (this.nav)? this.name.bgColor : this.name.backgroundColor;
	this.ov= this.name.overflow;
	this.z = this.name.zIndex;
	this.activo = false;
	this.draging = false;
	this.xdrag = 0;
	this.ydrag = 0;
	this.haveFrame=false;
	this.timeGoo;
	this.move = teknoDivMove;
	






	this.slide = teknoDivSlide;

	this.whatToMove = teknoWhatToMoveGoo;
	this.runGoo = teknoWhatToMoveRun;



}





function teknoDivMove(x,y) {
	this.x = x;
	this.y = y;
	this.name.left = this.x;
	this.name.top = this.y;
}

function teknoDivSlide(xf,yf,resolution,speed,kine,nextEv) {
	this.whatToMove(this.x,this.y,xf,yf,resolution,speed,Math.round(this.x+(xf-this.x)/20*(10+kine)),Math.round(this.y+(yf-this.y)/20*(10+kine)),'this.move',nextEv);
}

function teknoWhatToMoveGoo(xi,yi,xf,yf,resolution,speed,xbeizer,ybeizer,func,nextEv) {
	this.datGoo = new Array();
	this.datGoo[0] = resolution+1;
	this.datGoo[1] = speed;
	this.datGoo[2] = 1;
	this.datGoo[3] = 0;
	this.datGoo[4] = 1/resolution;
	this.datGoo[5] = func;
	this.datGoo[6] = nextEv;
	this.datGoo[7] = new Array();
	this.datGoo[8] = new Array();
	for (i=1;i<=this.datGoo[0];i++){
		var auxS0 = 1-this.datGoo[3];
		var auxS1 = auxS0 * auxS0;
		var auxS2 = this.datGoo[3] * this.datGoo[3];
		var auxS3 = 2 * this.datGoo[3] * auxS0; 
		this.datGoo[7][i] = Math.round((auxS1*xi)+(auxS3*xbeizer)+(auxS2*xf));
		this.datGoo[8][i] = Math.round((auxS1*yi)+(auxS3*ybeizer)+(auxS2*yf));
		this.datGoo[3] = i * this.datGoo[4];	
	}
	clearTimeout(this.timeGoo);
	this.runGoo();
}

function teknoWhatToMoveRun() {
	if (this.datGoo[2] <= this.datGoo[0]) {
		eval(this.datGoo[5]+'('+this.datGoo[7][this.datGoo[2]]+','+this.datGoo[8][this.datGoo[2]]+')');
		this.datGoo[2]++;
		this.timeGoo=setTimeout(this.nameTip+".runGoo()",this.datGoo[1]);		
	} else { 
		if (this.datGoo[6]) eval(this.datGoo[6]);
	}	
}


