//This places a persistent cookie on the visitors PC to enable tracking of their movement (IE 4.0, Netscape 4.0 and above)
var allcookies = document.cookie;
var pos = -1;
if (allcookies != '') {
	pos = allcookies.indexOf("SM");
}
if (pos == -1){	
	var nextyear = new Date();
	var encryptDate = new Date();
	nextyear.setFullYear(nextyear.getYear() + 1);
	var content = "";
	var randomNo = Math.round(Math.random()*999999);
	var datetime = encryptDate.getTime()
		
	content = "" + datetime + randomNo + "";
	content += "; expires=" + nextyear.toUTCString();
	content += "; path=/";
	content += "; domain=.tesco.ie";
	document.cookie = "SM=" + content;
	}
