var my_win=null;

function open_window(mypage,myname,w,h,scroll,menubar,toolbar,resize)
{
	LeftPosition=(screen.width)?(screen.width-w)/2:100;
	TopPosition=(screen.height)?(screen.height-h)/2-50:100;
	if(w=='') LeftPosition=0;
	if(h=='') TopPosition=0;
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar='+menubar+',toolbar='+toolbar+',resizable='+resize;
	my_win=window.open(mypage,myname,settings);
	if(w=='' & h=='') my_win.resizeTo(screen.availWidth,screen.availHeight);
	my_win.focus();
}

function open_map_window(mypage)
{
	open_window(mypage,'','','','yes','yes','no','yes');
}

function open_print_window(mypage)
{
	open_window(mypage,'lgt2_print_window',650,500,'yes','yes','no');
}

function open_mail_window(mypage)
{
	open_window(mypage,'lgt2_mail_window',650,300,'no','no','no');
}

function open_redak_window(mypage)
{
	open_window(mypage,'lgt2_redak_window',460,280,'no','no','no');
}

function open_preview_window(mypage,w,h)
{
	open_window(mypage,'lgt2_preview_window',w,h,'yes','no','no');
}

function open_image_window(mypage)
{
	open_window(mypage,'lgt2_image_window',700,600,'yes','no','no');
}

function open_text_window(title,text,w,h,scroll)
{
	LeftPosition=(screen.width)?(screen.width-w)/2:100;
	TopPosition=(screen.height)?(screen.height-h)/2:100;
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	my_win=window.open("","lgt2_note_window",settings);
	my_win.document.write('<html>\n');
	my_win.document.write('<head>\n<title>'+title+'</title>\n');
	my_win.document.write('<LINK REL="StyleSheet" HREF="styles/amber/style.css" TYPE="text/css">\n');
	my_win.document.write('</head>\n');
	my_win.document.write('<body bgcolor="OldLace">\n');
	my_win.document.write(text);
	my_win.document.write('<hr width="100%" color="Black" size="1"><center><form><input type="button" value="Uždaryti langą" onclick="window.close();"></form></center>\n');
	my_win.document.write('</body>\n');
	my_win.document.write('</html>\n');
	my_win.focus();
}
