function WriteThumb(img,url,alt,blank,highlight,imgwidth,imgheight)
{
var thumbWidth=0;
var thumbHeight=0;
if (imgwidth<imgheight)
{
	if (imgheight>140)
	{
	  thumbHeight=140;
	}
	else
	{
	  thumbHeight=imgheight;
	}
}
else
{
	if (imgwidth>140)
	{
	  thumbWidth=140;
	}
	else
	{
	  thumbWidth=imgwidth;
	}
}
var thumbHWidth=thumbWidth;var thumbHHeight=thumbHeight;
        if (blank==null)
                blank=false;
        if (highlight==null)
                highlight=false;
        with(document){
                write("<table class='thumbnail'>");
                write("<tr><td width=152 height=152 align='center' valign='middle'>");
                write("<a href='");
                write(url);
                if (blank)
                        write("' target='_blank'>");
                else
                        write("'>");
                write("<img src='");
                write(img);
                write("' alt='");
                write(alt);
                write("' ");
                if (highlight){
                        if (thumbHWidth>0){
                                write(" width='");
                                write(thumbHWidth);
                                write("' ");
                        }
                        if (thumbHHeight>0){
                                write(" height='");
                                write(thumbHHeight);
                                write("' ");
                        }
                }else{
                        if (thumbWidth>0){
                                write(" width='");
                                write(thumbWidth);
                                write("' ");
                        }
                        if (thumbHeight>0){
                                write(" height='");
                                write(thumbHeight);
                                write("' ");
                        }
                }
                write("></a></td></tr></table>");
        }

}

function WriteThumb2(img,url,alt,blank,highlight,imgwidth,imgheight)
{
var thumbWidth=0;
var thumbHeight=0;
if (imgwidth<imgheight)
{
	if (imgheight>120)
	{
	  thumbHeight=120;
	}
	else
	{
	  thumbHeight=imgheight;
	}
}
else
{
	if (imgwidth>120)
	{
	  thumbWidth=120;
	}
	else
	{
	  thumbWidth=imgwidth;
	}
}
var thumbHWidth=thumbWidth;var thumbHHeight=thumbHeight;
        if (blank==null)
                blank=false;
        if (highlight==null)
                highlight=false;
        with(document){
                write("<td width=133 height=133 align='center' valign='middle'>");
                write("<a href='");
                write(url);
                if (blank)
                        write("' target='_blank'>");
                else
                        write("'>");
                write("<img src='");
                write(img);
                write("' alt='");
                write(alt);
                write("' ");
                write("' title='");
                write(alt);
                write("' ");
                if (highlight){
                        if (thumbHWidth>0){
                                write(" width='");
                                write(thumbHWidth);
                                write("' ");
                        }
                        if (thumbHHeight>0){
                                write(" height='");
                                write(thumbHHeight);
                                write("' ");
                        }
                }else{
                        if (thumbWidth>0){
                                write(" width='");
                                write(thumbWidth);
                                write("' ");
                        }
                        if (thumbHeight>0){
                                write(" height='");
                                write(thumbHeight);
                                write("' ");
                        }
                }
                write("></a></td>");
        }

}
