// variables
var passwordPage = "index2.html";
// functions
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
// function called onLoad of this web page
function getPass() {
	// we read the cookie to check if the user has already submitted the pass  (we don't need to know what is the correct passwod)
	// cookiePass=CorrectPassword but we don't need to check it because if the cookie != null, that means the user has entered the correct passwod
	var cookiePass = readCookie('cookiePass');
	if (cookiePass == null || String(cookiePass).length==0) {
		// pass not submitted yet during this session (since browser open and site visit). We go to the page for the user to enter pass.
		var parts = String(document.location.href).split("/");
		var page = passwordPage+"?"+parts[parts.length-1];
		document.location.href = page;
	}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}