IE=navigator.appName==="Microsoft Internet Explorer";
Opera=navigator.appName==="Opera";
//alert(IE);
function zoom(src,w,h) {

	ww=w;
	wh=h;

	sb="no";
	if(ww>900) {ww=900; sb='yes';}
	if(wh>700) {wh=700; sb='yes';}

	lp = (screen.width) ? (screen.width-ww)/2 : 0;
	tp = (screen.height) ? (screen.height-wh)/2 : 0;



	html='<html><head><title>Zoom</title>'+'</head><body bgcolor=#FFFFFF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 >'+
			'<a href="javascript:self.close()"><img src="'+src+'" border=0 title="" width='+w+' height='+h+'></a></body></html>';

        if (IE) {
        	ww = ww-2;
	        wh = wh-2;
win=window.open('','_blank','width='+ww+',height='+wh+',resizable=yes'+',top='+tp+',left='+lp+',scrollbars='+sb+',status=no');

        }
        else {
  			//alert(Opera);
			if(Opera) win=window.open(src,'_blank','width='+ww+',height='+wh+',resizable=yes'+',top=100,left=100,scrollbars='+sb+',status=no');
			else win=window.open(src,'_blank','width='+ww+',height='+wh+',resizable=yes'+',top='+tp+',left='+lp+',scrollbars='+sb+',status=no');
        }
		win.document.open();
		win.document.write(html);
		win.document.close();
		win.focus();
		//win.resizeTo(ww,wh);
}

function refr(id){
	obj=document.getElementById(id);
	obj.src=obj.src;

}

function crop(file,w,h,img){
	w=w+45;
	h=h+110;
	win=window.showModalDialog("/crop.php?filename="+file,"","dialogHeight:"+h+"px; dialogWidth:"+w+"px; resizable:yes; status:no; help:no; scroll:no");

	if(win) setTimeout("refr('"+img+"')",3000);
}