function SystemPrintPreview(OLECMDID) 
{ 
//var OLECMDID = 10; 
/* OLECMDID values: 
* 6 - print 
* 7 - print preview 
* 8 - page setup (for printing) 
* 1 - open window 
* 4 - Save As 
* 10 - properties 
*/try
{
var PROMPT = 1; // 1 PROMPT & 2 DONT PROMPT USER 
var oWebBrowser = document.getElementById("WebBrowser1");
if(oWebBrowser == null)
{
var sWebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; 
document.body.insertAdjacentHTML('beforeEnd', sWebBrowser); 
oWebBrowser = document.getElementById("WebBrowser1");
//WebBrowser1.outerHTML = ""; 
}
oWebBrowser.ExecWB(OLECMDID,PROMPT);
}
catch(e){alert("Printing failed! " + e.message);}
} 

function mailpage()
{
mail_str = "mailto:?subject=" + document.title;
mail_str += "&body=I invite you to take a look at this webpage: " + document.title;
mail_str += ". I found it to be very inspiring. I think you will, too. You can view it at " + location.href; 
location.href = mail_str;
}

 var urlAddress = location.href;
 var pageName = document.title;

 function addToFavorites()
 {
  if (window.external)
  {
   window.external.AddFavorite(urlAddress,pageName)
  }
  else
  { 
   alert("Sorry! Your browser doesn't support this function.");
  }
 }
