var selectedImage = 0;

function setDetailImage(id,genericId,index){
	enclosingDiv = document.getElementById(genericId);
	enclosingDiv.style.display='block';
	var params =window.images[index].split(';');
	
	targetImg = document.getElementById(id+genericId);
	targetImg.src = '';
	targetImg.width = params[1];
	targetImg.height = params[2];
	targetImg.src = params[0];
	imganchor = '#obr'+params[3];
	
	
	leftElement = document.getElementById(genericId+'_left');
	rightElement = document.getElementById(genericId+'_right');
	leftElement.style.top=((params[2]/2)-75)+'px';
	rightElement.style.top=((params[2]/2)-75)+'px';

	if(window.images[index-1]){
		leftElement.style.display = 'block';
	}else{
		leftElement.style.display = 'none';
	}
	if(window.images[index+1]){
		rightElement.style.display = 'block';
	}else{
		rightElement.style.display = 'none';
	}
	
	window.selectedImage = index;
	//window.location = imganchor;
	
}