function thumbnail(image,width,height)
{
	var z,zw,zh
	var oriwidth,oriheight
	oriwidth=image.width
	zw=width/oriwidth
	oriheight=image.height
	zh=height/oriheight
	z=Math.min(zw,zh)
	if(oriwidth>width||oriheight>height)
	{
		image.width=oriwidth*z
		image.height=oriheight*z
	}
	return image
}
function resizepic(thispic){
  if(thispic.width>600) thispic.width=600;
}
function bbimg(o){
  var zoom=parseInt(o.style.zoom, 10)||100;
  zoom+=event.wheelDelta/12;
  if (zoom>0) o.style.zoom=zoom+'%';
  if (zoom>0) o.style.zoom=zoom+'%';
  return false;
}

function preview(control,path)
{
	if(path.length>4)
	{
		var re=/(.gif|.jpg|.jpeg){1}/ig
		if(path.match(re))
		{
			var img=new Image()
			img.src=path
			thumbnail(img,120,80);
			document.all(control).src=img.src
			document.all(control).width=img.width
			document.all(control).height=img.height
		}
	}
}