// JavaScript Document
//on dom ready...
window.addEvent
(
	'domready', function()
	{
		if ( $chk($$('.dnsa')) )
		{
			$$('.dnsa').addEvent
			(
				'click',function(e)
				{
					removePop();
					e.stop();
				}
			);
		}
		if ( $chk($$('.closednsa')) )
		{
			$$('.closednsa').addEvent
			(
				'click',function(e)
				{
					$$('.popcenter').hide();
					e.stop();
				}
			);
		}
	}
)

function removePop()
{
	//doWorking();
	var xmlHttp;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function()
	{
		if( (xmlHttp.readyState == 4) && (xmlHttp.status == 200) )
		{
			var result = xmlHttp.responseText;
			var sr = result.split(":");
			var success = sr[0];
			//success = success.replace("\n","");
			var msg = sr[1];
			if ( success == "1" )
			{
				$$('.popcenter').hide();
			}			
			//setResponseMessage(msg);
			//stopWorking();
		}
	}
	
	data = "dnsp=1";
	
	xmlHttp.open("POST","/myaccount/do_not_show_pop.php",true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", data.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(data);
	//xmlHttp.send(null);
}
