// print.js
	function printPageSetup() {
		var headerDiv = document.getElementById("header");
		if (headerDiv) {
			headerDiv.style.display="none";
		}
		var leftDiv = document.getElementById("contentLeftMenu");
		if (leftDiv) {
			leftDiv.style.display="none";
		}
		var rightDivs = ["contentRightThinNoMargin",
			"contentRightThin",
			"contentRight",		// used for leadership pages right rail (plus possibly others?)
			"contentRight207",	// only used in 100_60_10 and 70
			//"contentRightWide2", // only used in landing pages
			"contentRightWide2Trim"	// only used in 10_40
			];
		var rightDiv;
		for (i=0; i<rightDivs.length; i++) {
			rightDiv = document.getElementById(rightDivs[i]);
			if (rightDiv) {
				rightDiv.style.display="none";
				break;
			}
		}
		// hide product detail 2 Flash, show noflash backup banner
		var pd2NoFlashDiv = document.getElementById("pd2_flashModulePlaceholder");
		if (pd2NoFlashDiv) {
			pd2NoFlashDiv.style.visibility="visible";
		}
		var pd2FlashDiv = document.getElementById("pd2_flashModule");
		if (pd2FlashDiv) {
			pd2FlashDiv.style.display="none";
		}
		// code to turn leader pages light blue background to white
		var leaderBgDiv = document.getElementById("leaderContent5");
		if (leaderBgDiv) {
			leaderBgDiv.className="whiteBg";
		}
		// code to hide email/print icons
		var emailPrintDiv = document.getElementById("emailPrint");
		if (emailPrintDiv) {
			emailPrintDiv.style.display="none";
		}
		// code to show send to printer icon
		var sendToPrinterDiv = document.getElementById("sendToPrinter");
		if (sendToPrinterDiv) {
			sendToPrinterDiv.style.display="block";
		}
		// code to show printNotes textarea
		var printNotesDiv = document.getElementById("printNotes");
		if (printNotesDiv) {
			printNotesDiv.style.display="block";
		}
		
	}
	
	function sendToPrinterBack() {		
		var headerDiv = document.getElementById("header");
		if (headerDiv) {
			headerDiv.style.display="";
		}
		var leftDiv = document.getElementById("contentLeftMenu");
		if (leftDiv) {
			leftDiv.style.display="";
		}
		var rightDivs = ["contentRightThinNoMargin",
			"contentRightThin",
			"contentRight",		// used for leadership pages right rail (plus possibly others?)
			"contentRight207",	// only used in 100_60_10 and 70
			//"contentRightWide2", // only used in landing pages
			"contentRightWide2Trim"	// only used in 10_40
			];
		var rightDiv;
		for (i=0; i<rightDivs.length; i++) {
			rightDiv = document.getElementById(rightDivs[i]);
			if (rightDiv) {
				rightDiv.style.display="";
				break;
			}
		}
		// show product detail 2 Flash, hide noflash backup banner
		var pd2NoFlashDiv = document.getElementById("pd2_flashModulePlaceholder");
		if (pd2NoFlashDiv) {
			pd2NoFlashDiv.style.visibility=(useFlash)?"hidden":"visible";
		}
		var pd2FlashDiv = document.getElementById("pd2_flashModule");
		if (pd2FlashDiv) {
			pd2FlashDiv.style.display=(useFlash)?"block":"none";
		}
		// code to turn leader pages light blue background to white
		var leaderBgDiv = document.getElementById("leaderContent5");
		if (leaderBgDiv) {
			leaderBgDiv.className="whiteBg";
		}
		// code to hide email/print icons
		var emailPrintDiv = document.getElementById("emailPrint");
		if (emailPrintDiv) {
			emailPrintDiv.style.display="";
		}
		// code to show send to printer icon
		var sendToPrinterDiv = document.getElementById("sendToPrinter");
		if (sendToPrinterDiv) {
			sendToPrinterDiv.style.display="";
		}
		// code to show printNotes textarea
		var printNotesDiv = document.getElementById("printNotes");
		if (printNotesDiv) {
			printNotesDiv.style.display="";
		}
		
	}	
	
	function sendToPrinter() {
		window.print();
	}

	
	function clientSideInclude(printvar) 
{
  var req = false;
  var url = "/_admin/print_email.inc";
  if (printvar=="print") {
       url = "/_admin/print.inc";
  }
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) 
  {
    try 
	{
      req = new XMLHttpRequest();
    } 
	catch (e) 
	{
      req = false;
    }
  } 
  else if (window.ActiveXObject) 
  {
    // For Internet Explorer on Windows
    try 
	{
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } 
	catch (e) 
	{
      try 
	  {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } 
	  catch (e) 
	  {
        req = false;
      }
    }
  }

 var element = document.getElementById("print_email_output");
 
  if (req) 
  {
    // Synchronous request, wait till we have it all
    //alert(url);
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } 
  else 
  {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
 
}

function openWindow() { 
  var currentUrl=window.document.URL;
  if(currentUrl.length > 0) {
   var popup=window.open(currentUrl.substring(0,currentUrl.indexOf(".emc.com"))+".emc.com/utilities/email-this-page-form.esp","popup","resizable=yes,width=457,height=570")
   popup.focus();
  }
}
