// Printable Content Area Function 

var gAutoPrint = false; // Flag for whether or not to automatically call the print function

function printContent()
{
	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';
		html += '<img src="/ctyclerk/images/election2005/newvotebanner.jpg" alt="Vancouver Votes November 19" width="475" height="68" border="1">';
				
		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("This page has not been set up with a print version.");
			return;
		}
			
		html += '<table width="100%" border="0" cellspacing="5" cellpadding="5" align="left"><tr><td><hr size="1" noshade>';
		html += '<p class="smalltext">&copy; 2005 City of Vancouver</p>';
		html += '<p>&nbsp;</p>' + '</td></tr></table>' + '\n</BO' + 'DY>\n</HT' + 'ML>';

			
		// open the new window for print content
		var width='650';
    	var height='450';
		var printWin = window.open("", "printContent", "resizable=yes,scrollbars=yes,width="+width+",height="+height+" ");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		// ensure print window has focus in case they already have an open window 
		printWin.focus();
		if (gAutoPrint) {
			printWin.print();
		}	
	}
	else
	{
		alert("The printable page feature is only available in current browsers.");
	}
}
