function showDetail(id,element){
	album_act = id;
	document.getElementById(element).src=album[id];
	document.getElementById(element+'_title').innerHTML = album_title[id];
	if(id == album_first){
		document.getElementById('arrow_left').style.display = 'none';
	}
	else{
		document.getElementById('arrow_left').style.display = 'block';
	}
	if(id == album_last){
		document.getElementById('arrow_right').style.display = 'none';
	}	
	else{
		document.getElementById('arrow_right').style.display = 'block';
	}
}

function next(){
	showDetail(album_act+1,'big_photo');
}

function prev(){
	showDetail(album_act-1,'big_photo');
}

function gallery(){
	this.aid = 0;
	this.album = [];
	this.album_title = [];
	this.album_first = 0;
	this.album_last = 0;
	this.album_act = 0;
	
	this.init = function(aid,last){
		this.aid = aid;
		this.album_last = last;
	};
	
	this.add = function(src,title,key){
		this.album[key] = src;
		this.album_title[key] = title;
	};
	
	this.showDetail = function(id,element){
		this.album_act = id;
		document.getElementById(element).src = this.album[id];
		document.getElementById(element+'_title').innerHTML = this.album_title[id];
		if(id == this.album_first){
			document.getElementById('arrow_left_'+this.aid).style.display = 'none';
		}
		else{
			document.getElementById('arrow_left_'+this.aid).style.display = 'block';
		}
		if(id == this.album_last){
			document.getElementById('arrow_right_'+this.aid).style.display = 'none';
		}	
		else{
			document.getElementById('arrow_right_'+this.aid).style.display = 'block';
		}
	};
	
	this.next = function(){
		this.showDetail(this.album_act+1,'big_photo_'+this.aid);
	};

	this.prev = function(){
		this.showDetail(this.album_act-1,'big_photo_'+this.aid);
	}	;
	
}
