// sloppy javascripting, needs cleanup

var DHTML	= (document.getElementById || document.all || document.layers);
var is_ie	= ((navigator.userAgent.toLowerCase().indexOf("msie") != -1) && (navigator.userAgent.toLowerCase().indexOf("opera") == -1));
var mobj;
var current	= 20;

showPic = function ( ) 
{
	$("larger_pic").src=this.src.replace('120', '400');
	$("larger_pic_container").style.display = "block";
	
	pic_top = this.offsetTop;
	pic_top -= (MAX_IMG_HEIGHT - THUMB_HEIGHT) / 2; // this doesn't really work
	if(pic_top < 10)
	{
		pic_top = 10;
	}
	if((pic_top + MAX_IMG_HEIGHT) >= document.height)
	{
		pic_top = document.height - MAX_IMG_HEIGHT - 20;
	}
	
	$("larger_pic_container").style.top = pic_top + "px";
}
	  
function init ()
{
	clickables = document.getElementsByClassName('clickable');
	clickables.each(function (c) { c.onclick = showPic });
	
	if (is_ie && DHTML)
	{
		teaser		= $('contents_teaser');
		contents	= $('contents_full');
		teaser.onmouseover = function ()
		{
			contents.style.display = "block";
		}
		teaser.onmouseout = function ()
		{
			contents.style.display = "none";
		}
		contents.onmouseover = function ()
		{
			contents.style.display = "block";
		}
		contents.onmouseout = function ()
		{
			contents.style.display = "none";
		}
	}
	mobj = $('contents_teaser');
	if (DHTML)
	{
		setInterval("poll()",400);
	}
}

function poll () { return; }

Event.observe(window, 'load', init);
