
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';
		
		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
			{
				html += headTags[0].innerHTML;
			}
		}
		
		html += '<link rel="StyleSheet" href="/_layouts/1030/fdb/styles/print.css" type="text/css">\n';
		html += '\n</HEAD>\n<BODY>\n';
		var printReadyElem = document.getElementById("printReady"); 
		if (printReadyElem != null)
		{
			html += '<!-- ********************** PRINT-START *********************-->\n' ;
			html += '<table>\n<tr>\n<td>\n' + printReadyElem.innerHTML + '\n</td>\n</tr>\n</table>\n';
			//html += '<table>\n' + printReadyElem.innerHTML + '\n</table>\n';
			html += '<!-- ********************** PRINT-SLUT **********************-->\n' ;
			//html +=  printReadyElem.innerHTML ;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}		
			
		html += '\n</BODY>\n</HTML>';
			
		var printWin = window.open("","printSpecial","width=960,height=600,resizable=no,top=50,left=50");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
		{
			printWin.print();
			printWin.close();
		}
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}		

function printSpecial2()
{
	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 += '<link rel="StyleSheet" href="/_layouts/1030/fdb/styles/print2.css?timestamp='+ (new Date().getTime()) +'" type="text/css">\n';
		//html += '<link rel="StyleSheet" href="/_layouts/1030/fdb/styles/additionalLayout.css" type="text/css">\n';
		//html += '<link rel="StyleSheet" href="/_layouts/1030/fdb/styles/print.css" type="text/css">\n';
		html += '\n</HEAD>\n<BODY>\n';
		var printReadyElem = document.getElementById("printReady"); 
		if (printReadyElem != null)
		{
			html += '<!-- ********************** PRINT-START *********************-->\n' ;
			html += '<table>\n<tr>\n<td>\n' + printReadyElem.innerHTML + '\n</td>\n</tr>\n</table>\n';
			html += '<!-- ********************** PRINT-SLUT **********************-->\n' ;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}		
			
		html += '\n</BODY>\n</HTML>';
			
		var printWin = window.open("","printSpecial","width=960,height=600,resizable=no,top=50,left=50");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
//		if (gAutoPrint)
//			printWin.print();
//			printWin.close();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}		
