/*--------------------------------------------------------------------------
 *  Handles various functions throughout the site...
 *  Depends on the Prototype Library.
 *--------------------------------------------------------------------------*/
var tabFileType = 'png';
if (/MSIE (5\.5|6\.)/.test(navigator.userAgent)) {
	tabFileType = 'gif';
}

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.display = 'none';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.display = 'block';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.display = 'none';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

function showArtists() {
	$('Artists').show();
	
}
function hideArtists() {
	$('Artists').hide();
	
}
function showSubjects() {
	$('Subjects').show();
	
}
function hideSubjects() {
	$('Subjects').hide();
	
}

function opengiclee() {
	//window.open('/giclee.php', '_blank', 'width=500pixels,height=325px,scrollable=no,toolbar=no');
	document.location='/giclee.php';
}

function openColor() {
	window.open('/color.php', '_blank', 'width=500pixels,height=325px,scrollable=no,toolbar=no');
}

function setGalleryHeight() {
	var divHeight = $('Main').getHeight() - 30;
	if (divHeight > 528) {
		$('Artists').setStyle({height: divHeight + 'px'});
		$('Subjects').setStyle({height: divHeight + 'px'});
	}
}

