function _SM_getCookie(NameOfCookie) 
{ 
  if (document.cookie.length > 0)
  {
	var begin = document.cookie.indexOf(NameOfCookie+"="); 
	if (begin != -1)
	{ 
		begin += NameOfCookie.length+1;
		var end = document.cookie.indexOf(";", begin); 
		if (end == -1) end = document.cookie.length; 
		return unescape(document.cookie.substring(begin, end)); 
	} 
  } 
  return null; 
} 

function _SM_setCookie(NameOfCookie, value, expiredays) 
{ 
	var ExpireDate = new Date (); 
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000)); 
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()); 
} 

function _SM_setAllCookie(NameOfCookie, value, expiredays) 
{ 
	var ExpireDate = new Date (); 
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000)); 
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()); 
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; domain=streetmap.co.uk; expires=" + ExpireDate.toGMTString()); 
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; domain=www.streetmap.co.uk; expires=" + ExpireDate.toGMTString()); 
} 
