function getViewportSize() { 
			var size = [0, 0]; 
			if (typeof window.innerWidth != "undefined") { 
				size = [window.innerWidth, window.innerHeight];
			} 
			else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) {
				size = [document.documentElement.clientWidth, document.documentElement.clientHeight]; 
			}
			else {
				size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight]; 
			}
			return size; 
		}
		
		function createFullBrowserFlash() {
			swfobject.createCSS("html", "height:100%;");
			swfobject.createCSS("body", "height:100%;");
			swfobject.createCSS("#container", "margin:0; width:100%; height:100%; min-width:990px; min-height:620px; background-color:#FFFFFF;");
			
			var size = getViewportSize();
			
			if(size[1] < 620){
					swfobject.createCSS("body", "overflow:auto;");
				}else{
					swfobject.createCSS("body", "overflow:hidden;");
				}
			
			window.onresize = function() {
				var el = document.getElementById("container");
				var size = getViewportSize(); 
 				el.style.width = size[0] < 990 ? "990px" : "100%";
				el.style.height = size[1] < 620 ? "620px" : "100%";
			
				if(size[1] < 620){
					swfobject.createCSS("body", "overflow:auto;");
				}else{
					swfobject.createCSS("body", "overflow:hidden;");
				}
			
			};
			window.onresize();
		}
		
		var flashvars = {};
		flashvars.domain = "*";
		flashvars.language = "0";

		var params = {};
		params.menu = "false";
		params.bgcolor = "#0a0a0a";
		params.allowFullScreen = "true";
		params.wmode = "opaque";
		
		var attributes = {};
		attributes.id = "flashswf";
		attributes.name = "flashswf";
		
		swfobject.embedSWF("berti.swf", "flashcontent", "100%", "100%", "9.0.124", "expressInstall.swf", flashvars, params, attributes);
		if (swfobject.hasFlashPlayerVersion("9.0.124")) {
			swfobject.addDomLoadEvent(createFullBrowserFlash);
		}
		//]]>
		
		
var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17765515-1']);
  _gaq.push(['_setDomainName', 'none']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

function segnaVisita($link){
	
	
			if(SWFAddress.getTitle()!=''){
				
				if($link.indexOf('.html')!=-1 || $link=='/' ){
					_gaq.push(['_setAccount', 'UA-17765515-1']);
	  				_gaq.push(['_setDomainName', 'none']);
	  				_gaq.push(['_setAllowLinker', true]);
	 				 _gaq.push(['_trackPageview',$link]);
				}
			
			}
}


var deviceList = /(ipad|nokia|iphone|android|motorola|^mot\-|softbank|foma|docomo|kddi|up\.browser|up\.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\-|longcos|pantech|gionee|^sie\-|portalmmm|jig\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\s*mobi|opera\*mini|320x320|240x320|176x220)/i;

//Initialize our user agent string to lower case.
var userAgent = navigator.userAgent.toLowerCase();

//**************************
// Detects if the current device is an Mobile.
function detectMobileBrowser()
{
    if (userAgent.match(deviceList) != null)
        return true;
   else
       return false;
}

//Gabbola da eliminare non fa il detect del mobile
if(detectMobileBrowser() && false) {
        window.location = "http://www.berti.net/ipad.html"
}

