/*onMouseOver menu*/

if (document.images){
main1over = new Image;
main1out = new Image;
main1over.src= "img/but-1-over.gif";
main1out.src  = "img/but-1.gif";
}


if (document.images){
main2over = new Image;
main2out = new Image;
main2over.src= "img/but-2-over.gif";
main2out.src  = "img/but-2.gif";
}


if (document.images){
main3over = new Image;
main3out = new Image;
main3over.src= "img/but-3-over.gif";
main3out.src  = "img/but-3.gif";
}


if (document.images){
main4over = new Image;
main4out = new Image;
main4over.src= "img/but-4-over.gif";
main4out.src  = "img/but-4.gif";
}


if (document.images){
main5over = new Image;
main5out = new Image;
main5over.src= "img/but-5-over.gif";
main5out.src  = "img/but-5.gif";
}

if (document.images){
main6over = new Image;
main6out = new Image;
main6over.src= "img/but-6-over.gif";
main6out.src  = "img/but-6.gif";
}


if (document.images){
main7over = new Image;
main7out = new Image;
main7over.src= "img/but-7-over.gif";
main7out.src  = "img/but-7.gif";
}


if (document.images){
main8over = new Image;
main8out = new Image;
main8over.src= "img/but-8-over.gif";
main8out.src  = "img/but-8.gif";
}


if (document.images){
main9over = new Image;
main9out = new Image;
main9over.src= "img/but-9-over.gif";
main9out.src  = "img/but-9.gif";
}


function swap (iname, gname) {
  if (document.images){
  iname.src = gname.src;
  }
}

/*menu laterale*/
//nella funzione passo l'id del sottomenų e l'id(im) dell'immagine
function Menu(id, im) 
{
var menu = document.getElementById(id).style;
var img  = document.getElementById(im);
/*nei 2 array inserisco tutti gli id dei sottomenų (array c) e tutti gli id dell'immagine (array g)
ad eccezione dell'id f0 ed id i0 che appartengono all'elemento root*/
var c = new Array("f1","f2","f3","f4","f5","f6","f7","f8")
var g = new Array("i1","i2","i3","i4","i5","i6","i7","i8")


//verifico lo status dell'attributo display: se č aperto lo chiudo e viceversa
	if (menu.display != "block")	
	{	
		menu.display = "block";
			
	} 
	else
	{
		menu.display = "none";
		
	}
		/*il ciclo ha il compito di chiudere 
			gli eventuali sottomenų aperti*/
		//eseguo un ciclo per tutti gli id dei sottomenų -1 
		for (i=0; i<=c.length-1; i++)
		{
			//verifico che l'id passato dalla funzione sia diverso da qualsiasi altro presente nell'array
			if(c[i]!==id)
				{
					//la condizione mi consente di escludere dal ciclo i vari sottomenų secondari...
					if(id.match(c[i]))
					{
						
					}
					else
					//chiudo il sottomenų aperto, variandogli l'attributo
					{
						document.getElementById(c[i]).style.display= "none";
					}				
				}
		}
		/*il ciclo ha il compito di cambiare 
			l'immagine dei sottomenų aperti*/
		//eseguo un ciclo per tutti gli id delle immagini -1
		for (i=0; i<=g.length-1; i++)
		{
			//verifico che l'id passato dalla funzione sia diverso da qualsiasi altro presente nell'array
			if(g[i]!==im)
				{
					//la condizione mi consente di escludere dal ciclo le immagini dei  sottomenų secondari...
					if(im.match(g[i]))
					{
					
					}
					else
					//cambio l'immagine
					{
						document.getElementById(g[i]).src= "img/av_mini.jpg";
					}				
				}
		}
}

/* messaggio sulla status bar */
function displayStatus(msg) { //v1.2
  status=msg;
  document.returnValue = true;
}

/* funzione per la stampa*/
function stampa(){
	window.print();
	}

/* apertura finestra */
function Aprifinestra(url,width,height) {
 window.open(url,width,height);}

/* chisura finestre foto */
function Chiudifinestra(){
       window.close();}

/* Data aggiornamento */
function um() {
      document.write('<span class="um">Ultima modifica:' )
};


/* funzione per la sezione notizie */
      var notizia = 1;

      var date = new Array(1)
      date[0]= ""
      
      var notizie = new Array(1)
      notizie[0]= 'Notizia 1'

function mostra_notizie() {


      for (var i=0; i<notizia; i++){                           

             document.write('<span class="data">' + date[i] + '</span>' + '<a href="co.php" class="indent" title="">' + notizie[i] + '</a>');

            };                                                   
};

/* funzioni per apertura pop-up foto */
function apriw(pag) {
 win = window.open(pag,'win','height=718,width=851');
 win.focus();
};

function apriw2(pag) {
 win = window.open(pag,'win','height=931,width=638');
 win.focus();
};

function doimage() { 
 var ind = location.href;
 var splitter = ind.indexOf("?");
 if (splitter != -1) {
  var nvar = ind.substring(splitter+1);
  var param = nvar.indexOf("=");
  if (param != -1) {
   var nparam = nvar.substring(0,param);
   var valore = nvar.substring(param+1);
   if (nparam == "img") {
    var imma = new Image();
    imma.src = valore;
    
    document.images[0].src = valore;
   }
  }
 }
 else {
  document.images[0].src = "img/vuoto.gif"; 
  // mettete al posto di vuoto una foto di default che deve apparire nella popup se non č stata specificata nessuna foto
 }
};

/* stampa mail, indirizzi, recapiti */
function mailsito() {
        var mail= "mailto:cam-sersale@gmail.com";
        document.write(mail);
};


// function infosito2()
function footer() {

         var mail= "cam-sersale@gmail.com"
		 var alink= "http://cam.sersale.eu"
         var testo= "CAM EDILCALCESTRUZZI - Materiali per l'edilizia: idraulica, Legnami, lattoneria, sistemi tetto, Laterizi, trasporto e scarico gru."
		 var testo2= " ValleDelCrocchio.Eu - Sersale (cz)"
         
         document.write('<span class="bold2">' + testo + '</span>');
};


// function infosito()
function infosito() {
         var addr= "Info Sito Standard - Via Roma, nc 88054 Sersale (cz)";
         document.write('<span class="p2">' + addr + ' | <a class="normal" href="co.php" title="Contatti">Contatti</a></span>');
};

function infotel() {

         var mail= "cam-sersale@gmail.com";
         var tel= "telefoni: 0961.936849 / Via Scesa Pietā, 17 88054 Sersale (CZ) / P.IVA 02571610795";
         
         document.write('<div class="center">Per informazioni: ' + '<a class="normal" title="Scrivici" href="mailto:' + mail + '">' + mail + '</a> | ' + tel);

};

function infomaster() {

         var nome= "<|> Webmaster: ";
         var mail= "plurisiti@gmail.com";
		 var vdc= "ValleDelCrocchio.Eu";
        
         document.write('<p class="center">Š 2006 - Tutti i diritti riservati<br />' + '<span class="normal">Sito implementato in ' + '<a class="normal" href="'+ 'http://valledelcrocchio.eu" target="_blank"' + '">' + vdc + '</a>' + ' </span>' + nome + '<img src="img/po.gif" width="194" height="11" />' + '</a>');

};


// Imposta pagina di default
function homepage() { 
if(document.all)
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.cam.sersale.eu');
}


/* -- Aggiunge ai preferiti */
function addbookmark(){
var bookmarkurl="http://www.prolocosersale.it"
var bookmarktitle="CAM EDILCALCESTRUZZI - SERSALE aggiungi ai preferiti"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
/* -- Aggiunge ai preferiti FINE */

// avviso GENERICO
function avviso(){
     alert('Questo é un esempio di avviso generico.');
};
// avviso GENERICO fine
