<!-- 
var valid = 0
if (window.screen)	
{ 
	var wide = window.screen.width;
	var height  = window.screen.height;
}
if (navigator.appName=="Microsoft Internet Explorer") 
{
	if (navigator.cookieEnabled==true) 
	{
		var cook = 1;
	}
	else
	{
		var cook = 2;
	}
}
else 
{
	var cook = 3;
}

function getCookieVal (offset) 
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		Endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

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 SetCookie (name, value) 
{
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}

function DeleteCookie(name) 
{
	var exp = new Date();
	FixCookieDate (exp); // Correct for Mac bug
	exp.setTime (exp.getTime() - 1); // This cookie is history
	var cval = GetCookie (name);
	if (cval != null)
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function check() 
{
	//document.write("We are on IB log off page");
	if (valid != 1) 
	{
		// IMPORTANT Reset cookie name in next line to "clientname+survey"
		if (GetCookie("ibcsurvey") != 1)
		{
			//  IMPORTANT Set nth to reflect the proportion of visitors to be sampled. Currently set to smaple everyone for testing
			//  For example if sampling every 10th person set var nth = 10 (value 1->1000 only)
			//  frequency temporarily set to 65 from 650 for KE00010678, reverted (back to 650) under same KE Jan 2008
			var nth = 181;
			today = new Date();
			randomnum = today.getTime();
			randomnum = Math.round(Math.abs(Math.sin(randomnum) * 1000000)) % 1000;
			if ((randomnum + 1) * nth /1000 <= 1) 
			{
				var expdate = new Date();
				//  IMPORTANT Reset next line to 30*24*60*60*1000 before using if a 30 day cookie required. Currently set to <1 second for testing 
				//expdate.setTime(expdate.getTime() + ( 90 * 24 * 60 * 60 * 1000));
				expdate.setTime(expdate.getTime() + ( 60 * 1000));
				// IMPORTANT Reset cookie name in next line to "clientname+survey"
				SetCookie("ibcsurvey","1",expdate);
				browserVer = parseInt(navigator.appVersion);
				// IMPORTANT: Set the location of the survey in the next line. 
				// Live URL
				HB=window.open("http://survey.euro.confirmit.com/wi/p3640860/i.asp?c=1&w="+wide+"&h="+height+"&k="+cook,"ibcsurveypopup","toolbar=no,width=550,height=440,left=20,top=20,directories=no,status=no,scrollbars=yes,resize=no,menubar=no");
				if( browserVer >= 4) {
					window.focus() ;
     				}
			}
		}
	}
}
//-->

