var SendStaf = "/wp-content/plugins/sendtoafriend/sendtoafriend.php?staf=true"; function initStaf() { if(document.getElementById('send-a-friend-form') ) { // initiates the object for sending and receiving data httpStaf = staf_getHTTPObject(); stafLnk = document.getElementById('send-a-friend-link'); staffrm = document.getElementById('send-a-friend-form').innerHTML; if(stafLnk) { stafLnk.onclick = function() { if(document.getElementById('send-a-friend-form').style.display != 'block') { document.getElementById('send-a-friend-url').value = document.URL; document.getElementById('send-a-friend-form').style.display = 'block'; } else { document.getElementById('send-a-friend-form').style.display = 'none'; } return false; } } stafCntnt = document.getElementById('send-a-friend').innerHTML; } } function staf_Close() { document.getElementById('send-a-friend-form').style.display = 'none'; return false; } function staf_Reset() { document.getElementById('send-a-friend').innerHTML = stafCntnt; document.getElementById('send-a-friend-url').value = document.URL; document.getElementById('send-a-friend-form').style.display = 'block'; } function staf_Error(stafErrorArr) { document.getElementById('send-a-friend-error').innerHTML = "
Please check the data you filled in.
"; } function staf_Submit() { if (httpStaf.readyState == 4 || httpStaf.readyState == 0) { httpStaf.open("POST", SendStaf, true); httpStaf.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); params = 'url='+document.getElementById('send-a-friend-url').value; params+= '&fromname='+document.getElementById('send-a-friend-from').value; params+= '&frommail='+document.getElementById('send-a-friend-email-from').value; params+= '&toname='+document.getElementById('send-a-friend-to').value; params+= '&tomail='+document.getElementById('send-a-friend-email-to').value; params+= '&site='+document.getElementById('send-a-friend-site').value; httpStaf.send(params); httpStaf.onreadystatechange = function () { if (httpStaf.readyState == 4) { results = httpStaf.responseText; if(results.substring(0,5) == "Array") { results = eval(results); staf_Error(results); } else { pageTracker._trackPageview("/sendafriend/" + (document.URL).substr(7)); document.getElementById("send-a-friend").innerHTML = "The article has been forwarded to " + document.getElementById('send-a-friend-to').value + ".
Send to another friend