var hideTimeout;
function showPrintOptions(object) {
	var target = document.getElementById("print_options_menu");
	if (target.style.display != "block") {
		//target.style.left = (((getScreenWidth() - 760) / 2) + 554) + "px";
		//alert("x: "+object.x+" y: "+object.y);
		//alert("oL: "+object.offsetLeft+" oT: "+object.offsetTop);
		target.style.left = (getLeftOffset(object)-4)+"px";
		target.style.top = (getTopOffset(object)+19)+"px";
		target.style.display = "block";
	}
}
function clearTimer() {
	clearTimeout(hideTimeout);
}
function hidePrintOptions() {
	hideTimeout = setTimeout("doHidePrintOptions();",300);
}
function doHidePrintOptions() {
	document.getElementById("print_options_menu").style.display = "none";
}
function getLeftOffset(object) {
	var total = object.offsetLeft;
	var parent = object.offsetParent;
	while (parent != null) {
		total += parent.offsetLeft;
		parent = parent.offsetParent;
	}
	return (total);
}
function getTopOffset(object) {
	var total = object.offsetTop;
	var parent = object.offsetParent;
	while (parent != null) {
		total += parent.offsetTop;
		parent = parent.offsetParent;
	}
	return (total);
}
function getScreenWidth() {
	var windowWidth;
	if (self.innerWidth) {	// all except Explorer
		windowWidth = self.innerWidth - 16;
	} else if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
	}
	return (windowWidth);
}