var MSC = {	
	version: 1.0
}

MSC.Gallery = {	
	currentPic: 1,
	maxPic: 1,
	setMax: function(max) {
		if(max >= 1 && max <= 50) {
			this.maxPic = max;
		}
	},
	prev: function() {
		if(this.currentPic <= 1) {
			this.currentPic = 1;
		} else {
			this.currentPic--;
		}
		this.show(this.currentPic);
	},	
	next: function() {
		if(this.currentPic >= this.maxPic) {
			this.currentPic = this.maxPic;
		} else {
			this.currentPic++;
		}		
		this.show(this.currentPic);				
	},	
	show: function(index) {
		if(document.getElementById) {
			for(var i=1; i<=this.maxPic;i++) {
				document.getElementById('gallery_img' + i).style.display = 'none';
				document.getElementById('navigation_img' + i).className = '';
				
			}
			document.getElementById('gallery_img' + index).style.display = 'block';
			document.getElementById('navigation_img' + index).className = 'current';
			this.currentPic = index;
		}
	}
}
