var currentscrolltop;

function showimage(description, image){
	
	if (!document.getElementById('absolute')){ return; }
	
	if (image == ''){ 	document.getElementById('absolute').style.display = 'none'; undobody(); }
	else { 				document.getElementById('absolute').style.display = 'block'; dobody(); }
		
	
	
	if (document.getElementById('galleryimage')){
		
		var theimage = document.createElement('img');
		theimage.setAttribute('src','http://www.symbiontsuite.com/webimg/34/'+image);
		theimage.alt = '';
		
		var thedescription = document.createElement('div');
		thedescription.innerHTML = description;
		
		document.getElementById('galleryimage').innerHTML = '';
		document.getElementById('galleryimage').appendChild(theimage);
		document.getElementById('galleryimage').appendChild(thedescription);
		
	}
	
}

function undobody(){
	document.body.style.height = '';
	document.body.style.overflow = '';
	document.documentElement.scrollTop = currentscrolltop;
}
function dobody(){
	currentscrolltop = document.documentElement.scrollTop;
	document.body.style.height = '100%';
	document.body.style.overflow = 'hidden';
}


function sha1(elementID){
	
	if (get(elementID)){
		
		get(elementID).value = hex_sha1(get(elementID).value);
		
	}
	
}

function get(elementID){
	
	if (document.getElementById(elementID)){
		
		return document.getElementById(elementID);
		
	}
	else {
		
		return false;
		
	}
	
}

var currentcount = 0;

var currentlocation = location.href;
currentlocation = currentlocation.indexOf('#galleryanchor',0);
if (currentlocation != -1){
	
	var theparts = location.href.split('#galleryanchor');
	currentcount = parseInt(theparts[1]);
	
}

function galleryup(){
	
	// reduce currentcount
	
	if (get('galleryanchor'+(currentcount-1))){
		
		currentcount--;
		document.location =  '#galleryanchor'+currentcount;
		
	}
	else {
		document.location =  '#galleryanchor'+currentcount;
	}
	
}
function gallerydown(){
	
	if (get('galleryanchor'+(currentcount+1))){
		
		currentcount++;
		document.location =  '#galleryanchor'+currentcount;
		
	}
	else {
		document.location =  '#galleryanchor'+currentcount;
	}
	
}
