//	DEZE JAVA SCRIPTS ZIJN BEWERKT OP 	14 juli 2001
// Global variables

var isNav4 = false, isIE4 = false, isOpera = false

var range = ""

var styleObj = ""

 

var  versieNummer = parseInt(navigator.appVersion.charAt(0));

if (navigator.userAgent.indexOf("Opera") != -1) isOpera = true

if (versieNummer >= 4){

	if (navigator.appName == "Netscape") {

		isNav4 = true;

		insideWindowWidth = window.innerWidth;

	}else if (navigator.appVersion.indexOf("MSIE") != -1) {

		isIE4 = true;

		range = "all.";

		styleObj = ".style";

	}

	else {

		location = "pardon.html";

	}

} else {

	location = "pardon.html";

}

 

/*==================================================================

=================================================================*/

 

				// convert object name string or object reference

				// into a valid object reference

function getObj(obj) {

	var theObj

	if (typeof obj == "string") {

		theObj = eval("document." + range + obj + styleObj);

	} else {

		theObj = obj;

	}

	return theObj;

}

 

				// conver an object name of an object of another frame

				// into a valid object reference

function getFrameObj(frame, obj) {

	var theObj

	if (typeof obj == "string") {

		theObj = eval("parent." + frame + ".document." + range + obj + styleObj);

	} else {

		alert ("getFrameObj(frame, obj) accepteert alleen strings, geen objecten!");

		theObj = "undefined"

	}

	return theObj;

}

 

				//een object naar een bepaalde plaats verschuiven

function moveObjTo(obj, x, y) {

	var theObj = getObj(obj);

	if (isNav4) {

		theObj.moveTo(x,y);

	} else {

		theObj.pixelLeft = x;

		theObj.pixelTop = y;

	}

}

 

				// een object verschuiven met een horizontale en verticale factor

function moveObjBy(obj, hor, ver) {

	var theObj = getObj(obj);

	if (isNav4) {

		theObj.moveBy(hor, ver);

	} else {

		theObj.pixelLeft += hor;

		theObj.pixelTop += ver;

	}

}

 

				// de diepte van een object instellen

function setZIndex(obj, zNummer) {

	var theObj = getObj(obj);

	theObj.zIndex = zNummer;

}

 

				// de zichtbaarheid instellen

function showObj(obj) {

	var theObj = getObj(obj);

	theObj.visibility = "visible";

}

 

				// de zichtbaarheid instellen

function hideObj(obj) {

	var theObj = getObj(obj);

	theObj.visibility = "hidden";

}

 

				// de achtergrondkleur instellen NB dit werkt niet op de achtergrondkleur als je

				// binnen <DIV> nog een <LAYER> hebt

				// gebruik in dat geval de hierop volgende functie setBgColorDIVLAYER(obj, color)

function setBgColor(obj, color) {

	var theObj = getObj(obj);

	if (isNav4) theObj.bgColor = color;

	else if (isOpera) theObj.background = color;

	else if (isIE4) theObj.backgroundColor = color;

}

 

 
function setBgColorDIVLAYER(obj, color) {

	var theObj = getObj(obj);

	if (isNav4) theObj.document.layers[0].bgColor = color;

	else if (isOpera) theObj.background = color

	else if (isIE4) theObj.backgroundColor = color;

}

 

				// de x-coordinaat verkrijgen

function getObjLeft(obj) {

	var theObj = getObj(obj);

	if (isNav4) {

		return theObj.left;

	} else {

		return theObj.pixelLeft;

	}

}

 

				// de y-coordinaat verkrijgen

function getObjTop(obj) {

	var theObj = getObj(obj);

	if (isNav4) {

		return theObj.top;

	} else {

		return theObj.pixelTop;

	}

}

 

 

 

//-----------------------

 

/*	DE VOLGENDE 2 VARIABELEN PLUS 2 FUNCTIES WORDEN INGEZET OMDAT IN INTERNET EXPLORER DE pixelTop EN pixelLeft 

	NIET WORDEN GEINITIALISEERD ALS JE IN EEN <STYLE> TAG DE POSITIE BEPAALT, MET ANDERE WOORDEN 

	DIE TWEE WAARDEN WORDEN ALTIJD OP 0 (NUL) GEZET, HEEL ERG IRRITANT!!!!!!!

	DE FUNCTIE setgInitArray(..) VULT EEN ARRAY IN MET DE OBJECTEN EN DE POSITIEWAARDEN

	DE FUNCTIE onLoadgInitArray() MOET WORDEN AANGEROEPEN IN DE <BODY onLoad="onLoadgInitArray()"> TAG ZOALS HIER GETOOND!

	DAN WORDEN DE OBJECTEN VIA JAVASCRIPT OP HUN PLEK GEZET, EN GEVEN pixelTop en pixelLeft DE JUISTE WAARDEN!!

*/

 

var gInitTeller = 0 

var gInitArray = new Array()

function setgInitArray(pNaam, pLeft, pTop, pVisible){

	gInitArray[gInitTeller++] = pNaam

	gInitArray[gInitTeller++] = pLeft

	gInitArray[gInitTeller++] = pTop

	gInitArray[gInitTeller++] = pVisible

}

 

				//DEZE FUNCTIE ZORGT ER VOOR DAT pixelLeft en pixelTop goed worden ingesteld

				//EN DAT IN NETSCAPE NAVIGATOR OBJECTEN OP DE JUISTE POSITIE WORDEN GETOOND

				//	BOVENDIEN WORDT DE "visible" OBJECTEN PAS GETOOND ALS ZE VERPLAATST ZIJN (showObj(gIni.....)

function onLoadgInitArray(){

	if (gInitTeller == 0) return

 

	var naam

	var left

	var top

	var nr = gInitTeller / 4

	for (var i = 0 ; i < nr ; i++){

		moveObjTo(gInitArray[i*4], gInitArray[(i*4 + 1)], gInitArray[(i*4 + 2)])

		if (gInitArray[(i*4 + 3)].indexOf("visible") != -1) showObj(gInitArray[i*4])

	}

}

				// LAAT DE INHOUD VAN gInitArray ZIEN VOOR DEBUG DOELEINDEN!!!!

function showgInitArray(){

	if (gInitTeller == 0) return

 

	var tekst = ""

	var nr = gInitArray.length / 4

	for (var i = 0 ; i < nr ; i++){

		tekst+= gInitArray[i * 4] + " " + gInitArray[i * 4 + 1] + " " + gInitArray[i * 4 + 2] + " " + gInitArray[i * 4 + 3] + "\n"

	}

	alert(tekst)

}

		

//--------------------------------------------

/*	DE VOLGENDE FUNCTIE MAAKT MET DEZE PARAMETERS ("pen", "pen.jpg", 10, 30, 45, 60)

	AUTOMATISCH DE VOLGENDE HTML CODE AAN:

	<style> #penId{position:absolute; top:30; left:10; width:45; height:60; visibility:visible;}</style>

	<div id=penId><img name='penImage' width=45 height=60 alt='pen' src='pen.jpg'></div>

	HET GEVORMDE OBJECT KAN GEBRUIK MAKEN VAN DE HIERBOVEN STAANDE SPECIALE FUNCTIES:

	getImageObject("pen"), getImageWidth("pen") en getImageHeight("pen")

 

	verder kan het object gebruikmaken van de schuifMet("penId",...) enz alle object functies hierboven

	N.B. met de 'gewone' objectfuncties moet de naam "vlak" + "Id" worden gebruikt, dus: vlakId   !!

 

	N.B. BIJ GEBRUIK VAN DEZE FUNCTIE MOET onLoadgInitArray() in de <BODY> tag worden aangeroepen!!

*/

 

function writeDIVIMG(pNaamDivImg , pSource , pLeft, pTop, pWidth, pHeight){

	//var naamId = pNaamDivImg + "Id";

	//var naamImage = pNaamDivImg + "Image";

 

	var nieuweInhoud = "\n<style>\n"

 

	nieuweInhoud += "#" + pNaamDivImg + "Id{position:absolute; top:" + pTop + "; left:" + pLeft + "; width:" + pWidth + "; height:" + pHeight + "; visibility:hidden;}\n"

 

	nieuweInhoud += "</style>\n"

	nieuweInhoud += "\n"

	nieuweInhoud += "<div id=" + pNaamDivImg + "Id><img name='" + pNaamDivImg + "Image' width='" + pWidth + "' height='" + pHeight + "' alt='" + pNaamDivImg + "' src='" + pSource + "' border=0></div>\n"

	document.write(nieuweInhoud)

	setgInitArray((pNaamDivImg + "Id"), pLeft, pTop, "visible");

}

 

function writeDIVAIMG(pNaamDivImg , pSource , pLeft, pTop, pWidth, pHeight, pHref, pOnMouseOver, pOnMouseOut){

	var nieuweInhoud = "\n<style>\n"

 

	nieuweInhoud += "#" + pNaamDivImg + "Id{position:absolute; top:" + pTop + "; left:" + pLeft + "; width:" + pWidth + "; height:" + pHeight + "; visibility:hidden;}\n"

 

	nieuweInhoud += "</style>\n"

	nieuweInhoud += "\n"

	nieuweInhoud += "<div id=" + pNaamDivImg + "Id>"

	nieuweInhoud += "<a href='" + pHref + "' onMouseOver='" + pOnMouseOver + "' onMouseOut='" + pOnMouseOut + "'><img name='" + pNaamDivImg + "Image' width='" + pWidth + "' height='" + pHeight + "' alt='" + pNaamDivImg + "' src='" + pSource + "' border=0></a></div>\n"

	document.write(nieuweInhoud)

	setgInitArray((pNaamDivImg + "Id"), pLeft, pTop, "visible");

}

 

				//	EEN <div> + <image> OBJECT !!!!!!!!!

				//	<div id="naamId"><image name="naamImage".......>   

				//	VOOR naam MOET JE DUS HET GEDEELTE ZONDER Id EN Image NEMEN!!!!

function getImageWidth(naam){

	naamId = naam + "Id";

	naamImage = naam + "Image";

	if (isNav4) {

		return document.layers[naamId].document.images[naamImage].width;

	}

	else {

		return document.images[naamImage].width;

	}

}

 

function getImageHeight(naam){

	naamId = naam + "Id";

	naamImage = naam + "Image";

	if (isNav4) {

		return document.layers[naamId].document.images[naamImage].height;

	}

	else {

		return document.images[naamImage].height;

	}

}

 

function getImageObj(naam){

	naamId = naam + "Id";

	naamImage = naam + "Image";

	if (isNav4) {

		return document.layers[naamId].document.images[naamImage];

	}

	else {

		return document.images[naamImage];

	}

}

 

//----------------------- ANIMATION OBJECT VOOR imageObj 

 

function animate1Frame(){ // 1 staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	var im = getImageObj(this.naamDiv);

 

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

	}

 

	im.src = this.imA[this.teller].src;

}

 

function animate1Loop(){ // 1 staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	var im = getImageObj(this.naamDiv);

 

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

	}

 

	im.src = this.imA[this.teller].src;

 

	this.timer = setTimeout(this.naamObj + "AIObj.animate1Loop()", this.tijd);

}

 

function animate1LoopW(){ // 1 staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	var im = getImageObj(this.naamDiv);

 

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

	}

 

	im.src = this.imA[this.teller].src;

 

	if ((this.teller == 0)||(this.teller == this.aantal -1)) this.timer = setTimeout(this.naamObj + "AIObj.animate1LoopW()", 3000);

	else this.timer = setTimeout(this.naamObj + "AIObj.animate1LoopW()", this.tijd);

}

 

function animate1(){ // 1 staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	var im = getImageObj(this.naamDiv);

 

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

		clearTimeout(this.timer);

		this.timer = null;

		return;

	}

 

	im.src = this.imA[this.teller].src;

 

	this.timer = setTimeout(this.naamObj + "AIObj.animate1()", this.tijd);

}

 

			//DEZE FUNCTIE IS AFGELEID VAN animate2Loop(). DE setTimeout(...) ONTBREEKT, DEZE FUNCTIE MOET WORDEN

			//GEACTIVEERD DOOR EEN ANDERE FUNCTIE VOOR SYNCHRONITEIT MET BEWEGING IN EEN makeAnimationPositionObj OBJECT!!!

function animate2Frame(){ // 2 staat voor Two-direction van 0 naar aantal en weer terug naar 0

	var im = getImageObj(this.naamDiv);

 

	this.teller += this.factor;

 

	if ((this.teller < 1)||(this.teller > (this.aantal - 2))) {

		this.factor *= -1;

	}

 

	im.src = this.imA[this.teller].src;

}

 

function animate2Loop(){ // 2 staat voor Two-direction van 0 naar aantal en weer terug naar 0

	var im = getImageObj(this.naamDiv);

 

	this.teller += this.factor;

 

	if ((this.teller < 1)||(this.teller > (this.aantal - 2))) {

		this.factor *= -1;

	}

 

	im.src = this.imA[this.teller].src;

 

	this.timer = setTimeout(this.naamObj + "AIObj.animate2Loop()", this.tijd);

}

 

function animate2LoopW(){ // 2 staat voor Two-direction van 0 naar aantal en weer terug naar 0

	var im = getImageObj(this.naamDiv);

 

	this.teller += this.factor;

 

	if ((this.teller < 1)||(this.teller > (this.aantal - 2))) {

		this.factor *= -1;

	}

 

	im.src = this.imA[this.teller].src;

 

	if ((this.teller == 0)||(this.teller == this.aantal -1)) this.timer = setTimeout(this.naamObj + "AIObj.animate2LoopW()", 3000);

	else this.timer = setTimeout(this.naamObj + "AIObj.animate2LoopW()", this.tijd);

}

 

function animate2(){ // One staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	var im = getImageObj(this.naamDiv);

 

	this.teller += this.factor;

 

	if ((this.teller < 1)||(this.teller > (this.aantal - 2))) {

		this.factor *= -1;

	}

 

	im.src = this.imA[this.teller].src;

 

	if (this.teller == 0) {

		clearTimeout(this.timer);

		this.timer = null;

		return;

	}

 

	this.timer = setTimeout(this.naamObj + "AIObj.animate2()", this.tijd);

}

 

function setFirstFrame(){

	this.teller = 0

	this.factor = 1;

}

function setLastFrame(){

	this.teller = this.aantal - 1

	this.factor = -1;

}

 

			// bv. var eekhoornRentAIObj = copyAnimationImageObj("eekhoorn2Rent", eekhoornKlimtAIObj, "eekhoornRent", ".gif",  enz...) 

			// het is belangrijk dat de variabele uit pNaamSource + "AIObj" wordt samengesteld, dan werken de scripts goed

			// var eekhoornRentAIObj = copyAnimationImageObj(eekhoornKlimtAIObj, "eekhoornRent", ".gif", 4) gaat om:

			//	<DIV =eekhoornKlimtAIObj.naamDiv + "Id"> <IMG name='eekhoornKlimtAIObj.naamDiv + "Img"'> en eekhoornRent1.gif, eekhoornRent2.gif t/m eekhoornRent5.gif

function returnAnimationImageObj(pNaamObj, pNaamDiv,  pNaamSource, pExtensie, pWidth, pHeight, pAantal, pTijd){

	this.naamObj = pNaamObj //deze pNaamObj + "AIObj" is de naam die je de objectvariabele (laatste regel deze constructor: return this !!) moet geven 

		// b.v. als pNaamObj(this.naamObj) == "eekhoorn2loopt" dan is de variabele eekhoorn2looptAIObj  en hoort bij plaatjes eekhoornloopt1.jpg, eekhoornloopt2.jpg enz!!

	this.naamDiv = pNaamDiv

	this.width = pWidth

	this.height = pHeight

	this.aantal = pAantal

	this.imA = new Array(this.aantal)

	this.timer = null;

	this.teller = 0;

	this.factor = 1;

	this.tijd = pTijd;

	this.animate1 = animate1

	this.animate1Loop = animate1Loop

	this.animate1Frame = animate1Frame

	this.animate2 = animate2

	this.animate2Loop = animate2Loop

	this.animate2Frame = animate2Frame

	this.setFirstFrame = setFirstFrame

	this.setLastFrame = setLastFrame

 

	for (var i = 0 ; i < this.aantal ; i++) {

		this.imA[i] = new Image(this.width, this.height);

		this.imA[i].src= pNaamSource + (i + 1) + pExtensie

	}

 

	return this

}

 

			// pAIObj is een ander AnimationImageObj-object, waaruit de volgende 4 waarden worden getrokken:

			// this.naamDiv, this.width, this.height, en this.tijd 

function copyAnimationImageObj(pNaamObj, pExtAIObj, pNaamSource, pExtensie, pAantal){

	return new returnAnimationImageObj(pNaamObj, pExtAIObj.naamDiv,  pNaamSource, pExtensie, pExtAIObj.width, pExtAIObj.height, pAantal, pExtAIObj.tijd)

}

 

			// bv. var eekhoorn1KlimtAIObj = makeAnimationImageObj("eekhoorn1Klimt", "eekhoorn", "eekhoornKlimt", ".gif",  enz...) 

			// het is belangrijk dat de variabele uit pNaamObj + "AIObj" wordt samengesteld, dan werken de scripts goed

			// var eekhoorn1KlimtAIObj = makeAnimationImageObj("eekhoorn1Klimt", "eekhoorn", "eekhoornKlimt", ".gif", 5, 50) gaat om:

			//	<DIV =eekhoornId> <IMG name="eekhoornImage"> en eekhoornKlimt1.gif, eekhoornKlimt2.gif t/m eekhoornKlimt5.gif

function makeAnimationImageObj(pNaamObj, pNaamDiv,  pNaamSource, pExtensie, pLeft, pTop, pWidth, pHeight, pAantal, pTijd){

	writeDIVIMG(pNaamDiv , (pNaamSource + "1" + pExtensie) , pLeft, pTop, pWidth, pHeight)

 

	return new returnAnimationImageObj(pNaamObj, pNaamDiv,  pNaamSource, pExtensie, pWidth, pHeight, pAantal, pTijd)

}

 

function makeAnimationAnchorImageObj(pNaamObj, pNaamDiv,  pNaamSource, pExtensie, pLeft, pTop, pWidth, pHeight, pAantal, pTijd, pHref, pOnMouseOver, pOnMouseOut){

	writeDIVAIMG(pNaamDiv , (pNaamSource + "1" + pExtensie) , pLeft, pTop, pWidth, pHeight, pHref, pOnMouseOver, pOnMouseOut)

 

	return new returnAnimationImageObj(pNaamObj, pNaamDiv,  pNaamSource, pExtensie, pWidth, pHeight, pAantal, pTijd)

}

 

function move2Loop(){ // 2 staat voor Two-direction van 0 naar aantal en weer terug naar 0

	this.teller += this.factor;

 

	if ((this.teller < 1)||(this.teller > (this.aantal - 2))) {

		this.factor *= -1;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1]);

 

	if ((this.teller == 0)||(this.teller == this.aantal -1)) this.timer = setTimeout(this.naamObj + "APObj.move2Loop()", 3000);

	else this.timer = setTimeout(this.naamObj + "APObj.move2Loop()", this.tijd);

}

function move2LoopA1F(){ // 2 staat voor Two-direction van 0 naar aantal en weer terug naar 0

	this.teller += this.factor;

 

	if ((this.teller < 1)||(this.teller > (this.aantal - 2))) {

		this.factor *= -1;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1]);

	this.AIObj.animate1Frame()

 

	if ((this.teller == 0)||(this.teller == this.aantal -1)) this.timer = setTimeout(this.naamObj + "APObj.move2LoopA1F()", 3000);

	else this.timer = setTimeout(this.naamObj + "APObj.move2LoopA1F()", this.tijd);

}

function move2LoopA2F(){ // 2 staat voor Two-direction van 0 naar aantal en weer terug naar 0

	this.teller += this.factor;

 

	if ((this.teller < 1)||(this.teller > (this.aantal - 2))) {

		this.factor *= -1;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1]);

	this.AIObj.animate2Frame()

 

	if ((this.teller == 0)||(this.teller == this.aantal -1)) this.timer = setTimeout(this.naamObj + "APObj.move2LoopA2F()", 3000);

	else this.timer = setTimeout(this.naamObj + "APObj.move2LoopA2F()", this.tijd);

}

 

function move2(){ // One staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	this.teller += this.factor;

 

	if (this.teller > (this.aantal - 2)) {

		this.factor *= -1;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1]);

 

	if (this.teller == 0) {

		this.factor *= -1; // als je dit object nog een keer aanroept is de factor weer juist ingesteld

		clearTimeout(this.timer);

		this.timer = null;

		if (this.volgendeFunctie != "") this.timer = setTimeout(this.volgendeFunctie,10)

		return;

	}

 

	this.timer = setTimeout(this.naamObj + "APObj.move2()", this.tijd);

}

function move2A1F(){ // One staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	this.teller += this.factor;

 

	if (this.teller > (this.aantal - 2)) {

		this.factor *= -1;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1]);

	this.AIObj.animate1Frame()

 

	if (this.teller == 0) {

		this.factor *= -1; // als je dit object nog een keer aanroept is de factor weer juist ingesteld

		clearTimeout(this.timer);

		this.timer = null;

		if (this.volgendeFunctie != "") this.timer = setTimeout(this.volgendeFunctie,10)

		return;

	}

 

	this.timer = setTimeout(this.naamObj + "APObj.move2A1F()", this.tijd);

}

function move2A2F(){ // One staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	this.teller += this.factor;

 

	if (this.teller > (this.aantal - 2)) {

		this.factor *= -1;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1]);

	this.AIObj.animate2Frame()

 

	if (this.teller == 0) {

		this.factor *= -1; // als je dit object nog een keer aanroept is de factor weer juist ingesteld

		clearTimeout(this.timer);

		this.timer = null;

		if (this.volgendeFunctie != "") this.timer = setTimeout(this.volgendeFunctie,10)

		return;

	}

 

	this.timer = setTimeout(this.naamObj + "APObj.move2A2F()", this.tijd);

}

 

function move1Loop(){ // 1 staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1]);

 

	//if ((this.teller == 0)||(this.teller == this.aantal -1)) this.timer = setTimeout(this.naamObj + "APObj.move1Loop()", 3000);

	this.timer = setTimeout(this.naamObj + "APObj.move1Loop()", this.tijd);

}

 

function move1LoopA1F(){ // 1 staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1])

	this.AIObj.animate1Frame()

 

	//if ((this.teller == 0)||(this.teller == this.aantal -1)) this.timer = setTimeout(this.naamObj + "APObj.move1LoopA1F()", 3000);

	this.timer = setTimeout(this.naamObj + "APObj.move1LoopA1F()", this.tijd);

}

 

function move1LoopA2F(){ // 1 staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1])

	this.AIObj.animate2Frame()

 

	//if ((this.teller == 0)||(this.teller == this.aantal -1)) this.timer = setTimeout(this.naamObj + "APObj.move1LoopA2F()", 3000);

	this.timer = setTimeout(this.naamObj + "APObj.move1LoopA2F()", this.tijd);

}

 

function move1(){ // 1 staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

		clearTimeout(this.timer);

		this.timer = null;

		if (this.volgendeFunctie != "") this.timer = setTimeout(this.volgendeFunctie,10)

		return;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1]);

 

	this.timer = setTimeout(this.naamObj + "APObj.move1()", this.tijd);

}

 

function move1A1F(){ // 1 staat voor One-direction alleen van 1 tot aantal en dan weer vanvorenafaan

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

		clearTimeout(this.timer);

		this.timer = null;

		if (this.volgendeFunctie != "") this.timer = setTimeout(this.volgendeFunctie,10)

		return;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1])

	this.AIObj.animate1Frame()

 

	this.timer = setTimeout(this.naamObj + "APObj.move1A1F()", this.tijd);

}

 

function move1A2F(){

	this.teller++;

	if (this.teller >= this.aantal) {

		this.teller = 0;

		clearTimeout(this.timer);

		this.timer = null;

		if (this.volgendeFunctie != "") this.timer = setTimeout(this.volgendeFunctie,10)

		return;

	}

 

	moveObjTo( (this.naamDiv + "Id") , this.posA[this.teller*2] , this.posA[this.teller*2 + 1])

	this.AIObj.animate2Frame()

 

	this.timer = setTimeout(this.naamObj + "APObj.move1A2F()", this.tijd);

}

 

function setFirstPosition(){

	this.teller = 0

	this.factor = 1;

}

function setLastPosition(){

	this.teller = this.aantal - 1

	this.factor = -1;

}

 

function setNaamDiv(pNaamDiv){

	this.naamDiv = pNaamDiv

}

 

function addPositionArray(pX2, pY2){

	var beginPos = this.aantal - 1

	var X1 = this.posA[beginPos*2]

	var Y1 = this.posA[beginPos*2 + 1]

 

	var xVerschil = pX2 - X1

	var yVerschil = pY2 - Y1

	var verschil = Math.round(Math.sqrt(yVerschil*yVerschil + xVerschil*xVerschil))

	var aantalSteps = Math.round(verschil / this.step)

////////////////////////////////////////////////////////

	if (aantalSteps < 1) return

 

 

	for (var i = 0 ; i < 1 + aantalSteps ; i++) {

		this.posA[(beginPos + i)*2] = X1 + Math.round((xVerschil * i )/aantalSteps)

		this.posA[(beginPos + i)*2 +1] = Y1 + Math.round((yVerschil * i )/aantalSteps)

	}

	this.aantal += aantalSteps

}

 

 

				// het is belangrijk dat de variabele uit pNaamObj + "APObj" wordt samengesteld, dan werken de scripts goed

				//	var logo1APObj = makeAnimationPositionObj("logo1", 0, 0, 100, 200 , 25 , 100) gaat om:

				//	<DIV =logo1Id>  die van positie (0,0) in 25 stappen met tussentijd van 100 milliseconden naar (100,200) wordt verplaatst)

function makeAnimationPositionObj(pNaamObj, pNaamDiv, pX1, pY1, pX2 ,pY2, pStep, pTijd){

	this.naamObj = pNaamObj

	this.naamDiv = pNaamDiv

	this.step = pStep // beginpositie + het aantal stappen 

	this.aantal = 1 // beginpositie + het aantal stappen 

	this.posA = new Array(2)

	this.timer = null;

	this.teller = 0

	this.factor = 1

	this.tijd = pTijd

	this.volgendeFunctie = "" // DEZE FUNCTIE WORDT UITGEVOERD ALS move1 OF move2 KLAAR ZIJN!

	this.AIObj = null

	this.move1 = move1

	this.move1A1F = move1A1F

	this.move1A2F = move1A2F

	this.move1Loop = move1Loop

	this.move1LoopA1F = move1LoopA1F

	this.move1LoopA2F = move1LoopA2F

	this.move2 = move2

	this.move2A1F = move2A1F

	this.move2A2F = move2A2F

	this.move2Loop = move2Loop

	this.move2LoopA1F = move2LoopA1F

	this.move2LoopA2F = move2LoopA2F

	this.setFirstPosition = setFirstPosition

	this.setLastPosition = setLastPosition

	this.addPositionArray = addPositionArray

	this.setNaamDiv = setNaamDiv

 

	this.posA[0] = pX1

	this.posA[1] = pY1

	this.addPositionArray(pX2, pY2)

}

	

 

 

//-----------------------

 

function handleMouseDown(x, y){

	//B.V. start2();

}

 

function handleMouseMove(x, y){

	//B.V. movePlaatje3(x, y);

	status = "( " + x + " , " + y + " )"

}

 

function translateMouseDown(e){

	if (isNav4)handleMouseDown(e.pageX, e.pageY);

	else handleMouseDown(window.event.clientX + document.body.scrollLeft, window.event.clientY + document.body.scrollTop);

}

 

function translateMouseMove(e){

	if (isNav4)handleMouseMove(e.pageX, e.pageY);

	else handleMouseMove(window.event.clientX + document.body.scrollLeft, window.event.clientY + document.body.scrollTop);

}

 

 

				// voor Netscape moet je de events activeren!

function initNetscapeEvents(opdr){

	if (opdr == null || opdr == ""){

		alert("initNetscapeEvents(....) vereist parameter 'click' en of 'move'")

		return

	}

	if (isNav4){

		if (opdr.indexOf("click") != -1 && opdr.indexOf("move") != -1){

			document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE)

			document.onMouseDown = translateMouseDown

			document.onMouseMove = translateMouseMove

		}

		else if (opdr.indexOf("click") != -1){

			document.captureEvents(Event.MOUSEDOWN)

			document.onMouseDown = translateMouseDown

		}

		else if (opdr.indexOf("move") != -1){

			document.captureEvents(Event.MOUSEMOVE)

			document.onMouseMove = translateMouseMove

		}

 

	}

}

 

//------------------------------------------------------------------

 

/*	DE VOLGENDE FUNCTIE MAAKT MET DEZE PARAMETERS ("vlak", 10, 30, 45, 60, "FF1183", 15, "hidden")

	AUTOMATISCH DE VOLGENDE HTML CODE AAN:

	<style> #vlakId{position:absolute; top:30; left:10; width:45; height:60; background-color:FF1183; visibility:visible;}</style>

	<div id=vlakId><layer bgcolor='#FF1183' width=45 height=60></layer></div>

 

	het object kan gebruikmaken van de moveObjBy("vlakId",...) en alle andere 'gewone' object-functies hierboven

	N.B. met de 'gewone' objectfuncties moet de pNaam -in dit geval- "vlak" + "Id" worden gebruikt, dus: "vlakId" ipv "vlak" !!!

 

	N.B. BIJ GEBRUIK VAN DEZE FUNCTIE MOET onLoadgInitArray() in de <BODY> tag worden aangeroepen!!

*/

 

function writeDIVLAYER(pNaam, pLeft, pTop, pWidth, pHeight, pColor, pAantal, pVisible){

	if ((pVisible == null)||(pVisible == "")) pVisible = "visible"

 

	var nieuweInhoud = "\n<style>\n"

 

	// als er maar 1 DIV gemaakt wordt, word de naam BV bordId i.p.v. bord1Id (de 1 is nu immers niet nodig ter onderscheid van bord2Id...)

	if (pAantal ==  1) nieuweInhoud += "#" + pNaam + "Id{position:absolute; top:" + pTop  + "; left:" + pLeft + "; width:" + pWidth + "; height:" + pHeight + "; background-color:" + pColor + "; visibility:hidden;}\n"

	else for (var i = 1 ; i < (pAantal + 1) ; i++) nieuweInhoud += "#" + pNaam + i + "Id{position:absolute; top:" + (pTop + i*10) + "; left:" + (pLeft + i*10) + "; width:" + pWidth + "; height:" + pHeight + "; background-color:" + pColor + "; visibility:hidden;}\n"

 

	nieuweInhoud += "</style>\n"

	

	if (pColor != "transparent"){

					// als er maar 1 DIV gemaakt wordt, word de naam BV bordId i.p.v. bord1Id (de 1 is nu immers niet nodig ter onderscheid van bord2Id...)

			if (pAantal == 1) nieuweInhoud += "<div id=" + pNaam + "Id><layer bgcolor='" + pColor + "' width='" + pWidth + "' height='" + pHeight + "'></layer></div>\n"

			else for (var i = 1 ; i < (pAantal + 1); i++) nieuweInhoud += "<div id=" + pNaam + i + "Id><layer bgcolor='" + pColor + "' width='" + pWidth + "' height='" + pHeight + "'></layer></div>\n"

	} else {			//	ALS (pColor == "transparent") DAN GEEN bgcolor propertie in de LAYER aanmaken, NETSCAPE BUG!!!

						// als er maar 1 DIV gemaakt wordt, word de naam BV bordId i.p.v. bord1Id (de 1 is nu immers niet nodig ter onderscheid van bord2Id...)

			if (pAantal == 1) nieuweInhoud += "<div id=" + pNaam + "Id><layer width='" + pWidth + "' height='" + pHeight + "'></layer></div>\n"

			else for (var i = 1 ; i < (pAantal + 1); i++) nieuweInhoud += "<div id=" + pNaam + i + "Id><layer width='" + pWidth + "' height='" + pHeight + "'></layer></div>\n"

	}

 

	document.write(nieuweInhoud);

 

	// als er maar 1 DIV gemaakt wordt, wordt de naam BV bordId i.p.v. bord1Id (de 1 is nu immers niet nodig ter onderscheid van bord2Id...)

	if (pAantal == 1)  setgInitArray((pNaam + "Id"), pLeft, pTop, pVisible);

	else for (var i = 1 ; i < (pAantal + 1); i++) setgInitArray((pNaam + i + "Id"), (pLeft + i*10) , (pTop + i*10), pVisible);

}

 

 

/*	ALS JE EEN TEKST IN EEN DIVLAYERtag WILT PLAATSEN GEBRUIK JE DEZE FUNCTIE

	JE KUNT DE TEKST IN EEN VARIABELE VERZAMELEN EN DAN ALS PARAMETER AAN DEZE FUNCTIE MEEGEVEN

	var nieuweTekst = "<font face='Arial' size='4'><a href="info.html" target='bovenFrame'>Info</a></font><br>\n"

	nieuweTekst += "Dit is de volgende regel<br>\n"

	nieuweTekst += "en dit de derde\n"

	writeDIVLAYERtekst(........., nieuweTekst)

 

	EN DE TEKST VERSCHIJNT IN HET BLOK!

*/

 

function writeDIVLAYERtekst(pNaam, pLeft, pTop, pWidth, pHeight, pColor, pVisible, tekst){

	if ((pVisible == null)||(pVisible == "")) pVisible = "visible"

 

	var nieuweInhoud = "\n<style>\n"

 

	nieuweInhoud += "#" + pNaam + "Id{position:absolute; top:" + pTop  + "; left:" + pLeft + "; width:" + pWidth + "; height:" + pHeight + "; background-color:" + pColor + "; visibility:hidden;}\n"

 

	nieuweInhoud += "</style>\n"

	

				//	ALS (pColor == "transparent") DAN GEEN bgcolor propertie in de LAYER aanmaken, NETSCAPE BUG!!!

	if (pColor != "transparent") nieuweInhoud += "<div id=" + pNaam + "Id><layer bgcolor='" + pColor + "' width='" + pWidth + "' height='" + pHeight + "'>" + tekst + "</layer></div>\n"

	else nieuweInhoud += "<div id=" + pNaam + "Id><layer width='" + pWidth + "' height='" + pHeight + "'>" + tekst + "</layer></div>\n"

 

	document.write(nieuweInhoud);

 

	setgInitArray((pNaam + "Id"), pLeft, pTop, pVisible);

}

 

function writeFONT(pFace, pSize, tekst){

	var nieuweTekst = "<font face='" + pFace + "' size='" + pSize + "'>"

	nieuweTekst += tekst + "</font>\n"

	return nieuweTekst

}

 

function writeA(pHref, pTarget, tekst){

	var nieuweTekst = "<a href='" + pHref + "'"

	if (pTarget!="") nieuweTekst += " target='" + pTarget + "'"

	nieuweTekst += ">" + tekst + "</a>\n"

	return nieuweTekst

}

 

 

/*====================================================================

	DE VOLGENDE FUNCTIES MOETEN WORDEN VERVANGEN!!!!!!

=====================================================================*/

 

function getObject(obj) {

	alert("Vervang getObject(obj) door:\ngetObj(obj)")

	getObj(obj)

}

 

function schuifNaar(obj, x, y) {

	alert("Vervang schuifNaar(obj, x, y) door:\nmoveObjTo(obj, x, y)")

	moveObjTo(obj, x, y)

}

 

function schuifMet(obj, hor, ver) {

	alert("Vervang schuifMet(obj, hor, ver) door:\nmoveObjBy(obj, hor, ver)")

	moveObjBy(obj, hor, ver)

}

 

function zetZIndex(obj, zNummer) {

	alert("Vervang zetZIndex(obj, zNummer) door:\nsetZIndex(obj, zNummer)")

	setZIndex(obj, zNummer)

}

 

function toon(obj) {

	alert("Vervang toon(obj) door:\nshowObj(obj)")

	showObj(obj)

}

function verberg(obj) {

	alert("Vervang verberg(obj) door:\nhideObj(obj)")

	hideObj(obj)

}

 

function zetAchtergrondKleur(obj, color) {

	alert("Vervang zetAchtergrondKleur(obj, color) door:\nsetBgColor(obj, color)")

	setBgColor(obj, color)

}

 

// de x-coordinaat verkrijgen

function geefObjectLeft(obj) {

	alert("Vervang geefObjectLeft(obj) door:\ngetObjLeft(obj)")

	getObjLeft(obj)

}

 

function geefObjectTop(obj) {

	alert("Vervang geefObjectTop(obj) door:\ngetObjTop(obj)")

	getObjTop(obj)

}

 

function getImageHeight(naam){

	naamId = naam + "Id";

	naamImage = naam + "Image";

	if (isNav4) {

		return document.layers[naamId].document.images[naamImage].height;

	}

	else {

		return document.images[naamImage].height;

	}

}

 

function getImageObject(naam){

	alert("Vervang getImageObject(naam) door:\ngetImageObj(naam)")

	getImageObj(naam)

}


