// JavaScript Document
function get_browser () {
	return navigator.appName;
}

function international_cambiomenu (azione) {
	var nazione = document.getElementById ( "generale_lingua_menu" ).value;

	if ( azione == 0 ) {
		document.getElementById ( "menu_"+nazione+"_flash" ).style.display = "none";
		document.getElementById ( "menu_"+nazione+"_immagine" ).style.display = "block";
		document.getElementById ( "international_mappa_flash" ).style.display = "none";
		document.getElementById ( "international_mappa_immagine" ).style.display = "block";
	} else {
		document.getElementById ( "menu_"+nazione+"_immagine" ).style.display = "none";
		document.getElementById ( "menu_"+nazione+"_flash" ).style.display = "block";
		document.getElementById ( "international_mappa_immagine" ).style.display = "none";
		document.getElementById ( "international_mappa_flash" ).style.display = "block";
	}
}
function international_vedi_area ( area ) {
	international_cambiomenu(0);
	carica_pop_up_id("international_area_"+area);
	//document.getElementById ( "international_vedi_block" ).innerHTML = document.getElementById ( "international_area_"+area ).innerHTML;
}

function handleAjaxKernel ( response ) {
	var res = response.split('!!__!!__!!'); 
	
	if ( res[0] == "ok" ) {
		if ( res[1] == "ok" ) {
			if( animazioni == 0 ) {
				document.getElementById ( 'divHomePage' ).innerHTML = res[2];
			} else {
				creaListaEffetti ( 'apollo', 'unico',
					'fadeForza(\'divHomePage\',1, \'codice_lista\')',
					'fade ( \'divHomePage\', 0, \'codice_lista\',0.2 )',
					'assegnaContenutoHTML ( \'divHomePage\',unescape(\''+escape(res[2])+'\'), \'codice_lista\' )',
					'fade ( \'divHomePage\', 1, \'codice_lista\',0.2 )'
				);
			}
		} else {
			if( animazioni == 0 ) {
				document.getElementById ( res[1] ).innerHTML = res[2];
			} else {
				creaListaEffetti ( 'conferma', 'unico',
					'fadeForza(\''+res[1]+'\',0, \'codice_lista\')',
					'assegnaContenutoHTML ( \''+res[1]+'\',unescape(\''+escape(res[2])+'\'), \'codice_lista\' )',
					'fade ( \''+res[1]+'\', 1, \'codice_lista\',0.2 )'
				);
			}
		}
	} else {
		if ( res[0] == "popup" ) {
			if ( res[1] == "ok" ) {
				carica_pop_up_contenuto(res[2]);
			} else {
				window.alert(response);
			}
		} else {
			if ( res[0] == "popupalert" ) {
				if ( res[1] == "ok" ) {
					pop_up_alert_view(1,res[2]);
				} else {
					if ( res[0] != "none" )
						window.alert(response);
				}
			} else {
				window.alert(response);
			}
		}
	}
}


function recuperaOrario ( id ) {
	
	var orario = "";
	
	orario += document.getElementById ( id + "Anno" ).value + "-";
	orario += document.getElementById ( id + "Mese" ).value + "-";
	orario += document.getElementById ( id + "Giorno" ).value + " ";
	orario += document.getElementById ( id + "Ore" ).value + ":";
	orario += document.getElementById ( id + "Minuti" ).value + ":00";
	
	return orario;
	
}

var array_preload_images = 0;
function axp_preload_images ( contenitore, max ) {
	array_preload_images++;
	if ( array_preload_images == max ) {
		document.getElementById ( contenitore+"_caricamento" ).style.display='none';
		document.getElementById ( contenitore ).style.display='block';
	}
}


