// Handles rollover images for NN3+ and IE4+
var loaded = new Array();
function LoadButtons(image,imageName) {
	if (image && image.src && (null == image.out || typeof(image.out) == typeof(void(0)))) {
		s = image.src;
		image.out = new Image();
		image.out.src = s;
		image.over = new Image();
		if (imageName.lastIndexOf('/') >= 0) {
			s = imageName;
		} else {
			i = s.lastIndexOf('/');
			if (i<0) { s = imageName; }
			else	 { s = s.substring(0,i+1) + imageName; }
		}
		image.over.src = s;
		loaded[image.name] = image;
	}
}
function roll(imageName,over) {
	if (document.images) {
	if (over) { imageObject = "over"; }
	else	  { imageObject = "out"; }
	image = loaded[imageName];
	if (image) {
		ref = eval("image."+imageObject);
		if (ref) image.src = eval("image."+imageObject+".src");
	}
//This bit is for IE4 which doesn't support the NS event model
	if (window.event) window.event.cancelBubble = true;
	}
}

var helpwin=null;
function showhelp() {
	if ((helpwin==null) || (helpwin.closed)) {
		helpwin = window.open('helpfiles/help.html', 'Help', 'width=400,height=400');
	}else{
		helpwin.focus();
	}
}
//popup window routine takes 4 args - window name, url to load, width,height
function popwin(wname,url,w,h) {
	siz = "width="+w+",height="+h+",scrollbars,resizable";
	var wp=window.open(url, wname, siz);wp.focus();
}

function rusure(fname,msg){
	var a, put;
	a=window.confirm(msg);
	if(a){put='document.'+fname+'.submit()';eval(put);}
}

function adcheck(fname) {
	var put ;
	var n = 'document.'+fname+'.nstr.value';
	var n1 = eval(n);
	var a = 'document.'+fname+'.address1.value';
	var a1 = eval(a);
	var t = 'document.'+fname+'.town.value';
	var t1 = eval(t);
	if (n1.length == 0) {
		alert('You must enter a name !') ;
	}
	else if (a1.length == 0) {
		alert('You must enter the first address line !') ;
	}
	else if (t1.length == 0) {
		alert('You must enter a town !') ;
	}
	else {
		put='document.'+fname+'.submit()';
		eval(put);
	}
}

function ncheck(fname) {
	var put ;
	var F = 'document.'+fname+'.forename.value';
	var F1 = eval(F);
	var L = 'document.'+fname+'.lastname.value';
	var L1 = eval(L);
	if (F1.length == 0 && L1.length == 0) {
		alert('You must enter either \n a forename\n or a lastname\n or both !') ;
	}
	else {
		put='document.'+fname+'.submit()';
		eval(put);
	}
}

