function popup(loc, width, height, scrollbars) {
	var _params = "width="+width+",height="+height+",toolbar=no,location=no,status=no,menubar=no,scrollbars="+scrollbars+",resizable=yes,top=" + (screen.height-height)/2 + ",left=" + (screen.width-width)/2;

	var newWin = window.open(loc, 'window', _params);
	newWin.focus();
}



function showObj(id, type) {
	if (document.getElementById) document.getElementById(id).style.display = (type ? type : 'block');
}
function hideObj(id) {
	if (document.getElementById) document.getElementById(id).style.display = 'none';
}

// needed for safari+flash compatability
function showObj2(id) {
	if (document.getElementById) document.getElementById(id).style.visibility = 'visible';
}
function hideObj2(id) {
	if (document.getElementById) document.getElementById(id).style.visibility = 'hidden';
}

var curDivId = 0;

var displayDetailTable = '<table height="540" width="730"><tr><td valign="middle" align="center"><a href="#" onClick="hideDetail(); return false;" class="detailCap"><img src="/img/spacer.gif" name="detailImg" alt="Detail Image" /><br /><span class="copyright" id="detailCopyright">&#169; the artist, courtesy Horst Schuler Galerie.<br />The reproduction of this image is prohibited without written permission.</span><br /><br />Back</a></td></tr></table>'
function displayDetail(filename) {
	hideObj2('menu');
	hideObj('subhead1');
	hideObj2('slideshow');
	showObj('detailImage');
	
	document.detailImg.src = filename;
	
	//alert ('firstchild.data = '+document.getElementById('detailCopyright').childNodes[0].nodeValue+' var = ' + document.copyrightText);
	//document.getElementById('detailCopyright').childNodes[0].nodeValue = 'var = ' + document.copyrightText;
	//document.getElementById('detailImg').write('<div id="getFlash">Diese Seite benötigt den kostenlsen Flashplayer. <a href="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">Bitte hier herunterladen<\/a><\/div>');
	//<table height="540" width="730"><tr><td valign="middle" align="center"><a href="#" onClick="hideDetail(); return false;" class="detailCap"><img src="/img/spacer.gif" name="detailImg" alt="Detail Image" /><br /><br />Back</a></td></tr></table>
	//document.getElementById('body').className='white';
}

function hideDetail() {
	hideObj('detailImage');
	showObj2('menu');
	showObj('subhead1');
	showObj2('slideshow');

	document.detailImg.src = '/img/spacer.gif';
	document.getElementById('body').className='navy';
}

function scrollInit() {
	theThumb  = document.getElementById("thumb");
	theScroller  = document.getElementById("scrollerContent");

	scroller_obj.load();

	Drag.init(theThumb, null, 0, 0, 19, 194);

	// the number of pixels the thumb can travel vertically (max - min)
	thumbTravel = theThumb.maxY - theThumb.minY;

	// the ratio between scroller movement and thumbMovement
	ratio = scroller_obj.scrollH / thumbTravel;

	theThumb.onDrag = function(x, y) {
		scroller_obj.jumpTo(null, Math.round((y - theThumb.minY) * ratio));
	}
}

updateThumb = function() {
	var n = parseInt(theScroller.style.top);
	theThumb.style.top = (-n/ratio + theThumb.minY) +"px";
}
