function printDocument() {
	var isMinNS4=(navigator.appName.indexOf("Netscape")>=0&&parseFloat(navigator.appVersion)>=4)?1:0;
	var isMinIE4=(document.all)?1:0;
	
	getFullWindowWidth();
	var winWidth = parseInt(printScreenWidth * 7 / 10);
	var winHeight = parseInt(printScreenHeight * 7 / 10) - 64; //includes toolbar and menubar
	var url = document.location.href;
		if (url.toLowerCase().indexOf('&print') < 0) {
		if (url.indexOf('#') >= 0) {
			index = url.indexOf('#');
			left = url.substr(0, index);
			right = url.substr(index + 1);
			url = left + "&print=1#" + right;
		} else if ( url.substr(url.length - 4) == ".nsf" ) {
			url = url + "?OpenDatabase&print=1";
			} else if ( url.substr(url.length - 1) == "/" ) {
			url = url.substring(0,url.length - 1) + "?OpenDatabase&print=1";
			} else {
			url = url + "&print=1";
		}
	} else {
		//Already print version !!
	}

	var props = 'toolbar=yes';
	props += ',location=no';
	props += ',directories=yes';
	props += ',menubar=yes';
	props += ',status=no';
	props += ',scrollbars=yes,resizable=yes,width='+ winWidth +',height=' + winHeight;
	if (isMinNS4) props += ',screenX=' + (printScreenWidth/2 - winWidth/2) + ',screenY=' + (printScreenHeight/2 - winHeight/2 - 32);
	if (isMinIE4) props += ',left=' + (printScreenWidth/2 - winWidth/2) + ',top='+ (printScreenHeight/2 - winHeight/2 - 32);
	var printDoc = window.open(url, 'PrintVersion', props);
}

var printScreenWidth;
var printScreenHeight;

function getFullWindowWidth() {
	if (self.screen) {     // for NN4 and IE4
       	printScreenWidth = screen.width;
       	printScreenHeight = screen.height;
	}
	else if (self.java) {   // for NN3 with enabled Java
   		var jkit = java.awt.Toolkit.getDefaultToolkit();
   		var scrsize = jkit.getScreenSize();       
   		printScreenWidth = scrsize.width; 
   		printScreenHeight = scrsize.height;
	}
	else {
		if(isMinNS4) {
			printScreenWidth = top.innerWidth;
			printScreenHeight = top.innerHeight;
			return;
		}
		if(isMinIE4) {
			printScreenWidth = top.document.body.clientWidth;
			printScreenHeight = top.document.body.clientHeight;
			return;
		}
	}
}