ie = (document.all) ? 1 : 0;
ns = (document.layers) ? 1 : 0;
ns6 = (document.getElementById) ? 1 : 0;


function init() {

		if (ns) block1 = document.menu
		if (ie) block1 = menu.style
        if(ns6) block1 = document.getElementById("menu").style;
		block1.xpos = parseInt(block1.left)
		block1.ypos = parseInt(block1.top)
    	block1.angle = 0
    	block1.xinc = 30*Math.cos(block1.angle*Math.PI/180)
    	block1.yinc = 30*Math.sin(block1.angle*Math.PI/180)
		if (ns) block2 = document.citta
		if (ie) block2 = citta.style
        if(ns6) block2 = document.getElementById("citta").style;
		block2.xpos = parseInt(block2.left)
		block2.ypos = parseInt(block2.top)
    	block2.angle = 0
    	block2.xinc = 30*Math.cos(block2.angle*Math.PI/180)
    	block2.yinc = 30*Math.sin(block2.angle*Math.PI/180)
		if (ns) block3 = document.ima
		if (ie) block3 = ima.style
        if(ns6) block3 = document.getElementById("ima").style;
		block3.xpos = parseInt(block3.left)
		block3.ypos = parseInt(block3.top)
    	block3.angle = 0
    	block3.xinc = 30*Math.cos(block3.angle*Math.PI/180)
    	block3.yinc = 30*Math.sin(block3.angle*Math.PI/180)
		if (ns) block4 = document.gialla
		if (ie) block4 = gialla.style
        if(ns6) block4 = document.getElementById("gialla").style;
		block4.xpos = parseInt(block4.left)
		block4.ypos = parseInt(block4.top)
    	block4.angle = 0
    	block4.xinc = 30*Math.cos(block4.angle*Math.PI/180)
    	block4.yinc = 30*Math.sin(block4.angle*Math.PI/180)
		if (ns) block5 = document.rossa
		if (ie) block5 = rossa.style
        if(ns6) block5 = document.getElementById("rossa").style;
		block5.xpos = parseInt(block5.left)
		block5.ypos = parseInt(block5.top)
    	block5.angle = 0
    	block5.xinc = 30*Math.cos(block5.angle*Math.PI/180)
    	block5.yinc = 30*Math.sin(block5.angle*Math.PI/180)
		if (ns) block6 = document.viola
		if (ie) block6 = viola.style
        if(ns6) block6 = document.getElementById("viola").style;
		block6.xpos = parseInt(block6.left)
		block6.ypos = parseInt(block6.top)
    	block6.angle = 0
    	block6.xinc = 30*Math.cos(block6.angle*Math.PI/180)
    	block6.yinc = 30*Math.sin(block6.angle*Math.PI/180)
		if (ns) block7 = document.verde
		if (ie) block7 = verde.style
        if(ns6) block7 = document.getElementById("verde").style;
		block7.xpos = parseInt(block7.left)
		block7.ypos = parseInt(block7.top)
    	block7.angle = 0
    	block7.xinc = 30*Math.cos(block7.angle*Math.PI/180)
    	block7.yinc = 30*Math.sin(block7.angle*Math.PI/180)


	}
	

t = 0

function muovi() {

	init();
	if (block1.xpos < 0 && t==0) {
        block1.xpos += 5
        block1.left = block1.xpos
        block1.top = block1.ypos
		setTimeout('muovi()',10)
        }

	if (block1.xpos > -142 && t==1) {

        block1.xpos -= 5
        block1.left = block1.xpos
        block1.top = block1.ypos
		setTimeout('muovi()',10)

	    }
		
	}
	
function destra() {

	t=0;
	muovi();
}

function sinistra() {

	t=1;
	muovi();
}

function scelta() {

	init();
	if (block1.xpos < -100) destra();
	if (block1.xpos > -11) sinistra();

}

i = 0

function show() {

	init();
	if (block2.xpos < 10 && i==0) {
        block2.xpos += 5
        block2.left = block2.xpos
        block2.top = block2.ypos
        block3.xpos += 5
        block3.left = block3.xpos
        block3.top = block3.ypos
		setTimeout('show()',10)
        }

	if (block2.xpos > -150 && i==1) {

        block2.xpos -= 5
        block2.left = block2.xpos
        block2.top = block2.ypos
        block3.xpos -= 5
        block3.left = block3.xpos
        block3.top = block3.ypos
		setTimeout('show()',10)

	    }
		
	}
	
function destrax() {

	i=0;
	show();
}

function sinistrax() {

	i=1;
	show();
}

function sceltax() {

	init();
	if (block2.xpos < -50) destrax();
	if (block2.xpos > 0) sinistrax();

}

function uno() {

	init();
	if (block4.xpos < 185) {
        block4.xpos += 20
        block4.left = block4.xpos
        block4.top = block4.ypos
		setTimeout('uno()',10)
        }
	else due();
	}
	
function due() {

	init();
	if (block5.xpos < 180) {
        block5.xpos += 25
        block5.left = block5.xpos
        block5.top = block5.ypos
		setTimeout('due()',10)
        }
	else tre();
	}
	
function tre() {

	init();
	if (block6.xpos < 185) {
        block6.xpos += 30
        block6.left = block6.xpos
        block6.top = block6.ypos
		setTimeout('tre()',10)
        }
	else quattro();
	}
	
function quattro() {

	init();
	if (block7.xpos < 185) {
        block7.xpos += 35
        block7.left = block7.xpos
        block7.top = block7.ypos
		setTimeout('quattro()',10)
        }
	}


