/*
 * Script for website www.modulo-architects.be
 * 
 * This script deals with all bullet- aspects.
 *
 * @ author: Lieven Van Landschoot.
 */
var previous = 0; // value containing previous position
var current = 0; // value containing current position
var file = new Array(); // array containing filenames
var filecount = 0; // value containing the total number of images
document.oncontextmenu=rightclickDisable // this will disable righ-clicking

/* function disabling right- clicking*/
function rightclickDisable() {
return false
}


/* function turning the arrow at the given position up */ 
function arrowUp(i){
 		position = "im" + i;
		image =  "images/bulletlight.gif";
		document.getElementById(position).src = image;		
}

/* function turning the arrow at the given position down */ 
function arrowDown(i){
		if(i != current){
			position = "im" + i;
			image =  "images/bulletdark.gif";
			document.getElementById(position).src = image;
		}
}

/* function changing image and current position to given values */ 
function swap(i){
		previous = current;
		current= i;
		arrowDown(previous); 
		arrowUp(i); 
		document.getElementById('foto').src= file[i];
}

/* function showing next image */ 
function next(){
	if(current < (filecount-1)){
			swap(current+1);		
	} else {
			swap(0);	
	}
			
}

/* function showing previous image */ 
function prev(){
	if(current > 0){
			swap(current-1);		
	} else {
			swap(filecount-1);
	}
}