function initMail(form) {
text = "Check out this page:  " + window.location;
form.message.value = "Hi " + form.sendto.value + " (" + form.to.value + "):\n\n"
 + text + "\n\nYour Friend,\n" + form.sendername.value + "(" + form.senderemail.value + ")";
return (form.to.value != "");
}

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}

function facebook()
{u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436')
}

function share_article(service) {
    var url = location.href;
    url = url.replace(/^http:\/\/[a-z]+\.u\./i,'http://www.');
    encodedurl = encodeURIComponent(url);
    var encodedtitle = encodeURIComponent(document.title);

    var serviceUrl = null;
    if (service == 'delicious') {
        serviceURL = 'http://del.icio.us/post?v=4&noui&jump=close'
            + '&url='      + encodedurl
            + '&title='    + encodedtitle;
    } else if (service == 'digg') {
        serviceURL = 'http://digg.com/submit?phase=2'
            + '&url='      + encodedurl
            + '&title='    + encodedtitle;
    } else if (service == 'stumbleupon') {
        serviceURL = 'http://www.stumbleupon.com/submit?'
            + '&url='      + encodedurl
            + '&title='    + encodedtitle;
    } else if (service == 'reddit') {
        serviceURL = 'http://reddit.com/submit'
            + '?url='      + encodedurl
            + '&title='    + encodedtitle;
    } else if (service == 'technorati') {
        serviceURL = 'http://technorati.com/faves?sub=favthis'
            + '&add=' + encodedurl;
    }
    if ( serviceURL != null ) {
        var theNewWin = window.open(serviceURL,'ddishare','full,resizable=yes,toolbar=yes,location=yes,scrollbars=yes');
        if ( typeof theNewWin != "undefined" &&
             theNewWin != null ) {
            theNewWin.focus();
        }
    }
    // remove the layer.
    document.getElementById('sharepop1').style.display='none';
    document.getElementById('sharepop1mask').style.display='none';
}

	