var button;
var keepCaption = 0;
var jumpTo = null;

function navOn(button) {
document.images[button].src = 'images/bt_'+button+'-over.gif';
}

function navOff(button) {
document.images[button].src = 'images/bt_'+button+'.gif';
}

function showLarger(thisfile) {
	document.images['enlargement'].src = 'art/'+thisfile+'.jpg';
	grid.style.display = "none";
	larger.style.display = "block";
	tip.innerHTML = "Click image to close";
	keepCaption = 1;
}

function hideLarger() {
	larger.style.display = "none";
	grid.style.display = "block";
	keepCaption = 0;
	hideCaption();
	document.images['enlargement'].src = 'images/loading.gif';
}

function showCaption(thistitle,thisspecs) {
	caption.style.display = "block";
	title.innerHTML = thistitle;
	specs.innerHTML = thisspecs;
	tip.innerHTML = "Click to view full image";
}

function hideCaption() {
	if (keepCaption == 0) { caption.style.display = "none"; }
}

function piece(thistitle,thisspecs,thisfile) {
	document.write('<a href="javascript:showLarger(\''+thisfile+'\')" onMouseOver="showCaption(\''+thistitle+'\',\''+thisspecs+'\');" onMouseOut="hideCaption();"><img src="art/sm_'+thisfile+'.jpg" alt="" width="140" height="110"></a>');
}

function galleryJump() {
	if (location.search.length > 0) {
			which = location.search.substring(1);
			jumpTo = (which * 3) - 1;
			showCaption(paintings[jumpTo-2],paintings[jumpTo-1]);
			showLarger(paintings[jumpTo]);
			for ( var i=10; i < which; i=i+10 ) {
					cycleforward();
					}
			}
	else grid.style.display = "block";

}



/***********************************************
 The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
 See:  http://www.msc.cornell.edu/~houle/javascript/randomizer.html
***********************************************/

rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};

