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)) document.getElementById(id).style.display = (type ? type : 'block');
}
function hideObj(id) {
	if (document.getElementById && document.getElementById(id)) document.getElementById(id).style.display = 'none';
}

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

var curDivId = 0;
function displayDetail(filename) {
	if (UFO.hasFlashVersion(6,0)) {
		hideObj2('menuFlash');
	} else {
		hideObj('header');
		hideObj('menu');
	}
	hideObj('subhead1');
	hideObj2('content1');

	showObj('detailImage');

	document.detailImg.src = filename;
}

function hideDetail() {
	hideObj('detailImage');

	if (UFO.hasFlashVersion(6,0)) {
		showObj2('menuFlash');
	} else {
		showObj('header');
		showObj('menu');
	}
	showObj('subhead1');
	showObj2('content1');
	
	document.detailImg.src = './img/spacer.gif';

}

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

	scroller_obj.load();

	Drag.init(theThumb, null, 0, 0, 22, 124);

	// 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";
}

// THIS IS NEEDED FOR PRIVATE PRESS
function popupform(loc, name, 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;

	if (! window.focus)return true;
	window.open('', name, _params);
	loc.target=name;
	return true;
}
