<!-- Copyright 2003 Bontrager Connection, LLC
// Code obtained from http://willmaster.com/possibilities/

var CookieName = 'TargetLink';
document.writeln('<form name="targetlinks">');
document.writeln('<input type="checkbox" name="tlcb" onClick="Links()">');
document.writeln('Open links in a new window');
//document.writeln('</form>');

function GetCookie() {
var Cc = '';
if(document.cookie.length > 0) {
	var Cn = CookieName + '=';
	var Cb = document.cookie.indexOf(Cn);
	var Ce = 0;
	if(Cb > -1) {
		Cb += Cn.length;
		Ce = document.cookie.indexOf(";",Cb);
		if(Ce < Cb) { Ce = document.cookie.length; }
		Cc = document.cookie.substring(Cb,Ce);
	}
}
return Cc;
} // end of function GetCookie()

function SetCookie(value) {
var v = 'no';
if(value == true) { v = 'yes'; }
var oldval = GetCookie();
if(oldval == v) { return; }

//Set expiry date (Thejo - 7th Jan, 2006)
var date = new Date();
date.setTime(date.getTime()+(365*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
		
document.cookie = CookieName + '=' + v + expires + '; path=/';
} // end of function SetCookie()

function Links() {
var dest = '_self';
if(document.targetlinks.tlcb.checked == true) {
	dest = '_blank';
	SetCookie(true);
	}
else { SetCookie(false); }
var numlinks = document.links.length - 1;
for(var i = 0; i <= numlinks; i++)
	{ 
		var linkobj=document.links[i].href
		 if ( linkobj.indexOf("javascript:") ==-1 && linkobj.indexOf("#") ==-1){
			document.links[i].target = dest;
		}
	}
} // end of function Links()

function CheckBoxCheck() {
var valid_cookie = GetCookie();
if(valid_cookie == 'yes') {
	document.targetlinks.tlcb.checked = true;
	Links();
	}
else {
	document.targetlinks.tlcb.checked = false;
	Links();
	}
} // function CheckBoxCheck() 

setTimeout('CheckBoxCheck()',3000);