﻿// JavaScript Document

function loadContent() {
	document.getElementById('content').innerHTML="W3Schools";
}

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';
		html += '<link href="CSBE.css" rel="stylesheet" type="text/css" />'		
		html += '\n</HEAD>\n<BODY style="background-color:White;">\n';
		var printReadyElem = document.getElementById("printReady");
		if (printReadyElem != null)
		{
				html += '<table border=0 height="100%"><tr><td valign="top">';
				html += '<img src="images/hdr_compName.gif" border="0"><br><br>\n';
				html += '<div style="width: 665px;">';
				var printTitleElem = document.getElementsByTagName("title");
				if (printTitleElem.length > 0)
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
		html += '\n</div></td></tr></table></BO' + 'DY>\n</HT' + 'ML>';
		var printWin = window.open("","printSpecial",'width=730,scrollbars=yes');
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
	printWin.document.close();
}

