function ShowPic(classid,id) {

  var winClose = 0;
  if (window.viewimage != null && ! viewimage.closed)
  {
    viewimage.close();
    winClose = 1;
  }

  if (window.viewimage == null || viewimage.closed || winClose)
  {
	url="ClassAlbum.asp?CLassID="+classid+"&Action=ShowPhoto&PhotoID="+id;
    var w_opt="width=800,height=600,resizable=0,scrollbars=1,menubar=0,toolbar=1,status=1";
    viewimage=window.open(url,"Preview",w_opt);

    if (window.viewimage != null)
      viewimage.focus();
  }

}


function zoomout()
{            
	var height1=photo.height;           
	var width1=photo.width;         
	height1=height1/1.2;
	width1=width1/1.2;
	if (width1<=60||height1<=60)
	{return;}
	photo.height=height1;
	photo.width=width1;        
}             
          
function zoomin()
{            
	var height1=photo.height;
	var width1=photo.width;
	height1=height1*1.2;
	width1=width1*1.2;
	if (width1>580)
	{return;}
	photo.height=height1;       
	photo.width=width1;
}             
 

function fitpage(pwidth,pheight)
{
	var height1;
	var width1;
	if (pwidth<=580){
		height1=pheight;          
		width1=pwidth;
		}
	else
		{
		width1=580;
		height1=width1*pheight/pwidth;
		}
	photo.height=height1;
	photo.width=width1;
}

