var duratacent=200;
var duratasec=1;
var h_contenuto=415;
var h_linkProdotti=126;
var h_linkProdotti_chiuso=23;
var h_supporting=532;
var h_linkIstituzionali=532	;
var altezza_bg_menu=120;
var fuori_range_menu=140;
var hires=new Array('dettaglio_hires_uno','150px','150px','50px','120px','dettaglio_hires_due','150px','150px','215px','135px','dettaglio_hires_tre','150px','150px','50px','245px','dettaglio_hires_quattro','150px','150px','300px','200px');
var path_immagini='/img/';
var path_pagine='/newsite/';
var path_sito_immaggini_grandi='http://www.bertolottoporte.net/images/fotograndi/';
var durata_apparischeda=1;
var durata_minima=.5;
var durata_schede_interne=1;
var current_in = '';
var current_clicked = '';


Ajax.Responders.register({
	  onCreate: function(){
		loader('on');
	  }, 
	  onComplete: function(){
		  loader.delay(.3,'off');
	  }
	});


Event.observe(window, 'resize', function() {
 //   centra();
})

Event.observe(window, 'click',function() {
	chiudi_popup_earth()
})
Event.observe(window, 'load', function() {
	centra();
	$('body2').setStyle({visibility: 'visible'});
	no_click_menu();
	si_click_menu();
	for(i=0;  i<linee.length; i++) {
		var linea = $(linee[i]);
		linea.setStyle({backgroundPosition: '0px 150px'})
	}

	
	$('pageHeader').observe('click', function(event){
		document.location.href='/newsite/index2/lang:' + $('lingua').value;
	});

	$('velocita').observe('click', function(event){
		audio_s($('audio_on').getStyle('display'),$('audio_off').getStyle('display'));
	});
	$('velocita').observe('mouseover', function(event){
		new Tip('velocita', '<div id=contenitore_tooltip_alto><span class=testo_tooltip>Audio On-Off</span></div>', {offset: {x:0,y:-5}, hook: { target: 'bottomRight', tip: 'topRight'},delay: 0.1});
	});

	
	$('area_riservata').observe('mouseover', function(event){
		new Tip('area_riservata', '<div id=contenitore_tooltip_alto><span class=testo_tooltip>Area riservata</span></div>', {offset: {x:0,y:-5}, hook: { target: 'bottomRight', tip: 'topRight'},delay: 0.1});
	});
	$('linkEsterno').observe('click', function(event){
		apri_popup('bihome');
	});
	$('area_riservata').observe('click', function(event){
		apri_popup('area_riservata');
	});
	


	$('pageHeader').style.display='inline';
	$('linkProdotti').style.display='inline';

	for(i=0;  i<linee.length; i++) {
		var linea = $(linee[i]);	

		linea.observe('click', function(event){
		    Sound.disable();
		    Sound.enable();
			my_linea = this;
			current_clicked = this.id;
			w_modelliLinea=$('modelliLinea').getStyle('width');
				chiudi_flash();
			if (w_modelliLinea.indexOf("px")>0) { 
				w_modelliLinea=w_modelliLinea.substring(0,w_modelliLinea.length-2);
			}
			if(w_modelliLinea==0) {
				var ml_displ=$('modelliLinea').getStyle('display');
				var ml_opac=$('modelliLinea').getStyle('opacity');
// alert('a' + current_clicked)
				if(ml_displ=='none'  || ml_opac < 1 ) {
					document.location.href='/newsite/reset/'+current_clicked + '/lang:' + $('lingua').value;
					// compare_scheda('modelliLinea',current_clicked,'','');
				} else {
					chiudi_menu_principale('chiudi');
					// compare_scheda.delay(2,'modelliLinea',current_clicked,'');
				} 
			} else {
// alert('v')
					document.location.href='/newsite/reset/'+current_clicked + '/lang:' + $('lingua').value;

				// scompare_scheda('modelliLinea',current_clicked)
			}
		});
	}
	

new PeriodicalExecuter(function(pe) {
	if($('_flash')) {
		// alert('b')
		
	} else {
		if($('FE_InfoWindow')) {
			$('FE_InfoWindow').setStyle({display: 'none'})
			
		}
	}
})

})
