/* Script (c)2001 by Danny Adamse
// -----------------------------------------
// written for telematica practicum 2001 for 
// project of business information systems
// university of amsterdam
//
// copying this script without permission of
// the author is prohibitted
// -----------------------------------------
// specification: javascript / dhtml
// compatible: ie4,5,6 / ns4,6
// -----------------------------------------
*/

paginaGeladen = false;
bg2="";

/* function:	pageLoaded
// -------------------------------
// input:		void
// output:		void
// does this:	sets variable paginaGeladen to true if page has been loaded
*/
function pageLoaded(){
	paginaGeladen = true;
}

/* function:	placeLayerToOffset
// -------------------------------
// input:		layer,basicOffSet
// output:		void
// does this:	moves layer layer to a new vertical position due to scroll
//				operation of the user, starting with a basic vertical position
//				of baiscOffSet only and only if the page has been loaded
*/
function placeLayerToOffset(laag,basicOffSet){
	if(paginaGeladen==true){
		if(document.layers){	// netscape
			if(document.laag){
				scrollY = window.pageYOffset + basicOffSet;
				document.laag.top = scrollY;
			}
		}else{					// ie
			if(laag.style){
				scrollY = document.body.scrollTop + basicOffSet;
				laag.style.top = scrollY;
			}
		}
	}
}

baseY = 30;		// base Y coordinate of layer
muisX = 0;		
muisY = 0;


/* function:	startMoveLayer
// ---------------------------
// input:		void
// output:		void
// does this:	Catch both X and Y coordinates of user's mouse cursor position
//				Invoke positionLayer function to set the menu position 
*/
function startMoveLayer(){
	muisX = event.clientX;
	muisY = event.clientY;
	if(muisX<200){
		nextY = (30+(((200-muisX)/200)*((muisY<175)?0:(muisY-175))));
		positionLayer("menu","menu", 0, nextY);
	}
}

/* function:	positionLayer
// --------------------------
// input:		frame,layerName,x,y
// output:		void
// does this:	Set position of a layer layerName in frame frame to x and y coordinates
*/
function positionLayer(frame,layerName, x, y){
  if (layerName != "") { 
    (document.layers) ? eval("top.frames." + frame + ".document." + layerName + ".top = " + y.toString() ) : eval("top.frames." + frame + ".document.all." + layerName + ".style.top = " + y.toString());
    (document.layers) ? eval("top.frames." + frame + ".document." + layerName + ".left = " + x.toString() ) : eval("top.frames." + frame + ".document.all." + layerName + ".style.left = "+ x.toString());
  }
}


function openVenster(breedte, hoogte, hor_pos, vert_pos, url, naam){
	var opties =  "toolbar=no,status=no,menubar=no,scrollbars=0,resizable=no,width="+breedte+",height="+hoogte+",top="+vert_pos+",left="+hor_pos+";"
	newWindow = window.open(url , naam , opties);
}


	function setAlpha(layer,max,more,speed,iteraties){
		if(document.all){
			laag = eval("document.all."+layer);
		}else if(document.getElementById){
			laag = document.getElementById(layer);
		}

		if(iteraties > max){
			return;
		}
		if(document.all){
			currentAlpha = laag.filters.alpha.opacity;
		}else if(document.getElementById){
			currentAlpha = laag.style.MozOpacity * 100;
		}
		(more) ? currentAlpha-=3*speed : currentAlpha+=3*speed;

		if(currentAlpha <= 0){
			laag.style.display = 'none';
		}

		if(document.all){
			laag.filters.alpha.opacity = currentAlpha;
		}else if(document.getElementById){
			laag.style.MozOpacity = 0;
			laag.style.MozOpacity = currentAlpha / 100;
		}
		if((!more && currentAlpha<max) || (more && currentAlpha>max)){
			iteraties++;
			setTimeout("setAlpha('"+layer+"',"+max+","+more+","+speed+","+iteraties+")",100);
		}
	}


// Plaatjes pre-loaden

a = new Image();a.src="gfx/global/loadingpage.gif";
b = new Image();b.src="gfx/headers/nwdlogo.gif";
c = new Image();c.src="gfx/bgs/bghome_br.jpg";


