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';
		
		//rlb
		var pagetitle=document.title;
		//rlb 20041208
		pagetitle = stringReplace(pagetitle,"<i>","");
		pagetitle = stringReplace(pagetitle,"<I>","");
		pagetitle = stringReplace(pagetitle,"<p>","");
		pagetitle = stringReplace(pagetitle,"</p>","");
		pagetitle = stringReplace(pagetitle,"'","");
		pagetitle = stringReplace(pagetitle,"</I>","");
		pagetitle = stringReplace(pagetitle,"</b>","");
		pagetitle = stringReplace(pagetitle,"<b>","");
		pagetitle = stringReplace(pagetitle,"</B>","");
		pagetitle = stringReplace(pagetitle,"<B>","");
		pagetitle = stringReplace(pagetitle,"</i>","");
		pagetitle = stringReplace(pagetitle,"<br>","");
	
		html+='<title>';
		html+=pagetitle;
		html+='</title>\n';
		html+='<link href=\"/main.css\" rel=\"stylesheet\" type=\"text/css\" />';
		html += '\n</HE' + 'AD>\n<BODY>\n';
		html += '\n<font face=\"verdana\" size=\"2\"><b>Jamaica Gleaner Online</b></font>\n<hr size=1>';
		
		var printReadyElem = document.getElementById("printReady");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
			
		html += '\n<font face=\"verdana\" size=\"2\">Copyright Jamaica-Gleaner.com</font>';
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		//rlb
		features="menubar=YES,scrollbars=YES,width=700,height=450";
		var printWin = window.open("","printSpecial",features);
		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.");
	}
}
