// onload handler
var doOnload = function() {
	initInputFields();
	soopaRolloverSetup();
	
}
window.onload = doOnload;


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// fancy search field auto-clearing

var fieldFocus = function() {
	if (this.value == this.title) {
		this.value = '';
		this.style.color = '#000000';
	}
}
var fieldBlur = function() {
	if ((this.value == this.title) || (this.value == '')) {
		this.value = this.title;
		this.style.color = '#999999';
	}
}
function initInputFields() {
	if (! document.getElementById) return;
	
	var keywords = document.getElementById('keywords');
	if (keywords) {
		keywords.onfocus = fieldFocus;
		keywords.onblur = fieldBlur;
		keywords.onblur();
	}
	
	var email = document.getElementById('alertsemail');
	if (email) {
		email.onfocus = fieldFocus;
		email.onblur = fieldBlur;
		email.onblur();
	}
}


// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// easiest rollovers on earth, baby!
// see www.youngpup.net for documentation.
//
// altered by nate cook for xhtml compliance

function soopaRolloverSetup() {
	var img, sh, sn, sd;
	
	for (var i = 0; (img = document.images[i]); i++) {
		if (img.className == "roll") {
			img.n = new Image();
			img.n.src = img.src;

			img.h = new Image();
			img.h.src = img.src.substring(0,img.src.length - 4) + "_o.gif";
			img.onmouseover = soopaSwapOn;
			img.onmouseout  = soopaSwapOff;
		}
	}
}

function soopaSwapOn() {
	this.src = this.h.src;
}

function soopaSwapOff() {
	this.src  = this.n.src;
}
