			var count = 0;
			var surveyShown = false;

			var tID, tIT;

			function openSurvey()
			{
				try
				{
					window.open ("http://www.rocketsciencesurveys.co.uk/akira/TakeSurvey?id=1027703","NomadSurvey","scrollbars=yes,status=no,resizeable=yes,height=650,width=850,left=100,top=50,");
					set_cookie("submitted",true,2);
				}
				catch(e)
				{
				}
			}

			function hideSurvey()
			{
				document.getElementById("Survey2").style.display = 'none';
				//write a cookie to say user has been shown the survey window
				set_cookie("submitted",true,2);

				clearInterval(tIT);
			}

			function Timer()
			{

			  count++;

			  if (count >= 2) //ie 20 seconds
			  {
			  	var c = get_cookie("submitted");

			  	if (c)
			  	{
					if (c == "false")
					  	document.getElementById("Survey2").style.display = 'inline';
				}
				else
				{	//cookie has never been set
					set_cookie("submitted",false,2);
				}

			  }
			}

			function StartInterval()
			{
				tIT = setInterval('Timer()',10000);
			}

			function set_cookie(name,value,days)
			{
				var expires;

				if (days)
				{
					var date = new Date();
					date.setTime(date.getTime()+(days*24*60*60*1000));
					expires = "; expires="+date.toGMTString();

				}
				else expires = "";

				document.cookie = name + "=" + value + expires + "; path=/";
			}

			function get_cookie(name)
			{
				var nameEQ = name + "=";
				var cookieBits = document.cookie.split(";");

				for (var i=0;i<cookieBits.length;i++)
				{
					c = cookieBits[i];
					while (c.charAt(0) == ' ')
						c = c.substring(1,c.length);

					if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
					//document.write(i + " " + cookieBits[i]);
				}

				return null;
			}

			function erase_cookie(name)
			{
				get_cookie(name,"",-1);
			}


			function writeSurveyDiv()
			{
				var s;

				s = '<div id="Survey2" style="position:absolute;top:200px;left:250px;width:350px;height:150px;border-width:20px 3px 3px 3px;border-color:#B66532;border-style:solid;z-index:502;display:none;background-color:#FFFFFF;filter:alpha(opacity=80,style=3,finishopacity=90)">';
				s += '<h1 style="margin:0;padding:0">User survey</h1>';
				s += '<p style="margin:10px">';
				//s += 'As a valued user of this site, we\'d like you to take a few minutes to let us know what you think of our site';
				s += 'As a valued user of Local Information Systems, we\'d like you to take a few minutes to take part in a short survey on behalf of the Department for Communities and Local Government.';
				s += '</p>';
				s += '<p>';
				s += '<span style="text-align:center;width:100%"><a href="javascript:hideSurvey()">No thanks, not now.</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:openSurvey();hideSurvey()">Yes, i\'d like to read more</a></span>';
				s += '</p>';
				s += '</div>';

				return s;
			}

