function detectBrowser()
{
	var browserInfo=navigator.userAgent;
	var result = 'browser';
	if (browserInfo.indexOf('MSIE') != -1)
	{
		if (browserInfo.indexOf('MSIE 8.0') != -1)
			result = 'IE8';
		else if (browserInfo.indexOf('MSIE 7.0') != -1)
			result = 'IE7';
		else if (browserInfo.indexOf('MSIE 6.0') != -1)
			result = 'IE6';
		else
			result = 'IE';
	}
	else if (browserInfo.indexOf('Firefox') != -1)
	{
		if (browserInfo.indexOf('Firefox/3') != -1)
			result = 'FF3';
		else if (browserInfo.indexOf('Firefox/2') != -1)
			result = 'FF2';
		else
			result = 'FF';
	}
	else if  (browserInfo.indexOf('Chrome') != -1)
	{
		result = 'CHR';
	}
	return result;
}

//Determina il file con i nomi dei fogli CSS da includere
function getBrowserCSSLinks()
{
	var browserDetection = detectBrowser();
	
	var cssLinks = '';
	
	if (browserDetection == 'IE')
		cssLinks = 'cssLinks_IE';
	else if (browserDetection == 'IE6')
		cssLinks = 'cssLinks_IE6';
	else if (browserDetection == 'IE7')
		cssLinks = 'cssLinks_IE7';
	else if (browserDetection == 'IE8')
		cssLinks = 'cssLinks_IE8';	
	else if (browserDetection == 'FF')
		cssLinks = 'cssLinks_FF';
	else if (browserDetection == 'FF2')
		cssLinks = 'cssLinks_FF2';
	else if (browserDetection == 'FF3')
		cssLinks = 'cssLinks_FF3';
	else if (browserDetection == 'CHR')
		cssLinks = 'cssLinks_CHR';
	
	return cssLinks;
}
function sendBrowserInfo()
{
	var screen_width = screen.width;
	var browserDetection = detectBrowser();
	// Vai a principale.php con i parametri specificati
	location.href = 'principale.php?screen_width=' + screen_width + '&browser=' + browserDetection;
}
