/*
Developed by Baron Jonathas Reinisch (mka James Kriebel) 12/6/2009.  All rights reserved.

Free use to any SCA.Org related site so long as credit is given.
*/

function Email_Protector(User, Site, Ext) {
	/* 
	This function should be placed in a link which a human user will never see and/or could never actually click on.
	It is design such that if a spambot is smart enough to execute an OnClick, which is being used later in the page 
	to protect email addresses, so that the spambot gets stuck in an endless loop and is unable to render the rest 
	of the page. Also be sure to use a bogus email address.
	
	Example Code:
	<div style="display:none;"><a href="do.nothing" onMouseOver="javascript:this.href=Email_Protector('Jack.Yokal', 'mail.localshop', 'com')">Don't Ever Click This!!</a></div>

	*/
	
	FullAddress = Site + '@' + Ext ;
	while (FullAddress.length>0) {
		FullAddress += '.' + User ;
	}
	
	return('mail'+'to:' + FullAddress);
}

function Email_obf(Ext, Site, User, Subject){
	/*
	 Ext - is the final extension of the email address.
	        Example: COM, NET, or ORG (or any other)

	 Site - is the middle portion of the address between the 'AT' and the last 'DOT'
	        Example: hotmail, mail.comcast, or any other
	
	 User - is what appears before the 'AT'
	        Example: Jane.Doe, billy245
	
	 Subject - is OPTIONAL - if a subject to be used
	        Example: Email me
	
	 Sample: Jane.Doe@mail.localisp.net
	 Example Code: 
	 <a href="do.nothing" onMouseOver="javascript:this.href=Email_obf('net', 'mail.localisp', 'Jane.Doe')">Contact Me</a>
	*/
	var FullAddress = User + '@' ;
	FullAddress += Site + '.' ;
	FullAddress += Ext ;
	
	if (!Subject) {
		var Subject = "nothing";
	}else{
		FullAddress += '?Subject=' + Subject ;
	}

	return('mail'+'to:' + FullAddress);
}