// Checks for a cookie showing last accessed time, if not present or not within period, does action showing popup notice //
// The cookie we are checking is set by code in the file popup1.htm 
//NOT WORKING PROPERLY, SO RELYING ON CODE DIRECTLY IN EACH FILE//
function fDoActionBasedOnCookie(){

alert("Cookie value is: " + readCookie(popup1));

If (readCookie(popup1) !== "showedpopupthissession")
{
	fShowPopup;
}

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 createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function fShowPopup(){

    var w = screen.width/1.2;
	var h = screen.height/1.7;
	var Xpi = ((screen.width - (screen.width/1.2))/2);
	var Ypi = ((screen.height - (screen.height/1.2))/4);

	self.name="parent_window";
	thePopup = "popup1.htm";
	
	var newwin = window.open(thePopup, "disclaimer", "width=600,height=300,scrollbars=yes,status=no,height="+h+",width="+w+",screenX="+Xpi+",screenY="+Ypi+",top="+Ypi+",left="+Xpi+"")
	
}




}


