
function WindowTitle(title) {
	document.title = title;
}
function WindowStatus(status) {
	window.status = status;
}
function getPageSizeWithScroll(wh) {
	if (window.innerHeight) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else {
		if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
			yWithScroll = document.body.scrollHeight;
			xWithScroll = document.body.scrollWidth;
		} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
			yWithScroll = document.body.offsetHeight;
			xWithScroll = document.body.offsetWidth;
		}
	}
	if (wh == "h") {
		return yWithScroll;
	} else {
		return xWithScroll;
	}
}
function grayOut(vis, options) {
	getPageSizeWithScroll();
	var options = options || {};
	var zindex = options.zindex || 50;
	var opacity = options.opacity || 70;
	var opaque = (opacity / 100);
	var bgcolor = options.bgcolor || "#eeeeee";
	var dark = document.getElementById("screenObj");
	if (!dark) {
		var tbody = document.getElementsByTagName("body")[0];
		var tnode = document.createElement("div");
		tnode.style.position = "absolute";
		tnode.style.top = "0px";
		tnode.style.left = "0px";
		tnode.style.overflow = "hidden";
		tnode.style.display = "none";
		tnode.id = "screenObj";
		tbody.appendChild(tnode);
		dark = document.getElementById("screenObj");
	}
	if (vis) {
		pageWidth = getPageSizeWithScroll("w") + "px";
		pageHeight = getPageSizeWithScroll("h") + "px";
		dark.style.opacity = opaque;
		dark.style.MozOpacity = opaque;
		dark.style.filter = "alpha(opacity=" + opacity + ")";
		dark.style.zIndex = zindex;
		dark.style.backgroundColor = bgcolor;
		dark.style.width = pageWidth;
		dark.style.height = pageHeight;
		dark.style.display = "block";
	} else {
		dark.style.display = "none";
	}
}
function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		while (1) {
			curleft += obj.offsetLeft;
			if (!obj.offsetParent) {
				break;
			}
			obj = obj.offsetParent;
		}
	} else {
		if (obj.x) {
			curleft += obj.x;
		}
	}
	return curleft;
}
function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		while (1) {
			curtop += obj.offsetTop;
			if (!obj.offsetParent) {
				break;
			}
			obj = obj.offsetParent;
		}
	} else {
		if (obj.y) {
			curtop += obj.y;
		}
	}
	return curtop;
}
function getStyleObject(objectId) {
	if (document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId).style;
	} else {
		if (document.all && document.all(objectId)) {
			return document.all(objectId).style;
		} else {
			if (document.layers && document.layers[objectId]) {
				return document.layers[objectId];
			} else {
				return false;
			}
		}
	}
}
function changeObjectVisibility(objectId, newVisibility, newDisplay) {
	var styleObject = getStyleObject(objectId);
	if (styleObject) {
		styleObject.display = newDisplay;
		styleObject.visibility = newVisibility;
		return true;
	} else {
		return false;
	}
}
function moveObject(objectId, newXCoordinate, newYCoordinate) {
	var styleObject = getStyleObject(objectId);
	if (styleObject) {
		styleObject.left = newXCoordinate + "px";
		styleObject.top = newYCoordinate + "px";
		return true;
	} else {
		return false;
	}
}
function setCookie(name, value) {
	document.cookie = name + "=" + value;
}
function getCookie(name) {
	var coo = document.cookie.split(";");
	for (var i = 0; i < coo.length; i++) {
		var coo2 = coo[i].split("=");
		if (coo2[0] == name) {
			return coo2[1];
		}
	}
	return "";
}

