//===== relative URL handling code for js files ================
sWZBaseFolder = "www.idae.es";                          
sWZ = window.location.href;                                     
iWZ = sWZ.indexOf(sWZBaseFolder) + sWZBaseFolder.length + 1;    
sWZBase = sWZ.substring(0,iWZ);                                 
//===== Copyright © 2001 Spidersoft. All rights reserved. ======



function qd(tip,obj,child) {
	if (ns4) {
		if (child) {
			this.name = document.layers[obj].document.layers[child];
		} else {
			this.name = document.layers[obj];
		}
	} else {
		if (ie4) {
			if (child) {
				this.name = document.all[child].style;
				this.nostyle = document.all[child];
			} else {
			this.name = document.all[obj].style;
			this.nostyle = document.all[obj];
			}
		}
	}
	this.nameObj = tip;
	this.x = (ns4) ? this.name.left : this.name.pixelLeft;
	this.y = (ns4) ? this.name.top : this.name.pixelTop;
	this.h = (ns4)? this.name.clip.height : this.nostyle.offsetHeight;
	this.w = (ns4)? this.name.clip.width : this.nostyle.offsetWidth;
	this.h2 = (ns4)? this.name.height : this.nostyle.scrollHeight;
	this.w2 = (ns4)? this.name.width : this.nostyle.scrollWidth;
	this.z = this.name.zIndex;
	this.color = (ns4)? this.name.bgColor : this.name.backgroundColor;
	this.activo = false;
	this.datGoo = new Array();
	this.show = qdShow;
	this.hide = qdHide;
	this.stack = qdStack;
	this.paint = qdPaint;	
	this.move = qdMove;
	this.push = qdPush;
	this.fill = qdFill;
	this.slide = qdSlide;
	this.beizer = qdBeizer;
	this.whatToMove = qdWhatToMoveGoo;
	this.runGoo = qdWhatToMoveRun;
}

function qdShow() {
	this.name.visibility = (ns4) ? 'show' : 'visible';
}

function qdHide() {
	this.name.visibility = (ns4) ? 'hide' : 'hidden';
}

function qdStack(zI) {
	this.name.zIndex = zI;
}

function qdPaint(colH) {
	 (ns4) ? this.name.bgColor = colH : this.name.backgroundColor = colH;
}

function qdMove(x,y) {
	this.x = x;
	this.y = y;
	this.name.left = this.x;
	this.name.top = this.y;
}

function qdPush(x,y) {	
	this.x += x;
	this.y += y;
	this.name.left = this.x;
	this.name.top = this.y;
}

function qdFill(puppet) {
	if (ns4) { 
		this.name.document.open();
		this.name.document.write(puppet);
		this.name.document.close();
	} else {
		if (ie4) this.nostyle.innerHTML = puppet;
	}	
}

function qdSlide(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)),'http://www.idae.es/codigo/this.move',nextEv);
}

function qdBeizer(xf,yf,resolution,speed,xbeizer,ybeizer,nextEv) {
	this.whatToMove(this.x,this.y,xf,yf,resolution,speed,xbeizer,ybeizer,'http://www.idae.es/codigo/this.move',nextEv);
}
	
function qdWhatToMoveGoo(xi,yi,xf,yf,resolution,speed,xbeizer,ybeizer,func,nextEv) {
	this.datGoo[0] = xi;
	this.datGoo[1] = yi;
	this.datGoo[2] = xf;
	this.datGoo[3] = yf;
	this.datGoo[4] = resolution;
	this.datGoo[5] = speed;
	this.datGoo[6] = 1;
	this.datGoo[7] = 0;
	this.datGoo[8] = xbeizer;
	this.datGoo[9] = ybeizer;
	this.datGoo[10] = 1/resolution;
	this.datGoo[11] = func;
	this.datGoo[12] = nextEv;
	this.runGoo();
}

function qdWhatToMoveRun() {
	if (this.datGoo[6] <= this.datGoo[4]) {
		var auxS1 = Math.pow(1-this.datGoo[7],2);
		var auxS2 = Math.pow(this.datGoo[7],2);
		var auxS3 = 2 * this.datGoo[7] * (1-this.datGoo[7]); 
		eval(this.datGoo[11] + '(' + Math.round((auxS1 * this.datGoo[0]) + (auxS3 * this.datGoo[8]) + (auxS2 * this.datGoo[2])) + ',' + Math.round((auxS1 * this.datGoo[1]) + (auxS3 * this.datGoo[9]) + (auxS2 * this.datGoo[3])) + ')');
		this.datGoo[6]++;
		this.datGoo[7] = this.datGoo[6] * this.datGoo[10];
		setTimeout(this.nameObj+".runGoo()",this.datGoo[5]);		
	} else { 
		if (this.datGoo[12]){
			//alert(this.datGoo[12]);
			eval(this.datGoo[12]);
		}	
	}	
}

