var browserWin="";
var closeAtBlur = false;
var lastFocus = false;
var closeAfterPrint = false;
var doAutoPrint = true;

function autoClose() {
	if (closeAtBlur) {
		close();
	}
}

function autoPrint() {
	if (doAutoPrint) {
		print ();
	}
	if (closeAfterPrint) {
		close();
	}
}

function setAutoClose(myValue) {
	closeAtBlur = myValue;
}

function setAutoPrintClose(myPrint,myClose) {
	doAutoPrint = myPrint;
	closeAfterPrint = myClose;
}

function openSpecialPdf(myValue) {
	if(typeof document.getElementsByName("sg_zfelib_pdflink")[0] != 'undefined') {
		var input = document.getElementsByName("sg_zfelib_pdflink")[0].value;
		if (input.length>2) {
			//alert ("false - value="+myValue+' input='+input);
			nw = window.open(input,myValue,'');
			return (false);
		} else {
			//alert ('length<2');
			return (true);
		}
	} else {
		//alert ('not found');
		return (true);
	}
}

function openPrintMode(myUrl,winMode,pluginName) {
	var pM = document.getElementsByName(pluginName)[0].value;
	if (winMode.length<1) {
		winMode = '';
	}
	//alert ("myUrl='"+myUrl+"'\nwinMode='"+winMode+"'\npluginName='"+pluginName+"'\nprintMode='"+pM+"'");
	window.open (myUrl+'&pM='+pM);
}

