// Email.js version 6

// tld value determines its content...
// default CSS link class is "mail"
// title variable contains title attribute (since we are being nice)

// 2006 Mister Mike (nibiru@mac.com)

var tld_ = new Array()
tld_[0] = "com";
tld_[1] = "ch";
tld_[2] = "cc";
tld_[3] = "de";
tld_[4] = "fr";
tld_[5] = "net";
var topDom_ = 1;
var m_ = "mailto:";
var a_ = "@";
var d_ = ".";

function mail(name, dom, tl, params, title) {
	var s = e(name,dom,tl);
	document.write('<a class="mail" href="'+m_+s+params+'" title="'+title+'">'+s+'</a>');
}

function e(name, dom, tl)   {
	var s = name+a_;
	if (tl!=-2)
	{
		s+= dom;
		if (tl>=0)
			s+= d_+tld_[tl];
	}
	else
		s+= swapper(dom);
	return s;
}

function swapper(d) {
	var s = "";
	for (var i=0; i<d.length; i+=2)
		if (i+1==d.length)
			s+= d.charAt(i)
		else
			s+= d.charAt(i+1)+d.charAt(i);
	return s.replace(/\?/g,'.');
}

// Date calculations

var myMonths=new Array(
"Januar","Februar","M&auml;rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");

function mymonth()  {
	today=new Date();
	y = new Date().getFullYear();
	thisMonth=today.getMonth();
	document.write(myMonths[thisMonth]," ",y)
}

function monthdir()  {
	today=new Date();
	thisMonth=today.getMonth();
	document.write(myMonths[thisMonth])
}

function copyright() {
	y = new Date().getFullYear();
	if (y>2006) {
		document.write('2001-'+y);
	}
	else {
		document.write(y);
	}
}

function actuality() {
	today=new Date();
	dy = today.getDay();
	y = new Date().getFullYear();
	thisMonth=today.getMonth();
	document.write(dy,". ",myMonths[thisMonth]," ",y)
}

