function GetCookieData ()
{
	var idx = document.URL.indexOf ('?');
	var referID = "";
	if (idx != - 1)
	{
		var pairs = document.URL.substring (idx + 1, document.URL.length);
		var wtString = pairs.substring (0, 16);
		referID = wtString.substring (9, 16);
	}
	var id = GetCookie ('LetSureReferID');
	if (id == null || id == "")
	{
		createCookie ('LetSureReferID', referID, 1);
	} 
	else //get cookie
	
	{
		//alert("cookie found");
		//alert(id);
		
	}
}
function createCookie (name, value, days)
{
	if (days)
	{
		var date = new Date ();
		date.setTime (date.getTime () + (days * 24 * 60 * 60 * 1000));
		var expires = "; expires=" + date.toGMTString ();
	} 
	else var expires = "";
	document.cookie = name + "=" + value + expires + "; path=/";
}
function SetCookie (name, value, expires, path, domain, secure)
{
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" + expires.toGMTString ())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}
function GetCookie (name)
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
	{
		var j = i + alen;
		if (document.cookie.substring (i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf (" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}
function getCookieVal (offset)
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == - 1)
	endstr = document.cookie.length;
	return unescape (document.cookie.substring (offset, endstr));
}

function chklandlord ()
{
	
	if (frmApplicationNewCustomer.howfoundus.value == "EdinburghAccreditation")
	{
		frmApplicationNewCustomer.letsure_agt.value = "05000003";
	} 
		
	else 
	{
		
		if  (frmApplicationNewCustomer.howfoundus.value == "WestBromBS")
		{
			frmApplicationNewCustomer.letsure_agt.value = "05000004";
		}
		
		else 
		{
		frmApplicationNewCustomer.letsure_agt.value = "05000001";
		}
	}
}	



