var done=false;
function launchViewer(filename,x,y)
 { 
 if (!done)
 	{
  	window.imagex=x;
  	window.imagey=y;
  	window.imagename=filename;
  	viewer=window.open('picview.html','VIEWER','scrollbars,status,resizable');
  	viewer.opener=window;
  	viewer.focus();
 	}
 return done;
 }

var lastz=100;
function zoom(z)
	{
	lastz=z;
	window.parent.frames[1].document.open();
	window.parent.frames[1].document.writeln('<body leftmargin=0 topmargin=0 bottommargin=50 rightmargin=0 bgcolor="#fffff0">');
	window.parent.frames[1].document.writeln('<center><img src="'+window.parent.imagename+'" '+ (z==-1?'width=100%':((z!=-2&&z!=100)?(' width='+z*window.parent.imagex/100):'')) + (z==-2?'height=100%':((z!=-1&&z!=100)?(' height='+z*window.parent.imagey/100):'')) + '></center>');
	window.parent.frames[1].document.close();
	}

function OpenDialog(filename)
{
if (window.showModelessDialog) 
	{ 
		window.showModelessDialog(filename, window.parent, 'dialogWidth=400px; dialogLeft=200px; dialogTop=200px; status=no')
	} 
else 
	{ 
		alert('This method is only supported by Internet Explorer 5 and above.')
	} 
}
