//--------------------------------------------------------------------------
// Created by:	Pascal Parent and Abu Abrahams
// Version:		1.0
// Date			19/03/2004
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
// Print a DIV 
//--------------------------------------------------------------------------
var gAutoPrint = true; // Flag for whether or not to automatically call the print function
 
function printSpecial()
{
 if (document.getElementById != null)
 {
  var html = '<HTML>\n<HEAD>\n';
 
  if (document.getElementsByTagName != null)
  {
   var headTags = document.getElementsByTagName("head");
   if (headTags.length > 0)
    html += headTags[0].innerHTML;
  }
  
  html += '\n</HE' + 'AD>\n<BODY>\n';
  
  var printReadyElem = document.getElementById("printReady");
  
  if (printReadyElem != null)
  {
    html += printReadyElem.innerHTML;
  }
  else
  {
   alert("Could not find the printReady section in the HTML");
   return;
  }
   
  html += '\n</BO' + 'DY>\n</HT' + 'ML>';
  var myObject = new Object();
  
  myObject.Title = document.title
  myObject.PrintHTML = html
  myObject.AutoPrint = gAutoPrint
 
  var printWin = window.showModalDialog("Print.htm", myObject,"dialogHeight: 500px; dialogWidth: 618px; edge: Raised; center: Yes; help: Yes; resizable: No; status: No;");
 }
 else
 {
  alert("Sorry, the print ready feature is only available in modern browsers.");
 }
}

//--------------------------------------------------------------------------
// Add to vavorites
//--------------------------------------------------------------------------

function FavoritesSpecial()
{
	window.external.AddFavorite(location.href, document.title);
}


//--------------------------------------------------------------------------
// E-Mail to a friend 
//--------------------------------------------------------------------------

function MailSpecial()
{
	window.location.href = "mailto:?subject="+escape(document.title)+"&body=" +BuildEmailDescription(document.title);
	return true;
}

function BuildEmailDescription(strDescription)
{
	return escape("Here's a great page you might be interested in:" +
		String.fromCharCode(13)+ String.fromCharCode(13) + strDescription + String.fromCharCode(13) + "URL: " + location.href);
}