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

"; //document.getElementById("send-a-friend").innerHTML += '

Stuur nog eens door

'; //setTimeout('staf_Reset()', 1000); } } } } else { setTimeout('staf()', 400) } return false; } //returns the window size function staf_windowsize() { var x,y; if (self.innerHeight) // all except Explorer { x = self.innerWidth; y = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode { x = document.documentElement.clientWidth; y = document.documentElement.clientHeight; } else if (document.body) // other Explorers { x = document.body.clientWidth; y = document.body.clientHeight; } retval = new Object; retval.x = x; retval.y = y; return retval; } //initiates and handles the XMLHttpRequest object //as found here: http://www.webpasties.com/xmlHttpRequest function staf_getHTTPObject() { var xmlhttp; /*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } // brothercake's generic onload // http://www.brothercake.com/site/resources/scripts/onload/ if(typeof window.addEventListener != 'undefined') { //.. gecko, safari, konqueror and standard window.addEventListener('load', initStaf, false); } else if(typeof document.addEventListener != 'undefined') { //.. opera 7 document.addEventListener('load', initStaf, false); } else if(typeof window.attachEvent != 'undefined') { //.. win/ie window.attachEvent('onload', initStaf); }