var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);




function printPage(frame, arg)
{
	if (frame == window)
	{
		printThis();
	}
	else
	{
		link = arg;  
		printFrame(frame);
	}
}




function printThis()
{
	if (pr)
	{
		window.print();
	}
	else if (da && !mac)
	{
		
		vbPrintPage();
	}
	else
	{
		
		if(mac)
		{
			alert("Please press your Print button on your iMac computer to print.");
		}
		else
		{
			alert("Sorry, your browser doesn't support this feature.");
		}
	}
}





function printFrame(frame)
{
	if (pr && da)
	{
		
		frame.focus();
		window.print();
		link.focus();
	}
	else if (pr)
	{
		
		frame.print();
	}
	else if (da && !mac)
	{
		
		frame.focus();
		setTimeout("vbPrintPage(); link.focus();", 100);
	}
	else
	{
		
		if (mac)
		{
			alert("Please press your Print button on your iMac computer to print.");
		}
		else
		{
			alert("Sorry, your browser doesn't support this feature.");
		}
	}
}


if (da && !pr && !mac) with (document)
{
	writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
	writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
	writeln('Sub window_onunload');
	writeln('  On Error Resume Next');
	writeln('  Set WB = nothing');
	writeln('End Sub');
	writeln('Sub vbPrintPage');
	writeln('  OLECMDID_PRINT = 6');
	writeln('  OLECMDEXECOPY_DONTPROMPTUSER = 2');
	writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
	writeln(' On Error Resume Next');
	writeln(' WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DOTPROMPTUSER');
	writeln('End Sub');
	writeln('<' + '/SCRIPT>');
}
