// <key>__BROWSER_SUPPORT</key>

//Funzione per reperire le info sul browser
function getBrowserObj()
{
	this.agent = navigator.userAgent;
	this.version = navigator.appVersion;
	
	//Controlla il DOM
	if (document.getElementById)
		this.hasDom = true;
	else
		this.hasDom = false;
		
	//Controlla Internet Explorer (qualsiasi versione)
	this.isIE = this.version.indexOf("MSIE ") > -1 && this.hasDom;
	//Controlla Netscape (qualsiasi versione)
	if (this.hasDom && parseInt(this.version) >= 5)
		this.isNS6 = true;
	else
		this.isNS6 = false;
	if (document.layers && !this.hasDom) 
		this.isNS4 = true;
	else
		this.isNS4 = false;
	this.isNS = (this.isNS6 || this.isNS4);
	this.recognisedBrowser = (this.isIE || this.isNS)
	
	//Emette un messaggio di errore se il browser non e' supportato
	if(!this.recognisedBrowser)
		alert("Attention. This application needs Microsoft Internet Explorer 5+ or Netscape Navigator 6+");
	
	//Inizializza le dimensioni della finestra del browser
	this.xStart = 0;
	this.xEnd = this.isIE && document.body.offsetWidth-20 || innerWidth || 0;
	if(this.isNS6) this.xEnd -= 2;
	this.yStart = 0;
	this.yEnd = this.isIE && document.body.offsetHeight-5 || innerHeight || 0;
	if(this.isNS6) this.yEnd -= 4;
	if(!this.xEnd||!this.yEnd) return "Document has no width or height";
	this.yTop=140*100/this.yEnd;
	this.avail=(this.yEnd*(100-this.yTop))/100 ;
	this.screenWidth = screen.availWidth;
	this.screenHeight = screen.availHeight;
	this.centerX = Math.round(this.screenWidth / 2);
	this.centerY = Math.round(this.screenHeight / 2);
	return this
}