// sostituzione caratteri in onload
function avvio() {
	document.getElementById('logolink').innerHTML = "";
    }

// opacita per galleriafotografica
function cambiaopacita(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 
function opacita(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("cambiaopacita(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("cambiaopacita(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 
function img(nome) {
	document.getElementById('nomecollezione').style.display = "none";
	if (document.cambioimmagine.valorecambioimmagine.value == 0)
		{
		document.getElementById('immaginesotto').innerHTML = "<img src='/img/collezione_primavera_estate_2010/big/" + nome + ".jpg' alt='foto " + nome + "' />";
		opacita('immaginesotto', 0, 100, 500);
		opacita('immagine', 100, 0, 500);;
		document.cambioimmagine.valorecambioimmagine.value = 1
		} else {
		document.getElementById('immagine').style.opacity = 0;
		document.getElementById('immagine').style.filter = 'alpha(opacity=' + 0 + ')';
		document.getElementById('immagine').innerHTML = "<img src='/img/collezione_primavera_estate_2010/big/" + nome + ".jpg' alt='foto " + nome + "' />";
		opacita('immagine', 0, 100, 500);
		opacita('immaginesotto', 100, 0, 500);
		document.cambioimmagine.valorecambioimmagine.value = 0
		}
    }
function attivaspostagalleria(valore) {
	var idtimeout;
	idtimeout = parseInt(document.cambioimmagine.valoretimeout.value)
	window.clearTimeout(idtimeout)
	if (valore != 0) {
		var intValue;
		intValue=window.setTimeout( "spostagalleria("+valore+")", 10);
		document.cambioimmagine.valoretimeout.value = intValue;
		}
	}
function spostagalleria(valore){
	valorenuovo = parseInt(document.cambioimmagine.valoreposizionegalleria.value) + parseInt(valore);
	maxposizione = parseInt(document.cambioimmagine.maxposizionegalleria.value)
	if ( valorenuovo < maxposizione ) {
			valorenuovo = maxposizione;
		} else if ( valorenuovo > 0 ) {
			valorenuovo = 0;
			}
	document.getElementById('rigacollezione').style.left = valorenuovo+"px";
	document.cambioimmagine.valoreposizionegalleria.value = valorenuovo;
	
	
	attivaspostagalleria(valore)
	}