function galeria(param){
	var source= document.getElementById(param).src;
	
	var int = getPicName(source);
	var photo = document.getElementById("gphoto").src;
	
	checkArrow(param);
	document.getElementById("gphoto").setAttribute('class',param);
	document.getElementById("lyteboximage").href=photo.substr(0,photo.lastIndexOf('/')+1)+int+'b'+source.substr(source.lastIndexOf('.'));
	
	document.getElementById("lyteboximage").title=document.getElementById(param).title;
	document.getElementById("gphoto").src=photo.substr(0,photo.lastIndexOf('/')+1)+int+source.substr(source.lastIndexOf('.'));
	document.getElementById("lyteboxzoom").href=photo.substr(0,photo.lastIndexOf('/')+1)+int+'b'+source.substr(source.lastIndexOf('.'));
	document.getElementById("lyteboxzoom").title=document.getElementById(param).title;
	return true;
}

function prev(){
	var int = document.getElementById("gphoto").getAttribute('class');
	var src = new String(document.getElementById(int).src);


	int--;
	
	if (int<1) int=1;
	var src = new String(document.getElementById(int).src);
	var pic = getPicName(src);	

	document.getElementById("gphoto").src=src.substr(0,src.lastIndexOf('/')+1)+pic+src.substr(src.lastIndexOf('.'));
	document.getElementById("lyteboximage").href=src.substr(0,src.lastIndexOf('/')+1)+pic+'b'+src.substr(src.lastIndexOf('.'));
	document.getElementById("lyteboximage").title=document.getElementById(int).title;
	document.getElementById("lyteboxzoom").href=src.substr(0,src.lastIndexOf('/')+1)+pic+'b'+src.substr(src.lastIndexOf('.'));
	document.getElementById("lyteboxzoom").title=document.getElementById(int).title;
	document.getElementById("gphoto").setAttribute('class',int);
	checkArrow(document.getElementById("gphoto").src);
	return true;
}
function next(){
	var int = document.getElementById("gphoto").getAttribute('class');
	var src = new String(document.getElementById(int).src);


	int++;
	
	if (int>10) int=10;
	var src = new String(document.getElementById(int).src);
	var pic = getPicName(src);	

	document.getElementById("gphoto").src=src.substr(0,src.lastIndexOf('/')+1)+pic+src.substr(src.lastIndexOf('.'));
	document.getElementById("lyteboximage").href=src.substr(0,src.lastIndexOf('/')+1)+pic+'b'+src.substr(src.lastIndexOf('.'));
	document.getElementById("lyteboximage").title=document.getElementById(int).title;
	document.getElementById("lyteboxzoom").href=src.substr(0,src.lastIndexOf('/')+1)+pic+'b'+src.substr(src.lastIndexOf('.'));
	document.getElementById("lyteboxzoom").title=document.getElementById(int).title;
	document.getElementById("gphoto").setAttribute('class',int);
	checkArrow(document.getElementById("gphoto").src);
	return true;
}
function getPicName(string){
	var temp=string.split('/');
	temp=temp[temp.length-1].split('.');
	var int = parseInt(temp[0]);
	return int;
}
function checkArrow(src){
	var int = getPicName(src)
	/*
	 * if (int==1) document.getElementById('leftArrow').style.display='none';
	 * else document.getElementById('leftArrow').style.display='inline'; if
	 * (int==10) document.getElementById('rightArrow').style.display='none';
	 * else document.getElementById('rightArrow').style.display='inline';
	 */
}
