
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/samvirke/styles/style.css" type="text/css">\n';
		html += '<link rel="StyleSheet" href="/_layouts/1030/samvirke/styles/print.css" type="text/css">\n';
		html += '<link media="screen" type="text/css" href="/_layouts/1030/Samvirke/styles/sIFR-screen.css" rel="stylesheet"/>';
		html += '<link media="print" type="text/css" href="/_layouts/1030/Samvirke/styles/sIFR-print.css" rel="stylesheet"/>';

		html += '\n</HEAD>\n<BODY style="background-image: none; background-color:white;">\n';
		var printReadyElem = document.getElementById("printReady"); 

		if (printReadyElem != null)
		{
			html += '<!-- ********************** PRINT-START *********************-->\n' ;
			html += '<table style="width:100%;">\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=506,height=600,resizable=no,top=50,left=50");
		if (printWin != null)
		{
			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.");
	}
}		
