function swapImage(id,caption) {
	document.getElementById('main_'+currentImage).style.display = 'none';
	document.getElementById('main_'+id).style.display = 'inline';
	document.getElementById('image-caption').innerHTML = caption;
	currentImage = id;
}

function fnValidateEmailSignup(f){
	if (IsEmpty(f.Email_Name.value)){
		alert('Please enter your name to continue.');
		f.Email_Name.focus();
		return false;
	}
	
	if (!IsValidEmail(f.Email_Email.value)){
		alert('Please enter a valid email address to continue.');
		f.Email_Email.focus();
		return false;
	}
	return true;
}

function IsNumeric(val) {
	var ValidChars = "0123456789.";
	for (i=0; i<val.length; i++) {
		if (ValidChars.indexOf(val.charAt(i)) == -1) return false
	}
	return true
}

function IsEmpty(val) {
	for (i=0; i<val.length; i++) { 
		if (val.charAt(i) != ' ') return false
	}
	return true
}

function IsValidEmail(val) {
	var iLen = val.length;
	if 	((iLen < 6) || (val.indexOf('@') < 1) || ((val.charAt(iLen - 3) != '.') && (val.charAt(iLen - 4) != '.') && (val.charAt(iLen - 5) != '.')) ) return false
	return true
}