/* 
 * The Artists Studio Gallery JavaScript
 * Dan Hopkins <dan@homicidalmaniac.org> June 2002 $Id$
 */
 
// gallery code -------------------------------------
function reload_gallery( id, thumbs )
{
	var page = Math.ceil(id/thumbs);
	self.location.search = "page=" + page + "&" + "thumbs=" + thumbs;
}


// showimage code -----------------------------------

function reload_page( page, cur_thumbs, thumbs )
{
	first  = 1 + (page * cur_thumbs) - cur_thumbs;
	page   = Math.ceil(first/thumbs);
	self.location.search =  "page=" + page + "&" + "thumbs=" + thumbs;
}

function reload_showimage( id, page, thumbs )
{
	self.location.search = "id=" + id + "&page=" + page + "&thubs=" + thumbs;
}

function mount_colour( col )
{
	// Change the outermount and make sure the innermount is shown
	var colstr = col.replace(' ', '').toLowerCase();
	document.getElementById('outermount').className = "tabbg-" + colstr;
	document.getElementById('innermount').className = "tabbg-white";
}

function toggle_mount( mount )
{
	// Toggle displaying the mount.
	// When turning on, use the colour currently selected
	var colsel = document.getElementById('col_select');
	var colstr = colsel.value.replace(' ','').toLowerCase();

	document.getElementById('outermount').className = (mount.checked ? "tabbg-" + colstr : "off");
	document.getElementById('innermount').className = (mount.checked ? "tabbg-white" : "off");
	document.getElementById('col_select').disabled = (mount.checked ? false : true);
}

