function validateEmailForm(f) {
	if((f.add_email.value == '') || (f.add_email.value == 'Your email here') || (!emailIsValid(f.add_email.value))) {
		alert("Please enter a valid email address to register for updates.");
		f.add_email.focus();
		return false;
	}
	return true;
}
function emailIsValid(e) {
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(e)) return true;
	else return false;
}


function fadeImage(i,t) {
	pn_um = document.getElementById(i);
	pn_um.onclick = function () {
		clearTimeout(fadeTimeOut);
		fadeElement(pn_um,10,100);
	}
	fadeTimeOut = setTimeout('fadeElement(pn_um,10,100);', t * 1000);
}
function unFadeImage(i) {
	pn_um = document.getElementById(i);
	unFadeElement(pn_um,10,100);
	//setTimeout('fadeElement(pn_um,-10,100);', t * 1000);
}
function fadeElement(el, step, msecs) {
	var to = 0;
	if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5) {
		if(parseInt(document.getElementById(el.id).style.MozOpacity) == 0) return;
		step = step/100;
		step = parseInt(step * 100)/100;
		for(i = 1; i >= 0; i = parseInt((i - step)*100)/100) {
			to = to + msecs;
			self.setTimeout('document.getElementById("' + el.id + '").style.MozOpacity = ' + i + ';',to);
		}
		to = to + msecs;
		self.setTimeout('document.getElementById("' + el.id + '").style.display = "none";',to);
	} else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4) {
		if(el.filters.alpha.opacity == 0) { return; }
		for(i = 100; i >= 0; i = parseInt((i - step)*100)/100) {
			to = to + msecs;
			setTimeout('document.getElementById("' + el.id + '").filters.alpha.opacity = ' + i + ';',to);
		}
		to = to + msecs;
		self.setTimeout('document.getElementById("' + el.id + '").style.display = "none";',to);
	}
}
function unFadeElement(el, step, msecs) {
	var to = 0;
	if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5) {
		if(parseInt(document.getElementById(el.id).style.MozOpacity) == 100) return;
		self.setTimeout('document.getElementById("' + el.id + '").style.display = "inline";',to);
		to = to + msecs;
		step = step/100;
		step = parseInt(step * 100)/100;
		for(i = 0; i <= 1; i = parseInt((i + step)*100)/100) {
			to = to + msecs;
			self.setTimeout('document.getElementById("' + el.id + '").style.MozOpacity = ' + i + ';',to);
		}
	} else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4) {
		if(el.filters.alpha.opacity == 100) { return; }
		self.setTimeout('document.getElementById("' + el.id + '").style.display = "inline";',to);
		to = to + msecs;
		for(i = 0; i <= 100; i = parseInt((i + step)*100)/100) {
			to = to + msecs;
			setTimeout('document.getElementById("' + el.id + '").filters.alpha.opacity = ' + i + ';',to);
		}
	}
}