function picture(URL,Wname) { 
myimg =new Image();
myimg.src=URL; 
x=0; y=0; 
xMax=screen.availwidth-20;
yMax=screen.availheight-40;
L=0;
if  (myimg.height<yMax) 
    {
	   y=(myimg.height+40);
	   L=0
	 } 
	 else  
	 {
	     y=yMax;
	     L=1
	 }
if  (myimg.width<xMax)  
   { x=myimg.width+20}
    else 
	{
	  x=xMax;
	  L=1
	 };
w1=window.open(myimg.src, Wname, config="width="+x+", height="+y+", toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars="+L+", resizable=1");
w1.width=x;
w1.height=y
} 