//Call this function with user, domain and function typed backwards.
//Subject should be typed normally
function mail_to(_user,_domain,_extension,_subject)
{
	var d = "";
	var u = "";
	var x = "";
	var s = "";
	var tmpArray = "";

	// Did the user specify a subject
	(_subject.length == 0)? s = "" : s = "?subject=";

	// Unscramble the domain
	var i = _domain.length;
	while(i >= 0){d = d + _domain.substr(i,1); i--;}

	// Unscramble the users name
	i = _user.length;
	while(i >= 0){u = u + _user.substr(i,1); i--;}

	// Unscramble the extension
	i = _extension.length;
	while(i >= 0){x = x + _extension.substr(i,1); i--;}
	 
	 
	// If the user specified a subject replace each space with %20 
	if (s != "")
	  {
	  tmpArray = _subject.split(" ");
	  for (i = 0; i < tmpArray.length; i++) s = s + tmpArray[i] + "%20";
	  s = s.substring(0,s.length-3);
	  }
	//s = s.substring(0,s.length-3);

	// Build the return string
	location.href = 'mai' + 'lto:' + u + String.fromCharCode(64) + d + "." + x + s;   
}
