hex = new Array(9) 
set = new Array(9) 
set1 = new Array(0,0,0,0,0,0,0,0,0,0) 
hex[0] = "#000099" 
hex[1] = "#1919CC" 
hex[2] = "#2E2ED2" 
hex[3] = "#4141D6" 
hex[4] = "#5555DC" 
hex[5] = "#6D6DE2"   
hex[6] = "#8282E7" 
hex[7] = "#9696ED" 
hex[8] = "#A9A9EF"
hex[9] = "#FFFFFF"

function rollon(n){ 
if (n==1){set[1]=1} 
if (n==2){set[2]=1} 
if (n==3){set[3]=1} 
if (n==4){set[4]=1}
if (n==5){set[5]=1} 
if (n==6){set[6]=1} 
if (n==7){set[7]=1} 
if (n==8){set[8]=1}
if (n==9){set[9]=1}  
} 

function rolloff(n){ 
if (n==1){set[1]=0} 
if (n==2){set[2]=0} 
if (n==3){set[3]=0} 
if (n==4){set[4]=0} 
if (n==5){set[5]=0} 
if (n==6){set[6]=0} 
if (n==7){set[7]=0} 
if (n==8){set[8]=0}
if (n==9){set[9]=0}
} 

tophex = new Array(9) 
topset = new Array(9) 
topset1 = new Array(0,0,0,0,0,0,0,0,0,0) 

tophex[0] = "#DF8600" 
tophex[1] = "#E29014" 
tophex[2] = "#E49826" 
tophex[3] = "#E7A43F" 
tophex[4] = "#EAAF56" 
tophex[5] = "#EDB769"   
tophex[6] = "#EFC27F"  
tophex[7] = "#F1CC93" 
tophex[8] = "#F5D8AC"
tophex[9] = "#FFFFFF"

function toprollon(n){ 
if (n==1){topset[1]=1} 
if (n==2){topset[2]=1} 
if (n==3){topset[3]=1} 
if (n==4){topset[4]=1}
if (n==5){topset[5]=1} 
if (n==6){topset[6]=1} 
if (n==7){topset[7]=1} 
if (n==8){topset[8]=1}
if (n==9){topset[9]=1}  
} 

function toprolloff(n){ 
if (n==1){topset[1]=0} 
if (n==2){topset[2]=0} 
if (n==3){topset[3]=0} 
if (n==4){topset[4]=0} 
if (n==5){topset[5]=0} 
if (n==6){topset[6]=0} 
if (n==7){topset[7]=0} 
if (n==8){topset[8]=0}
if (n==9){topset[9]=0}
} 

function color(){ 
// menu a sx
if (set[1]==1){ 
	if (set1[1]==9){
	} 
	else {
	 set1[1]++ ;item1.style.background = hex[set1[1]] 
	} 
} 
else { 
	if (set1[1]==0){
	} 
	else {
	 set1[1]=set1[1]-1 ;item1.style.background = hex[set1[1]] 
	} 
} 

	if (set[2]==1){ 
	if (set1[2]==9){} else{set1[2]++ ;item2.style.background = hex[set1[2]] } 
	} else { 
	if (set1[2]==0){} else{set1[2]=set1[2]-1 ;item2.style.background = hex[set1[2]] } 
	} 
	if (set[3]==1){ 
	if (set1[3]==9){} else{set1[3]++ ;item3.style.background = hex[set1[3]] } 
	} else { 
	if (set1[3]==0){} else{set1[3]=set1[3]-1 ;item3.style.background = hex[set1[3]] } 
	} 
	if (set[4]==1){ 
	if (set1[4]==9){} else{set1[4]++ ;item4.style.background = hex[set1[4]] } 
	} else { 
	if (set1[4]==0){} else{set1[4]=set1[4]-1 ;item4.style.background = hex[set1[4]] } 
	}
	if (set[5]==1){ 
	if (set1[5]==9){} else{set1[5]++ ;item5.style.background = hex[set1[5]] } 
	} else { 
	if (set1[5]==0){} else{set1[5]=set1[5]-1 ;item5.style.background = hex[set1[5]] } 
	} 
	if (set[6]==1){ 
	if (set1[6]==9){} else{set1[6]++ ;item6.style.background = hex[set1[6]] } 
	} else { 
	if (set1[6]==0){} else{set1[6]=set1[6]-1 ;item6.style.background = hex[set1[6]] } 
	} 
	if (set[7]==1){ 
	if (set1[7]==9){} else{set1[7]++ ;item7.style.background = hex[set1[7]] } 
	} else { 
	if (set1[7]==0){} else{set1[7]=set1[7]-1 ;item7.style.background = hex[set1[7]] } 
	} 
	if (set[8]==1){ 
	if (set1[8]==9){} else{set1[8]++ ;item8.style.background = hex[set1[8]] } 
	} else { 
	if (set1[8]==0){} else{set1[8]=set1[8]-1 ;item8.style.background = hex[set1[8]] } 
	}  
	if (set[9]==1){ 
	if (set1[9]==9){} else{set1[9]++ ;item9.style.background = hex[set1[9]] } 
	} else { 
	if (set1[9]==0){} else{set1[9]=set1[9]-1 ;item9.style.background = hex[set1[9]] } 
}  
// menu top
if (topset[1]==1){ 
if (topset1[1]==9){} else{topset1[1]++ ;topitem1.style.background = tophex[topset1[1]] } 
} else { 
if (topset1[1]==0){} else{topset1[1]=topset1[1]-1 ;topitem1.style.background = tophex[topset1[1]] } 
} 
if (topset[2]==1){ 
if (topset1[2]==9){} else{topset1[2]++ ;topitem2.style.background = tophex[topset1[2]] } 
} else { 
if (topset1[2]==0){} else{topset1[2]=topset1[2]-1 ;topitem2.style.background = tophex[topset1[2]] } 
} 
if (topset[3]==1){ 
if (topset1[3]==9){} else{topset1[3]++ ;topitem3.style.background = tophex[topset1[3]] } 
} else { 
if (topset1[3]==0){} else{topset1[3]=topset1[3]-1 ;topitem3.style.background = tophex[topset1[3]] } 
} 
if (topset[4]==1){ 
if (topset1[4]==9){} else{topset1[4]++ ;topitem4.style.background = tophex[topset1[4]] } 
} else { 
if (topset1[4]==0){} else{topset1[4]=topset1[4]-1 ;topitem4.style.background = tophex[topset1[4]] } 
}
if (topset[5]==1){ 
if (topset1[5]==9){} else{topset1[5]++ ;topitem5.style.background = tophex[topset1[5]] } 
} else { 
if (topset1[5]==0){} else{topset1[5]=topset1[5]-1 ;topitem5.style.background = tophex[topset1[5]] } 
} 
if (topset[6]==1){ 
if (topset1[6]==9){} else{topset1[6]++ ;topitem6.style.background = tophex[topset1[6]] } 
} else { 
if (topset1[6]==0){} else{topset1[6]=topset1[6]-1 ;topitem6.style.background = tophex[topset1[6]] } 
} 
if (topset[7]==1){ 
if (topset1[7]==9){} else{topset1[7]++ ;topitem7.style.background = tophex[topset1[7]] } 
} else { 
if (topset1[7]==0){} else{topset1[7]=topset1[7]-1 ;topitem7.style.background = tophex[topset1[7]] } 
} 
if (topset[8]==1){ 
if (topset1[8]==9){} else{topset1[8]++ ;topitem8.style.background = tophex[topset1[8]] } 
} else { 
if (topset1[8]==0){} else{topset1[8]=topset1[8]-1 ;topitem8.style.background = tophex[topset1[8]] } 
}  
if (topset[9]==1){ 
if (topset1[9]==9){} else{topset1[9]++ ;topitem9.style.background = tophex[topset1[9]] } 
} else { 
if (topset1[9]==0){} else{topset1[9]=topset1[9]-1 ;topitem9.style.background = tophex[topset1[9]] } 
}  
// imposta un timeout alla funzione color()
setTimeout("color()",100) 
} 
