/*
=========================================================
NorthWise Services website - JavaScript Redirect 2 script

Redirects users to a preferences page on first visit and
then to the desired website on subsequent visits
=========================================================
-----------------------------------------------------
            Script written by Chris Hansen
		  http://www.ngweb.biz/people/chris/
		  
   Modified by Robin North for pFusion:Design 2005
              www.pfusion-design.co.uk
                www.robinnorth.co.uk
------------------------------------------------------
*/

<!--
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 "";
}

expDays = 365;
exp = new Date();
exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000));

function SetCookie(name, value)
{
document.cookie = name + "=" + escape(value) + "; expires=" + exp.toGMTString();
}

var nz = GetCookie("nz")

if (nz!="12" || nz!="ok2"){
SetCookie("nz", "12");
}

if (nz=="12" || nz=="ok2"){
SetCookie("nz", "ok2");
}

var nz = GetCookie("nz")

if (nz=="12"){
// Destination of user for first visit
window.location = "../nws_site_preferences.html";
}

if (nz=="ok2"){
// Destination of user for subsequent visits
window.location = "home.php";
}
// -->