﻿// JScript File

function send_email_to_friend(pageUrl){ 

var MailLink = "mailto:"; 
var currentURL = replaceAll(window.location.href,"&","%26");
MailLink += "?subject=Information on DoubleClick I thought you should read"; 
MailLink += "&body=I thought you would be interested in this information from DoubleClick: " + currentURL;
MailLink += escape(".\nDiscover more at the nerve center of digital marketing: http://www.doubleclick.com \n"); 
location.href = MailLink; 
}

function replaceAll(oldStr,findStr,repStr) {
  var srchNdx = 0;  // srchNdx will keep track of where in the whole line
                    // of oldStr are we searching.
  var newStr = "";  // newStr will hold the altered version of oldStr.
  while (oldStr.indexOf(findStr,srchNdx) != -1)
                    // As long as there are strings to replace, this loop
                    // will run.
  {
    newStr += oldStr.substring(srchNdx,oldStr.indexOf(findStr,srchNdx));
                    // Put it all the unaltered text from one findStr to
                    // the next findStr into newStr.
    newStr += repStr;
                    // Instead of putting the old string, put in the
                    // new string instead.
    srchNdx = (oldStr.indexOf(findStr,srchNdx) + findStr.length);
                    // Now jump to the next chunk of text till the next findStr.
  }
  newStr += oldStr.substring(srchNdx,oldStr.length);
                    // Put whatever's left into newStr.
  return newStr;
}