/*****************************************************
 * File Name: PrintFriendly.js
 * Created By: Tim Stratton
 * Date Created: 12/13/2007
 * 
 * Summary:
 * This file defines all the client side script
 * needed to allow print friendly versions of content
 * to open in a new window.
 *
 * Revisions:
 * Modified By      Date        Comments
 * -----------      ----        --------
 * 
 * 
 *****************************************************/
/*****************************************************
 * Function: makeprintfriendlyversion
 * Summary: This function is used in a anchor tag to place a web pages content in a new window for printing.
 * 
 * Parameters:
 * None
 * 
 * Returns: integer (1 for success)
 *****************************************************/
function makeprintfriendlyversion()
{
	/*Capture actual content on web page*/
	var PrinterFriendlyVersionHTML = document.getElementById("contentDiv").innerHTML;

	/*Open a new window to write acutal content to*/
	var PFVwindow = window.open("","PFVwindow","width=725,height=700,resizable=no,scrollbars=yes,toolbar=no,menubar=no,statusbar=no,location=no,directories=no");
	
	/*write conent to new window*/	
	PFVwindow.document.open();	
	PFVwindow.document.write("<html><head>");

	/*write printing and formating styles for page*/
	PFVwindow.document.write("<link type='text/css' rel='stylesheet' href='BWPConfig/css/Content.css' />");
	PFVwindow.document.write("<style type='text/css'>@media print {input,.DoNotPrint,{visibility: hidden;display:none;}} .DoNotPrint{visibility: hidden;display:none;}</style>");
	PFVwindow.document.write("</head><body><form><input type='button' value='Print Page' onClick='window.print();' /><input type='button' value='Close Window' onClick='window.close();' /></form>");
	PFVwindow.document.write(PrinterFriendlyVersionHTML);
	PFVwindow.document.write("</body></html>");
	PFVwindow.document.close();

	/*return 1 for success*/
	return 1;
}



