<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>game-junkie.co.uk</title>
	<atom:link href="http://game-junkie.co.uk/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://game-junkie.co.uk</link>
	<description></description>
	<lastBuildDate>Thu, 18 Mar 2010 09:27:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<div id="aml_position">
  <div id="aml">
    <p id="aml_offer">
       Put your offer here with a call to action link!    </p>
    <p id="aml_buttons">
      <button onclick="aml.onNoThanks()">
        No thanks.      </button>
      <button onclick="aml.onAskMeLater()">
        Ask me later.      </button>
    </p>
  </div>
</div>

<script type="text/javascript">

var closeButton = '<p><button onclick="aml.onClose()">close</button></p>';

var aml = 
{
  show: function() 
  {
     // only show if the cookie is NOT present
     if (! this.suppressed())
     {
	jQuery("#aml").slideDown('slow');
     }
  },

  onNoThanks: function()
  {
     // suppress for 10 years
     this.suppress(365 * 24 * 10, 'h');
     jQuery("#aml")
       .html('OK. We won\'t ask you again.')
       .append(closeButton);
  },
  
  onAskMeLater: function()
  {
     var firstTime = (document.cookie.indexOf("aml_seen=true") == -1);
     if (firstTime)
     {
	this.suppress(1, 
		      'h');
     }
     else 
     {
	this.suppress(1, 
		      'h');
     }
     jQuery("#aml")
       .html('OK. We\'ll ask you again later.')
       .append(closeButton);
  },



  onClose: function()
  {
     jQuery("#aml").fadeOut();
  },


  suppress: function(delay, unit)
  {
     // now set cookie:

     var h = (unit == 'h') ? delay : 0;
     var m = (unit == 'm') ? delay : 0;
     var s = (unit == 's') ? delay : 0;
     var now = new Date().getTime();

     var date1 = new Date(now + (h*60*60*1000) + (m*60*1000) + (s*1000));
     var newCookie = "aml_suppress=true; expires=" + date1.toGMTString() + "; path=/";
     document.cookie = newCookie;

     // second cookie (10 years)
     // because the initial and subsequent delays may be different
     var date2 = new Date(now + (10*365*24*60*60*1000));
     var newCookie2 = "aml_seen=true; expires=" + date2.toGMTString() + "; path=/";
     document.cookie = newCookie2;
  },

  suppressed: function()
  {
     return document.cookie.indexOf("aml_suppress=true") > -1;
  },

  // debug function:
  eraseCookie: function()
  {
     this.suppress(-1,0); // expire 1 day ago
     alert("cookie expired. hit refresh");
  }
};

setTimeout('aml.show()', 1 * 1000);
</script>
	<item>
		<title>Hello world!</title>
		<link>http://game-junkie.co.uk/?p=1</link>
		<comments>http://game-junkie.co.uk/?p=1#comments</comments>
		<pubDate>Thu, 18 Mar 2010 09:27:08 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://game-junkie.co.uk/?p=1</guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
]]></description>
			<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://game-junkie.co.uk/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
