function DoNotAgree() {
	UndoGrayOutPage("idc_grayoutcover");
	HideTag("usage_agreement");
}

function DoAgree() {
	UndoGrayOutPage("idc_grayoutcover");
	HideTag("usage_agreement");
	window.location = "/datalab/quickstats/default.aspx";
}

function ShowAgreement() {
	var usage_agreement = document.getElementById("usage_agreement");
	//var i_header = document.getElementById("i_header");
	//if (usage_agreement && i_header) {
	if (usage_agreement) {
		GrayOutPage("idc_grayoutcover");
		//var p = getPosition(i_header);
		usage_agreement.style.marginLeft = "auto";
		usage_agreement.style.marginRight = "auto";
		//usage_agreement.style.top = ((p.y * 1) + 50) + "px";
		usage_agreement.style.display = "block";
	}
}

function GrayOutPage(coverId) {
	var _isIE = (window.navigator.appName.toLowerCase().indexOf('explorer') != -1);
	var cvr = document.getElementById(coverId);
	cvr.style.display = "block";

	cvr.style.width = "100%";
	if (_isIE) {
		cvr.style.height = (document.body.offsetHeight + 30) + "px";  //"1000%";
	}
	else {
		//PrintDvRaed(document.body.clientHeight+","+document.documentElement.clientHeight+","+window.innerHeight);
		cvr.style.height = document.documentElement.clientHeight + window.scrollMaxY + "px";
	}
}

function UndoGrayOutPage(coverId) {
	var cvr = document.getElementById(coverId);
	cvr.style.display = "none";
}
function HideTag(ptr) {
	if (ptr) {
		var ptrHandle = document.getElementById(ptr);
		if (ptrHandle) {
			ptrHandle.style.display = "none";
		}
	}
}
function PrintAgreement(element, x, y) {				
	var a = window.open('', '', 'width=500,height=570,scrollbars=1,left=' + x + ',top=' + y + ',screenX=' + x + ',screenY=' + y);
	a.document.open("text/html");
	a.document.write("<html><header>");
	a.document.write("<link rel='stylesheet' href='css/index.css' type='text/css' />");
	a.document.write("<STYLE type='text/css'>body {margin:0;padding:0;}</STYLE>");
	a.document.write("</header><body><div class='indexmain'>");
	a.document.write("<div class='print_header'>National Center for Education Statistics QuickStats</div><br><br>");
	var output = "";
	var input = document.getElementById(element).innerHTML;
	a.document.write(input);
	a.document.write("</div></body></html>");
	a.document.close();
	a.print();
	//a.close();
			}