function clearText(thefield)	{
	if (thefield.defaultValue == thefield.value)
		thefield.value = "";
	}

function openWindow(url,w,h) {
	adviceWin = window.open(url,'advice','status=no,width='+w+',height='+h+',menubar=no,scrollbars=yes');
	adviceWin.focus(true);
	}


/* for old school slideshow */
function iList () {
	this.name = '';
	this.img = new Array();
	this.url = new Array();
	this.zum = new Array();
	this.pause = new Array();
	this.last = null;
	this.current = null;
	this.defaultpause = 2000;
	this.buttons = false;
	this.stopped = false;
	this.loaded = false;
	this.startstop = false;
}
function iLoad (i) {
	if (i.loaded == true) { return; }
	i.loaded = true;
	iRotate(i);
}
function iLink (i) {
	if (!i.loaded) { return; }
	if (typeof(i.url[i.current]) != "undefined") { window.location.href = i.url[i.current]; }
	else if (typeof(i.zum[i.current]) != "undefined") { zoom(i.zum[i.current]); }
	else if (i.startstop) { iSwitch(i); }
}
function iSwitch (i) {
	if (!i.loaded) { return; }
	if (i.stopped) { i.stopped = false; iRotate(i); }
	else { i.stopped = true; }
}
function iRotate (i) {
	if (i.stopped) { return; }
	iNext(i);
	var pause = i.defaultpause;
	if (typeof(i.pause[i.current]) != "undefined") { pause = i.pause[i.current]; }
	setTimeout("iRotate("+i.name+")",pause);
}
function iNext (i) {
	if (!i.loaded||!document['image_'+i.name]) { return; }
	if (i.buttons) { document['form_'+i.name].nextButton.value = "Loading..."; }
	i.current++; if (i.current > i.last) { i.current = 0; }
	document['image_'+i.name].src = i.img[i.current].src;
	if (i.buttons) { document['form_'+i.name].nextButton.value = "Next Image"; }
}
function iPrev (i) {
	if (!i.loaded||!document['image_'+i.name]) { return; }
	if (i.buttons) { document['form_'+i.name].prevButton.value = "Loading..."; }
	i.current--; if (i.current < 0) { i.current = i.last; }
	document['image_'+i.name].src = i.img[i.current].src;
	if (i.buttons) { document['form_'+i.name].prevButton.value = "Previous Image"; }
}
function zoom (url) {
	z = window.open('','zoom_popUp','status=0,directories=0,toolbar=0,menubar=0,resizable=1,scrollbars=1,location=0');
	z.document.write("<html>\n<head>\n<title>Picture Zoom</title>\n</head>\n<body>\n<div align=\"center\">\n<img src=\"" + url + "\"><br>\n<form><input type=\"button\" value=\"Close Window\" onClick=\"self.close(true)\"></form>\n</div>\n</body>\n</html>\n");
	z.document.close();
	z.focus(true);
}
