function next()
{
	var link = document.getElementById ("nextPic");
	if (link)
	{
		window.location.href = link.href
	}
}

function prev()
{
	var link = document.getElementById ("prevPic");
	if (link)
	{
		window.location.href = link.href
	}
}

function getkey(e)
{
	// Internet Explorer
	if (e == null)
	{
		kcode = event.keyCode;
	}
	// Mozilla
	else
	{
		// moz doesn't override ctrl keys,
		// eg, Ctrl-N won't bypass this function to open new window
		if (e.altKey || e.ctrlKey) {
			return true;
		}
		kcode = e.which;
	}

	switch(kcode) { 
	case 39 : next(); return false; //right arrow
	case 37 : prev(); return false; //left arrow
	}
}

document.onkeydown = getkey;

