var p;

function pi(name, w, h)
{
	p = window.open(name, 'gallery', 'scrollbars=yes,width=' + (w + 60) + ',height=' + (h + 240));
	if (window.focus) { p.focus(); }

	return false;
}


function resizeDialogToContent()
{

	var agt=navigator.userAgent.toLowerCase();
	var appVer = navigator.appVersion.toLowerCase();
	var is_opera = (agt.indexOf('opera') != -1);
	var is_ie  = (appVer.indexOf('msie') != -1);
	var is_gecko = ((navigator.product)&&(navigator.product.toLowerCase()=='gecko'))?true:false;

	if (is_ie && !is_opera && !is_gecko) {
		window.resizeTo(this.document.all['img'].width + 60, this.document.all['img'].height + 240);
	} else {
		window.sizeToContent();
	}

	return false;

}

function newwin(width,height,img, title){
	var sizer;
	sizer=window.open('','','left='+(parseInt((screen.availWidth-width)/2)-3)+',top='+(parseInt((screen.availHeight-height)/2)-40)+',width='+width+',height='+height+',status=yes,toolbar=no,menubar=no,resizable=no'); 
	sizer.document.write('<html><head><title>'+title+'</title></head><body bgcolor=#ffffff rightmargin=0 bottommargin=0 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><img src="'+img+'" width="'+width+'" height="'+height+'" /></body></html>');
}

