
function GrowFromCenter(u,n,w,h,f){
var WO=(d=document,WW=WH=100,s=window.screen,ws=s?1:0,sw=ws?s.availWidth:800,sh=ws?s.availHeight:640,x=(sw-WW)/2,y=(sh-WH)/2,l=(sw-w)/2,t=(sh-h)/2,s='width='+WW+',height='+WH+',top='+y+',screeny='+y+',left='+x+',screenx='+x,s+=(d.layers)?',resizable':'',s+=(!f||f=='')?'':','+f,W=self[n]=window.open('',n,s),(W&&!W.closed)?1:0);

while(WW!=w||WH!=h){

if(WO&&WW<w){W.moveTo((sw-WW)/2,(sh-WH)/2);W.resizeTo(WW,WH);WW*=1.3}

if(WO&&WW>w){WW=w;W.moveTo((sw-WW)/2,(sh-WH)/2);W.resizeTo(WW,WH)}

if(WO&&WH<h){W.moveTo((sw-WW)/2,(sh-WH)/2);W.resizeTo(WW,WH);WH*=1.3}

if(WO&&WH>h){WH=h;W.moveTo((sw-WW)/2,(sh-WH)/2);W.resizeTo(WW,WH)}}

if(d.layers){W.outerHeight=h;W.outerWidth=w;}W.moveTo(l,t);

W.document.location=u;W.focus();}

var myWindow;
function okno(url) {
    var width = 820;
    var height = 600;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status,resizable,scrollbars,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);
}






