function showscreenshot(i,w,h,c)
{
        m='screenshot';
        s=0;

        if(w>screen.availWidth-50)
        {
                w=screen.availWidth-50;
                s=1;
        }
        if(h>screen.availHeight-50)
        {
                h=screen.availHeight-50;
                s=1;
        }

        o='toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,scrollbars='+s+',width='+w+',height='+h;

        if(s)
        {
                o+=',top=10,left=10'
        };
        
        if(c)
        {
        	caption = '<div id="srccaption" style="position:absolute; top:10px; left:10px; right:10px; z-index:100; background-color:#ffffff; border:1px #000000 solid; padding:10px;"><div style="float:left; font:10pt Arial, helvetica, sans-serif;">'+c+'</div><div style="float:right; font:8pt Arial, helvetica, sans-serif;"><a href="javascript://" onclick="document.getElementById(\'srccaption\').style.display=\'none\';">Hide caption</a></div></div>';
        }
        else
        {
 					caption = '';
        }

        wd=window.open('','',o)
        wd.document.write('<html><head><title>Screenshot</title></head><body style="margin:0px;">'+caption+'<img src="'+i+'" onclick="top.window.close();" style="position:absolute; top:0px; left:0px; z-index:1;"></body></html>');
        wd.document.close();
        wd.focus();
}

scrloc = '/img/products/';
 
 
function showthumb(cat,scr,typ,w,h,cap)
{
	if(cap)	{capt = ',\''+cap+'\'';}	else {capt = '';}
	document.write('<a href="javascript:showscreenshot(\''+scrloc+cat+'/'+scr+'.'+typ+'\','+w+','+h+capt+');"><img src="'+scrloc+cat+'/'+scr+'_thumb.'+typ+'" style="margin: 5px 8px 5px 0px;"  title="Click to view" border="0"></a> ');
}


