function clear(id){
	var mio_div = document.getElementById(id);
	var selettori_mio_div = mio_div.getElementsByTagName('strong');
	for(k = 0; k < selettori_mio_div.length; k++) {
		selettori_mio_div[k].style.visibility = "hidden";
	}
}

function dinamic_panel(id){
	blocco = "box_home_service";
	if (document.getElementById(blocco)){
		var mio_blocco = document.getElementById(blocco);
		var mio_nodo = mio_blocco.getElementsByTagName('li');
		for(i=0; i < mio_nodo.length; i++){
			if (mio_nodo[i].id){
				var current_div = mio_nodo[i].id;
				var mio_div_content = document.getElementById(current_div);
				mio_div_content.style.overflow = "hidden";
				if (current_div != id){
					mio_div_content.style.height="15px";
				} else {
					mio_div_content.style.height="130px";
				}
			}
		}
	}
}

function open_panel(id){
	var blocco = "box_home_service";
	var panel_open_now = "undefined";
	var height_panel_open = 141;
	if (document.getElementById(blocco)){
		var mio_blocco = document.getElementById(blocco);
		var mio_nodo = mio_blocco.getElementsByTagName('li');
		for(i=0; i < mio_nodo.length; i++){
			if (mio_nodo[i].id){
				var current_div = mio_nodo[i].id;
				var mio_div_content = document.getElementById(current_div);
				if (mio_div_content.offsetHeight != "26" && (mio_div_content.offsetHeight*1 == height_panel_open*1)){
					panel_open_now = mio_nodo[i].id;
					height_panel_open = mio_div_content.offsetHeight;
				} else if (mio_div_content.offsetHeight != "26" && mio_div_content.offsetHeight != height_panel_open){
					return false;
				}
			}

		}
	}
	if (panel_open_now != id && panel_open_now != "undefined"){
		open_dinamic_panel(panel_open_now, id, 145, 15);
	}
}

function open_dinamic_panel(panel_open_now, id, height, height_now){
	
	p1 = panel_open_now + "";
	p2 = id + "";
	
	var blocco = "box_home_service";
	
	new_height = Math.round((height-height_now)/8)*1;
	my_height = height;

	var mio_blocco_figlio = document.getElementById(id);

	var mio_blocco_figlio_2 = document.getElementById(panel_open_now);
	
	my_height_result = new_height+height_now;
	
	if ((height-height_now)>15){
		mio_blocco_figlio.style.height = (my_height_result)+"px";
		mio_blocco_figlio_2.style.height = (height-my_height_result)+"px";
		
		setTimeout("open_dinamic_panel(p1, p2, my_height, my_height_result)", 10);
		
	} else {
		mio_blocco_figlio.style.height="130px";
		mio_blocco_figlio_2.style.height="15px";
		return false;
	}
}

function moveto(my_photo, my_container){
	if (document.getElementById(my_container)){
		var mio_blocco = document.getElementById(my_container);
		var mio_blocco_foto = mio_blocco.getElementsByTagName("img");
		/*if(mio_blocco_foto[0].style.top==""){
			mio_blocco_foto[0].style.top = "0";
		} else {
			mio_blocco_foto[0].style.top = -((my_photo*1)-1)*105+"px";
		}*/
		mio_blocco_foto[0].style.top = -((my_photo*1)-1)*105+"px";
	} else {
		alert("Elemento " + my_container + " inesistente.");
	}
}

function show(mydiv){
	if (document.getElementById){
		document.getElementById(mydiv).style.height="auto";
		//document.getElementById(mydiv).style.overflow="visible";
		document.getElementById(mydiv).style.backgroundPosition = "left bottom";
	}
}
function hide(mydiv){
	if (document.getElementById){
		document.getElementById(mydiv).style.height="20px";
		//document.getElementById(mydiv).style.overflow="hidden";
		document.getElementById(mydiv).style.backgroundPosition = "left -160px";
	}
}
function init(mydiv){
	if (document.getElementById(mydiv)){
		document.getElementById(mydiv).style.height="20px";
		document.getElementById(mydiv).style.overflow="hidden";
		document.getElementById(mydiv).style.backgroundPosition = "left -160px";
	}
}
