// domains updated 06/2011
	var valid_domains = new Array ('ac', 'ad', 'ae', 'aero', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'aq', 'ar', 'arpa', 'as', 'asia', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'biz', 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cat', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'com', 'coop', 'cr', 'cu', 'cv', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'edu', 'ee', 'eg', 'er', 'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb', 'gd', 'ge', 'gf', 'gg', 'gh', 'gi', 'gl', 'gm', 'gn', 'gov', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'info', 'int', 'io', 'iq', 'ir', 'is', 'it', 'je', 'jm', 'jo', 'jobs', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'me', 'mg', 'mh', 'mil', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'museum', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'name', 'nc', 'ne', 'net', 'nf', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'org', 'pa', 'pe', 'pf', 'pg', 'ph', 'pk', 'pl', 'pm', 'pn', 'pr', 'pro', 'ps', 'pt', 'pw', 'py', 'qa', 're', 'ro', 'rs', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sj', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'st', 'su', 'sv', 'sy', 'sz', 'tc', 'td', 'tel', 'tf', 'tg', 'th', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tp', 'tr', 'travel', 'tt', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws', 'xn', 'xxx', 'ye', 'yt', 'za', 'zm', 'zw');

function domain_in_array (domain) {
	for (a in valid_domains) {
		if (valid_domains[a] == domain) return (true);
		}
	return (false);
	}

function validate_email(addr) {
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
		if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
			alert('We could not validate your email address:\n> email address contains invalid characters');
			return false;
			}
		}
	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
		alert('We could not validate your email address:\n> email address must contain an "@"');
		return false;
		}
	if (atPos == 0) {
		alert('We could not validate your email address:\n> email address must not start with "@"');
		return false;
		}
	if (addr.indexOf('@', atPos + 1) > - 1) {
		alert('We could not validate your email address:\n> email address can contain only one "@"');
		return false;
		}
	if (addr.indexOf('.', atPos) == -1) {
		alert('We could not validate your email address:\n> email address must contain a "." in the domain name');
		return false;
		}
	if (addr.indexOf('@.',0) != -1) {
		alert('We could not validate your email address:\n> "." must not immediately follow "@" in email address');
		return false;
		}
	if (addr.indexOf('.@',0) != -1) {
		alert('We could not validate your email address:\n> "." must not immediately precede "@" in email address');
		return false;
		}
	if (addr.indexOf('..',0) != -1) {
		alert('We could not validate your email address:\n> two "." must not be adjacent in email address');
		return false;
		}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if ((suffix.length < 2) || (((suffix != 'museum') && (suffix != 'travel')) || (suffix.length > 4)) && (!domain_in_array(suffix))) {
	alert (suffix);
		alert('We could not validate your email address:\n> invalid primary domain in email address (e.g. ".com")');
		return false;
		}
	return true;
	}
	
function getExplorerVersion () {
    var browser=navigator.userAgent;
    var tmp = browser.indexOf('MSIE');
    version = 0;
    if (tmp != -1) {
        version = parseFloat(browser.substring(tmp + 4));
        }
    return (version);
    } 
	
function emptyCheck (str) {
	tmp = document.getElementById(str).value;
	document.getElementById(str).value = tmp.replace(/^[ \t]+|[ \t]+$/g, "");
	return;
	}
