/****************************************************************

	AUTHORING INFORMATION
	---------------------
	
	http://www.codeproject.com/KB/scripting/javascript_print_page.aspx
	
	COMMENTS & FORMATTING
	---------------------
	
	Geraldo Ramos 01/08/2010
	
	USAGE
	-----
	
	Create printer-friendly pages,Writing the content directly into the popup windows.
	Using this script the pop up window can be created which holds the data that has to be printed.
	
	It generates a new page using only content defined between div elements. <div id="print_content"> </div>
	Everything else is ignored.
	
	The new page is called with following scripts <a href="javascript:PrintThisPage()">Cick here to print</a>
	
	We can specify  properties of the window such as width, height, location bar etc.
	
	AVAILABLE PROPERTIES
	--------------------
	
	toolbar				= 0|1 Specifies whether to display the toolbar in the new window.
	location			= 0|1 Specifies whether to display the address line in the new window.
	directories			= 0|1 Specifies whether to display the Netscape directory buttons.
	status				= 0|1 Specifies whether to display the browser status bar.
	menubar				= 0|1 Specifies whether to display the browser menu bar.
	scrollbars			= 0|1 Specifies whether the new window should have scrollbars.
	resizable			= 0|1 Specifies whether the new window is resizable.
	width				= pixels Specifies the width of the new window
	height				= pixels Specifies the height of the new window
	top					= pixels Specifies the Y coordinate of the top left corner of the new window.
	left				= pixels Specifies the X coordinate of the top left corner of the new window.

****************************************************************/


function PrintThisPage(){ 
	var disp_setting  = "toolbar		= yes";
		disp_setting += "location		= no,";
		disp_setting += "directories	= yes,";
		disp_setting += "menubar		= yes,";
		disp_setting += "scrollbars		= yes,";
		disp_setting += "width			= 700,";
		disp_setting += "height			= 600,";
		disp_setting += "left			= 100,";
		disp_setting += "top			= 25";

	var content_vlue = document.getElementById("print-content").innerHTML; 

	var docprint = window.open("","",disp_setting); 
		docprint.document.open(); 
		docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"');
		docprint.document.write('	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
		docprint.document.write('<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">');
		docprint.document.write('<head>');
		docprint.document.write('<link href="/sites/all/themes/borders_media/assets/css/page-coupons-print.css" media="screen, print" rel="stylesheet" type="text/css" />');
		docprint.document.write('	<title>Borders - Books, Used Books, Music, DVDs &amp; Blu-ray</title>');
		docprint.document.write('</head>');
		docprint.document.write('<body onLoad="self.print()">');
		docprint.document.write(content_vlue);
		docprint.document.write('</body>');
		docprint.document.write('</html>');
		docprint.document.close(); 
		docprint.focus(); 
}
