/**
 * Title    : T324Scripts for Drupal
 * Version  : 1.0
 * Created  : 07 February 2006
 * Modified : 26 July 2008
 */

// NoSpamEmail Script
// Example: nospam("domain.com","info","Click here to get more information");
function nospam(domain,name,visible){
	document.write('<a href=\"mail' + 'to:' + name + '@' + domain + '\">');
	document.write(visible + '</a>');
}

// NoSpamEmail Script 2
// Example: nospam2("domain,"info","com");
function nospam2(domain,name,tld){
	document.write('<a href=\"mail' + 'to:' + name + '@' + domain + '.' + tld + '\">');
	document.write(name + '@' + domain + '.' + tld + '</a>');
}

// Mailing List Scripts

// Take out scripts below while testing mailing list module
/*
function checkEmail (email) {
	var error = false;
	if (email === "") {
   		error = "You didn't enter an email address.\n";
	}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(email))) { 
       error = "Please enter a valid email address.\n";
    } else {
		//test email for illegal characters
       	var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/;
        if (email.match(illegalChars)) {
        	error = "The email address contains illegal characters.\n";
       	}
    }
	
	return error;    
}

function validateEmail() {
	var email = document.getElementById('ml-email');
	var error = checkEmail(email.value);
	
	if (error !== false) {
		alert(error);
		email.focus();
		return false;
	}
	
	return true;
}

function clearml(obj) {
	if (obj.value.indexOf('email address') !== -1) {
		obj.value = '';
	}
}

*/
