var imginrowmax=4;
var imginrow=1;
var width=120;
var prevstring='';
function addImageInit(fullwidth){if(!fullwidth){fullwidth=380;}document.write('<table cellspacing="2" cellpadding="0" border="0" align="center" width="'+fullwidth+'"><tr>');for(x=0;x<imginrowmax;x++)document.write('</tr><tr>');}
function addImage(src,name,size,w,h){if(!w){w=800}if(!h){h=600}if(!name){name=src;}imgtmp='';if(imginrow==imginrowmax+1){imgtmp+='</tr><tr>';imginrow=1;}imginrow++;imgtmp+='<td class="prev" align="center" width="'+width+10+'">';imgtmp+='<a href="'+picsdir+src+'.jpg" onclick="openImage(\''+picsdir+src+'.jpg\','+w+','+h+');return false;" onfocus="blur();" target="_new" class="prevlink">';imgtmp+='<img src="'+previewsdir+src+prevstring+'.jpg" hspace=0 border=0>';imgtmp+='</a><br>';imgtmp+='<span class="little1"><span class="bold">'+name+'</span>';if(size){imgtmp+='<br>'+size+' kB ('+w+'x'+h+')'}imgtmp+='</span>';imgtmp+='</td>';document.write(imgtmp);}
function openImage(file,width,height){temp=0;maxwidth=(screen.availWidth-50);maxheight=(screen.availHeight-50);winwidth=width;winheight=height;if(width>maxwidth){winwidth=maxwidth;temp=1;}if(height>maxheight){winheight=maxheight;winwidth+=16;}if(temp==1){winheight+=16;}big=window.open('about:blank','','width='+winwidth+',height='+winheight);big.moveTo(0,0);big.document.write('<html><title>Image Browser</title><sc'+'ript>document.onkeydown=keyhandler; function keyhandler() { switch(window.event.keyCode) {case 0x1b:self.close();break; case 0x20:self.close();break;}}</sc'+'ript><body scroll=auto topmargin="0"leftmargin="0" bottommargin="0" rightmargin="0"><img src="'+file+'" border="0" width="'+width+'" height="'+height+'" alt=""></body></html>');}
function addImageEnd(){document.write('</tr></table><br><br>');imginrow=1;}
