
function TCurrWin(){this.width=screen.availWidth-10;this.height=screen.availHeight-30;this.width_max=screen.availWidth;this.height_max=screen.availHeight;this.top=0;this.left=0;this.need_scroll="auto";}
var CurrWin=new TCurrWin();function GetProc(proc,all){var p=Math.round(all*proc/100);return p;}
function GetTwoNumbersFromString(s){var p=new Array(0,0);if(s==""){return p;}
var a=s.indexOf(',');if(a>1){p[0]=Math.round(s.slice(0,a));p[1]=Math.round(s.slice(a+1));}
else{p[0]=Math.round(s);p[1]=Math.round(s);}
return p;}
function Get_ImageDoc_Attr(){var p=new Array(0,0);var a=0;var doc_type=0;var doc=getObject('win_prop');if(doc){doc_type=1;}
else{doc=getObject('win_prop_proc');if(doc){doc_type=2;}
else{doc=getObject('win_prop_abs');if(doc){doc_type=3;}
else{doc_type=4;}}}
switch(doc_type){case 1:CurrWin.need_scroll="no";a=Math.round(doc.width);if(a>0){CurrWin.width=a+10;}
else{CurrWin.need_scroll="auto";}
a=Math.round(doc.height);if(a>0){CurrWin.height=a+30;}
else{CurrWin.need_scroll="auto";}
if((CurrWin.width==CurrWin.width_max)||(CurrWin.height<CurrWin.height_max)){CurrWin.need_scroll="no";}
if(CurrWin.width>CurrWin.width_max){CurrWin.width=CurrWin.width_max-2;CurrWin.need_scroll="yes";}
if(CurrWin.height>CurrWin.height_max){if(CurrWin.width<=CurrWin.width_max-22){CurrWin.width=CurrWin.width+22;}
CurrWin.height=CurrWin.height_max-2;CurrWin.need_scroll="yes";}
break;case 2:p=GetTwoNumbersFromString(doc.title);CurrWin.need_scroll="no";if(p[0]>0){CurrWin.width=GetProc(p[0],CurrWin.width_max);}
else{CurrWin.need_scroll="auto";}
if(p[1]>0){CurrWin.height=GetProc(p[1],CurrWin.height_max);}
else{CurrWin.need_scroll="auto";}
CurrWin.need_scroll="auto";break;case 3:p=GetTwoNumbersFromString(doc.title);CurrWin.need_scroll="no";if(p[0]>0){CurrWin.width=p[0];}
else{CurrWin.need_scroll="auto";}
if(p[1]>0){CurrWin.height=p[1];}
else{CurrWin.need_scroll="auto";}}
if(CurrWin.width>CurrWin.width_max){CurrWin.width=CurrWin.width_max;CurrWin.need_scroll="auto";}
if(CurrWin.height>CurrWin.height_max){CurrWin.height=CurrWin.height_max;CurrWin.need_scroll="auto";}
CurrWin.top=Math.round((CurrWin.height_max-CurrWin.height)/2);;CurrWin.left=Math.round((CurrWin.width_max-CurrWin.width)/2);}
function AdjustImageDoc(){Get_ImageDoc_Attr();window.document.body.scroll=CurrWin.need_scroll;window.resizeTo(CurrWin.width,CurrWin.height);window.moveTo(CurrWin.left,CurrWin.top);window.opener='_';}
window.onload=AdjustImageDoc;