/*
    trogon.js

    Created by: Kevin Monahan
    Created on: Dec 26, 2009
    Contact: javascript(at)trogon(dot)com

    Licensing

    Copyright (c) 2009, Kevin Monahan.

    The JavaScript in this file may be used under the terms of the Lesser GNU Public License (LGPL).
    The contents are provided without support nor with any statement of suitability for use in any
    commercial or personal application. That is, use at your own risk! I assume no responsibility for
    any problems resulting from, loss of business caused by or costs incurred through use of the
    contents of this file.
*/

/**
 * Constructs an email address dynamically so that a static
 * address does not have to appear in the code.
 * @param address The email address,in the form <local name>(at)<domain name>(dot)com
 */
function generateEmailAddress( address )
{
    return address.replace( /\(at\)/, "@" ).replace( /\(dot\)/g, "." );
}

/**
 * Opens a compose window using the local email client. The supplied email
 * address is put into the TO field.
 * @param address The email address,in the form <local name>(at)<domain name>(dot)com
 */
function displayEmailComposeWindow( address )
{
    window.location = "mailto:" + generateEmailAddress( address );
}