/* Browser sniffer */

function browsercheck(){
	this.user=navigator.userAgent;
	this.mac=(window.navigator.platform == 'MacPPC' || window.navigator.platform == 'MacIntel')?1:0;
	this.pc=(window.navigator.platform == 'Win32')?1:0;
	this.explorer=(this.user.indexOf('MSIE')!=-1)?1:0;
	this.safari=(this.user.indexOf('Safari')!=-1)?1:0;
	this.firefox=(this.user.indexOf('Firefox')!=-1)?1:0;
	this.strd=document.getElementById?1:0;
	this.n5=(this.strd && this.user.indexOf('Netscape')!=-1 && this.safari != 1)?1:0;
	this.expWin = (this.pc && this.explorer)?1:0;
	this.exp5win = (this.pc && this.explorer && this.user.indexOf('MSIE 5.')!=-1)?1:0;
	this.exp5mac = (this.mac && this.explorer && this.user.indexOf('MSIE 5.')!=-1)?1:0;
	this.exp50mac = (this.mac && this.user.indexOf('5.0')!=-1)?1:0;
	this.exp51mac = (this.mac && this.user.indexOf('5.1')!=-1)?1:0;
	this.exp52mac = (this.mac && this.user.indexOf('5.2')!=-1 && this.safari != 1)?1:0;
}

br=new browsercheck();

/* Popup */

var pop;

function openPopup(str,w,h,scroll,center){
	var bartrig = (scroll != true)?'no':'yes';
	w = (bartrig == 'yes') ? w+15 : w;
	if(pop && !br.safari){  
		if(!pop.closed){ pop.close(); }
		delete pop; 
	}
	
	if(center == true){
		var l = (screen.width-w)/2;
		var t = (screen.height-h)/2;
	}
	
	pop = window.open(str,'popup','scrollbars='+bartrig+',resizable=no,width='+w+',height='+h+',top='+t+',left='+l+',status=no,location=no,toolbar=no');

	if(br.safari){ h = h+23; pop.resizeTo(w,h); }
	if(br.firefox){ h = h+18; pop.resizeTo(w,h); }
	
	setTimeout("pop.focus()",60);
}
