// isIE6 = true    ; if lt IE7 

function hideSelects(act) {
	var cells = document.getElementsByTagName("select");
	if (act) {
		for (i = 0; i < cells.length; i++) {
			status = cells[i].style.visibility = "hidden"; 
		}
	} else {
		for (i = 0; i < cells.length; i++) {
			status = cells[i].style.visibility = "visible"; 
		}
	}
}
function getScrollY() {
	var y = 0;
	if (typeof(window.pageYOffset) == 'number') y = window.pageYOffset; // Netscape
	else if (document.body && (document.body.scrollLeft || document.body.scrollTop )) y = document.body.scrollTop; // DOM
	else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) y = document.documentElement.scrollTop; // IE6 standards compliant mode
	return y;
}
/* This Overlay prototype was made by Nuno Peralta - http://www.nunoperalta.com/ */
function createOverlay(width, html, nohide, lighter) {
	if (isIE6 && !nohide) hideSelects(true);
	
	html2 = '<div id="nunooverlay" class="overlays';
	if (lighter) html2 += ' overlighted';
	html2 += '"><table id="overlaytable" class="overlaytables"><tr><td valign="middle" align="center"><div id="overlaycontent"';
	if (width) html2 += 'style="width: '+width+'px;"';
	html2 += '>'+html+'</div></td></tr></table></div>';
	
	var overlayelement = document.createElement("div");
	overlayelement.setAttribute("id", "overlayelement");
	overlayelement.innerHTML = html2;
	html2 = null;
	document.body.appendChild(overlayelement);
	$m("overlaytable").style.left = "0px";
	if (!isIE6) $m("overlaytable").style.top = "0px";
	else $m("overlaytable").style.top = getScrollY()+"px";
	if (isIE6) $m("overlaytable").style.height = (window.screen.availHeight-150)+"px";
}
function createCompleteOverlay(width, title, html, nohide, lighter) {
	if (isIE6 && !nohide) hideSelects(true);
	
	html2 = '<div id="nunooverlay" class="overlays';
	if (lighter) html2 += ' overlighted';
	html2 += '"><table id="overlaytable" class="overlaytables"><tr><td valign="middle" align="center"><div id="overlaycontent"';
	if (width) html2 += 'style="width: '+width+'px;"';
	html2 += '><div id="overlay-header"><div id="overlay-title">'+title+'</div><div id="overlay-close" onclick="closeOverlay();">&nbsp;</div><div class="clear cleared"></div></div><div id="overlay-html">'
	+html+'</div></div></td></tr></table></div>';
	
	var overlayelement = document.createElement("div");
	overlayelement.setAttribute("id", "overlayelement");
	overlayelement.innerHTML = html2;
	html2 = null;
	document.body.appendChild(overlayelement);
	$m("overlaytable").style.left = "0px";
	if (!isIE6) $m("overlaytable").style.top = "0px";
	else $m("overlaytable").style.top = getScrollY()+"px";
	if (isIE6) $m("overlaytable").style.height = (window.screen.availHeight-150)+"px";
}
function openOverlay(element, otable, nohide) {
	if (isIE6 && !nohide) hideSelects(true);
	
	$m(otable).style.left = "0px";
	if (!isIE6) $m(otable).style.top = "0px";
	else $m(otable).style.top = getScrollY()+"px";
	if (isIE6) $m(otable).style.height = (window.screen.availHeight-150)+"px";
	$h(false, element);
}
function closeOverlay(nodestroy, nohide) {
	if (isIE6 && !nohide) hideSelects(false);
	if (!nodestroy) document.body.removeChild($m("overlayelement"));
	else $h(nodestroy);
}