function isNN4(){return (null!=document.layers)}
function isOpera(){return (navigator.userAgent.toLowerCase().indexOf("opera")!=-1)}
function isNN6(){return (navigator.userAgent.toLowerCase().indexOf("mozilla/5")!=-1)}
function isIE5(){return (navigator.appVersion.toLowerCase().indexOf("msie 5")!=-1)}
function isWebTV(){return (navigator.appName.toLowerCase().indexOf("webtv")!=-1)}
gbNN4=isNN4()
gbIE5=isIE5()
gbNN6=isNN6()
gbOpera=isOpera()
gbDom=(gbNN6||gbIE5||gbOpera)
gbIE4=(!(gbDom||gbNN4)) 

var _console = null;

//.........................................................................................
// check MSIE version (is needed for compatibility with old pages)
var MyBrowserNam=navigator.appName;
var MyBrowserAgent=navigator.userAgent;
function msieversion() {
	var msie=MyBrowserAgent.indexOf("MSIE");
	if (msie > 0) return parseInt (MyBrowserAgent.substring (msie+5, MyBrowserAgent.indexOf ( ".", msie )))
	else return 0
}

//.........................................................................................
// open new popup window with auto centering it

function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2.5 : 10;
	TopPosition = (screen.height) ? (screen.height-h)/2.5 : 10;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	_console = window.open(mypage,myname,settings);
	_console.focus()
}

//.........................................................................................
// open new window with title, inner text, 
// specified width and height of window and submit button appearance

function showwin( title, text, width, height, submitbutton ) {
	leftPosition = (screen.width) ? (screen.width-width)/2 : 10;
	topPosition = (screen.height) ? (screen.height-height)/2 : 10;
	_console = window.open("", "", "width="+width+",height="+height+",top="+topPosition+",left="+leftPosition+",toolbar=no,menubar=no,resizable=yes,scrollbars=no");
	_console.document.open("text/html");
	_console.document.writeln("<html>");
	_console.document.writeln("<head>");
	_console.document.writeln("<title>" + title + "</title>");
//		_console.document.writeln('<link REL="STYLESHEET" TYPE="text/css" HREF="styles/mx.css">');
	_console.document.writeln("</head>");
	_console.document.writeln('<body bgcolor="#ffffcc" marginwidth=0 marginheight=0 leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0>');
	_console.document.writeln('<div align="center">');
	_console.document.writeln('<table cellpadding=0 cellspacing=0 border=0 width="100%" height="100%"><tr><td align="center" valign="middle" width="100%">');
	_console.document.writeln(" \
<table cellpadding=10 cellspacing=0 border=0> \
<tr><td class='title1'>" + title + "</td></tr> \
<tr><td>" + text + "</td></tr></table><br>");
	_console.document.writeln(submitbutton);
	_console.document.writeln("&nbsp;&nbsp;</td></tr></table></div>");
	_console.document.writeln("</body></html>");
	_console.focus();
}
//.........................................................................................
// open picture in new window with title, inner text, 
// specified width and height of window and submit button appearance

function showpic( body, title, width, height ) {
	leftPosition = (screen.width) ? (screen.width-width)/2 : 10;
	topPosition = (screen.height) ? (screen.height-height)/2 : 10;
	_console = window.open("", "", "width="+width+",height="+height+",top="+topPosition+",left="+leftPosition+",toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
	 _console.document.open("text/html");
	_console.document.writeln("<html>");
	_console.document.writeln("<head>");
	_console.document.writeln("<title>" + title + "</title>");
//		_console.document.writeln('<link REL="STYLESHEET" TYPE="text/css" HREF=".gen.css">');
	_console.document.writeln("</head>");
	_console.document.writeln('<body bgcolor="#ffffcc" marginwidth=0 marginheight=0 leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0>');
	_console.document.writeln('<script>document.body.style.cursor="wait"</script>');
	_console.document.writeln('<table cellpadding=0 cellspacing=0 border=0 width="100%" height="100%"> \
<tr><td align="center" valign="middle" width="100%"><img src="' + body + '" border=0 alt="' + title + '"></td></tr></table>');
	_console.document.writeln;
	_console.document.writeln('<script>document.body.style.cursor="auto"</script>');
	_console.document.writeln("</body></html>");
	_console.focus();
}