IE4 = (document.all) ? 1:0;
NN6 = (!document.all && document.getElementById) ? 1:0;

ok = (document.styleSheets) ? 1:0;
if(ok) {
  if(IE4) stile = document.styleSheets[0].rules;
  if(NN6) stile = document.styleSheets[0].cssRules ;
  }

var exa = new Array("8","9","A","B","C","D","E");
var exa1 = new Array("E","8","9","A","B","C","D");
var exa2 = new Array("D","E","8","9","A","B","C");
var exa3 = new Array("C","D","E","8","9","A","B");
var exa4 = new Array("B","C","D","E","8","9","A");
var exa5 = new Array("A","B","C","D","E","8","9");
var exa6 = new Array("9","A","B","C","D","E","8");

d=exa.length;
o=0;

function vai(){
if(ok && (IE4 || NN6)) {testoentra(0);}
else alert("l'oggetto syleSheets non è supportato!\nnon sarà possibile visualizzare al meglio\nil contenuto di questo sito");
}


function testoentra(ind) {

indice = ind;

  if(d>0){
	d--;
    colore = "#"+exa[d]+exa[d]+exa[d]+exa[d]+exa[d]+exa[d];
    stile[ind].style.color = colore;
		colore = "#"+exa1[d]+exa1[d]+exa1[d]+exa1[d]+exa1[d]+exa1[d];
    stile[ind+1].style.color = colore;
		colore = "#"+exa2[d]+exa2[d]+exa2[d]+exa2[d]+exa2[d]+exa2[d];
    stile[ind+2].style.color = colore;
		colore = "#"+exa3[d]+exa3[d]+exa3[d]+exa3[d]+exa3[d]+exa3[d];
    stile[ind+3].style.color = colore;
		colore = "#"+exa4[d]+exa4[d]+exa4[d]+exa4[d]+exa4[d]+exa4[d];
    stile[ind+4].style.color = colore;
		colore = "#"+exa5[d]+exa5[d]+exa5[d]+exa5[d]+exa5[d]+exa5[d];
    stile[ind+5].style.color = colore;
		colore = "#"+exa6[d]+exa6[d]+exa6[d]+exa6[d]+exa6[d]+exa6[d];
    stile[ind+6].style.color = colore;

	setTimeout("testoentra(indice)",150);
    }
  else {d=0; setTimeout("testoesce(indice)",0);}
 }


function testoesce(ind) {
indice = ind;

  if(d<7){
	
    colore = "#"+exa[d]+exa[d]+exa[d]+exa[d]+exa[d]+exa[d];
    stile[ind].style.color = colore;
		colore = "#"+exa1[d]+exa1[d]+exa1[d]+exa1[d]+exa1[d]+exa1[d];
    stile[ind+1].style.color = colore;
		colore = "#"+exa2[d]+exa2[d]+exa2[d]+exa2[d]+exa2[d]+exa2[d];
    stile[ind+2].style.color = colore;
		colore = "#"+exa3[d]+exa3[d]+exa3[d]+exa3[d]+exa3[d]+exa3[d];
    stile[ind+3].style.color = colore;
		colore = "#"+exa4[d]+exa4[d]+exa4[d]+exa4[d]+exa4[d]+exa4[d];
    stile[ind+4].style.color = colore;
		colore = "#"+exa5[d]+exa5[d]+exa5[d]+exa5[d]+exa5[d]+exa5[d];
    stile[ind+5].style.color = colore;
		colore = "#"+exa6[d]+exa6[d]+exa6[d]+exa6[d]+exa6[d]+exa6[d];
    stile[ind+6].style.color = colore;
		d++;
    setTimeout("testoesce(indice)",150);
    }
  else {d=7;setTimeout("testoentra(indice)",0);}
 }
 
 
function cambia(r){
				 switch(r){
				 case 1: document.images[7].src="../img/foto.jpg";break;
				 case 2: document.images[7].src="../img/fotobn.jpg";break;
				 }
} 
 


txanm = ":: www.claudiotiberio.it ::";
place = 0;
timinLong = 300;
function AleRTgo()
	{
	txTemp1 = txanm.substring(0,place);
	txTemp2 = txanm.substring(place,place+1);
	txTemp2 = txTemp2.toUpperCase();
	txTemp3 = txanm.substring(place+1,txanm.length);
	window.status = txTemp1 + txTemp2 + txTemp3;
	if (place>txanm.length)
		{
		place=0;
		timinLong=1000;
		}
	if (place==0)
		timinLong=200;
	place++;
	timinAleRTgo = setTimeout("AleRTgo()",timinLong)
	}
function AleRTcl()
	{
	window.status = "";
	clearTimeout();
	}

	

function invia(){

				 			 var nome = document.form1.nome.value;
							 var email = document.form1.email.value;
							 var messaggio = document.form1.messaggio.value;
							 var si= true;
	
	if (nome== ""){
									alert ("Inserire il nome!");
									document.form1.nome.focus();
									}
	
else	if(messaggio ==""){
										alert ("Inserire il messaggio!");
										document.form1.messaggio.focus();
										}
							else{
										if (email.length<5) {si=false};                                                       //5 caratteri
										if (email.indexOf("@") == -1) {si=false};                                            //almeno una @
										if (email.indexOf("@") < email.lastIndexOf("@")) {si=false};                        //una sola @
										if (email.indexOf ("@") == 0 || email.indexOf ("@") == email.length-1) {si=false}; //primo e ultimo != da @
										if (email.indexOf (" ") != -1) {si=false};                                        //niente spazi
										if (email.indexOf("\t") != -1) {si=false};                                       //niente tabulazioni
										if (email.lastIndexOf(".") == email.length-1) {si=false};                       //ultimo carattere != da .
										if (!si) {alert ("Email errata");document.form1.email.select()}
										
								
									else{
										    document.form1.submit();
												
												}
												
										}
}
