function openBookmarks () {
	$id('bookmark_dark').style.height = getBodyHeight() + 'px';
	$id('bookmark_dark').style.width = getBodyWidth() + 'px';
	$id('bookmark_dark').style.display = '';
	$id('bookmark_popup').style.left = (getBodyWidth() / 2 - 128) + 'px';
	$id('bookmark_popup').style.top = getScrollTop() + 256 + 'px';
	$id('bookmark_popup').style.display = '';
}
function closeBookmarks () {
	$id('bookmark_dark').style.display = 'none';
	$id('bookmark_popup').style.display = 'none';
}
function $id(obj) {
	return document.getElementById(obj);
}
function getBodyWidth () {
	return document.body.scrollWidth || window.innerWidth || document.documentElement.clientWidth || 0;
}
function getBodyHeight () {
	return document.body.scrollHeight || window.innerHeight || document.documentElement.clientHeight || 0;
}
function getScrollTop () {
	return (window.pageYOffset) ? window.pageYOffset : (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
}

function openPopup(winURL, winTitle, winWidth, winHeight) {
	var winLeft = (screen.availWidth / 2) - (winWidth / 2); // center window in screen
	var winTop = (screen.availHeight / 2) - (winHeight / 2); // center window in screen

  popWin = window.open(winURL, winTitle, 'width=' + winWidth + ',height=' + winHeight);

	//return false;
}
