
// URL and style of pop up
function launch_popUp(){
	
	/* 10/09/07 CMM */
	
	var myURL = "http://www.investorwords.com/todpopnew.html";
	var myFrame = document.createElement('iframe');
	myFrame.src = myURL; /* setAttribute('src', myURL); */
	myFrame.width = '290'; /* setAttribute('width', 290); */
	myFrame.height = '498'; /* setAttribute('height', 498); */
	myFrame.setAttribute('frameborder', 0);
	myFrame.scrolling = 'no'; /* setAttribute('scrolling', 'no'); */
	myFrame.marginheight = '0'; /* setAttribute('marginheight', 0); */
	myFrame.marginwidth = '0'; /* setAttribute('marginwidth', 0); */
	
	var closeText = document.createTextNode('click to close');
	var closeMessage = document.createElement('span');
	closeMessage.appendChild(closeText);
	
	var closeBox = document.createElement('span');
	closeBox.onclick = function() {
		var nlPop = document.getElementById('nlPop');
		nlPop.className = 'nlPopHide'; /* setAttribute('class', 'nlPopHide'); */
		document.body.removeChild(nlPop);
	};
	closeBox.className = 'closeBoxSpan'; /* setAttribute('class', 'closeBoxSpan'); */
	
	var containerDiv = document.createElement('div');
	containerDiv.id = 'nlPop'; /* setAttribute('id', 'nlPop'); */
	containerDiv.className = 'nlPopShow'; /* setAttribute('class', 'nlPopShow'); */
	
	closeBox.appendChild(closeMessage);
	containerDiv.appendChild(closeBox);
	containerDiv.appendChild(myFrame);
	
	document.body.appendChild(containerDiv);

}

// Used as part of getting cookie value(s)
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) {
		endstr = document.cookie.length;
	}
	return unescape(document.cookie.substring(offset, endstr));
}

// Gets entire cookie when cookie name (the key, not the value) matches a substring of the cookie
function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
			return getCookieVal (j);
		}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) {
			break;
		}
	}
	return null;
}

// Sets the cookie; must have ALL 3 parameters!!!!
function SetCookie (name, value, expires) {
	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + expires.toGMTString();
}

// the variable that stores the time/date right now
var now = new Date();
now.setTime(now.getTime());

// the variables that hold the cookie expiration dates
// *** THIS IS WHAT YOU CHANGE IF YOU WANT TO CHANGE THE POP UP SCHEDULE ***
var TODcookieexpire = new Date();
TODcookieexpire.setTime(TODcookieexpire.getTime() + (7*24*60*60*1000)); // The number at the beginning (7) is days

// If they haven't seen it: 
// 1) Set a cookie saying they've seen it set to expire at the time above
// 2) Launch the pop up using the URL and style designated in launch_popUp()
if (GetCookie("TODcookie")) {} 
else {
	SetCookie("TODcookie","yesexists",TODcookieexpire);	
	 launch_popUp();
}<!-- 
  
 -->