function getBrowser(){
	ua = new Object();
	var useragent = navigator.userAgent;

	//  Opera ==> ua.Opera
	if ( useragent.match( /Opera[\/\s](\d+\.\d+)/ ) && RegExp.$1 >= 6 ){ ua.Opera = RegExp.$1; return true; }

	//  Internet Explorer ==> ua.InternetExplorer
	if ( useragent.match( /MSIE (\d+\.\d+);/ ) && RegExp.$1 >= 5 ){ ua.InternetExplorer = RegExp.$1; return true; }

	//  Netscape6 ==> ua.Netscape
	if ( useragent.match( /Netscape6\/(\d+\.\d+)/ ) ){ ua.Netscape = RegExp.$1; return true; }

	//  Mozilla ==> ua.Mozilla
	if ( useragent.match( /^Mozilla\/5\.0.+rv:(\d+\.\d+).+Gecko/ ) && RegExp.$1 >= 1 ){ ua.Mozilla = RegExp.$1; return true; }

	ua.other = 1; return false; 
}

// Autosize pop-up
// Set the horizontal and vertical position for the popup

PositionX = 20;
PositionY = 30;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 600;
defaultHeight = 800;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

Scroll = "no";
if (screen.width < 1024){Scroll = "yes";}

var AutoClose = true;

// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
var optNN='scrollbars=' + Scroll + ',width='+ defaultWidth +',height='+ defaultHeight +',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=' + Scroll + ',width=' + defaultWidth + ',height=' + defaultHeight + ',left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
	writeln('<html><head><title>Loading...</title><style>body{margin:0px;padding:0px;}</style>');writeln('<sc'+'ript>');
	writeln('var isNN,isIE;');
	writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
	writeln('isNN=(navigator.appName=="Netscape")?1:0;');
	writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');	
	writeln('function reSizeToImage(){');
	writeln('moveTo(0,0);');
	writeln('if (isIE){');
	writeln('window.resizeTo(100,100);');
	writeln('width=100-(document.body.clientWidth-document.images[0].width) + 10;');
	writeln('if (screen.height < 100-(document.body.clientHeight-document.images[0].height)){height = screen.height; Scroll = "yes";}');
	writeln('else{height=100-(document.body.clientHeight-document.images[0].height); Scroll = "no";}');
	writeln('window.resizeTo(width,height);}');
	writeln('if (isNN){');       
	writeln('window.innerWidth=document.images["image"].width;');
	writeln('window.innerHeight=document.images["image"].height;}}');
	writeln('function doTitle(){document.title="'+imageTitle+'";}');
	writeln('</sc'+'ript>');
	if (!AutoClose) writeln('</head><body bgcolor="#ffffff" scroll="' + Scroll + '" onload="reSizeToImage();doTitle();self.focus()">')
	else writeln('</head><body bgcolor="#ffffff" scroll="' + Scroll + '" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
	writeln('<img name="image" src='+imageURL+' style="display:block" border=0></body></html>');
	close();
	}
}
