/* (c)2003 Denis Milakov */

function sendmail(pid,sub) {
eval ("window.open('/cgi-bin/ank/afm/sendmi?f="+pid+"&subj="+sub+"','_blank', config='height=210,width=630, toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no')")
}

function e_sendmail(pid) {
eval ("window.open('/cgi-bin/ank/afm/sendmi?e_f="+pid+"','_blank', config='height=230,width=610, toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no')")
}

function statistik(pid) {
eval ("window.open('/cgi-bin/ank/afm/idcount?pid="+pid+"','_blank', config='height=510,width=410,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no')")
}

function e_statistik(pid) {
eval ("window.open('/cgi-bin/ank/afm/edcount?pid="+pid+"','_blank', config='height=510,width=410,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no')")
}

function mesage(pid) {
eval ("window.open('/cgi-bin/ank/afm/mesager?pid="+pid+"','_blank',config='height=550,width=790, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no')")
}

function window_info(mes,W,H) {
eval ("window.open('"+mes+".htm','_blank',config='width="+W+",height="+H+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')")
}

function new_window(location,W,H,target) {
if (target == '') targer='_blank';
eval ("window.open('"+location+"','"+target+"',config='width="+W+",height="+H+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')")
}

function info(mes,W,H,scroll) {
var  envar="toolbar=no, menubar=no, resizable=no, location=no, directories=no, status=no, scrollbars=";
eval ("window.open('"+mes+"','_blank',config='width="+W+",height="+H+"," + envar + scroll + "')")
}

function winopen(pic,W,H, tito) {
W1=W+6;
H1=H+6;
with (top.window.open('','_blank', 'resizable=no,scrollbars=no,menubar=no, width='+W1+', height='+H1 ).document) {
	open();
	writeln('<html>\n<head>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">\n'+
	'<TITLE>'+tito+'</TITLE>\n</head>\n'+
	'<body bgcolor="white" text="black" style="margin:3">\n'+
	'<center><a href="javascript: self.close()">'+
	'<img src="'+pic+'" title="Закрыть" border=0>'+
	'</a></center></body>\n</html>');
	close();
} }

function big_image(pic,W,H, tito) {
W1=W+7;
H1=H+7;
with (top.window.open('','_blank', 'resizable=no,scrollbars=yes,menubar=no, width='+W1+', height='+H1 ).document) {
	open();
	writeln('<html>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">\n'+
	'<head>\n<title>'+tito+'</title>\n</head>\n'+
	'<body bgcolor="white" text="black" style="margin:3">\n'+
	'<center><a href="javascript: self.close()">'+
	'<img src="'+pic+'" title="Закрыть" border=0>'+
	'</a></center></body>\n</html>');
	close();
} }

/* Используется в a_моделях. Текущее окно под объект с именем ID */
function res_w_pic(dw, dh, idname) {
if (idname == '') idname='picture';
var Pwidth  = document.getElementById(idname).width;
var Pheight = document.getElementById(idname).height;
if (Pwidth<250) Pwidth=250;
if (Pheight<450) Pheight=450;
window.resizeTo(Pwidth+dw, Pheight+dh);
//alert (Pwidth + ' - ' + Pheight);
}

/* Используется в моделях. Новое окно под размер фотографии с паспарту */
function auto_image(pic,tito) {
with (top.window.open('','_blank', 'resizable=no,scrollbars=no,menubar=no').document) {
	open();
	writeln('<html>\n<head>\n<title>'+tito+'</title>\n' +
	'<script language="JavaScript">\n'+
	'<!--\n'+
	'function res_w_pic(dw, dh, idname) {\n'+
	'var Pwidth  = document.getElementById(idname).width;\n'+
	'var Pheight = document.getElementById(idname).height;\n'+
	'window.resizeTo(Pwidth+dw, Pheight+dh);\n}\n'+
	'//-->\n'+
	'</script>\n'+
	'</head>\n\n'+
	'<body bgcolor=#eeeeee text="black" style="margin:3">\n'+
	'<center><a href="javascript: self.close()">\n'+
	'<img src="'+pic+'" title="Закрыть" border=0 onLoad=res_w_pic(26,80,\'this\') id=this>\n'+
	'</a></center>\n</body>\n</html>');
	close();
} }

//####### Эта фигня не работает ######
function win_picture(pic,W,H,tito) {
with (top.window.open('','_blank', 'resizable=no,scrollbars=no,menubar=no, width='+W+', height='+H ).document) {
	open();
	writeln('<html>\n<head>\n'+
	'<script language="JavaScript1.2" src="/Admin/function.js"></script>\n'+
	'<title>'+tito+'</title>\n</head>\n'+
	'<body bgcolor="white" style="margin:3">\n'+
	'<a href="javascript: self.close()">'+
	'<img src="'+pic+'" title="Закрыть" border=0 OnLoad=res_w_pic(5,33) id=picture>'+
	'</a>\n</body>\n</html>');
	close();
} }

