// JavaScript Document

//--------------- LOCALIZEABLE GLOBALS ---------------
var d=new Date();
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
//Ensure correct for language. English is "January 1, 2004"
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();

var DOMAIN="bigpond";
var SUBDOMAIN="net.au";
//---------------   END LOCALIZEABLE   ---------------


/*************************************************
 * Open up a mail form without having to use user@domain.country codes explicitly
 * Usage:
 *    mailSender( userId <required>, linktext <optional>, domain <optional>, subject <optional>)
 *          userId is the part in front of @ sign in the email address
 *          linktext is the text to display. Defaults to "Contact " and the userIds
 *          domain is the part after the @ sign. Defaults to schoensleben.ch
 *          subject is well, the subject
 *************************************************/
function mailSender( userId, linkText, domain, subject, fullLinkText)
{
	if( typeof( userId) == "undefined"){
		alert("function mailSender: Error, no userId parameter provided!");
		return;
	}
	
	if( typeof( domain) == "undefined")
		domain = DOMAIN + "." + SUBDOMAIN;

	if( domain == "")
		domain = DOMAIN + "." + SUBDOMAIN;

	var mailAddress = userId + "@" + domain;

	if( typeof( linkText) == "undefined")
		linkText = "Contact " + userId;
	
	if( typeof( fullLinkText) != "undefined")
	{
		mailAddress = fullLinkText + "<" + mailAddress + ">";
		//alert( mailAddress);
	}
	

	if( typeof( subject) != "undefined")
		subject = "?subject=" + subject;
	else
		subject = "";
		
	var retVal = "<a href=\"mailto:" + mailAddress + subject + "\">" + linkText + "</a>"

//	alert( retVal);

	document.write( retVal);
}



/*************************************************
 * Open up a mail form without having to use user@domain.country codes explicitly
 * Usage:
 *    mailSender( userId <required>, linktext <optional>, domain <optional>, subject <optional>)
 *          userId is the part in front of @ sign in the email address
 *          linktext is the text to display. Defaults to "Contact " and the userIds
 *          domain is the part after the @ sign. Defaults to schoensleben.ch
 *          subject is well, the subject
 *************************************************/
function mailSenderImage( userId, domain, subject, imagePath)
{
	if( typeof( userId) == "undefined"){
		alert("function mailSender: Error, no userId parameter provided!");
		return;
	}
	if( typeof( imagePath) == "undefined"){
		alert("function mailSenderImage: Error, no imagePath parameter provided!");
		return;
	}
	if( typeof( domain) == "undefined")
		domain = DOMAIN + "." + SUBDOMAIN;

	if( domain == "")
		domain = DOMAIN + "." + SUBDOMAIN;

	if( typeof( subject) != "undefined")
		subject = "?subject=" + subject;
	else
		subject = "";
		
	var retVal = "<a href=\"mailto:" + userId + "@" + domain + subject + "\"><img src=\"" + imagePath + "\" border=\"0\"></a>"

//	alert( retVal);

	document.write( retVal);
}



