
var ArisMail = Aris.extend(null,{
	pageReady: function (contId) {
		var a = document.getElementsByTagName('a');
		forEach(a, this.popUpSafe);
	},
	inputFocus: function() {
		if (this.getAttribute('oldval') == null){
			this.setAttribute('oldval',this.value);
			this.value = '';
		} else {
			this.select();
		}
	},
	inputBlur: function() {
		if (this.value == '')
			this.value = this.getAttribute('oldval');
	}, 
	popUpSafe: function(a) {
		var _onSite = /(aristotle\.net)|(arismail\.com)|(javascript:)|(localhost)/i;
		var _files = /\.(pdf|doc)/i;
		var _rels = "external,webmail";
		
		
		if ( ( a.href.length > 0 && (  !(_onSite.test(a.href)) || _files.test(a.href) ) )|| (a.rel.length > 0 && _rels.indexOf(a.rel) > -1) ) {
			a.onclick = function() { return !Aris.popWin(this.href); }	
		}
		else if (a.rel.indexOf(':') > 0) {
			a.onclick = function(e) { args = this.rel.split(':'); return !Aris.popWin(this.href,args[0],args[1],args[2]);  }
		}
	}
});
