

foto2="immagini_aziende/itagri.gif";
foto1="immagini_aziende/logo_belluzzi.jpg";
foto3="immagini_aziende/ungherit.gif";


var timer_immagine
var i=1

function controllo () {



if (j==1){
window.open('azienda14.htm','','resizable=no, scrollbars=no, toolbar= no, titlebar=no, width=600,height=500,top=10, left=50')

}


if (j==2){
window.open('azienda12.htm','','resizable=no, scrollbars=no, toolbar= no, titlebar=no, width=600,height=550,top=10, left=50')

}


if (j==3){
window.open('azienda3.htm','','resizable=no, scrollbars=no, toolbar= no, titlebar=no, width=600,height=500,top=10, left=50')

}



}


function cambia (){

timer_immagine=setInterval("cambia_immagine()",2000);
}


function cambia_immagine () {


if (i>3) {
i=1

}

if (i==1) {

foto=foto1
}

if (i==2) {
foto=foto2

}


if (i==3) {
foto=foto3

}



immagine="im1";
oggetto=document.all[immagine];
oggetto.style.cursor='hand';
oggetto.src=foto

j=i
//oggetto.onclick=controllo




i++

}


function mostra (livello) {
var o_livello=document.all[livello];
o_livello.style.visibility="visible";
}


function nascondi (livello) {
var o_livello=document.all[livello];
o_livello.style.visibility="hidden";
}



function cambia_ag (){

timer_immagine=setInterval("cambia_immagine_ag()",2000);
}


function cambia_immagine_ag () {


if (i>3) {
i=1

}

if (i==1) {

foto_ag=messaggi_ag[0]
}

if (i==2) {
foto_ag=messaggi_ag[1]

}


if (i==3) {
foto_ag=messaggi_ag[2]

}



immagine_ag="im1_ag";
oggetto_ag=document.all[immagine_ag];
oggetto_ag.style.cursor='hand';
oggetto_ag.src=foto_ag

j=i


i++

}



function mostra_menu(oggetto) {
	blocco = oggetto.all("menu2");
	immagine=oggetto.all("icona");
	if (blocco) {
		if (blocco.style.display == "") {
			blocco.style.display = "none";
			immagine.src="immagini/cartella_chiusa.gif";
		} else {
			blocco.style.display = "";
			immagine.src="immagini/cartella_aperta.gif";
		}
	}
}





function getElHeight(el){ 

if(ns4)return (el.document.height)? el.document.height : el.clip.bottom-el.clip.top;
		else if(ie4||ie5)return (el.style.height)? el.style.height : el.clientHeight; 

			else return (el.style.height)? parseInt(el.style.height):parseInt(el.offsetHeight);


				}



	function getPageLeft(el){ 
			var x;
			if(ns4)return el.pageX;
		if(ie4||w3c){
		x = 0;
		while(el.offsetParent!=null){
	x+=el.offsetLeft;
			el=el.offsetParent;
			}
				x+=el.offsetLeft;
					return x;
										}
									}

				function getPageTop(el){ 

					var y;
					if(ns4)return el.pageY;
				if(ie4||w3c){
					y=0;
				while(el.offsetParent!=null){
				y+=el.offsetTop;
					el=el.offsetParent;
						}
							y+=el.offsetTop;
					return y;
						}
									}

			function scrollbox(){
	
			if(ns4){
		inner.top+=(godown)? pixelstep: -pixelstep;
	if(godown){ 	

	if(inner.top>boxheight)inner.top=-elementheight;
			}	
			else{ 
		if(inner.top<2-elementheight)inner.top=boxheight+2;
						}
				}	
			else{ 
	inner.style.top=parseInt(inner.style.top)+((godown)? pixelstep: -pixelstep)+'px';
			if(godown){
	if(parseInt(inner.style.top)>boxheight)inner.style.top=-elementheight+'px';
				}
			else{
		if(parseInt(inner.style.top)<2-elementheight)inner.style.top=boxheight+2+'px';
											}
										}
									}

			window.onresize=function(){ 	

				if(ns4){ 
			turnon(actimage);
				}
				else{   
			outer.style.left=getPageLeft(ref)+'px';
				outer.style.top=getPageTop(ref)+'px';
					}
									}

			function SetSize(){ 
			
elementheight=getElHeight(inner); 
			if(ns4){ 
			outer.moveTo(getPageLeft(ref),getPageTop(ref));
			outer.clip.width=boxwidth;
			outer.clip.height=boxheight;
			inner.top=(godown)? -elementheight : boxheight-2;
			inner.clip.width=boxwidth-4;
			inner.clip.height=elementheight;
			outer.visibility="show";
			inner.visibility="show";
inner.style.visibility="show";
					}
						else{

			outer.style.left=getPageLeft(ref)+'px';
			outer.style.top=getPageTop(ref)+'px'; 
		 inner.style.top=((godown)? -elementheight : boxheight)+'px'; 
	      inner.style.clip='rect(0px, '+(boxwidth-4)+'px, '+(elementheight)+'px, 0px)';
			outer.style.visibility="visible";
	inner.style.visibility="visible";
									}									}
									
window.onload=function(){

	outer=(ns4)?document.layers['outer']:(ie4)?document.all['outer']:document.getElementById('outer');
			inner=(ns4)?outer.document.layers['inner']:(ie4)?document.all['inner']:document.getElementById('inner');

					ref=(ns4)?document.layers['ref']:(ie4)?document.all['ref']:document.getElementById('ref');



					SetSize();
				setInterval('scrollbox()',speed);
				}





					function LayerWrite(_layer, _testo){ 
						if (document.layers){
						with (outer.document.layers[_layer].document){ 
						open(); 
						write(_testo); 
					close();												
											} 
										}
										else{
						if (document.getElementById){
						document.getElementById(_layer).innerHTML=_testo;


						}
					else{
					_layer.innerHTML=_testo
                 }
										}
									}

		












	
