// JavaScript Document

/*

Author: Arafat Rahman opurahman <at> yahoo.com
Created Date	: 09 October 2007
Modified Date	: 09 October 2007

*/

/*
function protected_email(email, title = '', attributes = '')
used to write spam protected email links.
@params
email_id - email id (string befor @ sign)
domain - domain name
title - title to display, if you keep null then email address wil be the title
attributes - other attributes to set <a> tag

*/

function protected_email(email_id, domain, title, attributes) {
	if( typeof email_id == "undefined" ) {
		var email_id = "not found";
	}
	if( typeof domain == "undefined" ) {
		var domain = "not found";
	}
	if( typeof title == "undefined" ) {
		var title = email_id + "@" + domain;
	}
	if(typeof attributes == "undefined") {
		var attributes = "";
	}
	//alert(typeof email);
	//alert( email_id + " " + title + " " + attributes );
	document.write('<a href="mailto:' + email_id + '@' + domain + '" ' + attributes +'>' + title + '</a>');
}

