

<!-- begin hiding from non-Javascript enabled browsers

// ------------------------------------------------------------------------------
// Function to get the value of the cookie
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

// ------------------------------------------------------------------------------
//  Function to get the cookie
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 to set the cookie info
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 to display the breadcrumbs from the cookie info
function DeleteCookie (name) {
 	var exp = new Date();
 	exp.setTime (exp.getTime() - 1);  // This cookie is history
 	var cval = GetCookie (name);
 	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

// ------------------------------------------------------------------------------
//  Function to display the breadcrumbs from the cookie info
function InitBreadcrumbs() {
	SetCookie("LastURL_1", GetCookie("LastURL_2"),null,"/");
	SetCookie("LastURL_2", GetCookie("LastURL_3"),null,"/");
	SetCookie("LastURL_3", GetCookie("LastURL_4"),null,"/");
	SetCookie("LastURL_4", GetCookie("LastURL_5"),null,"/");
	SetCookie("LastURL_5", document.title,null,"/");

	SetCookie("Last1", GetCookie("Last2"),null,"/");
	SetCookie("Last2", GetCookie("Last3"),null,"/");
	SetCookie("Last3", GetCookie("Last4"),null,"/");
	SetCookie("Last4", GetCookie("Last5"),null,"/");
	SetCookie("Last5", document.location,null,"/");
}

// ------------------------------------------------------------------------------
// Display the breadcrumbs found on the bottom of each page
function DisplayBreadcrumbs () {
	if (GetCookie("LastURL_1") != "null") 
		document.write("> <a class=breadcrumbslink href='", GetCookie("Last1"), "'>", GetCookie("LastURL_1"), "</a> ");
	if (GetCookie("LastURL_2") != "null") 
 		document.write("> <a class=breadcrumbslink href='", GetCookie("Last2"), "'>", GetCookie("LastURL_2"), "</a> ");
	if (GetCookie("LastURL_3") != "null") 
 		document.write("> <a class=breadcrumbslink href='", GetCookie("Last3"), "'>", GetCookie("LastURL_3"), "</a> ");
	if (GetCookie("LastURL_4") != "null") 
 		document.write("> <a class=breadcrumbslink href='", GetCookie("Last4"), "'>", GetCookie("LastURL_4"), "</a> ");
	if (GetCookie("LastURL_5") != "null") 
 		document.write("> <a class=breadcrumbslink href='", GetCookie("Last5"), "'>", GetCookie("LastURL_5"), "</a> ");
}

// ------------------------------------------------------------------------------
// When external links or tools traversed, they are displayed in a popup window. There are 2 types of windows, one for tools and one for external sites.
function popupPage(page,windowstyle) {
	if (windowstyle == 0) {
		windowprops = "height=600,width=800,toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,left=0,top=0";
	} else {
		windowprops = "height=600,width=800,toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,left=0,top=0";
	}
	window.open(page, "Popup", windowprops);
}

// ------------------------------------------------------------------------------
// Fixes the resizing issue in Netscape by reloading the page to fit.
function MM_reloadPage(init) {
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// ------------------------------------------------------------------------------
// Array to hold date values
function isnArray() {
	argnr=isnArray.arguments.length
	for (var i=0;i<argnr;i++) {
		this[i+1] = isnArray.arguments[i];
	}
}

// ------------------------------------------------------------------------------
// Y2K compliant year
function getFullYear(d) {
    var y = d.getYear();
    if (y < 1000) {y += 1900};
    return y;
}

// # ref removed 4 func

// ------------------------------------------------------------------------------
// Random number generator for index banner ads
function randomizeNumber(number) {
	today=new Date();
	jran=today.getTime();
	var random_number=0;
	ia=9301;
	ic=49297;
	im=233280;
	jran = (jran*ia+ic) % im;
	random_number=Math.ceil( (jran/(im*1.0)) *number);
	return random_number;
}
// Following Scripts used to set persitent cookies

function stripCharsInBag (s, bag){
	var i;
	var returnString = "";
	for (i = 0; i < s.length; i++){
		var c = s.charAt(i);
		if (bag.indexOf(c) == -1) returnString += c;
	}
	return returnString;
}

function generateCookie() {
		var now = new Date();
		var dateToday = now.toUTCString();
		var today= stripCharsInBag (dateToday, " ,:");
			today=today.substring(3,today.length - 3)
		var randomNum = Math.floor(Math.random()*15);
		var string1 = today.substring(0, randomNum);
		var string2 = today.substring(randomNum, today.length);
		var randomNum2 = Math.floor(Math.random()*50000);
		var newString = "bns" + string1 +"-"+randomNum2+"-"+string2+now.getMilliseconds();

		return newString;
	}
	
if (GetCookie ('bnsId') == 'null') {
var expDays = 1825;
var expDate = new Date();
expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays)); 
SetCookie('bnsId', generateCookie(), expDate, '/');
}

	var expDays = 1825;
	var expDate = new Date();
	expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays)); 
	// rts20080124 - second parameter to SetCookie is an empty string if no ID
	SetCookie('bnsSID', '', expDate, '/');

// STOP HIDING FROM OTHER BROWSERS -->