﻿//*******************************************************************
// --  used to automate block spam bots for important info
//
// COPYRIGHT: 2008 Spiderweb Logic Web Design
// http://www.SpiderwebLogic.com
// 
// LICENSE/RESTRICTIONS
//
// All copyright info, credits, and license terms are to be kept in place.
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
//
//  
//*******************************************************************

// <span id='mySpanId'>&nbsp;</span>
// <script language='javascript' type='text/javascript'>
//   SpamBlockEmailSpan('mySpanId','email me','robert','spiderweblogic', '.com')
// </script>
 
function SpamBlockEmailSpan(spanId,linkText,user,domain,toplevel) {
    if (document.getElementById && document.getElementById(spanId)) {
        if (linkText=="") {
           linkText=user + "@" + domain + toplevel;
        }
         locationstring = "mailto:" + user + "@" + domain + toplevel;
         document.getElementById(spanId).innerHTML = "<a href='" + locationstring + "'>" 
            + linkText
            + "</a>";         
    }
}


function SpamBlockWindowsLiveMessengerSpan(spanId,linkText,user,domain,toplevel) {
    if (document.getElementById && document.getElementById(spanId)) {
        if (linkText=="") {
           linkText="Windows Live Messenger: " + user + "@" + domain + toplevel;
        }
         locationstring = "msnim:chat?contact=" + user + "@" + domain + toplevel;
         document.getElementById(spanId).innerHTML = "<a  onclick=\"return confirm('If you have MSN for chat, this will intiate a chat with this person.');\"  href='" + locationstring + "'>" 
            + linkText
            + "</a>";         
    }
}

function SpamBlockYahooChatSpan(spanId,linkText,user,domain,toplevel) {
    if (document.getElementById && document.getElementById(spanId)) {
        if (linkText=="") {
           linkText="Yahoo Chat: " + user + "@" + domain + toplevel;
        }
         locationstring = "ymsgr:sendim?" + user + "@" + domain + toplevel;
         document.getElementById(spanId).innerHTML = "<a  onclick=\"return confirm('If you have Yahoo for chat, this will intiate a chat with this person.');\"  href='" + locationstring + "'>" 
            + linkText
            + "</a>";         
    }
}

//this is just a username, not an email
function SpamBlockSkypeSpan(spanId,linkText,user) {
    if (document.getElementById && document.getElementById(spanId)) {
        if (linkText=="") {
           linkText="Skype Call: "+ user;
        }
         locationstring = "skype:" + user + "?call";
         document.getElementById(spanId).innerHTML = "<a  onclick=\"return confirm('If you have Skype for chat or calls, this will intiate a Skype call to this person.');\"  href='" + locationstring + "'>" 
            + linkText
            + "</a>";         
    }
}
