

var EF_Banner = {

	IMAGE_DIR: 'http://www.mercatonedellarredamento.com/home_images/',
	
	data: [				
		{
			tagline: 'Hai mai provato una cucina mercatone?',
			CSS: null
		},
		{
			tagline: 'Guarda le nostre cucine <br />e scopri la differenza?',
			CSS: '.home #feature { background: url(cucine.jpg) no-repeat; height: auto!important; height: 293px; min-height: 293px; margin-top: -27px; padding-top: 28px; } *:first-child+html .home #feature h1 {margin-top: 1.8em;} * html .home #feature h1 {margin-top: 1.8em;}'
		},
		{
			tagline: 'E qui cosa cacchi ci scrivo?',
			CSS: '.home #feature { background: url(salotto.jpg) no-repeat;'
		},
		{
			tagline: 'Anche qui che cacchio <br />ci vado a scrivere?',
			CSS: '.home #feature { background: url(camera.jpg) no-repeat; height: auto!important; height: 293px; min-height: 293px; margin-top: -27px; padding-top: 28px;} *:first-child+html .home #feature h1, * html .home #feature h1 {margin-top: 1.8em;}* html .home #feature h1 {margin-top: 2em;}'
		}
	],
	
	init: function()
	{
		this.get();
	},
	
	
	get: function()
	{
		
		var r = Math.floor(Math.random()*(this.data.length));
		var sel = this.data[r];
		
		document.getElementById('tagline').innerHTML = sel.tagline;
		
		if( sel.CSS )
		{
		
			var css = document.createElement('style');
			var cssContent = sel.CSS.replace("url(","url("+this.IMAGE_DIR);
			css.setAttribute('type','text/css');
			if (css.styleSheet) { // IE
				css.styleSheet.cssText = cssContent;
			}else{
				var t = document.createTextNode(cssContent);
				css.appendChild(t);
			}
			var h = document.getElementsByTagName('head')[0];
			h.appendChild(css);
		
		}
	}
	
}