
/******************************************************
Window tools
===========================
Copyright (c) 2000 by mars69 (mars69@people.cz)
*******************************************************/

var PopupWindow = null;
var pop_win_params = "fullscreen=no,directories=no,history=no,location=no,menubars=no,menubar=no,resizable=yes,scrollbars=yes,statusbars=yes,status=no,titlebar=yes,toolbar=no";

// general popWin definition
function popWin( theURL, i_width, i_height, s_title ) {
    i_height += 16;
    if (parseInt(navigator.appVersion) >= 4) { winl = 100, wint = 100; }
    var winl = (screen.width - i_height) / 2;
    var wint = (screen.height - i_width) / 2;
    day = new Date();
    eval ("page"+s_title+" = window.open(\""+theURL+"\",\""+s_title+"\",\""+pop_win_params+",width="+i_width+",height="+i_height+",left="+winl+",top="+wint+"\");");
}

function ClosePopupWindow()
{
	if (PopupWindow != null) PopupWindow.close();
	//if (typeof(PopupWindow) == "object") PopupWindow.close();
}

function HelpWindow( source ) {
	i_width = 520;
	i_height = 300;
	PopupWindow = window.open("./system_help.php?src="+source+"", "Help", "left=10,top=10,width="+i_width+",height="+i_height+","+pop_win_params+"");
}

function HTMLWindow( theURL, i_width, i_height, s_title ) {
	ClosePopupWindow();
	PopupWindow = window.open(theURL, s_title, "left=10,top=10,width="+i_width+",height="+i_height+","+pop_win_params+"");
    PopupWindow.focus();
}

function ImageWindow( theImageURL, i_width, i_height, s_title ) {
	ClosePopupWindow();
	PopupWindow = window.open("", s_title, "left=10,top=10,width="+i_width+",height="+i_height+","+pop_win_params+"");
	with (PopupWindow.document) {
		open();
		writeln("<html><head><title>"+s_title+"</title></head>");
		writeln("<body style=\"margin: 0; padding: 0;\" onLoad=\"window.focus()\">");
		writeln("<div style=\"text-align: center;\"><a href=\"javascript:close()\"><img style=\"border: none;\" src=\""+theImageURL+"\" alt=\"close/zavri\" /></a></div>");
		writeln("</body></html>");
		close();
	}
    PopupWindow.focus();
}

function UnloadCleanup()
{
	ClosePopupWindow();
}


