
function addThisOnClick(title, url, o, tag) {
  addthis_pub  = 'intradedotnet';
  addthis_open(o, '', url, title);
  if (tag) addthis_sendto(tag);
  return false;
}

function addThisEmailOnClick(url, o) {
  return addThisOnClick('', url, o, 'email');
}

var EMAILTHIS={pub:"intradedotnet",url:"",send:function (u) {
		var _32=$("emailThis_from"),_33=$("emailThis_to"),_34=$("emailThis_img"),_35=$("emailThis_status"),_36=$("emailThis_msg"),euc=encodeURIComponent;
		if(!this.valEmail(_32) || !this.valEmail(_33)){
                    return false;
		}
		_rnd=Math.random();
		_url="http://www.addthis.com/tellfriend.php?pub="+euc(this.pub)+"&url="+euc(u ? u : this.url)+"&fromname=aaa&fromemail="+euc(_32.value)+"&tofriend="+euc(_33.value)+"&note="+euc(_36.value)+"&r="+_rnd;
		_34.src=_url;
		_35.style.visibility="visible";
		return true;
	},
        valEmail:function(i) {
            if (i.value.indexOf("@")<0||i.value.indexOf(".")<0) {
                alert("Please enter a valid email address!");
                i.focus();
                return false;
            }
            return true;
        },
	setFields:function (to,from, note) {
	  if (to) $('emailThis_to').value=to;
	  if (from) $('emailThis_from').value=from;
	  if (note) $('emailThis_msg').value=note;
	},
	onbeforeshow:function () {
          $("emailThis_img").src="http://s7.addthis.com/select/select_load.png";
          $("emailThis_status").style.visibility="hidden";
          var m=$("emailThis_msg"), s="{n}";
          var c = m.value;
          var i = c.indexOf(s);
          while (i > -1){
          c = c.replace(s, '\n');
          i = c.indexOf(s);
          }
          m.value=c;
	}
}