var gAutoPrint = true; 

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 += '\n</HE' + 'AD>\n<BODY><table bgcolor="#ffffff"><tr><td>\n';
		
		var printReadyElem = document.getElementById("printArea");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the print section in the HTML");
			return;
		}
			
		html += '\n</td></tr></table></BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print feature is only available in modern browsers.");
	}
}

var nWin
function nWindow(n,w,h,t,s,r){
  if (nWin) {nWin.close();}
  str="Toolbar="+t+",resizable="+r+",scrollbars="+s+",height="+h+",width="+w;
  if(parseInt(navigator.appVersion)>3)
  str+=",left="+(screen.width -w)/2+",top="+parseInt((screen.height -h)/3);
  //nWin = window.open(n,'popup',str)
  nWin = window.open(n,'popup','width='+ w +',height='+ h +',toolbars='+ t +',scrollbars='+ s +',left=10,top=10,resizable=yes')
  nWin.focus();
}
