// JavaScript Document


function checkEmailAddress(field)
{
    if (field.value != '')
    {
        var value = String(field.value);
        var passed = false;

        for (index = 0; index < value.length; index++)
        {
            if (value.charAt(index) == '@')
                passed = true;
        }

        if (passed == false)
        {
            alert('Please use {ie. username@domain.com} format for all email entries.');
            field.value = '';
            document.contactform.email.focus();
        }
    }
}


function checkFormData(frm)
{
    var sError = '';
    frm.SubmitButton.disabled=true;

    if (frm.first.value == "") sError += " - Please enter your first name\n";
    if (frm.last.value == "") sError += " - Please enter your last name\n";
    if (frm.company.value == "") sError += " - Please enter your company\n";
    if (frm.title.value == "") sError += " - Please enter your title\n";
    if (frm.email.value == "") sError += " - Please enter your email address\n";
    if (sError.length > 0)
    {
        alert('Please correct the following errors:\n\n' + sError); 
        frm.SubmitButton.disabled=false; 
        return false;
    }
    return true;
}



var emailname = "ideas";
var emailname2 = "research";
var emailserver = "interactionmetrics.com";

var strEmail = '<p style="margin:0;padding:0;font-weight:bold;font-size:14px;font-family:Arial, Helvetica, sans-serif;">';
strEmail = strEmail += "<a style='color:#ff9900;text-decoration:none;font-weight:bold;' href='mailto:" + emailname + "@" + emailserver + "'>";
strEmail = strEmail += emailname + "@" + emailserver;
strEmail = strEmail += "</a>";
strEmail = strEmail += "</p>";

var strEmail2 = '<p style="margin:0;padding:0;font-weight:bold;font-size:14px;font-family:Arial, Helvetica, sans-serif;">';
strEmail2 = strEmail2 += "<a style='color:#ff9900;text-decoration:none;font-weight:bold;' href='mailto:" + emailname2 + "@" + emailserver + "'>";
strEmail2 = strEmail2 += emailname2 + "@" + emailserver;
strEmail2 = strEmail2 += "</a>";
strEmail2 = strEmail2 += "</p>";

var strGood = '<a href="mailto:' + emailname2 + '@' + emailserver + '?subject=GOOD SERVICE">';
strGood = strGood += '<img src="images/email2.gif" alt="online surveys" border="0" height="128" width="128">';
strGood = strGood += '</a>';

var strBad = '<a href="mailto:' + emailname2 + '@' + emailserver + '?subject=BAD SERVICE">';
strBad = strBad += '<img src="images/email2.gif" alt="online surveys" border="0" height="128" width="128">';
strBad = strBad += '</a>';

