<!--
function ReadCookie (CookieName) {
  var CookieString = document.cookie;
  var CookieSet = CookieString.split (';');
  var SetSize = CookieSet.length;
  var CookiePieces
  var ReturnValue = "";
  var x = 0;

  for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {

    CookiePieces = CookieSet[x].split ('=');

    if (CookiePieces[0].substring (0,1) == ' ') {
      CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
    }

    if (CookiePieces[0] == CookieName) {
      ReturnValue = CookiePieces[1];
    }
	return ReturnValue;
  }
  document.forms[0].elements[1].value = ReturnValue;
  return null;
}

function WriteCookie (refPage) 
{	
  var oneDay= 1*24*60*60*1000;
  var expDate = new Date();
  expDate.setTime (expDate.getTime() + oneDay);
  var cookieExpires = expDate.toGMTString();

  if (document.cookie.length>0)
  {
	if ((ReadCookie("resolution") == "") || (ReadCookie("resolution") != screen.width))
	{
		var expDate = new Date();
		expDate.setTime (expDate.getTime() + (2678400000));
    	document.cookie = "resolution" + "=" + escape (screen.width) + "; expires=" + expDate.toGMTString();
	}
  }
  else
  {
  	// Only redirect if the page is on our domain i.e. not the Google cached version.
	if (window.location.href.indexOf("http://www.moneysupermarket.com") > -1)
	{
		if (window.location.href.indexOf("/nocookies.asp") == -1) // Stop infinite looping once on nocookies.asp.
		{
			window.location.href = (arguments.length == 0) ? "/nocookies.asp" : "/nocookies.asp?loc=" + refPage;
		}
	}
  }
}

//This executes the WriteCookie function to check the browser has cookies enabled.

WriteCookie(this.location.href);
//-->