function init_home(){
$(document).ready(function(){
	$('.alpha').css({
		'opacity':'0.6',
		'filter':'alpha(opacity=60)', 
		'-moz-opacity':'0.6'	});
});

$(function(){
	$('.flyers dl dt') 
		.hover(schiarisci,scurisci);

	function schiarisci(event) {
	$(this).animate({
			'opacity':'0.6',
			'filter':'alpha(opacity=60)', 
			'-moz-opacity':'0.6'
			
			},'slow')
	$(this).next().fadeIn('slow');
	}
	function scurisci(event) {
	$(this).animate({
			'opacity':'1.0',
			'filter':'alpha(opacity=100)', 
			'-moz-opacity':'1.0'  
		},'slow')
		$(this).next().fadeOut('slow');
	}
});

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-1339106-11");
pageTracker._trackPageview();
} catch(err) {}

}

function init_viewrec(){
	$(document).ready(function(){
		$('.alpha').css({
			'opacity':'0.6',
			'filter':'alpha(opacity=60)', 
			'-moz-opacity':'0.6'	});
	});
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-1339106-11");
pageTracker._trackPageview();
} catch(err) {}
}

function loadHomeRec(type){
	popolaElemento("flyers_left",'/loadHomeRec.php', 'get', 'type='+type);
	init_home();
//	document.getElementById("flyers_left").innerHTML="loadHomeRec.php?type="+type;	
}
function createRequestObj(){ // creo un'istanza XMLHttpRequest
	var re;
	var browser=navigator.appName;
	if (browser=="Microsoft Internet Explorer"){ // sniff browser
		re=new ActiveXObject("Microsoft.XMLHTTP");
	} else re=new XMLHttpRequest();
	return re;
}

function popolaElemento(idElDaPopolare, paginaFonteDati, metodo, parametri){ // faccio una richiesta
	//alert(parametri); // debug
	var url=paginaFonteDati+"?" + parametri
	var http=createRequestObj();
	http.open(metodo, url , true)
	document.getElementById(idElDaPopolare).innerHTML="";
//	alert(http.responseTex);
	http.onreadystatechange=function(){
		if (http.readyState==4 || http.readyState=="complete"){
			if (http.status == 200){
				document.getElementById(idElDaPopolare).innerHTML=http.responseText;
			} else {
				document.getElementById(idElDaPopolare).innerHTML="ERRORE";
			}
		}
	}
	http.send(null);
}


