var newWindow;
var wheight = 0, wwidth = 0;

function popup(url, title, width, height) {

	if (!newWindow || newWindow.closed) {

		newWindow = window.open('', 'htmlname', 'width=' + width + ', height=' + height + ', resizable=1, top=50, left=20');
		wheight = height;
		wwidth = width;
	}

	if (wheight != height || wwidth != width) {
		newWindow.resizeTo(width, height);
		wheight = height;
		wwidth = width;
	}
	
	newWindow.document.clear();
	newWindow.focus();
	newWindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head>');
	newWindow.document.writeln('<body style="margin: 0px; padding: 0px">');
	newWindow.document.writeln('<img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" >');
	newWindow.document.writeln(' <\/body> <\/html>');
	newWindow.document.close();
	newWindow.focus();
}

function popupflashurl(url, title, width, height) {
	
	if (width == undefined)  var width = 800;
	if (height == undefined) var height = 600;
	
	var wstat;
	var ns4up  = (document.layers) ? 1 : 0;
	var ie4up  = (document.all) ? 1 : 0;
	var xsize  = screen.width;
	var ysize  = screen.height;
	var xpos= (xsize - width)/2;
	var ypos= (ysize - height)/2;
	wstat = window.open(url, title, "scrollbars=no,status=no,toolbar=no,location=no,directories=no,resizable=no,menubar=no,width="+width+",height="+height+",screenX="+xpos+",screenY="+ypos+",top="+ypos+",left="+xpos)
}


