// JavaScript Document
<!--
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}


// modified to handle both formmail and multiple email addresses
function noSpam() {
	var link = noSpam.arguments[0]; // text for the link
	var subject = noSpam.arguments[1]; // if there's a subject line to the message

	var myat = String.fromCharCode(64);   // @
	var mydot = String.fromCharCode(46);  // .
	var addr = '';

	// starting from the third argument,
	// read the segments and build the address:
	var i;
	var position = 0; // used to check progress to add @ dot comma
	for (i = 2; i < noSpam.arguments.length; i++) {
		if (position == 3) { // must be another email address so reset this and add comma
			position = 0;
			addr += ',';
		}
		if (position) {
			// check whether this element (any but the first)
			// comes after the @ or a dot:
			addr += (position == 1) ? myat : mydot;
		}
		addr += noSpam.arguments[i];
		position++;
	}

	var str = '';
	if (link) {
		if (link== 'formmail') {
			// you could break this down further so that
			// the 'recipient' is less apparent:
			str = '<INPUT TYPE=hidden NAME="recipient" VALUE="';
			
			str += addr;
			str += '">';
		}
		else {
			// you could break this down further so that
			// the 'mailto' is less apparent:
			str = '<a href="mailto:' + addr;
			
			if (subject) {
				// code to display the subject
				str += '?subject=' + subject;
			}
			
			str += '">';
	
			// if the first argument was literally 'addr', the text for the link
			// is the address itself, otherwise it's the text of the argument:
			str += (link == 'addr') ? addr : link;
			
			str += '<\/a>';  // close the tag
		}
	}
	else {
		// if the first argument is '' just print the address
		// without making it a link at all:
		str = addr;
	}

	document.write (str);
}
//-->

// open pop-up window
function openPopup(mylink, windowname, width, height, attrib)
{
	if (! window.focus) return true;
	var href;
	var w;
	if (!attrib) attrib=',scrollbars=yes,resizable=yes';
	if (!width) width=540;
	if (!height) height=480;
	if (typeof(mylink) == 'string') {
		href=mylink;
	} else {
		href=mylink.href;
	}
	w=window.open(href, windowname, 'width='+width+',height='+height+attrib);
	w.focus();
	return false;
}
