/* set date to at least two days after the message is done as this is the expiration date of the cookie, not the done date of the message and we want the cookie to contiue to block the message until we take it down */

var qpexpiration_date = new Date("January 1, 2018");  
qpexpiration_date = qpexpiration_date.toGMTString();

/*function setCookie(cookieName, cookieValue, cookieExpires, cookiePath, cookieDomain)  
{ 
	cookieValue = escape(cookieValue);
	document.cookie = cookieName + "=" + cookieValue + "; expires=" + cookieExpires + "; path=" + cookiePath + "; domain=" + cookieDomain;
}*/

function getCookie(name)
{ 
	var cookieString = document.cookie;
	var index = cookieString.indexOf(name + "=");

	if (index == -1)
		{ return null; }

	index = cookieString.indexOf("=", index) + 1;
	var endstr = cookieString.indexOf(";", index);

	if (endstr == -1) 
		{ endstr = cookieString.length; }

	return unescape(cookieString.substring(index, endstr));
}


function qpspecialMessage()
{ 
	var pagesviewed = getCookie('NewQPMessage');
	if (pagesviewed != 'shown') // if the user has seen the popup do not show it again.
	{ 
		window.open("http://www.asq.org/new-qp-message.html","message","menubar=no,width=495,height=300,toolbar=no");
		document.cookie = 'NewQPMessage=shown;expires=' + qpexpiration_date + ';path=/;domain=asq.org';
	}
}
