/* Terms and Conditions */

Lib_div = document.createElement("div");
Lib_div.className = "popupDiv library";
Lib_idiv = document.createElement("div");
Lib_idiv.className = "inner library";
Lib_div.appendChild(Lib_idiv);
Lib_h3 = document.createElement("h3");
Lib_h3.innerHTML = "Tax Research Library Disclaimer";
Lib_idiv.appendChild(Lib_h3);
Lib_p = document.createElement("p");
Lib_p.innerHTML = "The articles in the Tax Research Library are provided to give you basic information on some of the most popular topics of today.<br />They are not designed to cover all aspects of the subject matter and as such you should not make any decisions without further research.<br /> We will be glad to assist you by providing more information.<br />By clicking enter you acknowledge that you have read and understand the above disclaimer."
Lib_a = document.createElement("div");
Lib_b = document.createElement("div");
Lib_a.className = "lib_button";
Lib_b.className = "lib_button";
Lib_a.innerHTML = "Enter";
Lib_b.innerHTML = "Cancel";
Lib_idiv.appendChild(Lib_p);
Lib_idiv.appendChild(Lib_a);
Lib_idiv.appendChild(Lib_b);
fixStyle(Lib_idiv);

addEvent(Lib_a, "click", goLibrary);
addEvent(Lib_b, "click", removeLib);

function displayLibrary() {
	if (getCookie("agreeToLibTerms") == "1") {
		window.location = "library.html";
	} else {
		shade();
		bigDiv.appendChild(Lib_div);
	}
}
function removeLib() {
	setCookie("agreeToLibTerms", "0");
	bigDiv.removeChild(Lib_div);
	shadeOff();
}
function goLibrary() {
	setCookie("agreeToLibTerms", "1", "31");
	window.location = "library.html";
}
function goBack() {
	if (window.history.length>1) {
		try { window.history.back(); }
		catch (e) {
			try { window.history.forward(); }
			catch(e){ window.close(); }
		}
	} else {
		window.location = "index.html";
	}
}

function lib_checkCookie() {
	if (getPageName() == "library.html") {
		if (getCookie("agreeToLibTerms")!="1") {
			removeEvent(Lib_b, "click", removeLib);
			addEvent(Lib_b, "click", goBack);
			displayLibrary();
		}
	}
}

