/**
 Rolloverscript voor het wijzigen van bijv. 2 afbeeldingen

 changeImage(image-source, target-image-element);
 
 image-source -> url naar plaatje
 target-image-element -> een ID (string) of object
 
 Voorbeelden:
 	onmouseover="changeImage('plaatje2.gif',this);"
		// verander plaatje huidige image element
	
	onmouseover="changeImage('plaatje3.gif','blah');"
		// verander plaatje van image element met ID 'blah'
	
	onmouseover="changeImage('plaatje2.gif',this); changeImage('plaatje3.gif','blah');"
		// verander zowel plaatje van huidge element als plaatje van element met id 'blah'

*/

function changeImage(file, target) {
	if (typeof(target)=="string"){
		target = document.getElementById(target);
	}
	target.src = file;
}




// Rolloverscript (name="rollover")


	var defaultStatus = '';
	
		function roll_highlight() {
			if (!isOn(this.src)) {
				prefix = this.src.substring(0,this.src.lastIndexOf("."));
				postfix = this.src.substring(this.src.lastIndexOf("."));
				this.src = prefix+"_on"+postfix;
				if (this.alt) {
					window.status = this.alt;
				}
			}
			return true;			
		}
		
		function isOn(imgsrc) {
			if (imgsrc.length>6) {
				onstr = imgsrc.substring(imgsrc.lastIndexOf(".")-3,imgsrc.lastIndexOf("."));
				//alert(onstr);
				if (onstr.toLowerCase()=="_on") {
					return true;
				}
			} 
			return false;
		}
		
		function roll_shadow() {
			if (isOn(this.src)) {
				prefix = this.src.substring(0,this.src.lastIndexOf(".")-3);
				postfix = this.src.substring(this.src.lastIndexOf("."));
				this.src = prefix+postfix;
				if (this.alt) {
					window.status = defaultStatus;
				}
			}
			return true;			
		}
	
		function makeItRoll(ds) {
			if (ds!=null) {
				defaultStatus = ds;
				window.status = defaultStatus;;
			}
			images = document.getElementsByName("rollover");

			for (i=0;i<images.length;i++) {
				images[i].onmouseover = roll_highlight;
				images[i].onmouseout = roll_shadow;
			}
			return true;
		}
	

