/* ******************************************************** */
/* ****************** FUNZIONE OROLOGIO ******************* */
/* ******************************************************** */
function OreMinutiSecondi() {
	 status = "Chichet sito statico"
         Data = new Date()
         Ore = Data.getHours()
         Minuti = Data.getMinutes()
         Secondi = Data.getSeconds()
         if (Minuti < 10) Minuti = "0" + Minuti
         if (Secondi < 10) Secondi = "0" + Secondi
		  Orologio = Ore + ":" + Minuti + "." + Secondi
	}

function AggiornaOrologio() {
		  OreMinutiSecondi()
		  if (document.all)
		  		document.all.clock.innerHTML=Orologio 
		  else
				document.write(Orologio)		  
         setTimeout("AggiornaOrologio();",1000);
	}


/* **************************************************** */
/* ****************** FUNZIONE DATA ******************* */
/* **************************************************** */
function data () {
	thisDate = new Date()
		giorno = thisDate.getDay();
		oggi = thisDate.getDate();
		monthNum = thisDate.getMonth();
		year = thisDate.getYear();
	if (year <=100)
		year=1900+Year;
	
	if (monthNum == 0) NomeMese = "Gennaio ";
		else if (monthNum == 1) NomeMese = "Febbraio ";
		else if (monthNum == 2) NomeMese = "Marzo ";
		else if (monthNum == 3) NomeMese = "Aprile ";
		else if (monthNum == 4) NomeMese = "Maggio ";
		else if (monthNum == 5) NomeMese = "Giugno ";
		else if (monthNum == 6) NomeMese = "Luglio ";
		else if (monthNum == 7) NomeMese = "Agosto ";
		else if (monthNum == 8) NomeMese = "Settembre ";
		else if (monthNum == 9) NomeMese = "Ottobre ";
		else if (monthNum == 10) NomeMese = "Novembre ";
		else if (monthNum == 11) NomeMese = "Dicembre ";
	
	if (giorno == 0) NomeGiorno = "Domenica";
		else if (giorno == 1) NomeGiorno = "Luned&igrave;";
		else if (giorno == 2) NomeGiorno = "Marted&igrave;";
		else if (giorno == 3) NomeGiorno = "Mercoled&igrave;";
		else if (giorno == 4) NomeGiorno = "Gioved&igrave;";
		else if (giorno == 5) NomeGiorno = "Venerd&igrave;";
		else if (giorno == 6) NomeGiorno = "Sabato";
	document.write(NomeGiorno+' '+oggi+' '+NomeMese+ ' '+year);
	}


/* ***************************************************************** */
/* FUNZIONE per visualizzare il copyright in basso a tutte le pagine */
/* ***************************************************************** */
function CopyRight() {
	document.write('<div align="center">');
	document.write('<table cellSpacing="0" cellPadding="0" width="750" border="0">');
	document.write('  <tbody>');
	document.write('  <tr>');
	document.write('    <td height="35" width="100%" valign="top">');
	document.write('      <p style="FONT-SIZE: 10px; COLOR: #efefdf; FONT-FAMILY: century gothic, verdana, sans-serif; TEXT-ALIGN: center" align="center">MET Sviluppo - Viale Kennedy, 65 - 89900 - Vibo Valentia - Tel. +39 (0) 963 472202 Fax +39 (0) 963 42673');
	document.write('        <br>');
	document.write('        <i>Designed and engineered by MET Sviluppo</i>');
	document.write('      </p>');
	document.write('    </td>');
	document.write('  </tr>');
	document.write('  </tbody>');
	document.write('</table>');
	document.write('</div>');
	}
/* ****************************************** */
/* FUNZIONE per aprire la finestra delle News */
/* ****************************************** */

function popUpNews(id) {
	l = (screen.width-440)/2;
	t = (screen.height-380)/2;
	if (id == 0){
		urlPop = "newsArchivio.asp";
		scrl="yes";
	}else{
		urlPop = "newsDettaglio.asp?idnews="+id;
		scrl="yes";
	}
	newWin = window.open(urlPop,"nuovafinestra", "width=420, height=300, left=" + l + ", top=" + t + ", scrollbars="+scrl);
}

function popup(url,w,h,scrl) {
 l = (screen.width-(w+100))/2;
 t = (screen.height-(h+100))/2;
 newWin = window.open(url,"nuovafinestra", "width="+w+", height="+h+", left="+l+", top="+t+", scrollbars="+scrl+", resizable=no") 
 }

/* ***************************************************************** */
/* roolover immagini sito  */
/* ***************************************************************** */

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
