//javascript
//contact: valen16@trypill.org
//kphotools     --        2004
var images = new Array;
var i = 0;

var offset = delineate(window.location);
if(offset == "")offset=0;
function loadnone(i)
{
	document.getElementById('img'+i).src = "nofile.png";
	document.getElementById('link'+i).href = "";	
}
for(i = 0;i<9;i++)
{
	var count = 0;
	count = i+eval(offset*9);
	var id =  form_id(count);
	images[i] = new Image;
	images[i].src = "images/"+base_name+""+id+"_thumb."+type;
	images[i].onload=eval("document.getElementById('img'+i).src = images[i].src;document.getElementById('link'+i).href = \"show.html?img=\"+id;");
}

//create navigation menu:

var j=0;
var output = "";
var max_offset = img_count/9;
if(offset>=1)
{
	output+= '<A href="?offset='+eval(offset-1)+'">&lt;&lt;</A> -  ';
}
for(j = 0; j<max_offset;j++)
{
	output += '<A href="?offset='+eval(j)+'">'+eval(j+1)+'</A>';
	
	if(j<max_offset-1)
	{
		output+=' - ';
	}
	
}
if(offset<max_offset-1)
{

	var offset2 = offset-0+1
	output+= ' - <A href="?offset='+eval(offset2)+'"> &gt;&gt;</A>';
}
document.getElementById('navigation').innerHTML=output;
document.getElementById('page_current').innerHTML=eval(offset)+1;
document.getElementById('page_count').innerHTML=roundTowardsZero(max_offset)+1;


