var imaop, ima;

function wait(){
	if(!imaop.width){ setTimeout("wait()",50); return; }
	var x = imaop.width+25; var y = imaop.height+25;
	window.onerror=null;
	var mywin=eval('window.open(ima,\'GFX\',\'status=no,left=0,top=0,scrollbars=no,width='+x+',height='+y+'\'); ');
	mywin.onfocus=null; mywin.focus();
}//wait

function okno(ima2) {
	ima = ima2;
	imaop = new Image(); imaop.src = ima; wait();
}//winop

function win(url, width, height) {
	width1=width/2;
	height1=height/2;
	x=screen.availWidth/2-width1;
	y=screen.availHeight/2-height1;
    var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no, menubar=no, left='+x+', top='+y );
	Win.resizeTo(width, height);
	Win.focus();
};
