
utilities = { /* funzioni di appoggio */

	

	addLoadListener:function(functionRef)
	{
	  if (typeof window.addEventListener != 'undefined')
	  {
		window.addEventListener('load', functionRef, false);
	  }
	  else if (typeof document.addEventListener != 'undefined')
	  {
		document.addEventListener('load', functionRef, false);
	  }
	  else if (typeof window.attachEvent != 'undefined')
	  {
		window.attachEvent('onload', functionRef);
	  }
	  else
	  {
		var oldListener = window.onload;
		if (typeof window.onload != 'function')
		{
		  window.onload = functionRef;
		}
		else
		{
		  window.onload = function()
		  {
			oldListener();
			return functionRef();
		  };
		}
	  }
	},
	
		
	changeBg:function() {
		
		
	
		bgElement = document.getElementById('wrapper');
		
		if (window.innerWidth)
			myWidth = window.innerWidth;
		else if(document.documentElement && document.documentElement.clientWidth)
			myWidth = document.documentElement.clientWidth;
		else
			myWidth = 800;
	
		
		
		if (parseInt(myWidth) >= 1130) {
		
			bgElement.style.backgroundImage = 'url(img/bough2.gif)';
			
		}
		else if (parseInt(myWidth) < 1130 && parseInt(myWidth) >= 1010) {
			bgElement.style.backgroundImage = 'url(img/bough2b.gif)';
		
		}
		else if (parseInt(myWidth) < 1010) {
		
			bgElement.style.backgroundImage = 'url()'
		
		}
	
	
	}

}

function onContent(f){//(C)webreflection.blogspot.com
var a=onContent,b=navigator.userAgent,d=document,w=window,c="onContent",e="addEventListener",o="opera",r="readyState",
s="<scr".concat("ipt defer src='//:' on",r,"change='if(this.",r,"==\"complete\"){this.parentNode.removeChild(this);",c,".",c,"()}'></scr","ipt>");
a[c]=(function(o){return function(){a[c]=function(){};for(a=arguments.callee;!a.done;a.done=1)f(o?o():o)}})(a[c]);
if(d[e])d[e]("DOMContentLoaded",a[c],false);
if(/WebKit|Khtml/i.test(b)||(w[o]&&parseInt(w[o].version())<9))(function(){/loaded|complete/.test(d[r])?a[c]():setTimeout(arguments.callee,1)})();
else if(/MSIE/i.test(b))d.write(s);
}


onContent(utilities.changeBg);

window.onresize= utilities.changeBg;