/*
####################################################
##	javascript functions			##
##	custom API developed by			##
##	and copyright (C) 2006			##
##	eYe Openers design			##
##	http://eYeOpeners.info			##
##	programming [at] eYeOpeners [dot] info	##
##	for				## 
##	http://CorpWorks.com			##
####################################################
*/


/*
### ( UNIVERSAL FUNCTION ASSEMBLES MAILTO HREF TO DETER HARVESTERS ]###
*/


/*
RESOURCES FOR FUNCTION INPUT

onclick="mail_To('inquiries','corpworks','com','CorpWorks','Please%20send%20information%20on%20CorpWorks%20services.%0A%0AI%20am%20most%20interested%20in%0A%20%20%20%20%20%20%20%20%20%20%2A%20Corporate%20Branding%20and%20National%20Advertising%0A%20%20%20%20%20%20%20%20%20%20%2A%20Web%20development%20including%20online%20application%20modules.%0A%0AYour%20message%20here%3A%0A%0A')"


Data strings may be passed to the function to insert text into the body of the E-mail. 
Use these switches in the strings
	Space		%20
	Line Break 		%0A
	Paragraph 		%0A%0A
	Line Break then indent	0A%20%20%20%20%20%20%20%20%20%20
	Others		Hex conversion table:
http://cnx.org/content/m12308/latest/
*/


function mail_To(tld,domain,account,site,bodyText){
// "domain" is the domain name. Here we add the universal dot seperator to the string.

domain=domain+".";

/*
Append "@" sign character to the end of variable.
"account" is the E-mail account name (everything before the "@")
*/

account=account+"@";

/*
1). "tld" is the Top Level Domain - .com, .net, etc.
2). "site" is the name of the site if different or differently configured from domain name.
3). "header" is the "hname" after the "?" switch used in the mailto string. Here we use it as a subject header.
*/

var header="subject=";

//When body text is present, pass it into the E-mail. If not, leave the body blank.
if(bodyText != ''){
	var body="&body="+bodyText}
else{
	var body=''}

//Put the pieces together.
eval("location.href=\'mailto:"+account+domain+tld+"?"+header+"Inquiry%20from%20"+site+"%20Web%20site."+body+"\'")}

/*
####################################################
##	javascript functions			##
##	custom API developed by			##
##	and copyright (C) 2006			##
##	eYe Openers design			##
##	http://eYeOpeners.info			##
##	programming [at] eYeOpeners [dot] info	##
##	for				## 
##	http://CorpWorks.com			##
####################################################
*/



