/*########################################################################
#
# Nome Programma: data_odierna 
#
# Descrizione: restituisce il path della pagina aperta
#
# Linguaggio: javascript
# 
# Autore: Roberto Dell'Agnola, Massimo Rossi
#
# CSI-Piemonte
# C.so Unione Sovietica, 216 - 10134 Torino
# http://www.csi.it
#
# Data creazione: 06/04/2002
########################################################################
*/
<!--
var curr_image, max_image;

curr_image;
max_image=10;

function start_loop()
{
   // alert("START");
  setTimeout("sfondo()",7000) ;   
}

function sfondo() 
{
  curr_image = Math.floor(Math.random()*max_image);
  if(curr_image<=0)
  {
    curr_image = 1;
  }
  // alert(curr_image);   document.getElementsByTagName("body")
  document.getElementById("bkg1").style.background="url(/im/loop/head_ph_bkg" + curr_image +"p.jpg) top center no-repeat";
setTimeout("sfondo2()",700) ;  
  
}


function sfondo2() 
{
  document.getElementById("bkg2").style.background="url(/im/loop/head_ph_bkg" + curr_image +"m.jpg) top right no-repeat";
setTimeout("sfondo3()",500) ;   
}

function sfondo3() 
{
  document.getElementById("bkg3").style.background="#ffffff url(/im/loop/head_ph_bkg" + curr_image +".jpg) top right no-repeat";
setTimeout("sfondo()",8000) ;  
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}





/*****************************************************************************/
/*                                                   */
/*  FUNZIONE APRI IN NUOVA FINESTRA       */
/*****************************************************************************/

window.onload = function(e) {

link_apri(); link_apri_piccolo(); link_apri_medio(); link_apri_img(); inizializzazione();
}


//funzioni per aprire popup		
function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
}

function apri(theURL) { window.open(theURL); }	

function link_apri() { 
prop=''; var dimensione = 'apri'; apri_url(prop, dimensione); }

function link_apri_piccolo() {
var prop = "toolbar=no,location=no, directories=no, status=no, menuBar=no, scrollbars=no, resizable=no, width=450, height=350";	
var dimensione = 'apri_piccolo'; apri_url(prop, dimensione); }	

function link_apri_medio() {
var prop = "toolbar=no,location=no, directories=no, status=no, menuBar=no, scrollbars=yes, resizable=yes, width=750, height=400";	
var dimensione = 'apri_medio'; apri_url(prop, dimensione); }	

function apri_url(prop, dimensione){
a = document.getElementsByTagName('A');
for(i=0;a[i];i++) if(a[i].className == dimensione) {
if(a[i].title) {a[i].title += " [il collegamento apre una nuova finestra]";}
else {a[i].title =" [il collegamento apre una nuova finestra]";}
a[i].onclick = function () {window.open(this.href, '_blank',prop);return false;};
a[i].onkeypress = function (e) {k = (e) ? e.keyCode : window.event.keyCode; if(k==13) {Window.open(this.href,'_blank',prop); return false;}}
}}

//JS per galleria fotografica: ogni ancora con class="apri_img" deve puntare all'img ingrandita e avere un title
function link_apri_img() {
var modo = 'toolbar=no,location=no, directories=no, status=no, menuBar=no, scrollbars=no, resizable=yes, width=500, height=500';
a = document.getElementsByTagName('A');
for(i=0;a[i];i++) 
 if(a[i].className.match(/apri_img/g) == 'apri_img') {
   a[i].title += " [il collegamento apre una nuova finestra]";
   a[i].onclick = function () {popup=window.open('', '_blank', modo);popup.location.href='/js/skin_acc/template.htm'+'?'+this.href; return false;};
   a[i].onkeypress = function (e) {k = (e) ? e.keyCode : window.event.keyCode;if(k==13) {popup=window.open('', '_blank', modo);popup.location.href='/js/skin_acc/template.htm'+'?'+this.href; return false;}}
}}	   


   

// function nulla()   




/*----------------------------------------------------------------------------------*/
/*                                   STORIA				*/
/*Autore: Roberto Dell'Agnola 															*/
/*Data: gen 2007 																*/
/*----------------------------------------------------------------------------------
/* Javascript per switchare visibilità di un DIV a visibile/non utilizzando anche CSS2	, ed usato per notizie storiche /*  dinamiche 			       																*/

curr_storia;

function imstoria() 
{
var max_storia;
max_storia=23;

curr_storia = Math.ceil(Math.random()*max_storia);
if(curr_storia<=0)
  {
    curr_storia = 1;
  }

document.write('<img src="/include/storia/im/storia'+curr_storia+'.gif" class="right">');
}


function storia() 
{
var  max_storia;

max_storia=23;

for (i=1;i<=max_storia;i++)
{
document.getElementById("st"+i).style.display='none';
}

document.getElementById("st"+curr_storia).style.display='block';

}


