var pippo;

function center_me(w,h){
	if(navigator.appName.indexOf('Explorer')+1){
		var win_width=w;
		var win_height=h;
	} else {
		var win_width=window.outerWidth;
		var win_height=window.outerHeight;
	}
	var pos_x=(screen.width-win_width)/2;
	var pos_y=(screen.height-win_height)/2;
	moveTo(pos_x,pos_y);
}

function open_pop(url,w,h){
	if(pippo) pippo.close();
	pippo = window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=no');
}

function open_it(url,w,h){
	if(pippo) pippo.close();
	pippo = window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=yes');
}

function close_pop(){
	if(pippo) pippo.close();
}



// Original:  Anders Jennerberg (anders@katedral.se)  

// Begin
function ViewImage(ifile,ix,iy,ititle) { 
var win;
var sWidth;
var sHeight;
var NS = (document.layers) ? 1 : 0;
win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
if (NS) {
sWidth = win.innerWidth;
sHeight = win.innerHeight;
} else {
sWidth = win.document.body.clientWidth;
sHeight = win.document.body.clientHeight;
}
if(sWidth!=ix || sHeight!=iy) {
win.close();
setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);

return;
}
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("</head><body>");
win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
win.document.write("<img src="+ifile+"></div></body></html>");
win.focus();
win.document.close();
}
//  End -->
