var mywin;
// function that creates a new printer window
// load the general CSS style sheets 
// inserts the object about to be printed
// initiates the timeout that stops the loading of the window, prints and then closes it
function createPrintWindow(obj)
{
 	
 	var W = obj.offsetWidth; 	
	var H = obj.offsetHeight;	
	mywin = window.open("","PrintPreview","scrollbars=1,menubar=1,status=0,location=0,toolbar=0,resizable=0,width=" + (W+30) + ",height=" + (H+70));

	var str = "<html>" +
					"<head>" +						
						"<link rel=\"stylesheet\" type=\"text/css\" href=\"CSS/patient.css\" />" +
						"<link rel=\"stylesheet\" type=\"text/css\" href=\"CSS/slider.css\" />" +
						"<link rel=\"stylesheet\" type=\"text/css\" href=\"CSS/forms.css\" />" +						
					"</head>" +
					"<body>" +
						obj.innerHTML + 
					"</body>"+
				"</html>";	
	mywin.document.write(str);
	window.setTimeout(stopload,1000);
}
// function taht stops loading the window
// prints the window 
// closes the window
function stopload()
{
	mywin.stop();
	mywin.print();
	mywin.close();
}
