var allpatologie_already_loaded = false;

window.onload = function() {

	// png fix (IE 5.5 e 6)
	if (document.all && document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule) {
		document.styleSheets[0].addRule('img', 'behavior: url("../includes/iepngfix.htc")');
	}
	
	$('#nav li').each(function() {
		$(this).mouseover(function()  { $(this).find('ul').show(); $(this).children().addClass('hover'); });
		$(this).mouseleave(function() { $(this).find('ul').hide(); $(this).children().removeClass('hover'); });
	});
	
	
	//$('#popup_rpp').mouseover(function () 	{	$(this).addClass('selected'); });
	//$('#popup_rpp').mouseleave(function () 	{	$(this).removeClass('selected'); });
	$('#popup_rpp').click(function () { visualizzaPatologie(); });
  
  //$('#hidden_patologie').height((document.documentElement.clientHeight - 6) +"px");
	
  function visualizzaPatologie() {
		if ($('#hidden_patologie').css('display') == 'none') {
			if (!allpatologie_already_loaded) {
				$('#hidden_patologie').show();
				$('#hidden_patologie').load('../ricerca-per-patologia/_allpatologie.php',null);
				allpatologie_already_loaded = true;
			} else
				$('#hidden_patologie').fadeIn(200);
		} else
			$('#hidden_patologie').fadeOut(200);
	}
	
} 