
function isNonNullAndNonEmptyString(s)
{
    return (s != null && s != "" && typeof(s) == "string");
}

function newRCMessage(recipient, subject)
{
    var uri = "mailto:";
    uri += recipient + '@';
    uri += "radioctl.";
    uri += "com";

    if (isNonNullAndNonEmptyString(subject))
        uri += "?subject=" + subject;

    window.location.href = uri;
}

function mtRCInfo(subject, linkLabel)
{
    var html = "<a href=\"";
    html += "javascript:";
    html += "newRCMessage('info',";

    if (isNonNullAndNonEmptyString(subject))
        html += "'" + subject + "'";
    else
        html += "null";

    html += ");\" ";
    html += "onmouseover=\"window.status=''; return true;\"";
    html += ">";
    html += linkLabel;
    html += "</a>";

    document.write(html);
}

function mtRCSupport(subject, linkLabel)
{
    var html = "<a href=\"";
    html += "javascript:";
    html += "newRCMessage('support',";

    if (isNonNullAndNonEmptyString(subject))
        html += "'" + subject + "'";
    else
        html += "null";

    html += ");\" ";
    html += "onmouseover=\"window.status=''; return true;\"";
    html += ">";
    html += linkLabel;
    html += "</a>";

    document.write(html);
}

